ARM: Use rMR for Baker RB introspection marking.
The marking register (r8 on ARM) is known to be 1 when
entering the introspection marking entrypoint, so we can
clobber it, use it as a temporaray register (instead or r4)
in the runtime entrypoint, and reload the 1 before
returning. The immediate benefits are minor, see below,
but this shall allow further improvements, for example we
could try to change rMR to r4 which would reduce code size
of every marking register check by 2 bytes.
ARM boot image (boot*.oat) size in aosp_taimen-userdebug:
- before: 17861724
- after: 17858088 (-3636)
Test: Pixel 2 XL boots.
Test: m test-art-host-gtest
Test: testrunner.py --target --optimizing --32
Test: Repeat the above tests with heap poisoning enabled.
Bug: 36141117
Change-Id: I0f625dec3a6b3ee1786f7e5f4377be42b9bc37d3
diff --git a/compiler/optimizing/code_generator_arm_vixl.h b/compiler/optimizing/code_generator_arm_vixl.h
index 6b9919a..d5b739b 100644
--- a/compiler/optimizing/code_generator_arm_vixl.h
+++ b/compiler/optimizing/code_generator_arm_vixl.h
@@ -113,9 +113,6 @@
static const size_t kRuntimeParameterFpuRegistersLengthVIXL =
arraysize(kRuntimeParameterFpuRegistersVIXL);
-// The reserved entrypoint register for link-time generated thunks.
-const vixl::aarch32::Register kBakerCcEntrypointRegister = vixl32::r4;
-
class LoadClassSlowPathARMVIXL;
class CodeGeneratorARMVIXL;
@@ -611,10 +608,6 @@
void EmitJitRootPatches(uint8_t* code, const uint8_t* roots_data) OVERRIDE;
- // Maybe add the reserved entrypoint register as a temporary for field load. This temp
- // is added only for AOT compilation if link-time generated thunks for fields are enabled.
- void MaybeAddBakerCcEntrypointTempForFields(LocationSummary* locations);
-
// Generate a GC root reference load:
//
// root <- *(obj + offset)
@@ -816,7 +809,7 @@
kBitsForBakerReadBarrierWidth>;
static void CheckValidReg(uint32_t reg) {
- DCHECK(reg < vixl::aarch32::ip.GetCode() && reg != kBakerCcEntrypointRegister.GetCode()) << reg;
+ DCHECK(reg < vixl::aarch32::ip.GetCode() && reg != mr.GetCode()) << reg;
}
static uint32_t EncodeBakerReadBarrierFieldData(uint32_t base_reg,