comparison src/share/vm/c1x/c1x_CodeInstaller.cpp @ 1447:1afbc44ee576

Modified class descriptions in C++ to reflect changes to CiDebugInfo.Frame
author Doug Simon <doug.simon@oracle.com>
date Tue, 09 Nov 2010 17:38:40 +0100
parents c0e244017dad
children 565f45cebac2
comparison
equal deleted inserted replaced
1446:5f1100e1cb12 1447:1afbc44ee576
303 } 303 }
304 } 304 }
305 305
306 } 306 }
307 307
308 void CodeInstaller::record_scope(jint pc_offset, oop code_pos, oop frame) { 308 void CodeInstaller::record_scope(jint pc_offset, oop code_pos) {
309 oop caller_pos = CiCodePos::caller(code_pos); 309 oop caller_pos = CiCodePos::caller(code_pos);
310 if (caller_pos != NULL) { 310 if (caller_pos != NULL) {
311 oop caller_frame = frame == NULL ? NULL : CiDebugInfo_Frame::caller(frame); 311 record_scope(pc_offset, caller_pos);
312 record_scope(pc_offset, caller_pos, caller_frame); 312 }
313 } else { 313 oop frame = NULL;
314 assert(frame == NULL || CiDebugInfo_Frame::caller(frame) == NULL, "unexpected layout - mismatching nesting of Frame and CiCodePos"); 314 if (code_pos->klass()->klass_part()->name() == vmSymbols::com_sun_cri_ci_CiDebugInfo_Frame()) {
315 } 315 frame = code_pos;
316
317 if (frame != NULL) {
318 assert(CiCodePos::bci(code_pos) == CiCodePos::bci(CiDebugInfo_Frame::codePos(frame)), "unexpected CiCodePos layout");
319 assert(CiCodePos::method(code_pos) == CiCodePos::method(CiDebugInfo_Frame::codePos(frame)), "unexpected CiCodePos layout");
320 } 316 }
321 317
322 oop hotspot_method = CiCodePos::method(code_pos); 318 oop hotspot_method = CiCodePos::method(code_pos);
323 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotMethodResolved::klass()), "unexpected hotspot method"); 319 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotMethodResolved::klass()), "unexpected hotspot method");
324 methodOop method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(hotspot_method)); 320 methodOop method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(hotspot_method));
326 jint bci = CiCodePos::bci(code_pos); 322 jint bci = CiCodePos::bci(code_pos);
327 bool reexecute; 323 bool reexecute;
328 if (bci == -1) { 324 if (bci == -1) {
329 reexecute = false; 325 reexecute = false;
330 } else { 326 } else {
331 Bytecodes::Code code = Bytecodes::java_code_at(method->bcp_from(bci)); 327 Bytecodes::Code code = Bytecodes::java_code_at(method->bcp_from(bci));
332 reexecute = Interpreter::bytecode_should_reexecute(code); 328 reexecute = Interpreter::bytecode_should_reexecute(code);
333 } 329 }
334 330
335 331
336 if (frame != NULL) { 332 if (frame != NULL) {
376 // address instruction = _instructions->start() + pc_offset; 372 // address instruction = _instructions->start() + pc_offset;
377 // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start(); 373 // jint next_pc_offset = Assembler::locate_next_instruction(instruction) - _instructions->start();
378 _debug_recorder->add_safepoint(pc_offset, create_oop_map(_frame_size, _parameter_count, debug_info)); 374 _debug_recorder->add_safepoint(pc_offset, create_oop_map(_frame_size, _parameter_count, debug_info));
379 375
380 oop code_pos = CiDebugInfo::codePos(debug_info); 376 oop code_pos = CiDebugInfo::codePos(debug_info);
381 oop frame = CiDebugInfo::frame(debug_info); 377 record_scope(pc_offset, code_pos);
382 record_scope(pc_offset, code_pos, frame);
383 378
384 _debug_recorder->end_safepoint(pc_offset); 379 _debug_recorder->end_safepoint(pc_offset);
385 } 380 }
386 381
387 void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, oop site) { 382 void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, oop site) {
400 jint next_pc_offset = pc_offset + NativeCall::instruction_size; 395 jint next_pc_offset = pc_offset + NativeCall::instruction_size;
401 396
402 if (debug_info != NULL) { 397 if (debug_info != NULL) {
403 _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_frame_size, _parameter_count, debug_info)); 398 _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_frame_size, _parameter_count, debug_info));
404 oop code_pos = CiDebugInfo::codePos(debug_info); 399 oop code_pos = CiDebugInfo::codePos(debug_info);
405 oop frame = CiDebugInfo::frame(debug_info); 400 record_scope(next_pc_offset, code_pos);
406 record_scope(next_pc_offset, code_pos, frame);
407 } 401 }
408 402
409 if (runtime_call != NULL) { 403 if (runtime_call != NULL) {
410 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); 404 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset);
411 if (runtime_call == CiRuntimeCall::Debug()) { 405 if (runtime_call == CiRuntimeCall::Debug()) {