Fix non-Baker build.
rMR is defined only for Baker read barriers. Replace the
entire introspection marking entrypoint with "bkpt" for
other configs so that we do not use rMR if unavailable.
Test: m ART_USE_READ_BARRIER=false
Bug: 36141117
Change-Id: I12e856a7f0841d342477d1dcbd4f00652ee11efa
diff --git a/runtime/arch/arm/entrypoints_init_arm.cc b/runtime/arch/arm/entrypoints_init_arm.cc
index 80080e9..b4e9036 100644
--- a/runtime/arch/arm/entrypoints_init_arm.cc
+++ b/runtime/arch/arm/entrypoints_init_arm.cc
@@ -90,30 +90,34 @@
qpoints->pReadBarrierMarkReg10 = is_active ? art_quick_read_barrier_mark_reg10 : nullptr;
qpoints->pReadBarrierMarkReg11 = is_active ? art_quick_read_barrier_mark_reg11 : nullptr;
- // For the alignment check, strip the Thumb mode bit.
- DCHECK_ALIGNED(reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection) - 1u, 256u);
- // Check the field narrow entrypoint offset from the introspection entrypoint.
- intptr_t narrow_diff =
- reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection_narrow) -
- reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection);
- DCHECK_EQ(BAKER_MARK_INTROSPECTION_FIELD_LDR_NARROW_ENTRYPOINT_OFFSET, narrow_diff);
- // Check array switch cases offsets from the introspection entrypoint.
- intptr_t array_diff =
- reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection_arrays) -
- reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection);
- DCHECK_EQ(BAKER_MARK_INTROSPECTION_ARRAY_SWITCH_OFFSET, array_diff);
- // Check the GC root entrypoint offsets from the introspection entrypoint.
- intptr_t gc_roots_wide_diff =
- reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection_gc_roots_wide) -
- reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection);
- DCHECK_EQ(BAKER_MARK_INTROSPECTION_GC_ROOT_LDR_WIDE_ENTRYPOINT_OFFSET, gc_roots_wide_diff);
- intptr_t gc_roots_narrow_diff =
- reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection_gc_roots_narrow) -
- reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection);
- DCHECK_EQ(BAKER_MARK_INTROSPECTION_GC_ROOT_LDR_NARROW_ENTRYPOINT_OFFSET, gc_roots_narrow_diff);
- // The register 12, i.e. IP, is reserved, so there is no art_quick_read_barrier_mark_reg12.
- // We're using the entry to hold a pointer to the introspection entrypoint instead.
- qpoints->pReadBarrierMarkReg12 = is_active ? art_quick_read_barrier_mark_introspection : nullptr;
+ if (kUseReadBarrier && kUseBakerReadBarrier) {
+ // For the alignment check, strip the Thumb mode bit.
+ DCHECK_ALIGNED(reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection) - 1u,
+ 256u);
+ // Check the field narrow entrypoint offset from the introspection entrypoint.
+ intptr_t narrow_diff =
+ reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection_narrow) -
+ reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection);
+ DCHECK_EQ(BAKER_MARK_INTROSPECTION_FIELD_LDR_NARROW_ENTRYPOINT_OFFSET, narrow_diff);
+ // Check array switch cases offsets from the introspection entrypoint.
+ intptr_t array_diff =
+ reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection_arrays) -
+ reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection);
+ DCHECK_EQ(BAKER_MARK_INTROSPECTION_ARRAY_SWITCH_OFFSET, array_diff);
+ // Check the GC root entrypoint offsets from the introspection entrypoint.
+ intptr_t gc_roots_wide_diff =
+ reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection_gc_roots_wide) -
+ reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection);
+ DCHECK_EQ(BAKER_MARK_INTROSPECTION_GC_ROOT_LDR_WIDE_ENTRYPOINT_OFFSET, gc_roots_wide_diff);
+ intptr_t gc_roots_narrow_diff =
+ reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection_gc_roots_narrow) -
+ reinterpret_cast<intptr_t>(art_quick_read_barrier_mark_introspection);
+ DCHECK_EQ(BAKER_MARK_INTROSPECTION_GC_ROOT_LDR_NARROW_ENTRYPOINT_OFFSET, gc_roots_narrow_diff);
+ // The register 12, i.e. IP, is reserved, so there is no art_quick_read_barrier_mark_reg12.
+ // We're using the entry to hold a pointer to the introspection entrypoint instead.
+ qpoints->pReadBarrierMarkReg12 =
+ is_active ? art_quick_read_barrier_mark_introspection : nullptr;
+ }
}
void InitEntryPoints(JniEntryPoints* jpoints, QuickEntryPoints* qpoints) {
diff --git a/runtime/arch/arm/quick_entrypoints_arm.S b/runtime/arch/arm/quick_entrypoints_arm.S
index 526960b..a930cc4 100644
--- a/runtime/arch/arm/quick_entrypoints_arm.S
+++ b/runtime/arch/arm/quick_entrypoints_arm.S
@@ -2610,6 +2610,7 @@
* art_quick_read_barrier_mark_introspection_arrays: // @0x100
* Exactly 128 bytes for array load switch cases (16x2 instructions).
*/
+#if defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER)
.balign 512
ENTRY art_quick_read_barrier_mark_introspection
// At this point, IP contains the reference, rMR is clobbered by the thunk
@@ -2676,6 +2677,11 @@
art_quick_read_barrier_mark_introspection_arrays:
BRBMI_FOR_REGISTERS BRBMI_ARRAY_LOAD, BRBMI_BKPT_FILL_8B
END art_quick_read_barrier_mark_introspection
+#else // defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER)
+ENTRY art_quick_read_barrier_mark_introspection
+ bkpt // Unreachable.
+END art_quick_read_barrier_mark_introspection
+#endif // defined(USE_READ_BARRIER) && defined(USE_BAKER_READ_BARRIER)
.extern artInvokePolymorphic
ENTRY art_quick_invoke_polymorphic