267 NOT_PRODUCT(++dir_stats.chunks_shared);
268 assert(ns+1 == _next_chunk, "");
269 _next_chunk = ns;
270 return match->offset();
271 } else {
272 // Inserted this chunk, so nothing to do
273 return serialized_null;
274 }
275 }
276
277
278 // must call add_safepoint before: it sets PcDesc and this routine uses
279 // the last PcDesc set
280 void DebugInformationRecorder::describe_scope(int pc_offset,
281 const methodHandle& methodH,
282 ciMethod* method,
283 int bci,
284 bool reexecute,
285 bool rethrow_exception,
286 bool return_oop,
287 bool has_ea_local_in_scope,
288 bool arg_escape,
289 DebugToken* locals,
290 DebugToken* expressions,
291 DebugToken* monitors) {
292 assert(_recording_state != rs_null, "nesting of recording calls");
293 PcDesc* last_pd = last_pc();
294 assert(last_pd->pc_offset() == pc_offset, "must be last pc");
295 int sender_stream_offset = last_pd->scope_decode_offset();
296 // update the stream offset of current pc desc
297 int stream_offset = stream()->position();
298 last_pd->set_scope_decode_offset(stream_offset);
299
300 // Record flags into pcDesc.
301 last_pd->set_should_reexecute(reexecute);
302 last_pd->set_rethrow_exception(rethrow_exception);
303 last_pd->set_return_oop(return_oop);
304 last_pd->set_has_ea_local_in_scope(has_ea_local_in_scope);
305 last_pd->set_arg_escape(arg_escape);
306
307 // serialize sender stream offset
308 stream()->write_int(sender_stream_offset);
309
310 // serialize scope
311 Metadata* method_enc;
312 if (method != nullptr) {
313 method_enc = method->constant_encoding();
314 } else if (methodH.not_null()) {
315 method_enc = methodH();
316 } else {
317 method_enc = nullptr;
318 }
319 int method_enc_index = oop_recorder()->find_index(method_enc);
320 stream()->write_int(method_enc_index);
321 stream()->write_bci(bci);
322 assert(method == nullptr ||
323 (method->is_native() && bci == 0) ||
|
267 NOT_PRODUCT(++dir_stats.chunks_shared);
268 assert(ns+1 == _next_chunk, "");
269 _next_chunk = ns;
270 return match->offset();
271 } else {
272 // Inserted this chunk, so nothing to do
273 return serialized_null;
274 }
275 }
276
277
278 // must call add_safepoint before: it sets PcDesc and this routine uses
279 // the last PcDesc set
280 void DebugInformationRecorder::describe_scope(int pc_offset,
281 const methodHandle& methodH,
282 ciMethod* method,
283 int bci,
284 bool reexecute,
285 bool rethrow_exception,
286 bool return_oop,
287 bool return_scalarized,
288 bool has_ea_local_in_scope,
289 bool arg_escape,
290 DebugToken* locals,
291 DebugToken* expressions,
292 DebugToken* monitors) {
293 assert(_recording_state != rs_null, "nesting of recording calls");
294 PcDesc* last_pd = last_pc();
295 assert(last_pd->pc_offset() == pc_offset, "must be last pc");
296 int sender_stream_offset = last_pd->scope_decode_offset();
297 // update the stream offset of current pc desc
298 int stream_offset = stream()->position();
299 last_pd->set_scope_decode_offset(stream_offset);
300
301 // Record flags into pcDesc.
302 last_pd->set_should_reexecute(reexecute);
303 last_pd->set_rethrow_exception(rethrow_exception);
304 last_pd->set_return_oop(return_oop);
305 last_pd->set_return_scalarized(return_scalarized);
306 last_pd->set_has_ea_local_in_scope(has_ea_local_in_scope);
307 last_pd->set_arg_escape(arg_escape);
308
309 // serialize sender stream offset
310 stream()->write_int(sender_stream_offset);
311
312 // serialize scope
313 Metadata* method_enc;
314 if (method != nullptr) {
315 method_enc = method->constant_encoding();
316 } else if (methodH.not_null()) {
317 method_enc = methodH();
318 } else {
319 method_enc = nullptr;
320 }
321 int method_enc_index = oop_recorder()->find_index(method_enc);
322 stream()->write_int(method_enc_index);
323 stream()->write_bci(bci);
324 assert(method == nullptr ||
325 (method->is_native() && bci == 0) ||
|