< prev index next > src/hotspot/cpu/x86/x86_64.ad
Print this page
if (do_polling() && C->is_method_compilation()) {
MacroAssembler _masm(&cbuf);
Label dummy_label;
Label* code_stub = &dummy_label;
if (!C->output()->in_scratch_emit_size()) {
! code_stub = &C->output()->safepoint_poll_table()->add_safepoint(__ offset());
}
__ relocate(relocInfo::poll_return_type);
__ safepoint_poll(*code_stub, r15_thread, true /* at_return */, true /* in_nmethod */);
}
}
if (do_polling() && C->is_method_compilation()) {
MacroAssembler _masm(&cbuf);
Label dummy_label;
Label* code_stub = &dummy_label;
if (!C->output()->in_scratch_emit_size()) {
! C2SafepointPollStub* stub = new (C->comp_arena()) C2SafepointPollStub(__ offset());
+ C->output()->add_stub(stub);
+ code_stub = &stub->entry();
}
__ relocate(relocInfo::poll_return_type);
__ safepoint_poll(*code_stub, r15_thread, true /* at_return */, true /* in_nmethod */);
}
}
%}
// Load narrow Klass Pointer
instruct loadNKlass(rRegN dst, memory mem)
%{
+ predicate(!UseCompactObjectHeaders);
match(Set dst (LoadNKlass mem));
ins_cost(125); // XXX
format %{ "movl $dst, $mem\t# compressed klass ptr" %}
ins_encode %{
__ movl($dst$$Register, $mem$$Address);
%}
ins_pipe(ialu_reg_mem); // XXX
%}
+ instruct loadNKlassLilliput(rRegN dst, indOffset8 mem, rFlagsReg cr)
+ %{
+ predicate(UseCompactObjectHeaders);
+ match(Set dst (LoadNKlass mem));
+ effect(KILL cr);
+ ins_cost(125); // XXX
+ format %{ "movl $dst, $mem\t# compressed klass ptr" %}
+ ins_encode %{
+ assert($mem$$disp == oopDesc::klass_offset_in_bytes(), "expect correct offset 4, but got: %d", $mem$$disp);
+ assert($mem$$index == 4, "expect no index register: %d", $mem$$index);
+ Register dst = $dst$$Register;
+ Register obj = $mem$$base$$Register;
+ C2LoadNKlassStub* stub = new (Compile::current()->comp_arena()) C2LoadNKlassStub(dst);
+ Compile::current()->output()->add_stub(stub);
+ __ movq(dst, Address(obj, oopDesc::mark_offset_in_bytes()));
+ __ testb(dst, markWord::monitor_value);
+ __ jcc(Assembler::notZero, stub->entry());
+ __ bind(stub->continuation());
+ __ shrq(dst, markWord::klass_shift);
+ %}
+ ins_pipe(pipe_slow); // XXX
+ %}
+
// Load Float
instruct loadF(regF dst, memory mem)
%{
match(Set dst (LoadF mem));
ins_pipe(ialu_cr_reg_imm);
%}
instruct compN_mem_imm_klass(rFlagsRegU cr, memory mem, immNKlass src)
%{
+ predicate(!UseCompactObjectHeaders);
match(Set cr (CmpN src (LoadNKlass mem)));
format %{ "cmpl $mem, $src\t# compressed klass ptr" %}
ins_encode %{
__ cmp_narrow_klass($mem$$Address, (Klass*)$src$$constant);
effect(TEMP tmp, TEMP scr, TEMP cx1, TEMP cx2, USE_KILL box);
ins_cost(300);
format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr,$cx1,$cx2" %}
ins_encode %{
__ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
! $scr$$Register, $cx1$$Register, $cx2$$Register,
_counters, _rtm_counters, _stack_rtm_counters,
((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
true, ra_->C->profile_rtm());
%}
ins_pipe(pipe_slow);
effect(TEMP tmp, TEMP scr, TEMP cx1, TEMP cx2, USE_KILL box);
ins_cost(300);
format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr,$cx1,$cx2" %}
ins_encode %{
__ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
! $scr$$Register, $cx1$$Register, $cx2$$Register, r15_thread,
_counters, _rtm_counters, _stack_rtm_counters,
((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
true, ra_->C->profile_rtm());
%}
ins_pipe(pipe_slow);
effect(TEMP tmp, TEMP scr, TEMP cx1, USE_KILL box);
ins_cost(300);
format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
ins_encode %{
__ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
! $scr$$Register, $cx1$$Register, noreg, _counters, NULL, NULL, NULL, false, false);
%}
ins_pipe(pipe_slow);
%}
instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
effect(TEMP tmp, TEMP scr, TEMP cx1, USE_KILL box);
ins_cost(300);
format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
ins_encode %{
__ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
! $scr$$Register, $cx1$$Register, noreg, r15_thread, _counters, NULL, NULL, NULL, false, false);
%}
ins_pipe(pipe_slow);
%}
instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
< prev index next >