comparison src/share/vm/c1x/c1x_VMExits.cpp @ 1432:b61a43cd1255

sourcecode formatting
author Lukas Stadler <lukas.stadler@oracle.com>
date Wed, 01 Sep 2010 17:13:38 -0700
parents abc670a709dc
children 9e5e83ca2259
comparison
equal deleted inserted replaced
1431:c01535d7fcc6 1432:b61a43cd1255
24 24
25 # include "incls/_precompiled.incl" 25 # include "incls/_precompiled.incl"
26 # include "incls/_c1x_VMExits.cpp.incl" 26 # include "incls/_c1x_VMExits.cpp.incl"
27 27
28 // these are *local* handles, and they need to be cleared before compileMethod returns 28 // these are *local* handles, and they need to be cleared before compileMethod returns
29 KlassHandle VMExits::_vmExitsKlass; 29 KlassHandle VMExits::_vmExitsKlass;
30 Handle VMExits::_vmExitsObject; 30 Handle VMExits::_vmExitsObject;
31 31
32 // this is a *global* handle 32 // this is a *global* handle
33 jobject VMExits::_vmExitsPermObject; 33 jobject VMExits::_vmExitsPermObject;
34 34
35 KlassHandle &VMExits::vmExitsKlass() { 35 KlassHandle &VMExits::vmExitsKlass() {
36 if (_vmExitsKlass.is_null()) { 36 if (_vmExitsKlass.is_null()) {
37 _vmExitsKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_VMExits(), SystemDictionary::java_system_loader(), NULL, Thread::current()); 37 _vmExitsKlass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_VMExits(), SystemDictionary::java_system_loader(), NULL, Thread::current());
38 if (_vmExitsKlass.is_null()) { 38 if (_vmExitsKlass.is_null()) {
48 KlassHandle compiler_klass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_Compiler(), SystemDictionary::java_system_loader(), NULL, Thread::current()); 48 KlassHandle compiler_klass = SystemDictionary::resolve_or_null(vmSymbols::com_sun_hotspot_c1x_Compiler(), SystemDictionary::java_system_loader(), NULL, Thread::current());
49 JavaValue result(T_OBJECT); 49 JavaValue result(T_OBJECT);
50 JavaCallArguments args; 50 JavaCallArguments args;
51 JavaCalls::call_static(&result, compiler_klass(), vmSymbols::getVMExits_name(), vmSymbols::getVMExits_signature(), &args, Thread::current()); 51 JavaCalls::call_static(&result, compiler_klass(), vmSymbols::getVMExits_name(), vmSymbols::getVMExits_signature(), &args, Thread::current());
52 check_pending_exception("Couldn't get VMExits"); 52 check_pending_exception("Couldn't get VMExits");
53 oop res = (oop)result.get_jobject(); 53 oop res = (oop) result.get_jobject();
54 _vmExitsPermObject = JNIHandles::make_global(res); 54 _vmExitsPermObject = JNIHandles::make_global(res);
55 } 55 }
56 _vmExitsObject = JNIHandles::resolve(_vmExitsPermObject); 56 _vmExitsObject = JNIHandles::resolve(_vmExitsPermObject);
57 } 57 }
58 return _vmExitsObject; 58 return _vmExitsObject;
82 args.push_oop(instance()); 82 args.push_oop(instance());
83 args.push_long(vmId); 83 args.push_long(vmId);
84 args.push_oop(name); 84 args.push_oop(name);
85 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethodResolved_name(), vmSymbols::createRiMethodResolved_signature(), &args, THREAD); 85 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethodResolved_name(), vmSymbols::createRiMethodResolved_signature(), &args, THREAD);
86 check_pending_exception("Error while calling createRiMethodResolved"); 86 check_pending_exception("Error while calling createRiMethodResolved");
87 return (oop)result.get_jobject(); 87 return (oop) result.get_jobject();
88 } 88 }
89 89
90 oop VMExits::createRiMethodUnresolved(Handle name, Handle signature, Handle holder, TRAPS) { 90 oop VMExits::createRiMethodUnresolved(Handle name, Handle signature, Handle holder, TRAPS) {
91 assert(!name.is_null(), "just checking"); 91 assert(!name.is_null(), "just checking");
92 JavaValue result(T_OBJECT); 92 JavaValue result(T_OBJECT);
95 args.push_oop(name); 95 args.push_oop(name);
96 args.push_oop(signature); 96 args.push_oop(signature);
97 args.push_oop(holder); 97 args.push_oop(holder);
98 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethodUnresolved_name(), vmSymbols::createRiMethodUnresolved_signature(), &args, THREAD); 98 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethodUnresolved_name(), vmSymbols::createRiMethodUnresolved_signature(), &args, THREAD);
99 check_pending_exception("Error while calling createRiMethodUnresolved"); 99 check_pending_exception("Error while calling createRiMethodUnresolved");
100 return (oop)result.get_jobject(); 100 return (oop) result.get_jobject();
101 } 101 }
102 102
103 oop VMExits::createRiField(Handle holder, Handle name, Handle type, int index, TRAPS) { 103 oop VMExits::createRiField(Handle holder, Handle name, Handle type, int index, TRAPS) {
104 assert(!holder.is_null(), "just checking"); 104 assert(!holder.is_null(), "just checking");
105 assert(!name.is_null(), "just checking"); 105 assert(!name.is_null(), "just checking");
111 args.push_oop(name); 111 args.push_oop(name);
112 args.push_oop(type); 112 args.push_oop(type);
113 args.push_int(index); 113 args.push_int(index);
114 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiField_name(), vmSymbols::createRiField_signature(), &args, THREAD); 114 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiField_name(), vmSymbols::createRiField_signature(), &args, THREAD);
115 check_pending_exception("Error while calling createRiField"); 115 check_pending_exception("Error while calling createRiField");
116 return (oop)result.get_jobject(); 116 return (oop) result.get_jobject();
117 } 117 }
118 118
119 oop VMExits::createRiType(jlong vmId, Handle name, TRAPS) { 119 oop VMExits::createRiType(jlong vmId, Handle name, TRAPS) {
120 assert(!name.is_null(), "just checking"); 120 assert(!name.is_null(), "just checking");
121 JavaValue result(T_OBJECT); 121 JavaValue result(T_OBJECT);
123 args.push_oop(instance()); 123 args.push_oop(instance());
124 args.push_long(vmId); 124 args.push_long(vmId);
125 args.push_oop(name); 125 args.push_oop(name);
126 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiType_name(), vmSymbols::createRiType_signature(), &args, THREAD); 126 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiType_name(), vmSymbols::createRiType_signature(), &args, THREAD);
127 check_pending_exception("Error while calling createRiType"); 127 check_pending_exception("Error while calling createRiType");
128 return (oop)result.get_jobject(); 128 return (oop) result.get_jobject();
129 } 129 }
130 130
131 oop VMExits::createRiTypePrimitive(int basic_type, TRAPS) { 131 oop VMExits::createRiTypePrimitive(int basic_type, TRAPS) {
132 JavaValue result(T_OBJECT); 132 JavaValue result(T_OBJECT);
133 JavaCallArguments args; 133 JavaCallArguments args;
134 args.push_oop(instance()); 134 args.push_oop(instance());
135 args.push_int(basic_type); 135 args.push_int(basic_type);
136 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypePrimitive_name(), vmSymbols::createRiTypePrimitive_signature(), &args, THREAD); 136 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypePrimitive_name(), vmSymbols::createRiTypePrimitive_signature(), &args, THREAD);
137 check_pending_exception("Error while calling createRiTypePrimitive"); 137 check_pending_exception("Error while calling createRiTypePrimitive");
138 return (oop)result.get_jobject(); 138 return (oop) result.get_jobject();
139 } 139 }
140 140
141 oop VMExits::createRiTypeUnresolved(Handle name, jlong accessingClassVmId, TRAPS) { 141 oop VMExits::createRiTypeUnresolved(Handle name, jlong accessingClassVmId, TRAPS) {
142 assert(!name.is_null(), "just checking"); 142 assert(!name.is_null(), "just checking");
143 JavaValue result(T_OBJECT); 143 JavaValue result(T_OBJECT);
145 args.push_oop(instance()); 145 args.push_oop(instance());
146 args.push_oop(name); 146 args.push_oop(name);
147 args.push_long(accessingClassVmId); 147 args.push_long(accessingClassVmId);
148 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypeUnresolved_name(), vmSymbols::createRiTypeUnresolved_signature(), &args, THREAD); 148 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypeUnresolved_name(), vmSymbols::createRiTypeUnresolved_signature(), &args, THREAD);
149 check_pending_exception("Error while calling createRiTypeUnresolved"); 149 check_pending_exception("Error while calling createRiTypeUnresolved");
150 return (oop)result.get_jobject(); 150 return (oop) result.get_jobject();
151 } 151 }
152 152
153 oop VMExits::createRiConstantPool(jlong vmId, TRAPS) { 153 oop VMExits::createRiConstantPool(jlong vmId, TRAPS) {
154 JavaValue result(T_OBJECT); 154 JavaValue result(T_OBJECT);
155 JavaCallArguments args; 155 JavaCallArguments args;
156 args.push_oop(instance()); 156 args.push_oop(instance());
157 args.push_long(vmId); 157 args.push_long(vmId);
158 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiConstantPool_name(), vmSymbols::createRiConstantPool_signature(), &args, THREAD); 158 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiConstantPool_name(), vmSymbols::createRiConstantPool_signature(), &args, THREAD);
159 check_pending_exception("Error while calling createRiConstantPool"); 159 check_pending_exception("Error while calling createRiConstantPool");
160 return (oop)result.get_jobject(); 160 return (oop) result.get_jobject();
161 } 161 }
162 162
163 oop VMExits::createRiSignature(Handle name, TRAPS) { 163 oop VMExits::createRiSignature(Handle name, TRAPS) {
164 assert(!name.is_null(), "just checking"); 164 assert(!name.is_null(), "just checking");
165 JavaValue result(T_OBJECT); 165 JavaValue result(T_OBJECT);
166 JavaCallArguments args; 166 JavaCallArguments args;
167 args.push_oop(instance()); 167 args.push_oop(instance());
168 args.push_oop(name); 168 args.push_oop(name);
169 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiSignature_name(), vmSymbols::createRiSignature_signature(), &args, THREAD); 169 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiSignature_name(), vmSymbols::createRiSignature_signature(), &args, THREAD);
170 check_pending_exception("Error while calling createRiSignature"); 170 check_pending_exception("Error while calling createRiSignature");
171 return (oop)result.get_jobject(); 171 return (oop) result.get_jobject();
172 } 172 }
173 173
174 oop VMExits::createCiConstantInt(jint value, TRAPS) { 174 oop VMExits::createCiConstantInt(jint value, TRAPS) {
175 JavaValue result(T_OBJECT); 175 JavaValue result(T_OBJECT);
176 JavaCallArguments args; 176 JavaCallArguments args;
177 args.push_oop(instance()); 177 args.push_oop(instance());
178 args.push_int(value); 178 args.push_int(value);
179 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantInt_name(), vmSymbols::createCiConstantInt_signature(), &args, THREAD); 179 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantInt_name(), vmSymbols::createCiConstantInt_signature(), &args, THREAD);
180 check_pending_exception("Error while calling createCiConstantInt"); 180 check_pending_exception("Error while calling createCiConstantInt");
181 return (oop)result.get_jobject(); 181 return (oop) result.get_jobject();
182 182
183 } 183 }
184 184
185 oop VMExits::createCiConstantLong(jlong value, TRAPS) { 185 oop VMExits::createCiConstantLong(jlong value, TRAPS) {
186 JavaValue result(T_OBJECT); 186 JavaValue result(T_OBJECT);
187 JavaCallArguments args; 187 JavaCallArguments args;
188 args.push_oop(instance()); 188 args.push_oop(instance());
189 args.push_long(value); 189 args.push_long(value);
190 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantLong_name(), vmSymbols::createCiConstantLong_signature(), &args, THREAD); 190 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantLong_name(), vmSymbols::createCiConstantLong_signature(), &args, THREAD);
191 check_pending_exception("Error while calling createCiConstantFloat"); 191 check_pending_exception("Error while calling createCiConstantFloat");
192 return (oop)result.get_jobject(); 192 return (oop) result.get_jobject();
193 193
194 } 194 }
195 195
196 oop VMExits::createCiConstantFloat(jfloat value, TRAPS) { 196 oop VMExits::createCiConstantFloat(jfloat value, TRAPS) {
197 JavaValue result(T_OBJECT); 197 JavaValue result(T_OBJECT);
198 JavaCallArguments args; 198 JavaCallArguments args;
199 args.push_oop(instance()); 199 args.push_oop(instance());
200 args.push_float(value); 200 args.push_float(value);
201 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantFloat_name(), vmSymbols::createCiConstantFloat_signature(), &args, THREAD); 201 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantFloat_name(), vmSymbols::createCiConstantFloat_signature(), &args, THREAD);
202 check_pending_exception("Error while calling createCiConstantFloat"); 202 check_pending_exception("Error while calling createCiConstantFloat");
203 return (oop)result.get_jobject(); 203 return (oop) result.get_jobject();
204 204
205 } 205 }
206 206
207 oop VMExits::createCiConstantDouble(jdouble value, TRAPS) { 207 oop VMExits::createCiConstantDouble(jdouble value, TRAPS) {
208 JavaValue result(T_OBJECT); 208 JavaValue result(T_OBJECT);
209 JavaCallArguments args; 209 JavaCallArguments args;
210 args.push_oop(instance()); 210 args.push_oop(instance());
211 args.push_double(value); 211 args.push_double(value);
212 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantDouble_name(), vmSymbols::createCiConstantDouble_signature(), &args, THREAD); 212 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantDouble_name(), vmSymbols::createCiConstantDouble_signature(), &args, THREAD);
213 check_pending_exception("Error while calling createCiConstantDouble"); 213 check_pending_exception("Error while calling createCiConstantDouble");
214 return (oop)result.get_jobject(); 214 return (oop) result.get_jobject();
215 } 215 }
216 216
217 oop VMExits::createCiConstantObject(jlong vmId, TRAPS) { 217 oop VMExits::createCiConstantObject(jlong vmId, TRAPS) {
218 JavaValue result(T_OBJECT); 218 JavaValue result(T_OBJECT);
219 JavaCallArguments args; 219 JavaCallArguments args;
220 args.push_oop(instance()); 220 args.push_oop(instance());
221 args.push_long(vmId); 221 args.push_long(vmId);
222 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantObject_name(), vmSymbols::createCiConstantLong_signature(), &args, THREAD); 222 JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantObject_name(), vmSymbols::createCiConstantLong_signature(), &args, THREAD);
223 check_pending_exception("Error while calling createCiConstantObject"); 223 check_pending_exception("Error while calling createCiConstantObject");
224 return (oop)result.get_jobject(); 224 return (oop) result.get_jobject();
225 } 225 }