diff options
| author | 2018-04-25 11:59:48 +0000 | |
|---|---|---|
| committer | 2018-04-25 11:59:48 +0000 | |
| commit | 0a6fee861d70c87e064637915e37324b6d722adb (patch) | |
| tree | 37c51ff1696bce2583863e20ea5360e8c0745f97 | |
| parent | a03627a94c0eead28e1c7d917218ad398d483495 (diff) | |
| parent | e3872ed887afbc4574f69a35f8ec91c73a01f2a9 (diff) | |
Merge "Fix non-Baker build."
| -rw-r--r-- | runtime/arch/arm/entrypoints_init_arm.cc | 52 | ||||
| -rw-r--r-- | runtime/arch/arm/quick_entrypoints_arm.S | 6 |
2 files changed, 34 insertions, 24 deletions
diff --git a/runtime/arch/arm/entrypoints_init_arm.cc b/runtime/arch/arm/entrypoints_init_arm.cc index 80080e9832..b4e9036084 100644 --- a/runtime/arch/arm/entrypoints_init_arm.cc +++ b/runtime/arch/arm/entrypoints_init_arm.cc @@ -90,30 +90,34 @@ void UpdateReadBarrierEntrypoints(QuickEntryPoints* qpoints, bool is_active) { 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 526960b79d..a930cc494e 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_gc_roots\label_suffix: * 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_narrow: 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 |