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 is_method_handle_invoke,
287 bool return_oop,
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_is_method_handle_invoke(is_method_handle_invoke);
305 last_pd->set_return_oop(return_oop);
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) ||
|
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 is_method_handle_invoke,
287 bool return_oop,
288 bool return_scalarized,
289 bool has_ea_local_in_scope,
290 bool arg_escape,
291 DebugToken* locals,
292 DebugToken* expressions,
293 DebugToken* monitors) {
294 assert(_recording_state != rs_null, "nesting of recording calls");
295 PcDesc* last_pd = last_pc();
296 assert(last_pd->pc_offset() == pc_offset, "must be last pc");
297 int sender_stream_offset = last_pd->scope_decode_offset();
298 // update the stream offset of current pc desc
299 int stream_offset = stream()->position();
300 last_pd->set_scope_decode_offset(stream_offset);
301
302 // Record flags into pcDesc.
303 last_pd->set_should_reexecute(reexecute);
304 last_pd->set_rethrow_exception(rethrow_exception);
305 last_pd->set_is_method_handle_invoke(is_method_handle_invoke);
306 last_pd->set_return_oop(return_oop);
307 last_pd->set_return_scalarized(return_scalarized);
308 last_pd->set_has_ea_local_in_scope(has_ea_local_in_scope);
309 last_pd->set_arg_escape(arg_escape);
310
311 // serialize sender stream offset
312 stream()->write_int(sender_stream_offset);
313
314 // serialize scope
315 Metadata* method_enc;
316 if (method != nullptr) {
317 method_enc = method->constant_encoding();
318 } else if (methodH.not_null()) {
319 method_enc = methodH();
320 } else {
321 method_enc = nullptr;
322 }
323 int method_enc_index = oop_recorder()->find_index(method_enc);
324 stream()->write_int(method_enc_index);
325 stream()->write_bci(bci);
326 assert(method == nullptr ||
327 (method->is_native() && bci == 0) ||
|