Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalCodeInstaller.cpp @ 3011:f00918f35c7f
inlining and runtime interface related changes:
added codeSize() and compilerStorage() to RiMethod
HotSpotMethodResolved uses reflective methods instead of vmIds and survives compilations
HotSpotResolvedType.isInitialized not represented as field (can change)
inlining stores graphs into method objects and reuses them
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 16 Jun 2011 20:36:17 +0200 |
parents | 0c0e407faa39 |
children | 5857923e563c |
comparison
equal
deleted
inserted
replaced
2993:3671e31615c9 | 3011:f00918f35c7f |
---|---|
23 | 23 |
24 #include "precompiled.hpp" | 24 #include "precompiled.hpp" |
25 #include "graal/graalCompiler.hpp" | 25 #include "graal/graalCompiler.hpp" |
26 #include "graal/graalCodeInstaller.hpp" | 26 #include "graal/graalCodeInstaller.hpp" |
27 #include "graal/graalJavaAccess.hpp" | 27 #include "graal/graalJavaAccess.hpp" |
28 #include "graal/graalVMEntries.hpp" | |
28 #include "graal/graalVmIds.hpp" | 29 #include "graal/graalVmIds.hpp" |
29 #include "c1/c1_Runtime1.hpp" | 30 #include "c1/c1_Runtime1.hpp" |
30 #include "classfile/vmSymbols.hpp" | 31 #include "classfile/vmSymbols.hpp" |
31 #include "vmreg_x86.inline.hpp" | 32 #include "vmreg_x86.inline.hpp" |
32 | 33 |
198 | 199 |
199 initialize_fields(target_method); | 200 initialize_fields(target_method); |
200 assert(_hotspot_method != NULL && _name == NULL, "installMethod needs NON-NULL method and NULL name"); | 201 assert(_hotspot_method != NULL && _name == NULL, "installMethod needs NON-NULL method and NULL name"); |
201 assert(_hotspot_method->is_a(HotSpotMethodResolved::klass()), "installMethod needs a HotSpotMethodResolved"); | 202 assert(_hotspot_method->is_a(HotSpotMethodResolved::klass()), "installMethod needs a HotSpotMethodResolved"); |
202 | 203 |
203 methodOop method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(_hotspot_method)); | 204 methodOop method = getMethodFromHotSpotMethod(_hotspot_method); |
204 ciMethodObject = (ciMethod *) _env->get_object(method); | 205 ciMethodObject = (ciMethod *) _env->get_object(method); |
205 _parameter_count = method->size_of_parameters(); | 206 _parameter_count = method->size_of_parameters(); |
206 } | 207 } |
207 | 208 |
208 // (very) conservative estimate: each site needs a relocation | 209 // (very) conservative estimate: each site needs a relocation |
344 } | 345 } |
345 | 346 |
346 void CodeInstaller::assumption_ConcreteMethod(oop assumption) { | 347 void CodeInstaller::assumption_ConcreteMethod(oop assumption) { |
347 oop context_oop = CiAssumptions_ConcreteMethod::context(assumption); | 348 oop context_oop = CiAssumptions_ConcreteMethod::context(assumption); |
348 oop method_oop = CiAssumptions_ConcreteMethod::method(assumption); | 349 oop method_oop = CiAssumptions_ConcreteMethod::method(assumption); |
349 jlong context_oop_id = HotSpotMethodResolved::vmId(context_oop); | 350 methodOop method = getMethodFromHotSpotMethod(method_oop); |
350 jlong method_oop_id = HotSpotMethodResolved::vmId(method_oop); | 351 methodOop context = getMethodFromHotSpotMethod(context_oop); |
351 methodOop method = VmIds::get<methodOop>(method_oop_id); | |
352 methodOop context = VmIds::get<methodOop>(context_oop_id); | |
353 | 352 |
354 ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method); | 353 ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method); |
355 ciMethod* c = (ciMethod*) CURRENT_ENV->get_object(context); | 354 ciMethod* c = (ciMethod*) CURRENT_ENV->get_object(context); |
356 ciKlass* context_klass = c->holder(); | 355 ciKlass* context_klass = c->holder(); |
357 { | 356 { |
431 if (code_pos->klass()->klass_part()->name() == vmSymbols::com_sun_cri_ci_CiFrame()) { | 430 if (code_pos->klass()->klass_part()->name() == vmSymbols::com_sun_cri_ci_CiFrame()) { |
432 frame = code_pos; | 431 frame = code_pos; |
433 } | 432 } |
434 | 433 |
435 oop hotspot_method = CiCodePos::method(code_pos); | 434 oop hotspot_method = CiCodePos::method(code_pos); |
436 assert(hotspot_method != NULL && hotspot_method->is_a(HotSpotMethodResolved::klass()), "unexpected hotspot method"); | 435 methodOop method = getMethodFromHotSpotMethod(hotspot_method); |
437 methodOop method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(hotspot_method)); | |
438 ciMethod *cimethod = (ciMethod *) _env->get_object(method); | 436 ciMethod *cimethod = (ciMethod *) _env->get_object(method); |
439 jint bci = CiCodePos::bci(code_pos); | 437 jint bci = CiCodePos::bci(code_pos); |
440 bool reexecute; | 438 bool reexecute; |
441 if (bci == -1) { | 439 if (bci == -1) { |
442 reexecute = false; | 440 reexecute = false; |
592 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); | 590 NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); |
593 assert(hotspot_method != NULL, "unexpected RiMethod"); | 591 assert(hotspot_method != NULL, "unexpected RiMethod"); |
594 assert(debug_info != NULL, "debug info expected"); | 592 assert(debug_info != NULL, "debug info expected"); |
595 | 593 |
596 methodOop method = NULL; | 594 methodOop method = NULL; |
597 if (hotspot_method->is_a(HotSpotMethodResolved::klass())) method = VmIds::get<methodOop>(HotSpotMethodResolved::vmId(hotspot_method)); | 595 // we need to check, this might also be an unresolved method |
596 if (hotspot_method->is_a(HotSpotMethodResolved::klass())) { | |
597 method = getMethodFromHotSpotMethod(hotspot_method); | |
598 } | |
598 | 599 |
599 assert(debug_info != NULL, "debug info expected"); | 600 assert(debug_info != NULL, "debug info expected"); |
600 | 601 |
601 TRACE_graal_3("method call"); | 602 TRACE_graal_3("method call"); |
602 switch (_next_call_type) { | 603 switch (_next_call_type) { |