Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCodeInstaller.cpp @ 21526:1da7aef31a08
created com.oracle.graal.hotspot.jvmci package and moved classes destined for future JVMCI module into it (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 19 May 2015 23:16:07 +0200 |
parents | c8166c23047d |
children |
comparison
equal
deleted
inserted
replaced
21489:b3f1d8b23037 | 21526:1da7aef31a08 |
---|---|
448 } | 448 } |
449 | 449 |
450 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words | 450 int stack_slots = _total_frame_size / HeapWordSize; // conversion to words |
451 | 451 |
452 GraalEnv::CodeInstallResult result; | 452 GraalEnv::CodeInstallResult result; |
453 if (compiled_code->is_a(HotSpotCompiledRuntimeStub::klass())) { | 453 if (!compiled_code->is_a(HotSpotCompiledNmethod::klass())) { |
454 oop stubName = HotSpotCompiledRuntimeStub::stubName(compiled_code); | 454 oop stubName = CompilationResult::name(HotSpotCompiledCode::comp(compiled_code_obj)); |
455 char* name = strdup(java_lang_String::as_utf8_string(stubName)); | 455 char* name = strdup(java_lang_String::as_utf8_string(stubName)); |
456 cb = RuntimeStub::new_runtime_stub(name, | 456 cb = RuntimeStub::new_runtime_stub(name, |
457 &buffer, | 457 &buffer, |
458 CodeOffsets::frame_never_safe, | 458 CodeOffsets::frame_never_safe, |
459 stack_slots, | 459 stack_slots, |
488 Handle hotspotJavaMethod = HotSpotCompiledNmethod::method(compiled_code); | 488 Handle hotspotJavaMethod = HotSpotCompiledNmethod::method(compiled_code); |
489 methodHandle method = getMethodFromHotSpotMethod(hotspotJavaMethod()); | 489 methodHandle method = getMethodFromHotSpotMethod(hotspotJavaMethod()); |
490 _parameter_count = method->size_of_parameters(); | 490 _parameter_count = method->size_of_parameters(); |
491 TRACE_graal_1("installing code for %s", method->name_and_sig_as_C_string()); | 491 TRACE_graal_1("installing code for %s", method->name_and_sig_as_C_string()); |
492 } else { | 492 } else { |
493 assert(compiled_code->is_a(HotSpotCompiledRuntimeStub::klass()), "CCE"); | 493 // Must be a HotSpotCompiledRuntimeStub |
494 // TODO (ds) not sure if this is correct - only used in OopMap constructor for non-product builds | 494 // TODO (ds) not sure if this is correct - only used in OopMap constructor for non-product builds |
495 _parameter_count = 0; | 495 _parameter_count = 0; |
496 } | 496 } |
497 _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code)); | 497 _sites_handle = JNIHandles::make_local(HotSpotCompiledCode::sites(compiled_code)); |
498 _exception_handlers_handle = JNIHandles::make_local(HotSpotCompiledCode::exceptionHandlers(compiled_code)); | 498 _exception_handlers_handle = JNIHandles::make_local(HotSpotCompiledCode::exceptionHandlers(compiled_code)); |
876 InstanceKlass* target_klass = InstanceKlass::cast(target->klass()); | 876 InstanceKlass* target_klass = InstanceKlass::cast(target->klass()); |
877 | 877 |
878 oop hotspot_method = NULL; // JavaMethod | 878 oop hotspot_method = NULL; // JavaMethod |
879 oop foreign_call = NULL; | 879 oop foreign_call = NULL; |
880 | 880 |
881 if (target_klass->is_subclass_of(SystemDictionary::HotSpotForeignCallLinkageImpl_klass())) { | 881 if (target_klass->is_subclass_of(SystemDictionary::HotSpotForeignCallTarget_klass())) { |
882 foreign_call = target; | 882 foreign_call = target; |
883 } else { | 883 } else { |
884 hotspot_method = target; | 884 hotspot_method = target; |
885 } | 885 } |
886 | 886 |
895 _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info)); | 895 _debug_recorder->add_safepoint(next_pc_offset, create_oop_map(_total_frame_size, _parameter_count, debug_info)); |
896 record_scope(next_pc_offset, debug_info); | 896 record_scope(next_pc_offset, debug_info); |
897 } | 897 } |
898 | 898 |
899 if (foreign_call != NULL) { | 899 if (foreign_call != NULL) { |
900 jlong foreign_call_destination = HotSpotForeignCallLinkageImpl::address(foreign_call); | 900 jlong foreign_call_destination = HotSpotForeignCallTarget::address(foreign_call); |
901 CodeInstaller::pd_relocate_ForeignCall(inst, foreign_call_destination); | 901 CodeInstaller::pd_relocate_ForeignCall(inst, foreign_call_destination); |
902 } else { // method != NULL | 902 } else { // method != NULL |
903 assert(hotspot_method != NULL, "unexpected JavaMethod"); | 903 assert(hotspot_method != NULL, "unexpected JavaMethod"); |
904 assert(debug_info != NULL, "debug info expected"); | 904 assert(debug_info != NULL, "debug info expected"); |
905 | 905 |