diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/optimizing/code_generator_x86.cc | 8 | ||||
| -rw-r--r-- | compiler/optimizing/code_generator_x86_64.cc | 9 |
2 files changed, 9 insertions, 8 deletions
diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 08a752f1d2..8afc6bab89 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -7177,10 +7177,10 @@ void InstructionCodeGeneratorX86::GenerateGcRootFieldLoad( instruction, root, /* unpoison_ref_before_marking */ false); codegen_->AddSlowPath(slow_path); - // Test the entrypoint (`Thread::Current()->pReadBarrierMarkReg ## root.reg()`). - const int32_t entry_point_offset = - CodeGenerator::GetReadBarrierMarkEntryPointsOffset<kX86PointerSize>(root.reg()); - __ fs()->cmpl(Address::Absolute(entry_point_offset), Immediate(0)); + // Test if the GC is marking. Note that X86 and X86_64 don't switch the entrypoints when the + // GC is marking. + const int32_t is_marking_offset = Thread::IsGcMarkingOffset<kX86PointerSize>().Int32Value(); + __ fs()->cmpl(Address::Absolute(is_marking_offset), Immediate(0)); // The entrypoint is null when the GC is not marking. __ j(kNotEqual, slow_path->GetEntryLabel()); __ Bind(slow_path->GetExitLabel()); diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc index ff6e099d12..c2b1a3190d 100644 --- a/compiler/optimizing/code_generator_x86_64.cc +++ b/compiler/optimizing/code_generator_x86_64.cc @@ -6542,10 +6542,11 @@ void InstructionCodeGeneratorX86_64::GenerateGcRootFieldLoad( instruction, root, /* unpoison_ref_before_marking */ false); codegen_->AddSlowPath(slow_path); - // Test the `Thread::Current()->pReadBarrierMarkReg ## root.reg()` entrypoint. - const int32_t entry_point_offset = - CodeGenerator::GetReadBarrierMarkEntryPointsOffset<kX86_64PointerSize>(root.reg()); - __ gs()->cmpl(Address::Absolute(entry_point_offset, /* no_rip */ true), Immediate(0)); + // Test if the GC is marking. Note that X86 and X86_64 don't switch the entrypoints when the + // GC is marking. + const int32_t is_marking_offset = + Thread::IsGcMarkingOffset<kX86_64PointerSize>().Int32Value(); + __ gs()->cmpl(Address::Absolute(is_marking_offset, /* no_rip */ true), Immediate(0)); // The entrypoint is null when the GC is not marking. __ j(kNotEqual, slow_path->GetEntryLabel()); __ Bind(slow_path->GetExitLabel()); |