equal
deleted
inserted
replaced
290 // we placed in the skeletal frame now that we finally know the |
290 // we placed in the skeletal frame now that we finally know the |
291 // exact interpreter address we should use. |
291 // exact interpreter address we should use. |
292 |
292 |
293 _frame.patch_pc(thread, pc); |
293 _frame.patch_pc(thread, pc); |
294 |
294 |
295 assert (!method()->is_synchronized() || locks > 0 || _removed_monitors, "synchronized methods must have monitors"); |
295 assert (!method()->is_synchronized() || locks > 0 || _removed_monitors || raw_bci() == SynchronizationEntryBCI, "synchronized methods must have monitors"); |
296 |
296 |
297 BasicObjectLock* top = iframe()->interpreter_frame_monitor_begin(); |
297 BasicObjectLock* top = iframe()->interpreter_frame_monitor_begin(); |
298 for (int index = 0; index < locks; index++) { |
298 for (int index = 0; index < locks; index++) { |
299 top = iframe()->previous_monitor_in_interpreter_frame(top); |
299 top = iframe()->previous_monitor_in_interpreter_frame(top); |
300 BasicObjectLock* src = _monitors->at(index); |
300 BasicObjectLock* src = _monitors->at(index); |
311 int bci = iframe()->interpreter_frame_bci(); |
311 int bci = iframe()->interpreter_frame_bci(); |
312 if (use_next_mdp) ++bci; |
312 if (use_next_mdp) ++bci; |
313 address mdp = mdo->bci_to_dp(bci); |
313 address mdp = mdo->bci_to_dp(bci); |
314 iframe()->interpreter_frame_set_mdp(mdp); |
314 iframe()->interpreter_frame_set_mdp(mdp); |
315 } |
315 } |
|
316 } |
|
317 |
|
318 if (PrintDeoptimizationDetails) { |
|
319 tty->print_cr("Expressions size: %d", expressions()->size()); |
316 } |
320 } |
317 |
321 |
318 // Unpack expression stack |
322 // Unpack expression stack |
319 // If this is an intermediate frame (i.e. not top frame) then this |
323 // If this is an intermediate frame (i.e. not top frame) then this |
320 // only unpacks the part of the expression stack not used by callee |
324 // only unpacks the part of the expression stack not used by callee |
325 StackValue *value = expressions()->at(i); |
329 StackValue *value = expressions()->at(i); |
326 intptr_t* addr = iframe()->interpreter_frame_expression_stack_at(i); |
330 intptr_t* addr = iframe()->interpreter_frame_expression_stack_at(i); |
327 switch(value->type()) { |
331 switch(value->type()) { |
328 case T_INT: |
332 case T_INT: |
329 *addr = value->get_int(); |
333 *addr = value->get_int(); |
|
334 #ifndef PRODUCT |
|
335 if (PrintDeoptimizationDetails) { |
|
336 tty->print_cr("Reconstructed expression %d (INT): %d", i, (int)(*addr)); |
|
337 } |
|
338 #endif |
330 break; |
339 break; |
331 case T_OBJECT: |
340 case T_OBJECT: |
332 *addr = value->get_int(T_OBJECT); |
341 *addr = value->get_int(T_OBJECT); |
|
342 #ifndef PRODUCT |
|
343 if (PrintDeoptimizationDetails) { |
|
344 tty->print("Reconstructed expression %d (OBJECT): ", i); |
|
345 oop o = (oop)(address)(*addr); |
|
346 if (o == NULL) { |
|
347 tty->print_cr("NULL"); |
|
348 } else { |
|
349 ResourceMark rm; |
|
350 tty->print_raw_cr(o->klass()->name()->as_C_string()); |
|
351 } |
|
352 } |
|
353 #endif |
333 break; |
354 break; |
334 case T_CONFLICT: |
355 case T_CONFLICT: |
335 // A dead stack slot. Initialize to null in case it is an oop. |
356 // A dead stack slot. Initialize to null in case it is an oop. |
336 *addr = NULL_WORD; |
357 *addr = NULL_WORD; |
337 break; |
358 break; |
346 StackValue *value = locals()->at(i); |
367 StackValue *value = locals()->at(i); |
347 intptr_t* addr = iframe()->interpreter_frame_local_at(i); |
368 intptr_t* addr = iframe()->interpreter_frame_local_at(i); |
348 switch(value->type()) { |
369 switch(value->type()) { |
349 case T_INT: |
370 case T_INT: |
350 *addr = value->get_int(); |
371 *addr = value->get_int(); |
|
372 #ifndef PRODUCT |
|
373 if (PrintDeoptimizationDetails) { |
|
374 tty->print_cr("Reconstructed local %d (INT): %d", i, (int)(*addr)); |
|
375 } |
|
376 #endif |
351 break; |
377 break; |
352 case T_OBJECT: |
378 case T_OBJECT: |
353 *addr = value->get_int(T_OBJECT); |
379 *addr = value->get_int(T_OBJECT); |
|
380 #ifndef PRODUCT |
|
381 if (PrintDeoptimizationDetails) { |
|
382 tty->print("Reconstructed local %d (OBJECT): ", i); |
|
383 oop o = (oop)(address)(*addr); |
|
384 if (o == NULL) { |
|
385 tty->print_cr("NULL"); |
|
386 } else { |
|
387 ResourceMark rm; |
|
388 tty->print_raw_cr(o->klass()->name()->as_C_string()); |
|
389 } |
|
390 } |
|
391 #endif |
354 break; |
392 break; |
355 case T_CONFLICT: |
393 case T_CONFLICT: |
356 // A dead location. If it is an oop then we need a NULL to prevent GC from following it |
394 // A dead location. If it is an oop then we need a NULL to prevent GC from following it |
357 *addr = NULL_WORD; |
395 *addr = NULL_WORD; |
358 break; |
396 break; |
390 thread->popframe_free_preserved_args(); |
428 thread->popframe_free_preserved_args(); |
391 } |
429 } |
392 } |
430 } |
393 |
431 |
394 #ifndef PRODUCT |
432 #ifndef PRODUCT |
395 if (TraceDeoptimization && Verbose) { |
433 if (PrintDeoptimizationDetails) { |
396 ttyLocker ttyl; |
434 ttyLocker ttyl; |
397 tty->print_cr("[%d Interpreted Frame]", ++unpack_counter); |
435 tty->print_cr("[%d Interpreted Frame]", ++unpack_counter); |
398 iframe()->print_on(tty); |
436 iframe()->print_on(tty); |
399 RegisterMap map(thread); |
437 RegisterMap map(thread); |
400 vframe* f = vframe::new_vframe(iframe(), &map, thread); |
438 vframe* f = vframe::new_vframe(iframe(), &map, thread); |