Mercurial > hg > graal-compiler
annotate src/share/vm/code/scopeDesc.hpp @ 20096:3844fb65016c
SL: repeating node should implement SLStatementNode for a proper toString implementation.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 30 Mar 2015 22:52:03 +0200 |
parents | 4ca6dc0799b6 |
children |
rev | line source |
---|---|
0 | 1 /* |
14909 | 2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1253
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1253
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1253
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_CODE_SCOPEDESC_HPP |
26 #define SHARE_VM_CODE_SCOPEDESC_HPP | |
27 | |
28 #include "code/debugInfo.hpp" | |
29 #include "code/pcDesc.hpp" | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
30 #include "oops/method.hpp" |
1972 | 31 #include "utilities/growableArray.hpp" |
32 | |
0 | 33 // SimpleScopeDesc is used when all you need to extract from |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
34 // a given pc,nmethod pair is a Method* and a bci. This is |
0 | 35 // quite a bit faster than allocating a full ScopeDesc, but |
36 // very limited in abilities. | |
37 | |
38 class SimpleScopeDesc : public StackObj { | |
39 private: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
40 Method* _method; |
0 | 41 int _bci; |
42 | |
43 public: | |
44 SimpleScopeDesc(nmethod* code,address pc) { | |
45 PcDesc* pc_desc = code->pc_desc_at(pc); | |
46 assert(pc_desc != NULL, "Must be able to find matching PcDesc"); | |
47 DebugInfoReadStream buffer(code, pc_desc->scope_decode_offset()); | |
48 int ignore_sender = buffer.read_int(); | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
49 _method = buffer.read_method(); |
931
72088be4b386
6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents:
900
diff
changeset
|
50 _bci = buffer.read_bci(); |
0 | 51 } |
52 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
53 Method* method() { return _method; } |
0 | 54 int bci() { return _bci; } |
55 }; | |
56 | |
57 // ScopeDescs contain the information that makes source-level debugging of | |
58 // nmethods possible; each scopeDesc describes a method activation | |
59 | |
60 class ScopeDesc : public ResourceObj { | |
61 public: | |
62 // Constructor | |
3018
5857923e563c
Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
1972
diff
changeset
|
63 ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool rethrow_exception, bool return_oop); |
0 | 64 |
65 // Calls above, giving default value of "serialized_null" to the | |
66 // "obj_decode_offset" argument. (We don't use a default argument to | |
67 // avoid a .hpp-.hpp dependency.) | |
3018
5857923e563c
Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
1972
diff
changeset
|
68 ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool rethrow_exception, bool return_oop); |
0 | 69 |
70 // JVM state | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
71 Method* method() const { return _method; } |
900
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
0
diff
changeset
|
72 int bci() const { return _bci; } |
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
0
diff
changeset
|
73 bool should_reexecute() const { return _reexecute; } |
3018
5857923e563c
Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
1972
diff
changeset
|
74 bool rethrow_exception() const { return _rethrow_exception; } |
1253
f70b0d9ab095
6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents:
931
diff
changeset
|
75 bool return_oop() const { return _return_oop; } |
0 | 76 |
77 GrowableArray<ScopeValue*>* locals(); | |
78 GrowableArray<ScopeValue*>* expressions(); | |
79 GrowableArray<MonitorValue*>* monitors(); | |
80 GrowableArray<ScopeValue*>* objects(); | |
81 | |
82 // Stack walking, returns NULL if this is the outer most scope. | |
83 ScopeDesc* sender() const; | |
84 | |
85 // Returns where the scope was decoded | |
86 int decode_offset() const { return _decode_offset; } | |
87 | |
88 // Tells whether sender() returns NULL | |
89 bool is_top() const; | |
14909 | 90 // Tells whether sd is equal to this |
91 bool is_equal(ScopeDesc* sd) const; | |
0 | 92 |
93 private: | |
94 // Alternative constructor | |
95 ScopeDesc(const ScopeDesc* parent); | |
96 | |
97 // JVM state | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
1972
diff
changeset
|
98 Method* _method; |
0 | 99 int _bci; |
900
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
0
diff
changeset
|
100 bool _reexecute; |
3018
5857923e563c
Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
1972
diff
changeset
|
101 bool _rethrow_exception; |
1253
f70b0d9ab095
6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents:
931
diff
changeset
|
102 bool _return_oop; |
0 | 103 |
104 // Decoding offsets | |
105 int _decode_offset; | |
106 int _sender_decode_offset; | |
107 int _locals_decode_offset; | |
108 int _expressions_decode_offset; | |
109 int _monitors_decode_offset; | |
110 | |
111 // Object pool | |
112 GrowableArray<ScopeValue*>* _objects; | |
113 | |
114 // Nmethod information | |
115 const nmethod* _code; | |
116 | |
117 // Decoding operations | |
118 void decode_body(); | |
119 GrowableArray<ScopeValue*>* decode_scope_values(int decode_offset); | |
120 GrowableArray<MonitorValue*>* decode_monitor_values(int decode_offset); | |
121 GrowableArray<ScopeValue*>* decode_object_values(int decode_offset); | |
122 | |
123 DebugInfoReadStream* stream_at(int decode_offset) const; | |
124 | |
125 | |
126 public: | |
127 // Verification | |
128 void verify(); | |
129 | |
130 #ifndef PRODUCT | |
131 public: | |
132 // Printing support | |
133 void print_on(outputStream* st) const; | |
134 void print_on(outputStream* st, PcDesc* pd) const; | |
135 void print_value_on(outputStream* st) const; | |
136 #endif | |
137 }; | |
1972 | 138 |
139 #endif // SHARE_VM_CODE_SCOPEDESC_HPP |