author | trims |
Thu, 27 May 2010 19:08:38 -0700 | |
changeset 5547 | f4b087cbb361 |
parent 4894 | 8a76fd3d098d |
child 7397 | 5b173b4ca846 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
4894
diff
changeset
|
2 |
* Copyright (c) 1997, 2009, 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 |
||
25 |
// SimpleScopeDesc is used when all you need to extract from |
|
26 |
// a given pc,nmethod pair is a methodOop and a bci. This is |
|
27 |
// quite a bit faster than allocating a full ScopeDesc, but |
|
28 |
// very limited in abilities. |
|
29 |
||
30 |
class SimpleScopeDesc : public StackObj { |
|
31 |
private: |
|
32 |
methodOop _method; |
|
33 |
int _bci; |
|
34 |
||
35 |
public: |
|
36 |
SimpleScopeDesc(nmethod* code,address pc) { |
|
37 |
PcDesc* pc_desc = code->pc_desc_at(pc); |
|
38 |
assert(pc_desc != NULL, "Must be able to find matching PcDesc"); |
|
39 |
DebugInfoReadStream buffer(code, pc_desc->scope_decode_offset()); |
|
40 |
int ignore_sender = buffer.read_int(); |
|
41 |
_method = methodOop(buffer.read_oop()); |
|
3686
69c1b5228547
6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents:
3600
diff
changeset
|
42 |
_bci = buffer.read_bci(); |
1 | 43 |
} |
44 |
||
45 |
methodOop method() { return _method; } |
|
46 |
int bci() { return _bci; } |
|
47 |
}; |
|
48 |
||
49 |
// ScopeDescs contain the information that makes source-level debugging of |
|
50 |
// nmethods possible; each scopeDesc describes a method activation |
|
51 |
||
52 |
class ScopeDesc : public ResourceObj { |
|
53 |
public: |
|
54 |
// Constructor |
|
4894
8a76fd3d098d
6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents:
3686
diff
changeset
|
55 |
ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool return_oop); |
1 | 56 |
|
57 |
// Calls above, giving default value of "serialized_null" to the |
|
58 |
// "obj_decode_offset" argument. (We don't use a default argument to |
|
59 |
// 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
|
60 |
ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool return_oop); |
1 | 61 |
|
62 |
// JVM state |
|
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
1
diff
changeset
|
63 |
methodHandle method() const { return _method; } |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
1
diff
changeset
|
64 |
int bci() const { return _bci; } |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
1
diff
changeset
|
65 |
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
|
66 |
bool return_oop() const { return _return_oop; } |
1 | 67 |
|
68 |
GrowableArray<ScopeValue*>* locals(); |
|
69 |
GrowableArray<ScopeValue*>* expressions(); |
|
70 |
GrowableArray<MonitorValue*>* monitors(); |
|
71 |
GrowableArray<ScopeValue*>* objects(); |
|
72 |
||
73 |
// Stack walking, returns NULL if this is the outer most scope. |
|
74 |
ScopeDesc* sender() const; |
|
75 |
||
76 |
// Returns where the scope was decoded |
|
77 |
int decode_offset() const { return _decode_offset; } |
|
78 |
||
79 |
// Tells whether sender() returns NULL |
|
80 |
bool is_top() const; |
|
81 |
// Tells whether sd is equal to this |
|
82 |
bool is_equal(ScopeDesc* sd) const; |
|
83 |
||
84 |
private: |
|
85 |
// Alternative constructor |
|
86 |
ScopeDesc(const ScopeDesc* parent); |
|
87 |
||
88 |
// JVM state |
|
89 |
methodHandle _method; |
|
90 |
int _bci; |
|
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
1
diff
changeset
|
91 |
bool _reexecute; |
4894
8a76fd3d098d
6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents:
3686
diff
changeset
|
92 |
bool _return_oop; |
1 | 93 |
|
94 |
// Decoding offsets |
|
95 |
int _decode_offset; |
|
96 |
int _sender_decode_offset; |
|
97 |
int _locals_decode_offset; |
|
98 |
int _expressions_decode_offset; |
|
99 |
int _monitors_decode_offset; |
|
100 |
||
101 |
// Object pool |
|
102 |
GrowableArray<ScopeValue*>* _objects; |
|
103 |
||
104 |
// Nmethod information |
|
105 |
const nmethod* _code; |
|
106 |
||
107 |
// Decoding operations |
|
108 |
void decode_body(); |
|
109 |
GrowableArray<ScopeValue*>* decode_scope_values(int decode_offset); |
|
110 |
GrowableArray<MonitorValue*>* decode_monitor_values(int decode_offset); |
|
111 |
GrowableArray<ScopeValue*>* decode_object_values(int decode_offset); |
|
112 |
||
113 |
DebugInfoReadStream* stream_at(int decode_offset) const; |
|
114 |
||
115 |
||
116 |
public: |
|
117 |
// Verification |
|
118 |
void verify(); |
|
119 |
||
120 |
#ifndef PRODUCT |
|
121 |
public: |
|
122 |
// Printing support |
|
123 |
void print_on(outputStream* st) const; |
|
124 |
void print_on(outputStream* st, PcDesc* pd) const; |
|
125 |
void print_value_on(outputStream* st) const; |
|
126 |
#endif |
|
127 |
}; |