8031475: Missing oopmap in patching stubs

Add patch test for lir_checkcast in compute_oop_map

Reviewed-by: roland, twisti
This commit is contained in:
Nils Eliasson 2014-05-21 11:25:25 +02:00
parent 638b464ed3
commit 506db6a0ea
5 changed files with 16 additions and 28 deletions

View file

@ -1083,7 +1083,7 @@ void LIR_OpLabel::emit_code(LIR_Assembler* masm) {
void LIR_OpArrayCopy::emit_code(LIR_Assembler* masm) { void LIR_OpArrayCopy::emit_code(LIR_Assembler* masm) {
masm->emit_arraycopy(this); masm->emit_arraycopy(this);
masm->emit_code_stub(stub()); masm->append_code_stub(stub());
} }
void LIR_OpUpdateCRC32::emit_code(LIR_Assembler* masm) { void LIR_OpUpdateCRC32::emit_code(LIR_Assembler* masm) {
@ -1100,20 +1100,20 @@ void LIR_Op1::emit_code(LIR_Assembler* masm) {
void LIR_OpAllocObj::emit_code(LIR_Assembler* masm) { void LIR_OpAllocObj::emit_code(LIR_Assembler* masm) {
masm->emit_alloc_obj(this); masm->emit_alloc_obj(this);
masm->emit_code_stub(stub()); masm->append_code_stub(stub());
} }
void LIR_OpBranch::emit_code(LIR_Assembler* masm) { void LIR_OpBranch::emit_code(LIR_Assembler* masm) {
masm->emit_opBranch(this); masm->emit_opBranch(this);
if (stub()) { if (stub()) {
masm->emit_code_stub(stub()); masm->append_code_stub(stub());
} }
} }
void LIR_OpConvert::emit_code(LIR_Assembler* masm) { void LIR_OpConvert::emit_code(LIR_Assembler* masm) {
masm->emit_opConvert(this); masm->emit_opConvert(this);
if (stub() != NULL) { if (stub() != NULL) {
masm->emit_code_stub(stub()); masm->append_code_stub(stub());
} }
} }
@ -1123,13 +1123,13 @@ void LIR_Op2::emit_code(LIR_Assembler* masm) {
void LIR_OpAllocArray::emit_code(LIR_Assembler* masm) { void LIR_OpAllocArray::emit_code(LIR_Assembler* masm) {
masm->emit_alloc_array(this); masm->emit_alloc_array(this);
masm->emit_code_stub(stub()); masm->append_code_stub(stub());
} }
void LIR_OpTypeCheck::emit_code(LIR_Assembler* masm) { void LIR_OpTypeCheck::emit_code(LIR_Assembler* masm) {
masm->emit_opTypeCheck(this); masm->emit_opTypeCheck(this);
if (stub()) { if (stub()) {
masm->emit_code_stub(stub()); masm->append_code_stub(stub());
} }
} }
@ -1144,7 +1144,7 @@ void LIR_Op3::emit_code(LIR_Assembler* masm) {
void LIR_OpLock::emit_code(LIR_Assembler* masm) { void LIR_OpLock::emit_code(LIR_Assembler* masm) {
masm->emit_lock(this); masm->emit_lock(this);
if (stub()) { if (stub()) {
masm->emit_code_stub(stub()); masm->append_code_stub(stub());
} }
} }

View file

@ -1127,6 +1127,7 @@ class LIR_Op: public CompilationResourceObj {
virtual void print_instr(outputStream* out) const = 0; virtual void print_instr(outputStream* out) const = 0;
virtual void print_on(outputStream* st) const PRODUCT_RETURN; virtual void print_on(outputStream* st) const PRODUCT_RETURN;
virtual bool is_patching() { return false; }
virtual LIR_OpCall* as_OpCall() { return NULL; } virtual LIR_OpCall* as_OpCall() { return NULL; }
virtual LIR_OpJavaCall* as_OpJavaCall() { return NULL; } virtual LIR_OpJavaCall* as_OpJavaCall() { return NULL; }
virtual LIR_OpLabel* as_OpLabel() { return NULL; } virtual LIR_OpLabel* as_OpLabel() { return NULL; }
@ -1387,6 +1388,7 @@ class LIR_Op1: public LIR_Op {
return (LIR_MoveKind)_flags; return (LIR_MoveKind)_flags;
} }
virtual bool is_patching() { return _patch != lir_patch_none; }
virtual void emit_code(LIR_Assembler* masm); virtual void emit_code(LIR_Assembler* masm);
virtual LIR_Op1* as_Op1() { return this; } virtual LIR_Op1* as_Op1() { return this; }
virtual const char * name() const PRODUCT_RETURN0; virtual const char * name() const PRODUCT_RETURN0;
@ -1619,6 +1621,7 @@ public:
int profiled_bci() const { return _profiled_bci; } int profiled_bci() const { return _profiled_bci; }
bool should_profile() const { return _should_profile; } bool should_profile() const { return _should_profile; }
virtual bool is_patching() { return _info_for_patch != NULL; }
virtual void emit_code(LIR_Assembler* masm); virtual void emit_code(LIR_Assembler* masm);
virtual LIR_OpTypeCheck* as_OpTypeCheck() { return this; } virtual LIR_OpTypeCheck* as_OpTypeCheck() { return this; }
void print_instr(outputStream* out) const PRODUCT_RETURN; void print_instr(outputStream* out) const PRODUCT_RETURN;

View file

@ -58,7 +58,7 @@ void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_cod
_masm->nop(); _masm->nop();
} }
patch->install(_masm, patch_code, obj, info); patch->install(_masm, patch_code, obj, info);
append_patching_stub(patch); append_code_stub(patch);
#ifdef ASSERT #ifdef ASSERT
Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->stack()->bci()); Bytecodes::Code code = info->scope()->method()->java_code_at_bci(info->stack()->bci());
@ -131,11 +131,6 @@ LIR_Assembler::~LIR_Assembler() {
} }
void LIR_Assembler::append_patching_stub(PatchingStub* stub) {
_slow_case_stubs->append(stub);
}
void LIR_Assembler::check_codespace() { void LIR_Assembler::check_codespace() {
CodeSection* cs = _masm->code_section(); CodeSection* cs = _masm->code_section();
if (cs->remaining() < (int)(NOT_LP64(1*K)LP64_ONLY(2*K))) { if (cs->remaining() < (int)(NOT_LP64(1*K)LP64_ONLY(2*K))) {
@ -144,7 +139,7 @@ void LIR_Assembler::check_codespace() {
} }
void LIR_Assembler::emit_code_stub(CodeStub* stub) { void LIR_Assembler::append_code_stub(CodeStub* stub) {
_slow_case_stubs->append(stub); _slow_case_stubs->append(stub);
} }
@ -442,7 +437,7 @@ void LIR_Assembler::add_debug_info_for_null_check_here(CodeEmitInfo* cinfo) {
void LIR_Assembler::add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo) { void LIR_Assembler::add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo) {
ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(pc_offset, cinfo); ImplicitNullCheckStub* stub = new ImplicitNullCheckStub(pc_offset, cinfo);
emit_code_stub(stub); append_code_stub(stub);
} }
void LIR_Assembler::add_debug_info_for_div0_here(CodeEmitInfo* info) { void LIR_Assembler::add_debug_info_for_div0_here(CodeEmitInfo* info) {
@ -451,7 +446,7 @@ void LIR_Assembler::add_debug_info_for_div0_here(CodeEmitInfo* info) {
void LIR_Assembler::add_debug_info_for_div0(int pc_offset, CodeEmitInfo* cinfo) { void LIR_Assembler::add_debug_info_for_div0(int pc_offset, CodeEmitInfo* cinfo) {
DivByZeroStub* stub = new DivByZeroStub(pc_offset, cinfo); DivByZeroStub* stub = new DivByZeroStub(pc_offset, cinfo);
emit_code_stub(stub); append_code_stub(stub);
} }
void LIR_Assembler::emit_rtcall(LIR_OpRTCall* op) { void LIR_Assembler::emit_rtcall(LIR_OpRTCall* op) {

View file

@ -144,7 +144,7 @@ class LIR_Assembler: public CompilationResourceObj {
// stubs // stubs
void emit_slow_case_stubs(); void emit_slow_case_stubs();
void emit_static_call_stub(); void emit_static_call_stub();
void emit_code_stub(CodeStub* op); void append_code_stub(CodeStub* op);
void add_call_info_here(CodeEmitInfo* info) { add_call_info(code_offset(), info); } void add_call_info_here(CodeEmitInfo* info) { add_call_info(code_offset(), info); }
// code patterns // code patterns

View file

@ -2382,16 +2382,6 @@ OopMap* LinearScan::compute_oop_map(IntervalWalker* iw, LIR_Op* op, CodeEmitInfo
int arg_count = frame_map()->oop_map_arg_count(); int arg_count = frame_map()->oop_map_arg_count();
OopMap* map = new OopMap(frame_size, arg_count); OopMap* map = new OopMap(frame_size, arg_count);
// Check if this is a patch site.
bool is_patch_info = false;
if (op->code() == lir_move) {
assert(!is_call_site, "move must not be a call site");
assert(op->as_Op1() != NULL, "move must be LIR_Op1");
LIR_Op1* move = (LIR_Op1*)op;
is_patch_info = move->patch_code() != lir_patch_none;
}
// Iterate through active intervals // Iterate through active intervals
for (Interval* interval = iw->active_first(fixedKind); interval != Interval::end(); interval = interval->next()) { for (Interval* interval = iw->active_first(fixedKind); interval != Interval::end(); interval = interval->next()) {
int assigned_reg = interval->assigned_reg(); int assigned_reg = interval->assigned_reg();
@ -2406,7 +2396,7 @@ OopMap* LinearScan::compute_oop_map(IntervalWalker* iw, LIR_Op* op, CodeEmitInfo
// moves, any intervals which end at this instruction are included // moves, any intervals which end at this instruction are included
// in the oop map since we may safepoint while doing the patch // in the oop map since we may safepoint while doing the patch
// before we've consumed the inputs. // before we've consumed the inputs.
if (is_patch_info || op->id() < interval->current_to()) { if (op->is_patching() || op->id() < interval->current_to()) {
// caller-save registers must not be included into oop-maps at calls // caller-save registers must not be included into oop-maps at calls
assert(!is_call_site || assigned_reg >= nof_regs || !is_caller_save(assigned_reg), "interval is in a caller-save register at a call -> register will be overwritten"); assert(!is_call_site || assigned_reg >= nof_regs || !is_caller_save(assigned_reg), "interval is in a caller-save register at a call -> register will be overwritten");