From 02b75806a80f8b75c3d6ba2ff97c995117630f36 Mon Sep 17 00:00:00 2001 From: Roland Levillain Date: Wed, 13 Jul 2016 11:54:35 +0100 Subject: Introduce more compact ReadBarrierMark slow-paths. Replace entry point ReadBarrierMark with 32 ReadBarrierMarkRegX entry points, using register number X as input and output (instead of the standard runtime calling convention) to save two moves in Baker's read barrier mark slow-path code. Test: ART host and target (ARM, ARM64) tests. Bug: 29506760 Bug: 12687968 Change-Id: I73cfb82831cf040b8b018e984163c865cc44ed87 --- compiler/optimizing/code_generator.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 9364be35ff..b8540baca2 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -350,6 +350,16 @@ class CodeGenerator : public DeletableArenaObject { // accessing the String's `value` field in String intrinsics. static uint32_t GetArrayDataOffset(HArrayGet* array_get); + // Return the entry point offset for ReadBarrierMarkRegX, where X is `reg`. + template + static int32_t GetReadBarrierMarkEntryPointsOffset(size_t reg) { + DCHECK_LT(reg, 32u); + // The ReadBarrierMarkRegX entry points are ordered by increasing + // register number in Thread::tls_Ptr_.quick_entrypoints. + return QUICK_ENTRYPOINT_OFFSET(pointer_size, pReadBarrierMarkReg00).Int32Value() + + pointer_size * reg; + } + void EmitParallelMoves(Location from1, Location to1, Primitive::Type type1, -- cgit v1.2.3-59-g8ed1b