comparison src/cpu/x86/vm/frame_x86.cpp @ 4970:33df1aeaebbf

Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 27 Feb 2012 13:10:13 +0100
parents 3dbcd1013cc8 5f17b16b3219
children 957c266d8bc5
comparison
equal deleted inserted replaced
4703:2cfb7fb2dce7 4970:33df1aeaebbf
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.
26 #include "interpreter/interpreter.hpp" 26 #include "interpreter/interpreter.hpp"
27 #include "memory/resourceArea.hpp" 27 #include "memory/resourceArea.hpp"
28 #include "oops/markOop.hpp" 28 #include "oops/markOop.hpp"
29 #include "oops/methodOop.hpp" 29 #include "oops/methodOop.hpp"
30 #include "oops/oop.inline.hpp" 30 #include "oops/oop.inline.hpp"
31 #include "prims/methodHandles.hpp"
31 #include "runtime/frame.inline.hpp" 32 #include "runtime/frame.inline.hpp"
32 #include "runtime/handles.inline.hpp" 33 #include "runtime/handles.inline.hpp"
33 #include "runtime/javaCalls.hpp" 34 #include "runtime/javaCalls.hpp"
34 #include "runtime/monitorChunk.hpp" 35 #include "runtime/monitorChunk.hpp"
35 #include "runtime/signature.hpp" 36 #include "runtime/signature.hpp"
654 intptr_t* frame::interpreter_frame_tos_at(jint offset) const { 655 intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
655 int index = (Interpreter::expr_offset_in_bytes(offset)/wordSize); 656 int index = (Interpreter::expr_offset_in_bytes(offset)/wordSize);
656 return &interpreter_frame_tos_address()[index]; 657 return &interpreter_frame_tos_address()[index];
657 } 658 }
658 659
659 #ifdef ASSERT 660 #ifndef PRODUCT
660 661
661 #define DESCRIBE_FP_OFFSET(name) \ 662 #define DESCRIBE_FP_OFFSET(name) \
662 values.describe(frame_no, fp() + frame::name##_offset, #name) 663 values.describe(frame_no, fp() + frame::name##_offset, #name)
663 664
664 void frame::describe_pd(FrameValues& values, int frame_no) { 665 void frame::describe_pd(FrameValues& values, int frame_no) {
665 if (is_interpreted_frame()) { 666 if (is_ricochet_frame()) {
667 MethodHandles::RicochetFrame::describe(this, values, frame_no);
668 } else if (is_interpreted_frame()) {
666 DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp); 669 DESCRIBE_FP_OFFSET(interpreter_frame_sender_sp);
667 DESCRIBE_FP_OFFSET(interpreter_frame_last_sp); 670 DESCRIBE_FP_OFFSET(interpreter_frame_last_sp);
668 DESCRIBE_FP_OFFSET(interpreter_frame_method); 671 DESCRIBE_FP_OFFSET(interpreter_frame_method);
669 DESCRIBE_FP_OFFSET(interpreter_frame_mdx); 672 DESCRIBE_FP_OFFSET(interpreter_frame_mdx);
670 DESCRIBE_FP_OFFSET(interpreter_frame_cache); 673 DESCRIBE_FP_OFFSET(interpreter_frame_cache);
671 DESCRIBE_FP_OFFSET(interpreter_frame_locals); 674 DESCRIBE_FP_OFFSET(interpreter_frame_locals);
672 DESCRIBE_FP_OFFSET(interpreter_frame_bcx); 675 DESCRIBE_FP_OFFSET(interpreter_frame_bcx);
673 DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp); 676 DESCRIBE_FP_OFFSET(interpreter_frame_initial_sp);
674 } 677 }
675
676 } 678 }
677 #endif 679 #endif
678 680
679 intptr_t *frame::initial_deoptimization_info() { 681 intptr_t *frame::initial_deoptimization_info() {
680 // used to reset the saved FP 682 // used to reset the saved FP
681 return fp(); 683 return fp();
682 } 684 }
685
686 intptr_t* frame::real_fp() const {
687 if (_cb != NULL) {
688 // use the frame size if valid
689 int size = _cb->frame_size();
690 if ((size > 0) &&
691 (! is_ricochet_frame())) {
692 // Work-around: ricochet explicitly excluded because frame size is not
693 // constant for the ricochet blob but its frame_size could not, for
694 // some reasons, be declared as <= 0. This potentially confusing
695 // size declaration should be fixed as another CR.
696 return unextended_sp() + size;
697 }
698 }
699 // else rely on fp()
700 assert(! is_compiled_frame(), "unknown compiled frame size");
701 return fp();
702 }