270 assert(ns+1 == _next_chunk, ""); 271 _next_chunk = ns; 272 return match->offset(); 273 } else { 274 // Inserted this chunk, so nothing to do 275 return serialized_null; 276 } 277 } 278 279 280 // must call add_safepoint before: it sets PcDesc and this routine uses 281 // the last PcDesc set 282 void DebugInformationRecorder::describe_scope(int pc_offset, 283 const methodHandle& methodH, 284 ciMethod* method, 285 int bci, 286 bool reexecute, 287 bool rethrow_exception, 288 bool is_method_handle_invoke, 289 bool return_oop, 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 307 // serialize sender stream offest 308 stream()->write_int(sender_stream_offset); 309 310 // serialize scope 311 Metadata* method_enc; 312 if (method != NULL) { 313 method_enc = method->constant_encoding(); 314 } else if (methodH.not_null()) { 315 method_enc = methodH(); 316 } else { 317 method_enc = NULL; 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 == NULL || 323 (method->is_native() && bci == 0) || 324 (!method->is_native() && 0 <= bci && bci < method->code_size()) || 325 bci == -1, "illegal bci"); | 270 assert(ns+1 == _next_chunk, ""); 271 _next_chunk = ns; 272 return match->offset(); 273 } else { 274 // Inserted this chunk, so nothing to do 275 return serialized_null; 276 } 277 } 278 279 280 // must call add_safepoint before: it sets PcDesc and this routine uses 281 // the last PcDesc set 282 void DebugInformationRecorder::describe_scope(int pc_offset, 283 const methodHandle& methodH, 284 ciMethod* method, 285 int bci, 286 bool reexecute, 287 bool rethrow_exception, 288 bool is_method_handle_invoke, 289 bool return_oop, 290 bool return_vt, 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_vt(return_vt); 308 309 // serialize sender stream offest 310 stream()->write_int(sender_stream_offset); 311 312 // serialize scope 313 Metadata* method_enc; 314 if (method != NULL) { 315 method_enc = method->constant_encoding(); 316 } else if (methodH.not_null()) { 317 method_enc = methodH(); 318 } else { 319 method_enc = NULL; 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 == NULL || 325 (method->is_native() && bci == 0) || 326 (!method->is_native() && 0 <= bci && bci < method->code_size()) || 327 bci == -1, "illegal bci"); |