1 /*
2 * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
30 #include "runtime/frame.inline.hpp"
31 #include "runtime/monitorChunk.hpp"
32 #include "utilities/growableArray.hpp"
33
34 // A vframeArray is an array used for momentarily storing off stack Java method activations
35 // during deoptimization. Essentially it is an array of vframes where each vframe
36 // data is stored off stack. This structure will never exist across a safepoint so
37 // there is no need to gc any oops that are stored in the structure.
38
39
40 class LocalsClosure;
41 class ExpressionStackClosure;
42 class MonitorStackClosure;
43 class MonitorArrayElement;
44 class StackValueCollection;
45
46 // A vframeArrayElement is an element of a vframeArray. Each element
47 // represent an interpreter frame which will eventually be created.
48
49 class vframeArrayElement : public _ValueObj {
50 private:
51
52 frame _frame; // the interpreter frame we will unpack into
53 int _bci; // raw bci for this vframe
54 bool _reexecute; // whether sould we reexecute this bytecode
55 methodOop _method; // the method for this vframe
56 MonitorChunk* _monitors; // active monitors for this vframe
57 StackValueCollection* _locals;
58 StackValueCollection* _expressions;
59
60 public:
61
62 frame* iframe(void) { return &_frame; }
63
64 int bci(void) const;
65
66 int raw_bci(void) const { return _bci; }
67 bool should_reexecute(void) const { return _reexecute; }
68
69 methodOop method(void) const { return _method; }
90 int popframe_extra_stack_expression_els) const;
91
92 // Unpacks the element to skeletal interpreter frame
93 void unpack_on_stack(int caller_actual_parameters,
94 int callee_parameters,
95 int callee_locals,
96 frame* caller,
97 bool is_top_frame,
98 int exec_mode);
99
100 #ifndef PRODUCT
101 void print(outputStream* st);
102 #endif /* PRODUCT */
103 };
104
105 // this can be a ResourceObj if we don't save the last one...
106 // but it does make debugging easier even if we can't look
107 // at the data in each vframeElement
108
109 class vframeArray: public CHeapObj {
110 private:
111
112
113 // Here is what a vframeArray looks like in memory
114
115 /*
116 fixed part
117 description of the original frame
118 _frames - number of vframes in this array
119 adapter info
120 callee register save area
121 variable part
122 vframeArrayElement [ 0 ]
123 ...
124 vframeArrayElement [_frames - 1]
125
126 */
127
128 JavaThread* _owner_thread;
129 vframeArray* _next;
|
1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
30 #include "runtime/frame.inline.hpp"
31 #include "runtime/monitorChunk.hpp"
32 #include "utilities/growableArray.hpp"
33
34 // A vframeArray is an array used for momentarily storing off stack Java method activations
35 // during deoptimization. Essentially it is an array of vframes where each vframe
36 // data is stored off stack. This structure will never exist across a safepoint so
37 // there is no need to gc any oops that are stored in the structure.
38
39
40 class LocalsClosure;
41 class ExpressionStackClosure;
42 class MonitorStackClosure;
43 class MonitorArrayElement;
44 class StackValueCollection;
45
46 // A vframeArrayElement is an element of a vframeArray. Each element
47 // represent an interpreter frame which will eventually be created.
48
49 class vframeArrayElement : public _ValueObj {
50 friend class VMStructs;
51
52 private:
53
54 frame _frame; // the interpreter frame we will unpack into
55 int _bci; // raw bci for this vframe
56 bool _reexecute; // whether sould we reexecute this bytecode
57 methodOop _method; // the method for this vframe
58 MonitorChunk* _monitors; // active monitors for this vframe
59 StackValueCollection* _locals;
60 StackValueCollection* _expressions;
61
62 public:
63
64 frame* iframe(void) { return &_frame; }
65
66 int bci(void) const;
67
68 int raw_bci(void) const { return _bci; }
69 bool should_reexecute(void) const { return _reexecute; }
70
71 methodOop method(void) const { return _method; }
92 int popframe_extra_stack_expression_els) const;
93
94 // Unpacks the element to skeletal interpreter frame
95 void unpack_on_stack(int caller_actual_parameters,
96 int callee_parameters,
97 int callee_locals,
98 frame* caller,
99 bool is_top_frame,
100 int exec_mode);
101
102 #ifndef PRODUCT
103 void print(outputStream* st);
104 #endif /* PRODUCT */
105 };
106
107 // this can be a ResourceObj if we don't save the last one...
108 // but it does make debugging easier even if we can't look
109 // at the data in each vframeElement
110
111 class vframeArray: public CHeapObj {
112 friend class VMStructs;
113
114 private:
115
116
117 // Here is what a vframeArray looks like in memory
118
119 /*
120 fixed part
121 description of the original frame
122 _frames - number of vframes in this array
123 adapter info
124 callee register save area
125 variable part
126 vframeArrayElement [ 0 ]
127 ...
128 vframeArrayElement [_frames - 1]
129
130 */
131
132 JavaThread* _owner_thread;
133 vframeArray* _next;
|