From 7c1559a06041c9c299d5ab514d54b2102f204a84 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Tue, 15 Dec 2015 10:55:36 +0000 Subject: x86 Baker's read barrier fast path implementation. Introduce an x86 fast path implementation in Optimizing for Baker's read barriers (for both heap reference loads and GC root loads). The marking phase of the read barrier is performed by a slow path, invoking a new runtime entry point (artReadBarrierMark). Other read barrier algorithms continue to use the original slow path based implementation, which has been renamed as GenerateReadBarrierSlow/GenerateReadBarrierForRootSlow. Bug: 12687968 Change-Id: Ie610c4befc19ff22378a8cba38b422dcacb54320 --- runtime/entrypoints/quick/quick_entrypoints.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'runtime/entrypoints/quick/quick_entrypoints.h') diff --git a/runtime/entrypoints/quick/quick_entrypoints.h b/runtime/entrypoints/quick/quick_entrypoints.h index 27865e3dc4..f5b68fa922 100644 --- a/runtime/entrypoints/quick/quick_entrypoints.h +++ b/runtime/entrypoints/quick/quick_entrypoints.h @@ -79,11 +79,17 @@ extern void ReadBarrierJni(mirror::CompressedReference* handle_o // functions directly. For x86 and x86-64, compilers need a wrapper // assembly function, to handle mismatch in ABI. +// Mark the heap reference `obj`. This entry point is used by read +// barrier fast path implementations generated by the compiler to mark +// an object that is referenced by a field of a gray object. +extern "C" mirror::Object* artReadBarrierMark(mirror::Object* obj) + SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR; + // Read barrier entrypoint for heap references. -// This is the read barrier slow path for instance and static fields and reference-type arrays. -// TODO: Currently the read barrier does not have a fast path for compilers to directly generate. -// Ideally the slow path should only take one parameter "ref". -extern "C" mirror::Object* artReadBarrierSlow(mirror::Object* ref, mirror::Object* obj, +// This is the read barrier slow path for instance and static fields +// and reference type arrays. +extern "C" mirror::Object* artReadBarrierSlow(mirror::Object* ref, + mirror::Object* obj, uint32_t offset) SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR; -- cgit v1.2.3-59-g8ed1b