Mercurial > hg > truffle
annotate src/share/vm/runtime/vframe_hp.hpp @ 1644:2a47bd84841f
6965184: possible races in make_not_entrant_or_zombie
Reviewed-by: kvn
author | never |
---|---|
date | Thu, 08 Jul 2010 14:29:44 -0700 |
parents | c18cbe5936b8 |
children | f95d63e2154a |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
948
diff
changeset
|
2 * Copyright (c) 1997, 2009, 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:
948
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
948
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:
948
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
25 class compiledVFrame: public javaVFrame { | |
26 public: | |
27 // JVM state | |
900
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
0
diff
changeset
|
28 methodOop method() const; |
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
0
diff
changeset
|
29 int bci() const; |
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
0
diff
changeset
|
30 bool should_reexecute() const; |
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
0
diff
changeset
|
31 StackValueCollection* locals() const; |
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
0
diff
changeset
|
32 StackValueCollection* expressions() const; |
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
0
diff
changeset
|
33 GrowableArray<MonitorInfo*>* monitors() const; |
0 | 34 |
35 void set_locals(StackValueCollection* values) const; | |
36 | |
37 // Virtuals defined in vframe | |
38 bool is_compiled_frame() const { return true; } | |
39 vframe* sender() const; | |
40 bool is_top() const; | |
41 | |
42 // Casting | |
43 static compiledVFrame* cast(vframe* vf) { | |
44 assert(vf == NULL || vf->is_compiled_frame(), "must be compiled frame"); | |
45 return (compiledVFrame*) vf; | |
46 } | |
47 | |
48 public: | |
49 // Constructors | |
50 compiledVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread, nmethod* nm); | |
51 | |
52 // Update a local in a compiled frame. Update happens when deopt occurs | |
53 void update_local(BasicType type, int index, jvalue value); | |
54 | |
55 // Returns the active nmethod | |
56 nmethod* code() const; | |
57 | |
58 // Returns the scopeDesc | |
59 ScopeDesc* scope() const { return _scope; } | |
60 | |
61 // Returns SynchronizationEntryBCI or bci() (used for synchronization) | |
62 int raw_bci() const; | |
63 | |
64 protected: | |
65 ScopeDesc* _scope; | |
66 | |
67 | |
68 //StackValue resolve(ScopeValue* sv) const; | |
69 BasicLock* resolve_monitor_lock(Location location) const; | |
70 StackValue *create_stack_value(ScopeValue *sv) const; | |
71 | |
72 private: | |
73 compiledVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread, ScopeDesc* scope); | |
74 | |
75 #ifndef PRODUCT | |
76 public: | |
77 void verify() const; | |
78 #endif | |
79 }; | |
80 | |
81 // In order to implement set_locals for compiled vframes we must | |
82 // store updated locals in a data structure that contains enough | |
83 // information to recognize equality with a vframe and to store | |
84 // any updated locals. | |
85 | |
86 class jvmtiDeferredLocalVariable; | |
87 class jvmtiDeferredLocalVariableSet : public CHeapObj { | |
88 private: | |
89 | |
90 methodOop _method; // must be GC'd | |
91 int _bci; | |
92 intptr_t* _id; | |
93 GrowableArray<jvmtiDeferredLocalVariable*>* _locals; | |
94 | |
95 public: | |
96 // JVM state | |
97 methodOop method() const { return _method; } | |
98 int bci() const { return _bci; } | |
99 intptr_t* id() const { return _id; } | |
100 GrowableArray<jvmtiDeferredLocalVariable*>* locals() const { return _locals; } | |
101 void set_local_at(int idx, BasicType typ, jvalue val); | |
102 | |
103 // Does the vframe match this jvmtiDeferredLocalVariableSet | |
104 bool matches(vframe* vf); | |
105 // GC | |
106 void oops_do(OopClosure* f); | |
107 | |
108 // constructor | |
109 jvmtiDeferredLocalVariableSet(methodOop method, int bci, intptr_t* id); | |
110 | |
111 // destructor | |
112 ~jvmtiDeferredLocalVariableSet(); | |
113 | |
114 | |
115 }; | |
116 | |
117 class jvmtiDeferredLocalVariable : public CHeapObj { | |
118 public: | |
119 | |
120 jvmtiDeferredLocalVariable(int index, BasicType type, jvalue value); | |
121 | |
122 BasicType type(void) { return _type; } | |
123 int index(void) { return _index; } | |
124 jvalue value(void) { return _value; } | |
125 // Only mutator is for value as only it can change | |
126 void set_value(jvalue value) { _value = value; } | |
127 // For gc | |
128 oop* oop_addr(void) { return (oop*) &_value.l; } | |
129 | |
130 private: | |
131 | |
132 BasicType _type; | |
133 jvalue _value; | |
134 int _index; | |
135 | |
136 }; |