# HG changeset patch # User Doug Simon # Date 1314284305 -7200 # Node ID bea0186223240fa8ed93061dd0e28917e977e7df # Parent 6e8fc93551d7c9105327595e97f252150f55e73e Changes to JavaAccess as a result of CRI changes. diff -r 6e8fc93551d7 -r bea018622324 src/share/vm/graal/graalCodeInstaller.cpp --- a/src/share/vm/graal/graalCodeInstaller.cpp Wed Aug 24 18:17:03 2011 +0200 +++ b/src/share/vm/graal/graalCodeInstaller.cpp Thu Aug 25 16:58:25 2011 +0200 @@ -336,12 +336,12 @@ oop site = sites[i]; jint pc_offset = CiTargetMethod_Site::pcOffset(site); - if (site->is_a(CiTargetMethod_Safepoint::klass())) { + if (site->is_a(CiTargetMethod_Call::klass())) { + TRACE_graal_4("call at %i", pc_offset); + site_Call(buffer, pc_offset, site); + } else if (site->is_a(CiTargetMethod_Safepoint::klass())) { TRACE_graal_4("safepoint at %i", pc_offset); site_Safepoint(buffer, pc_offset, site); - } else if (site->is_a(CiTargetMethod_Call::klass())) { - TRACE_graal_4("call at %i", pc_offset); - site_Call(buffer, pc_offset, site); } else if (site->is_a(CiTargetMethod_DataPatch::klass())) { TRACE_graal_4("datapatch at %i", pc_offset); site_DataPatch(buffer, pc_offset, site); @@ -567,14 +567,24 @@ } void CodeInstaller::site_Call(CodeBuffer& buffer, jint pc_offset, oop site) { - oop runtime_call = CiTargetMethod_Call::runtimeCall(site); - oop hotspot_method = CiTargetMethod_Call::method(site); - oop symbol = CiTargetMethod_Call::symbol(site); - oop global_stub = CiTargetMethod_Call::stubID(site); + oop target = CiTargetMethod_Call::target(site); + instanceKlass* target_klass = instanceKlass::cast(target->klass()); + + oop runtime_call = NULL; // CiRuntimeCall + oop hotspot_method = NULL; // RiMethod + oop global_stub = NULL; + + if (target_klass->is_subclass_of(SystemDictionary::Long_klass())) { + global_stub = target; + } else if (target_klass->name() == vmSymbols::com_sun_cri_ci_CiRuntimeCall()) { + runtime_call = target; + } else { + hotspot_method = target; + } oop debug_info = CiTargetMethod_Call::debugInfo(site); - assert((runtime_call ? 1 : 0) + (hotspot_method ? 1 : 0) + (symbol ? 1 : 0) + (global_stub ? 1 : 0) == 1, "Call site needs exactly one type"); + assert((runtime_call ? 1 : 0) + (hotspot_method ? 1 : 0) + (global_stub ? 1 : 0) == 1, "Call site needs exactly one type"); assert(NativeCall::instruction_size == (int)NativeJump::instruction_size, "unexpected size)"); jint next_pc_offset = pc_offset + NativeCall::instruction_size; @@ -658,8 +668,6 @@ } _instructions->relocate((address)inst, runtime_call_Relocation::spec(), Assembler::call32_operand); TRACE_graal_3("relocating (stub) at %016x", inst); - } else if (symbol != NULL) { - fatal("symbol"); } else { // method != NULL NativeCall* call = nativeCall_at(_instructions->start() + pc_offset); assert(hotspot_method != NULL, "unexpected RiMethod"); diff -r 6e8fc93551d7 -r bea018622324 src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Wed Aug 24 18:17:03 2011 +0200 +++ b/src/share/vm/graal/graalJavaAccess.hpp Thu Aug 25 16:58:25 2011 +0200 @@ -114,10 +114,7 @@ int_field(CiTargetMethod_Site, pcOffset) \ end_class \ start_class(CiTargetMethod_Call) \ - oop_field(CiTargetMethod_Call, runtimeCall, "Lcom/sun/cri/ci/CiRuntimeCall;") \ - oop_field(CiTargetMethod_Call, method, "Lcom/sun/cri/ri/RiMethod;") \ - oop_field(CiTargetMethod_Call, symbol, "Ljava/lang/String;") \ - oop_field(CiTargetMethod_Call, stubID, "Ljava/lang/Object;") \ + oop_field(CiTargetMethod_Call, target, "Ljava/lang/Object;") \ oop_field(CiTargetMethod_Call, debugInfo, "Lcom/sun/cri/ci/CiDebugInfo;") \ end_class \ start_class(CiTargetMethod_DataPatch) \