339 }
340
341 void DebugInformationRecorder::end_scopes(int pc_offset, bool is_safepoint) {
342 assert(_recording_state == (is_safepoint? rs_safepoint: rs_non_safepoint),
343 "nesting of recording calls");
344 debug_only(_recording_state = rs_null);
345
346 // Try to compress away an equivalent non-safepoint predecessor.
347 // (This only works because we have previously recognized redundant
348 // scope trees and made them use a common scope_decode_offset.)
349 if (_pcs_length >= 2 && recording_non_safepoints()) {
350 PcDesc* last = last_pc();
351 PcDesc* prev = prev_pc();
352 // If prev is (a) not a safepoint and (b) has the same
353 // stream pointer, then it can be coalesced into the last.
354 // This is valid because non-safepoints are only sought
355 // with pc_desc_near, which (when it misses prev) will
356 // search forward until it finds last.
357 // In addition, it does not matter if the last PcDesc
358 // is for a safepoint or not.
359 if (_prev_safepoint_pc < prev->pc_offset() &&
360 prev->scope_decode_offset() == last->scope_decode_offset()) {
361 assert(prev == last-1, "sane");
362 prev->set_pc_offset(pc_offset);
363 _pcs_length -= 1;
364 NOT_PRODUCT(++dir_stats.chunks_elided);
365 }
366 }
367
368 // We have just recorded this safepoint.
369 // Remember it in case the previous paragraph needs to know.
370 if (is_safepoint) {
371 _prev_safepoint_pc = pc_offset;
372 }
373 }
374
375 DebugToken* DebugInformationRecorder::create_scope_values(GrowableArray<ScopeValue*>* values) {
376 assert(!_oop_recorder->is_complete(), "not frozen yet");
377 return (DebugToken*) (intptr_t) serialize_scope_values(values);
378 }
379
380
|
339 }
340
341 void DebugInformationRecorder::end_scopes(int pc_offset, bool is_safepoint) {
342 assert(_recording_state == (is_safepoint? rs_safepoint: rs_non_safepoint),
343 "nesting of recording calls");
344 debug_only(_recording_state = rs_null);
345
346 // Try to compress away an equivalent non-safepoint predecessor.
347 // (This only works because we have previously recognized redundant
348 // scope trees and made them use a common scope_decode_offset.)
349 if (_pcs_length >= 2 && recording_non_safepoints()) {
350 PcDesc* last = last_pc();
351 PcDesc* prev = prev_pc();
352 // If prev is (a) not a safepoint and (b) has the same
353 // stream pointer, then it can be coalesced into the last.
354 // This is valid because non-safepoints are only sought
355 // with pc_desc_near, which (when it misses prev) will
356 // search forward until it finds last.
357 // In addition, it does not matter if the last PcDesc
358 // is for a safepoint or not.
359 if (_prev_safepoint_pc < prev->pc_offset() && prev->is_same_info(last)) {
360 assert(prev == last-1, "sane");
361 prev->set_pc_offset(pc_offset);
362 _pcs_length -= 1;
363 NOT_PRODUCT(++dir_stats.chunks_elided);
364 }
365 }
366
367 // We have just recorded this safepoint.
368 // Remember it in case the previous paragraph needs to know.
369 if (is_safepoint) {
370 _prev_safepoint_pc = pc_offset;
371 }
372 }
373
374 DebugToken* DebugInformationRecorder::create_scope_values(GrowableArray<ScopeValue*>* values) {
375 assert(!_oop_recorder->is_complete(), "not frozen yet");
376 return (DebugToken*) (intptr_t) serialize_scope_values(values);
377 }
378
379
|