src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
*** old/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp Thu Aug 13 14:17:20 2009
--- new/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp Thu Aug 13 14:17:20 2009
*** 747,756 ****
--- 747,760 ----
}
void LIRGenerator::do_ArrayCopy(Intrinsic* x) {
assert(x->number_of_arguments() == 5, "wrong type");
+
+ // Make all state_for calls early since they can emit code
+ CodeEmitInfo* info = state_for(x, x->state());
+
// Note: spill caller save before setting the item
LIRItem src (x->argument_at(0), this);
LIRItem src_pos (x->argument_at(1), this);
LIRItem dst (x->argument_at(2), this);
LIRItem dst_pos (x->argument_at(3), this);
*** 765,775 ****
--- 769,778 ----
int flags;
ciArrayKlass* expected_type;
arraycopy_helper(x, &flags, &expected_type);
CodeEmitInfo* info = state_for(x, x->state());
__ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(),
length.result(), rlock_callee_saved(T_INT),
expected_type, flags, info);
set_no_result(x);
}
*** 876,885 ****
--- 879,891 ----
__ move(reg, result);
}
void LIRGenerator::do_NewTypeArray(NewTypeArray* x) {
+ // Evaluate state_for early since it may emit code
+ CodeEmitInfo* info = state_for(x, x->state());
+
LIRItem length(x->length(), this);
length.load_item();
LIR_Opr reg = result_register_for(x->type());
LIR_Opr tmp1 = FrameMap::G1_oop_opr;
*** 890,927 ****
--- 896,933 ----
LIR_Opr len = length.result();
BasicType elem_type = x->elt_type();
__ oop2reg(ciTypeArrayKlass::make(elem_type)->encoding(), klass_reg);
CodeEmitInfo* info = state_for(x, x->state());
CodeStub* slow_path = new NewTypeArrayStub(klass_reg, len, reg, info);
__ allocate_array(reg, len, tmp1, tmp2, tmp3, tmp4, elem_type, klass_reg, slow_path);
LIR_Opr result = rlock_result(x);
__ move(reg, result);
}
void LIRGenerator::do_NewObjectArray(NewObjectArray* x) {
LIRItem length(x->length(), this);
+ // Evaluate state_for early since it may emit code.
+ CodeEmitInfo* info = state_for(x, x->state());
// in case of patching (i.e., object class is not yet loaded), we need to reexecute the instruction
// and therefore provide the state before the parameters have been consumed
CodeEmitInfo* patching_info = NULL;
if (!x->klass()->is_loaded() || PatchALot) {
patching_info = state_for(x, x->state_before());
}
+ LIRItem length(x->length(), this);
length.load_item();
const LIR_Opr reg = result_register_for(x->type());
LIR_Opr tmp1 = FrameMap::G1_oop_opr;
LIR_Opr tmp2 = FrameMap::G3_oop_opr;
LIR_Opr tmp3 = FrameMap::G4_oop_opr;
LIR_Opr tmp4 = FrameMap::O1_oop_opr;
LIR_Opr klass_reg = FrameMap::G5_oop_opr;
LIR_Opr len = length.result();
CodeEmitInfo* info = state_for(x, x->state());
CodeStub* slow_path = new NewObjectArrayStub(klass_reg, len, reg, info);
ciObject* obj = (ciObject*) ciObjArrayKlass::make(x->klass());
if (obj == ciEnv::unloaded_ciobjarrayklass()) {
BAILOUT("encountered unloaded_ciobjarrayklass due to out of memory error");
*** 941,969 ****
--- 947,970 ----
while (i-- > 0) {
LIRItem* size = new LIRItem(dims->at(i), this);
items->at_put(i, size);
}
// need to get the info before, as the items may become invalid through item_free
+ // Evaluate state_for early since it may emit code.
+ CodeEmitInfo* info = state_for(x, x->state());
CodeEmitInfo* patching_info = NULL;
if (!x->klass()->is_loaded() || PatchALot) {
patching_info = state_for(x, x->state_before());
// cannot re-use same xhandlers for multiple CodeEmitInfos, so
! // clone all handlers.
x->set_exception_handlers(new XHandlers(x->exception_handlers()));
}
i = dims->length();
while (i-- > 0) {
LIRItem* size = items->at(i);
// if a patching_info was generated above then debug information for the state before
// the call is going to be emitted. The LIRGenerator calls above may have left some values
// in registers and that's been recorded in the CodeEmitInfo. In that case the items
// for those values can't simply be freed if they are registers because the values
// might be destroyed by store_stack_parameter. So in the case of patching, delay the
// freeing of the items that already were in registers
size->load_item();
store_stack_parameter (size->result(),
in_ByteSize(STACK_BIAS +
frame::memory_parameter_word_sp_offset * wordSize +
i * sizeof(jint)));
*** 970,981 ****
--- 971,980 ----
}
// This instruction can be deoptimized in the slow path : use
// O0 as result register.
const LIR_Opr reg = result_register_for(x->type());
CodeEmitInfo* info = state_for(x, x->state());
jobject2reg_with_patching(reg, x->klass(), patching_info);
LIR_Opr rank = FrameMap::O1_opr;
__ move(LIR_OprFact::intConst(x->rank()), rank);
LIR_Opr varargs = FrameMap::as_pointer_opr(O2);
int offset_from_sp = (frame::memory_parameter_word_sp_offset * wordSize) + STACK_BIAS;
src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File