comparison src/share/vm/runtime/vframeArray.cpp @ 7213:ceb8c5b29419

print more details when -XX:+PrintDeoptimizationDetails is enabled
author Christian Haeubl <haeubl@ssw.jku.at>
date Mon, 03 Dec 2012 13:44:12 +0100
parents e522a00b91aa
children 8a3efb8c831d
comparison
equal deleted inserted replaced
7114:acfca8c77dd2 7213:ceb8c5b29419
309 address mdp = mdo->bci_to_dp(bci); 309 address mdp = mdo->bci_to_dp(bci);
310 iframe()->interpreter_frame_set_mdp(mdp); 310 iframe()->interpreter_frame_set_mdp(mdp);
311 } 311 }
312 } 312 }
313 313
314 if (PrintDeoptimizationDetails) {
315 tty->print_cr("Expressions size: %d", expressions()->size());
316 }
317
314 // Unpack expression stack 318 // Unpack expression stack
315 // If this is an intermediate frame (i.e. not top frame) then this 319 // If this is an intermediate frame (i.e. not top frame) then this
316 // only unpacks the part of the expression stack not used by callee 320 // only unpacks the part of the expression stack not used by callee
317 // as parameters. The callee parameters are unpacked as part of the 321 // as parameters. The callee parameters are unpacked as part of the
318 // callee locals. 322 // callee locals.
321 StackValue *value = expressions()->at(i); 325 StackValue *value = expressions()->at(i);
322 intptr_t* addr = iframe()->interpreter_frame_expression_stack_at(i); 326 intptr_t* addr = iframe()->interpreter_frame_expression_stack_at(i);
323 switch(value->type()) { 327 switch(value->type()) {
324 case T_INT: 328 case T_INT:
325 *addr = value->get_int(); 329 *addr = value->get_int();
330 #ifndef PRODUCT
331 if (PrintDeoptimizationDetails) {
332 tty->print_cr("Reconstructed expression %d (INT): %d", i, (int)(*addr));
333 }
334 #endif
326 break; 335 break;
327 case T_OBJECT: 336 case T_OBJECT:
328 *addr = value->get_int(T_OBJECT); 337 *addr = value->get_int(T_OBJECT);
338 #ifndef PRODUCT
339 if (PrintDeoptimizationDetails) {
340 tty->print("Reconstructed expression %d (OBJECT): ", i);
341 oop o = (oop)(*addr);
342 if (o == NULL) {
343 tty->print_cr("NULL");
344 } else {
345 tty->print_cr(err_msg("%s", o->klass()->name()->as_C_string()));
346 }
347 }
348 #endif
329 break; 349 break;
330 case T_CONFLICT: 350 case T_CONFLICT:
331 // A dead stack slot. Initialize to null in case it is an oop. 351 // A dead stack slot. Initialize to null in case it is an oop.
332 *addr = NULL_WORD; 352 *addr = NULL_WORD;
333 break; 353 break;
342 StackValue *value = locals()->at(i); 362 StackValue *value = locals()->at(i);
343 intptr_t* addr = iframe()->interpreter_frame_local_at(i); 363 intptr_t* addr = iframe()->interpreter_frame_local_at(i);
344 switch(value->type()) { 364 switch(value->type()) {
345 case T_INT: 365 case T_INT:
346 *addr = value->get_int(); 366 *addr = value->get_int();
367 #ifndef PRODUCT
368 if (PrintDeoptimizationDetails) {
369 tty->print_cr("Reconstructed local %d (INT): %d", i, (int)(*addr));
370 }
371 #endif
347 break; 372 break;
348 case T_OBJECT: 373 case T_OBJECT:
349 *addr = value->get_int(T_OBJECT); 374 *addr = value->get_int(T_OBJECT);
375 #ifndef PRODUCT
376 if (PrintDeoptimizationDetails) {
377 tty->print("Reconstructed local %d (OBJECT): ", i);
378 oop o = (oop)(*addr);
379 if (o == NULL) {
380 tty->print_cr("NULL");
381 } else {
382 tty->print_cr(err_msg("%s", o->klass()->name()->as_C_string()));
383 }
384 }
385 #endif
350 break; 386 break;
351 case T_CONFLICT: 387 case T_CONFLICT:
352 // A dead location. If it is an oop then we need a NULL to prevent GC from following it 388 // A dead location. If it is an oop then we need a NULL to prevent GC from following it
353 *addr = NULL_WORD; 389 *addr = NULL_WORD;
354 break; 390 break;
386 thread->popframe_free_preserved_args(); 422 thread->popframe_free_preserved_args();
387 } 423 }
388 } 424 }
389 425
390 #ifndef PRODUCT 426 #ifndef PRODUCT
391 if (TraceDeoptimization && Verbose) { 427 if (PrintDeoptimizationDetails) {
392 ttyLocker ttyl; 428 ttyLocker ttyl;
393 tty->print_cr("[%d Interpreted Frame]", ++unpack_counter); 429 tty->print_cr("[%d Interpreted Frame]", ++unpack_counter);
394 iframe()->print_on(tty); 430 iframe()->print_on(tty);
395 RegisterMap map(thread); 431 RegisterMap map(thread);
396 vframe* f = vframe::new_vframe(iframe(), &map, thread); 432 vframe* f = vframe::new_vframe(iframe(), &map, thread);
397 f->print(); 433 f->print();
398
399 tty->print_cr("locals size %d", locals()->size());
400 tty->print_cr("expression size %d", expressions()->size());
401
402 method()->print_value();
403 tty->cr(); 434 tty->cr();
404 // method()->print_codes(); 435 // method()->print_codes();
405 } else if (TraceDeoptimization) { 436 } else if (TraceDeoptimization) {
406 tty->print(" "); 437 tty->print(" ");
407 method()->print_value(); 438 method()->print_value();