Skip to content

Commit 6fbaa06

Browse files
committed
8353176: C1: x86 patching stub always calls Thread::current()
Reviewed-by: mdoerr, kvn, vlivanov
1 parent 79d0c94 commit 6fbaa06

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -360,17 +360,11 @@ void PatchingStub::emit_code(LIR_Assembler* ce) {
360360
}
361361
assert(_obj != noreg, "must be a valid register");
362362
Register tmp = rax;
363-
Register tmp2 = rbx;
364363
__ push(tmp);
365-
__ push(tmp2);
366-
// Load without verification to keep code size small. We need it because
367-
// begin_initialized_entry_offset has to fit in a byte. Also, we know it's not null.
368-
__ movptr(tmp2, Address(_obj, java_lang_Class::klass_offset()));
369-
__ get_thread(tmp);
370-
__ cmpptr(tmp, Address(tmp2, InstanceKlass::init_thread_offset()));
371-
__ pop(tmp2);
372-
__ pop(tmp);
373-
__ jcc(Assembler::notEqual, call_patch);
364+
__ movptr(tmp, Address(_obj, java_lang_Class::klass_offset()));
365+
__ cmpptr(r15_thread, Address(tmp, InstanceKlass::init_thread_offset()));
366+
__ pop(tmp); // pop it right away, no matter which path we take
367+
__ jccb(Assembler::notEqual, call_patch);
374368

375369
// access_field patches may execute the patched code before it's
376370
// copied back into place so we need to jump back into the main

0 commit comments

Comments
 (0)