265 // but searching in _shared_chunks is unlimited. 266 _shared_chunks->append(ms); 267 assert(ns+1 == _next_chunk, ""); 268 _next_chunk = ns; 269 return ms->_offset; 270 } 271 272 // No match. Add this guy to the list, in hopes of future shares. 273 _all_chunks->append(ns); 274 return serialized_null; 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 ciMethod* method, 282 int bci, 283 bool reexecute, 284 bool is_method_handle_invoke, 285 DebugToken* locals, 286 DebugToken* expressions, 287 DebugToken* monitors) { 288 assert(_recording_state != rs_null, "nesting of recording calls"); 289 PcDesc* last_pd = last_pc(); 290 assert(last_pd->pc_offset() == pc_offset, "must be last pc"); 291 int sender_stream_offset = last_pd->scope_decode_offset(); 292 // update the stream offset of current pc desc 293 int stream_offset = stream()->position(); 294 last_pd->set_scope_decode_offset(stream_offset); 295 296 // Record flags into pcDesc. 297 last_pd->set_should_reexecute(reexecute); 298 last_pd->set_is_method_handle_invoke(is_method_handle_invoke); 299 300 // serialize sender stream offest 301 stream()->write_int(sender_stream_offset); 302 303 // serialize scope 304 jobject method_enc = (method == NULL)? NULL: method->constant_encoding(); 305 stream()->write_int(oop_recorder()->find_index(method_enc)); 306 stream()->write_bci(bci); 307 assert(method == NULL || 308 (method->is_native() && bci == 0) || 309 (!method->is_native() && 0 <= bci && bci < method->code_size()) || 310 bci == -1, "illegal bci"); 311 312 // serialize the locals/expressions/monitors 313 stream()->write_int((intptr_t) locals); 314 stream()->write_int((intptr_t) expressions); 315 stream()->write_int((intptr_t) monitors); 316 317 // Here's a tricky bit. We just wrote some bytes. 318 // Wouldn't it be nice to find that we had already | 265 // but searching in _shared_chunks is unlimited. 266 _shared_chunks->append(ms); 267 assert(ns+1 == _next_chunk, ""); 268 _next_chunk = ns; 269 return ms->_offset; 270 } 271 272 // No match. Add this guy to the list, in hopes of future shares. 273 _all_chunks->append(ns); 274 return serialized_null; 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 ciMethod* method, 282 int bci, 283 bool reexecute, 284 bool is_method_handle_invoke, 285 bool return_oop, 286 DebugToken* locals, 287 DebugToken* expressions, 288 DebugToken* monitors) { 289 assert(_recording_state != rs_null, "nesting of recording calls"); 290 PcDesc* last_pd = last_pc(); 291 assert(last_pd->pc_offset() == pc_offset, "must be last pc"); 292 int sender_stream_offset = last_pd->scope_decode_offset(); 293 // update the stream offset of current pc desc 294 int stream_offset = stream()->position(); 295 last_pd->set_scope_decode_offset(stream_offset); 296 297 // Record flags into pcDesc. 298 last_pd->set_should_reexecute(reexecute); 299 last_pd->set_is_method_handle_invoke(is_method_handle_invoke); 300 last_pd->set_return_oop(return_oop); 301 302 // serialize sender stream offest 303 stream()->write_int(sender_stream_offset); 304 305 // serialize scope 306 jobject method_enc = (method == NULL)? NULL: method->constant_encoding(); 307 stream()->write_int(oop_recorder()->find_index(method_enc)); 308 stream()->write_bci(bci); 309 assert(method == NULL || 310 (method->is_native() && bci == 0) || 311 (!method->is_native() && 0 <= bci && bci < method->code_size()) || 312 bci == -1, "illegal bci"); 313 314 // serialize the locals/expressions/monitors 315 stream()->write_int((intptr_t) locals); 316 stream()->write_int((intptr_t) expressions); 317 stream()->write_int((intptr_t) monitors); 318 319 // Here's a tricky bit. We just wrote some bytes. 320 // Wouldn't it be nice to find that we had already |