comparison src/share/vm/runtime/vframeArray.cpp @ 6948:e522a00b91aa

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author Doug Simon <doug.simon@oracle.com>
date Mon, 12 Nov 2012 23:14:12 +0100
parents 957c266d8bc5 da91efe96a93
children 5d0bb7d52783 ceb8c5b29419
comparison
equal deleted inserted replaced
6711:ae13cc658b80 6948:e522a00b91aa
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
27 #include "interpreter/bytecode.hpp" 27 #include "interpreter/bytecode.hpp"
28 #include "interpreter/interpreter.hpp" 28 #include "interpreter/interpreter.hpp"
29 #include "memory/allocation.inline.hpp" 29 #include "memory/allocation.inline.hpp"
30 #include "memory/resourceArea.hpp" 30 #include "memory/resourceArea.hpp"
31 #include "memory/universe.inline.hpp" 31 #include "memory/universe.inline.hpp"
32 #include "oops/methodDataOop.hpp" 32 #include "oops/methodData.hpp"
33 #include "oops/oop.inline.hpp" 33 #include "oops/oop.inline.hpp"
34 #include "prims/jvmtiThreadState.hpp" 34 #include "prims/jvmtiThreadState.hpp"
35 #include "runtime/handles.inline.hpp" 35 #include "runtime/handles.inline.hpp"
36 #include "runtime/monitorChunk.hpp" 36 #include "runtime/monitorChunk.hpp"
37 #include "runtime/sharedRuntime.hpp" 37 #include "runtime/sharedRuntime.hpp"
300 if (ProfileInterpreter) { 300 if (ProfileInterpreter) {
301 iframe()->interpreter_frame_set_mdx(0); // clear out the mdp. 301 iframe()->interpreter_frame_set_mdx(0); // clear out the mdp.
302 } 302 }
303 iframe()->interpreter_frame_set_bcx((intptr_t)bcp); // cannot use bcp because frame is not initialized yet 303 iframe()->interpreter_frame_set_bcx((intptr_t)bcp); // cannot use bcp because frame is not initialized yet
304 if (ProfileInterpreter) { 304 if (ProfileInterpreter) {
305 methodDataOop mdo = method()->method_data(); 305 MethodData* mdo = method()->method_data();
306 if (mdo != NULL) { 306 if (mdo != NULL) {
307 int bci = iframe()->interpreter_frame_bci(); 307 int bci = iframe()->interpreter_frame_bci();
308 if (use_next_mdp) ++bci; 308 if (use_next_mdp) ++bci;
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 }
313
314 if (PrintDeoptimizationDetails) {
315 tty->print_cr("Expressions size: %d", expressions()->size());
316 } 312 }
317 313
318 // Unpack expression stack 314 // Unpack expression stack
319 // If this is an intermediate frame (i.e. not top frame) then this 315 // 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 316 // only unpacks the part of the expression stack not used by callee
325 StackValue *value = expressions()->at(i); 321 StackValue *value = expressions()->at(i);
326 intptr_t* addr = iframe()->interpreter_frame_expression_stack_at(i); 322 intptr_t* addr = iframe()->interpreter_frame_expression_stack_at(i);
327 switch(value->type()) { 323 switch(value->type()) {
328 case T_INT: 324 case T_INT:
329 *addr = value->get_int(); 325 *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
335 break; 326 break;
336 case T_OBJECT: 327 case T_OBJECT:
337 *addr = value->get_int(T_OBJECT); 328 *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->blueprint()->name()->as_C_string()));
346 }
347 }
348 #endif
349 break; 329 break;
350 case T_CONFLICT: 330 case T_CONFLICT:
351 // A dead stack slot. Initialize to null in case it is an oop. 331 // A dead stack slot. Initialize to null in case it is an oop.
352 *addr = NULL_WORD; 332 *addr = NULL_WORD;
353 break; 333 break;
362 StackValue *value = locals()->at(i); 342 StackValue *value = locals()->at(i);
363 intptr_t* addr = iframe()->interpreter_frame_local_at(i); 343 intptr_t* addr = iframe()->interpreter_frame_local_at(i);
364 switch(value->type()) { 344 switch(value->type()) {
365 case T_INT: 345 case T_INT:
366 *addr = value->get_int(); 346 *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
372 break; 347 break;
373 case T_OBJECT: 348 case T_OBJECT:
374 *addr = value->get_int(T_OBJECT); 349 *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->blueprint()->name()->as_C_string()));
383 }
384 }
385 #endif
386 break; 350 break;
387 case T_CONFLICT: 351 case T_CONFLICT:
388 // A dead location. If it is an oop then we need a NULL to prevent GC from following it 352 // A dead location. If it is an oop then we need a NULL to prevent GC from following it
389 *addr = NULL_WORD; 353 *addr = NULL_WORD;
390 break; 354 break;
422 thread->popframe_free_preserved_args(); 386 thread->popframe_free_preserved_args();
423 } 387 }
424 } 388 }
425 389
426 #ifndef PRODUCT 390 #ifndef PRODUCT
427 if (PrintDeoptimizationDetails) { 391 if (TraceDeoptimization && Verbose) {
428 ttyLocker ttyl; 392 ttyLocker ttyl;
429 tty->print_cr("[%d Interpreted Frame]", ++unpack_counter); 393 tty->print_cr("[%d Interpreted Frame]", ++unpack_counter);
430 iframe()->print_on(tty); 394 iframe()->print_on(tty);
431 RegisterMap map(thread); 395 RegisterMap map(thread);
432 vframe* f = vframe::new_vframe(iframe(), &map, thread); 396 vframe* f = vframe::new_vframe(iframe(), &map, thread);
433 f->print(); 397 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();
434 tty->cr(); 403 tty->cr();
435 // method()->print_codes(); 404 // method()->print_codes();
436 } else if (TraceDeoptimization) { 405 } else if (TraceDeoptimization) {
437 tty->print(" "); 406 tty->print(" ");
438 method()->print_value(); 407 method()->print_value();