--- old/src/share/vm/c1/c1_LIRAssembler.cpp 2016-10-25 10:40:05.237774921 +0200 +++ new/src/share/vm/c1/c1_LIRAssembler.cpp 2016-10-25 10:40:05.190774890 +0200 @@ -121,7 +121,8 @@ , _frame_map(c->frame_map()) , _current_block(NULL) , _pending_non_safepoint(NULL) - , _pending_non_safepoint_offset(0) + , _pending_non_safepoint_begin_offset(0) + , _pending_non_safepoint_end_offset(0) { _slow_case_stubs = new CodeStubList(); } @@ -365,7 +366,7 @@ if (src == NULL) return; int pc_offset = code_offset(); if (_pending_non_safepoint == src) { - _pending_non_safepoint_offset = pc_offset; + _pending_non_safepoint_end_offset = pc_offset; return; } ValueStack* vstack = debug_info(src); @@ -373,10 +374,13 @@ if (_pending_non_safepoint != NULL) { // Got some old debug info. Get rid of it. if (debug_info(_pending_non_safepoint) == vstack) { - _pending_non_safepoint_offset = pc_offset; + _pending_non_safepoint_end_offset = pc_offset; return; } - if (_pending_non_safepoint_offset < pc_offset) { + if (_pending_non_safepoint_end_offset < pc_offset) { + record_non_safepoint_debug_info(); + } else if (_pending_non_safepoint_begin_offset < pc_offset) { + _pending_non_safepoint_end_offset = pc_offset - 1; record_non_safepoint_debug_info(); } _pending_non_safepoint = NULL; @@ -384,7 +388,8 @@ // Remember the debug info. if (pc_offset > compilation()->debug_info_recorder()->last_pc_offset()) { _pending_non_safepoint = src; - _pending_non_safepoint_offset = pc_offset; + _pending_non_safepoint_begin_offset = pc_offset; + _pending_non_safepoint_end_offset = pc_offset; } } @@ -408,7 +413,7 @@ } void LIR_Assembler::record_non_safepoint_debug_info() { - int pc_offset = _pending_non_safepoint_offset; + int pc_offset = _pending_non_safepoint_end_offset; ValueStack* vstack = debug_info(_pending_non_safepoint); int bci = vstack->bci(); @@ -449,6 +454,11 @@ append_code_stub(stub); } +void LIR_Assembler::add_non_safepoint_debug_info_here(CodeEmitInfo* info) { + flush_debug_info(code_offset()); + info->record_non_safepoint_debug_info(compilation()->debug_info_recorder(), code_offset()); +} + void LIR_Assembler::emit_rtcall(LIR_OpRTCall* op) { rt_call(op->result_opr(), op->addr(), op->arguments(), op->tmp(), op->info()); }