hotspot/src/cpu/x86/vm/c1_CodeStubs_x86.cpp
Print this page
rev 611 : Merge
*** 1,10 ****
- #ifdef USE_PRAGMA_IDENT_SRC
- #pragma ident "@(#)c1_CodeStubs_x86.cpp 1.101 07/09/17 09:25:57 JVM"
- #endif
/*
! * Copyright 1999-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 44,58 ****
ExternalAddress((address)&float_zero));
} else if (input()->is_double_xmm()) {
__ comisd(input()->as_xmm_double_reg(),
ExternalAddress((address)&double_zero));
} else {
! __ pushl(rax);
__ ftst();
__ fnstsw_ax();
__ sahf();
! __ popl(rax);
}
Label NaN, do_return;
__ jccb(Assembler::parity, NaN);
__ jccb(Assembler::below, do_return);
--- 41,56 ----
ExternalAddress((address)&float_zero));
} else if (input()->is_double_xmm()) {
__ comisd(input()->as_xmm_double_reg(),
ExternalAddress((address)&double_zero));
} else {
! LP64_ONLY(ShouldNotReachHere());
! __ push(rax);
__ ftst();
__ fnstsw_ax();
__ sahf();
! __ pop(rax);
}
Label NaN, do_return;
__ jccb(Assembler::parity, NaN);
__ jccb(Assembler::below, do_return);
*** 62,72 ****
__ decrement(result()->as_register());
__ jmpb(do_return);
// input is NaN -> return 0
__ bind(NaN);
! __ xorl(result()->as_register(), result()->as_register());
__ bind(do_return);
__ jmp(_continuation);
}
--- 60,70 ----
__ decrement(result()->as_register());
__ jmpb(do_return);
// input is NaN -> return 0
__ bind(NaN);
! __ xorptr(result()->as_register(), result()->as_register());
__ bind(do_return);
__ jmp(_continuation);
}
*** 140,150 ****
void NewInstanceStub::emit_code(LIR_Assembler* ce) {
assert(__ rsp_offset() == 0, "frame size should be fixed");
__ bind(_entry);
! __ movl(rdx, _klass_reg->as_register());
__ call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
assert(_result->as_register() == rax, "result must in rax,");
__ jmp(_continuation);
--- 138,148 ----
void NewInstanceStub::emit_code(LIR_Assembler* ce) {
assert(__ rsp_offset() == 0, "frame size should be fixed");
__ bind(_entry);
! __ movptr(rdx, _klass_reg->as_register());
__ call(RuntimeAddress(Runtime1::entry_for(_stub_id)));
ce->add_call_info_here(_info);
ce->verify_oop_map(_info);
assert(_result->as_register() == rax, "result must in rax,");
__ jmp(_continuation);
*** 307,320 ****
__ block_comment(" being_initialized check");
}
assert(_obj != noreg, "must be a valid register");
Register tmp = rax;
if (_obj == tmp) tmp = rbx;
! __ pushl(tmp);
__ get_thread(tmp);
! __ cmpl(tmp, Address(_obj, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)));
! __ popl(tmp);
__ jcc(Assembler::notEqual, call_patch);
// access_field patches may execute the patched code before it's
// copied back into place so we need to jump back into the main
// code of the nmethod to continue execution.
--- 305,318 ----
__ block_comment(" being_initialized check");
}
assert(_obj != noreg, "must be a valid register");
Register tmp = rax;
if (_obj == tmp) tmp = rbx;
! __ push(tmp);
__ get_thread(tmp);
! __ cmpptr(tmp, Address(_obj, instanceKlass::init_thread_offset_in_bytes() + sizeof(klassOopDesc)));
! __ pop(tmp);
__ jcc(Assembler::notEqual, call_patch);
// access_field patches may execute the patched code before it's
// copied back into place so we need to jump back into the main
// code of the nmethod to continue execution.
*** 435,445 ****
// next registers will get stored on the stack
for (int i = 0; i < 5 ; i++ ) {
VMReg r_1 = args[i].first();
if (r_1->is_stack()) {
int st_off = r_1->reg2stack() * wordSize;
! __ movl (Address(rsp, st_off), r[i]);
} else {
assert(r[i] == args[i].first()->as_Register(), "Wrong register for arg ");
}
}
--- 433,443 ----
// next registers will get stored on the stack
for (int i = 0; i < 5 ; i++ ) {
VMReg r_1 = args[i].first();
if (r_1->is_stack()) {
int st_off = r_1->reg2stack() * wordSize;
! __ movptr (Address(rsp, st_off), r[i]);
} else {
assert(r[i] == args[i].first()->as_Register(), "Wrong register for arg ");
}
}
*** 450,462 ****
relocInfo::static_call_type);
__ call(resolve);
ce->add_call_info_here(info());
#ifndef PRODUCT
! __ increment(ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
#endif
__ jmp(_continuation);
}
#undef __
--- 448,505 ----
relocInfo::static_call_type);
__ call(resolve);
ce->add_call_info_here(info());
#ifndef PRODUCT
! __ incrementl(ExternalAddress((address)&Runtime1::_arraycopy_slowcase_cnt));
#endif
__ jmp(_continuation);
}
+ /////////////////////////////////////////////////////////////////////////////
+ #ifndef SERIALGC
+
+ void G1PreBarrierStub::emit_code(LIR_Assembler* ce) {
+
+ // At this point we know that marking is in progress
+
+ __ bind(_entry);
+ assert(pre_val()->is_register(), "Precondition.");
+
+ Register pre_val_reg = pre_val()->as_register();
+
+ ce->mem2reg(addr(), pre_val(), T_OBJECT, patch_code(), info(), false);
+
+ __ cmpptr(pre_val_reg, (int32_t) NULL_WORD);
+ __ jcc(Assembler::equal, _continuation);
+ ce->store_parameter(pre_val()->as_register(), 0);
+ __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_pre_barrier_slow_id)));
+ __ jmp(_continuation);
+
+ }
+
+ jbyte* G1PostBarrierStub::_byte_map_base = NULL;
+
+ jbyte* G1PostBarrierStub::byte_map_base_slow() {
+ BarrierSet* bs = Universe::heap()->barrier_set();
+ assert(bs->is_a(BarrierSet::G1SATBCTLogging),
+ "Must be if we're using this.");
+ return ((G1SATBCardTableModRefBS*)bs)->byte_map_base;
+ }
+
+ void G1PostBarrierStub::emit_code(LIR_Assembler* ce) {
+ __ bind(_entry);
+ assert(addr()->is_register(), "Precondition.");
+ assert(new_val()->is_register(), "Precondition.");
+ Register new_val_reg = new_val()->as_register();
+ __ cmpptr(new_val_reg, (int32_t) NULL_WORD);
+ __ jcc(Assembler::equal, _continuation);
+ ce->store_parameter(addr()->as_register(), 0);
+ __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::g1_post_barrier_slow_id)));
+ __ jmp(_continuation);
+ }
+
+ #endif // SERIALGC
+ /////////////////////////////////////////////////////////////////////////////
#undef __