comparison src/share/vm/graal/graalCompilerToVM.cpp @ 13375:e8c4a6ea3f77

cleaned up VMToCompiler.createResolvedJavaType
author twisti
date Tue, 17 Dec 2013 20:58:58 -0800
parents ad187607b784
children 52eb34dd84d7
comparison
equal deleted inserted replaced
13374:ad187607b784 13375:e8c4a6ea3f77
185 InstanceKlass* klass = (InstanceKlass*) java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(interface_type)); 185 InstanceKlass* klass = (InstanceKlass*) java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaClass(interface_type));
186 assert(klass->is_interface(), "must be"); 186 assert(klass->is_interface(), "must be");
187 if (klass->nof_implementors() == 1) { 187 if (klass->nof_implementors() == 1) {
188 InstanceKlass* implementor = (InstanceKlass*) klass->implementor(); 188 InstanceKlass* implementor = (InstanceKlass*) klass->implementor();
189 if (!implementor->is_abstract() && !implementor->is_interface() && implementor->is_leaf_class()) { 189 if (!implementor->is_abstract() && !implementor->is_interface() && implementor->is_leaf_class()) {
190 Handle type = GraalCompiler::get_JavaType(implementor, CHECK_NULL); 190 Handle type = GraalCompiler::createHotSpotResolvedObjectType(implementor, CHECK_NULL);
191 return JNIHandles::make_local(THREAD, type()); 191 return JNIHandles::make_local(THREAD, type());
192 } 192 }
193 } 193 }
194 return NULL; 194 return NULL;
195 C2V_END 195 C2V_END
241 if (resolved_type == NULL) { 241 if (resolved_type == NULL) {
242 assert(!eagerResolve, "failed eager resolution should have caused an exception"); 242 assert(!eagerResolve, "failed eager resolution should have caused an exception");
243 Handle type = VMToCompiler::createUnresolvedJavaType(name, THREAD); 243 Handle type = VMToCompiler::createUnresolvedJavaType(name, THREAD);
244 result = type(); 244 result = type();
245 } else { 245 } else {
246 Handle type = GraalCompiler::createHotSpotResolvedObjectType(resolved_type, name, CHECK_NULL); 246 Handle type = GraalCompiler::createHotSpotResolvedObjectType(resolved_type, CHECK_NULL);
247 result = type(); 247 result = type();
248 } 248 }
249 } 249 }
250 250
251 return JNIHandles::make_local(THREAD, result); 251 return JNIHandles::make_local(THREAD, result);
286 Bytecodes::Code bc = (Bytecodes::Code) (((int) opcode) & 0xFF); 286 Bytecodes::Code bc = (Bytecodes::Code) (((int) opcode) & 0xFF);
287 int cp_index = GraalCompiler::to_cp_index(index, bc); 287 int cp_index = GraalCompiler::to_cp_index(index, bc);
288 288
289 methodHandle method = GraalEnv::get_method_by_index(cp, cp_index, bc, pool_holder); 289 methodHandle method = GraalEnv::get_method_by_index(cp, cp_index, bc, pool_holder);
290 if (!method.is_null()) { 290 if (!method.is_null()) {
291 Handle holder = GraalCompiler::get_JavaType(method->method_holder(), CHECK_NULL); 291 Handle holder = GraalCompiler::createHotSpotResolvedObjectType(method->method_holder(), CHECK_NULL);
292 return JNIHandles::make_local(THREAD, VMToCompiler::createResolvedJavaMethod(holder, method(), THREAD)); 292 return JNIHandles::make_local(THREAD, VMToCompiler::createResolvedJavaMethod(holder, method(), THREAD));
293 } else { 293 } else {
294 // Get the method's name and signature. 294 // Get the method's name and signature.
295 Handle name = java_lang_String::create_from_symbol(cp->name_ref_at(cp_index), CHECK_NULL); 295 Handle name = java_lang_String::create_from_symbol(cp->name_ref_at(cp_index), CHECK_NULL);
296 Handle signature = java_lang_String::create_from_symbol(cp->signature_ref_at(cp_index), CHECK_NULL); 296 Handle signature = java_lang_String::create_from_symbol(cp->signature_ref_at(cp_index), CHECK_NULL);
361 } else { 361 } else {
362 offset = result.offset(); 362 offset = result.offset();
363 flags = result.access_flags(); 363 flags = result.access_flags();
364 holder_klass = result.field_holder(); 364 holder_klass = result.field_holder();
365 basic_type = result.field_type(); 365 basic_type = result.field_type();
366 holder = GraalCompiler::get_JavaType(holder_klass, CHECK_NULL); 366 holder = GraalCompiler::createHotSpotResolvedObjectType(holder_klass, CHECK_NULL);
367 } 367 }
368 } 368 }
369 369
370 Handle type = GraalCompiler::get_JavaTypeFromSignature(signature, cp->pool_holder(), CHECK_NULL); 370 Handle type = GraalCompiler::get_JavaTypeFromSignature(signature, cp->pool_holder(), CHECK_NULL);
371 Handle field_handle = GraalCompiler::get_JavaField(offset, flags.as_int(), name, holder, type, THREAD); 371 Handle field_handle = GraalCompiler::get_JavaField(offset, flags.as_int(), name, holder, type, THREAD);