author | anoll |
Fri, 24 Oct 2014 14:25:46 +0200 | |
changeset 27420 | 04e6f914cce1 |
parent 22246 | 343c5c94b73b |
child 33160 | c59f1676d27e |
permissions | -rw-r--r-- |
1 | 1 |
/* |
22246
343c5c94b73b
8026413: ScopeDesc::is_equal is declared in header file but not implemented
twisti
parents:
13728
diff
changeset
|
2 |
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4894
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4894
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4894
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 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" |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
30 |
#include "oops/method.hpp" |
7397 | 31 |
#include "utilities/growableArray.hpp" |
32 |
||
1 | 33 |
// SimpleScopeDesc is used when all you need to extract from |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
34 |
// a given pc,nmethod pair is a Method* and a bci. This is |
1 | 35 |
// quite a bit faster than allocating a full ScopeDesc, but |
36 |
// very limited in abilities. |
|
37 |
||
38 |
class SimpleScopeDesc : public StackObj { |
|
39 |
private: |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
40 |
Method* _method; |
1 | 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(); |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
49 |
_method = buffer.read_method(); |
3686
69c1b5228547
6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents:
3600
diff
changeset
|
50 |
_bci = buffer.read_bci(); |
1 | 51 |
} |
52 |
||
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
53 |
Method* method() { return _method; } |
1 | 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 |
|
4894
8a76fd3d098d
6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents:
3686
diff
changeset
|
63 |
ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop); |
1 | 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.) |
|
4894
8a76fd3d098d
6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents:
3686
diff
changeset
|
68 |
ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool return_oop); |
1 | 69 |
|
70 |
// JVM state |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
71 |
Method* method() const { return _method; } |
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
1
diff
changeset
|
72 |
int bci() const { return _bci; } |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
1
diff
changeset
|
73 |
bool should_reexecute() const { return _reexecute; } |
4894
8a76fd3d098d
6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents:
3686
diff
changeset
|
74 |
bool return_oop() const { return _return_oop; } |
1 | 75 |
|
76 |
GrowableArray<ScopeValue*>* locals(); |
|
77 |
GrowableArray<ScopeValue*>* expressions(); |
|
78 |
GrowableArray<MonitorValue*>* monitors(); |
|
79 |
GrowableArray<ScopeValue*>* objects(); |
|
80 |
||
81 |
// Stack walking, returns NULL if this is the outer most scope. |
|
82 |
ScopeDesc* sender() const; |
|
83 |
||
84 |
// Returns where the scope was decoded |
|
85 |
int decode_offset() const { return _decode_offset; } |
|
86 |
||
87 |
// Tells whether sender() returns NULL |
|
88 |
bool is_top() const; |
|
89 |
||
90 |
private: |
|
91 |
// Alternative constructor |
|
92 |
ScopeDesc(const ScopeDesc* parent); |
|
93 |
||
94 |
// JVM state |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
7397
diff
changeset
|
95 |
Method* _method; |
1 | 96 |
int _bci; |
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
1
diff
changeset
|
97 |
bool _reexecute; |
4894
8a76fd3d098d
6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents:
3686
diff
changeset
|
98 |
bool _return_oop; |
1 | 99 |
|
100 |
// Decoding offsets |
|
101 |
int _decode_offset; |
|
102 |
int _sender_decode_offset; |
|
103 |
int _locals_decode_offset; |
|
104 |
int _expressions_decode_offset; |
|
105 |
int _monitors_decode_offset; |
|
106 |
||
107 |
// Object pool |
|
108 |
GrowableArray<ScopeValue*>* _objects; |
|
109 |
||
110 |
// Nmethod information |
|
111 |
const nmethod* _code; |
|
112 |
||
113 |
// Decoding operations |
|
114 |
void decode_body(); |
|
115 |
GrowableArray<ScopeValue*>* decode_scope_values(int decode_offset); |
|
116 |
GrowableArray<MonitorValue*>* decode_monitor_values(int decode_offset); |
|
117 |
GrowableArray<ScopeValue*>* decode_object_values(int decode_offset); |
|
118 |
||
119 |
DebugInfoReadStream* stream_at(int decode_offset) const; |
|
120 |
||
121 |
||
122 |
public: |
|
123 |
// Verification |
|
124 |
void verify(); |
|
125 |
||
126 |
#ifndef PRODUCT |
|
127 |
public: |
|
128 |
// Printing support |
|
129 |
void print_on(outputStream* st) const; |
|
130 |
void print_on(outputStream* st, PcDesc* pd) const; |
|
131 |
void print_value_on(outputStream* st) const; |
|
132 |
#endif |
|
133 |
}; |
|
7397 | 134 |
|
135 |
#endif // SHARE_VM_CODE_SCOPEDESC_HPP |