summaryrefslogtreecommitdiff
path: root/runtime/entrypoints/quick/quick_entrypoints.h
diff options
context:
space:
mode:
author Roland Levillain <rpl@google.com> 2015-11-13 10:07:31 +0000
committer Roland Levillain <rpl@google.com> 2015-11-15 12:16:41 +0000
commit0d5a281c671444bfa75d63caf1427a8c0e6e1177 (patch)
treefd9bbe0f1c581bcc7c05bbfb2643ffe0b1fb014e /runtime/entrypoints/quick/quick_entrypoints.h
parentdd4cbcc924c8ba2a578914a4a366996693bdcd74 (diff)
x86/x86-64 read barrier support for concurrent GC in Optimizing.
This first implementation uses slow paths to instrument heap reference loads and GC root loads for the concurrent copying collector, respectively calling the artReadBarrierSlow and artReadBarrierForRootSlow (new) runtime entry points. Notes: - This implementation does not instrument HInvokeVirtual nor HInvokeInterface instructions (for class reference loads), as the corresponding read barriers are not stricly required with the current concurrent copying collector. - Intrinsics which may eventually call (on slow path) are disabled when read barriers are enabled, as the current slow path infrastructure does not support this case. - When read barriers are enabled, the code generated for a HArraySet instruction always go into the array set slow path for object arrays (delegating the operation to the runtime), as we are lacking a mechanism to keep a temporary register live accross a runtime call (needed for the instrumentation of type checking code, which requires two successive read barriers). Bug: 12687968 Change-Id: I14cd6107233c326389120336f93955b28ffbb329
Diffstat (limited to 'runtime/entrypoints/quick/quick_entrypoints.h')
-rw-r--r--runtime/entrypoints/quick/quick_entrypoints.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/runtime/entrypoints/quick/quick_entrypoints.h b/runtime/entrypoints/quick/quick_entrypoints.h
index 3d3f7a1bdb..27865e3dc4 100644
--- a/runtime/entrypoints/quick/quick_entrypoints.h
+++ b/runtime/entrypoints/quick/quick_entrypoints.h
@@ -31,12 +31,12 @@ namespace art {
namespace mirror {
class Array;
class Class;
+template<class MirrorType> class CompressedReference;
class Object;
-template<class MirrorType>
-class CompressedReference;
} // namespace mirror
class ArtMethod;
+template<class MirrorType> class GcRoot;
class Thread;
// Pointers to functions that are called by quick compiler generated code via thread-local storage.
@@ -72,9 +72,14 @@ extern void ReadBarrierJni(mirror::CompressedReference<mirror::Object>* handle_o
Thread* self)
NO_THREAD_SAFETY_ANALYSIS HOT_ATTR;
+
// Read barrier entrypoints.
-// Compilers for ARM, ARM64, MIPS, MIPS64 can insert a call to this function directly.
-// For x86 and x86_64, compilers need a wrapper assembly function, to handle mismatch in ABI.
+//
+// Compilers for ARM, ARM64, MIPS, MIPS64 can insert a call to these
+// functions directly. For x86 and x86-64, compilers need a wrapper
+// assembly function, to handle mismatch in ABI.
+
+// 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".
@@ -82,6 +87,10 @@ extern "C" mirror::Object* artReadBarrierSlow(mirror::Object* ref, mirror::Objec
uint32_t offset)
SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR;
+// Read barrier entrypoint for GC roots.
+extern "C" mirror::Object* artReadBarrierForRootSlow(GcRoot<mirror::Object>* root)
+ SHARED_REQUIRES(Locks::mutator_lock_) HOT_ATTR;
+
} // namespace art
#endif // ART_RUNTIME_ENTRYPOINTS_QUICK_QUICK_ENTRYPOINTS_H_