Mercurial > hg > graal-jvmci-8
changeset 2049:7e09ea4a8f36
Added leaf method assumptions.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Mon, 10 Jan 2011 16:59:48 +0100 |
parents | 177398c6147d |
children | b6d2c238e585 |
files | c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodResolved.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodUnresolved.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java src/share/vm/c1x/c1x_CodeInstaller.cpp src/share/vm/c1x/c1x_VMEntries.cpp |
diffstat | 6 files changed, 49 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodResolved.java Mon Jan 10 10:50:22 2011 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodResolved.java Mon Jan 10 16:59:48 2011 +0100 @@ -161,6 +161,11 @@ } @Override + public RiMethod uniqueConcreteMethod() { + return Compiler.getVMEntries().RiMethod_uniqueConcreteMethod(vmId); + } + + @Override public RiSignature signature() { if (signature == null) { signature = new HotSpotSignature(Compiler.getVMEntries().RiMethod_signature(vmId));
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodUnresolved.java Mon Jan 10 10:50:22 2011 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethodUnresolved.java Mon Jan 10 16:59:48 2011 +0100 @@ -90,6 +90,11 @@ } @Override + public RiMethod uniqueConcreteMethod() { + throw unresolved("uniqueConcreteMethod()"); + } + + @Override public int accessFlags() { throw unresolved("accessFlags"); }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java Mon Jan 10 10:50:22 2011 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java Mon Jan 10 16:59:48 2011 +0100 @@ -81,9 +81,10 @@ boolean RiMethod_hasBalancedMonitors(long vmId); + RiMethod RiMethod_uniqueConcreteMethod(long vmId); + void recordBailout(String reason); RiType RiType_uniqueConcreteSubtype(HotSpotTypeResolved hotSpotTypeResolved); - // Checkstyle: resume }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java Mon Jan 10 10:50:22 2011 +0100 +++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java Mon Jan 10 16:59:48 2011 +0100 @@ -110,5 +110,8 @@ @Override public native void recordBailout(String reason); + @Override + public native RiMethod RiMethod_uniqueConcreteMethod(long vmId); + // Checkstyle: resume }
--- a/src/share/vm/c1x/c1x_CodeInstaller.cpp Mon Jan 10 10:50:22 2011 +0100 +++ b/src/share/vm/c1x/c1x_CodeInstaller.cpp Mon Jan 10 16:59:48 2011 +0100 @@ -313,7 +313,17 @@ } void CodeInstaller::assumption_ConcreteMethod(oop assumption) { - fatal("unimplemented"); + oop context_oop = CiAssumptions_ConcreteMethod::context(assumption); + oop method_oop = CiAssumptions_ConcreteMethod::method(assumption); + jlong context_oop_id = HotSpotMethodResolved::vmId(context_oop); + jlong method_oop_id = HotSpotMethodResolved::vmId(method_oop); + methodOop method = VmIds::get<methodOop>(method_oop_id); + methodOop context = VmIds::get<methodOop>(context_oop_id); + + ciMethod* m = (ciMethod*) CURRENT_ENV->get_object(method); + ciMethod* c = (ciMethod*) CURRENT_ENV->get_object(context); + ciKlass* context_klass = c->holder(); + _dependencies->assert_unique_concrete_method(context_klass, m); } void CodeInstaller::process_exception_handlers() {
--- a/src/share/vm/c1x/c1x_VMEntries.cpp Mon Jan 10 10:50:22 2011 +0100 +++ b/src/share/vm/c1x/c1x_VMEntries.cpp Mon Jan 10 16:59:48 2011 +0100 @@ -119,6 +119,28 @@ return cimethod->has_balanced_monitors(); } +// public boolean RiMethod_uniqueConcreteMethod(long vmId); +JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1uniqueConcreteMethod(JNIEnv *, jobject, jlong vmId) { + Thread* THREAD = Thread::current(); + ciMethod* cimethod; + { + VM_ENTRY_MARK; + cimethod = (ciMethod*)CURRENT_ENV->get_object(VmIds::get<methodOop>(vmId)); + } + + + klassOop klass = (klassOop)cimethod->holder()->get_oop(); + methodOop method = (methodOop)cimethod->get_oop(); + methodOop unique_concrete = Dependencies::find_unique_concrete_method(klass, method); + if (unique_concrete == NULL) { + return NULL; + } + + Handle name = VmIds::toString<Handle>(unique_concrete->name(), CHECK_NULL); + oop method_resolved = VMExits::createRiMethodResolved(VmIds::add<methodOop>(unique_concrete), name, CHECK_NULL); + return JNIHandles::make_local(THREAD, method_resolved); +} + // public RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass); JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiSignature_1lookupType(JNIEnv *env, jobject, jstring jname, jobject accessingClass) { VM_ENTRY_MARK; @@ -592,6 +614,7 @@ {CC"RiMethod_accessFlags", CC"("PROXY")I", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags)}, {CC"RiMethod_exceptionHandlers", CC"("PROXY")"EXCEPTION_HANDLERS, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1exceptionHandlers)}, {CC"RiMethod_hasBalancedMonitors", CC"("PROXY")Z", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1hasBalancedMonitors)}, + {CC"RiMethod_uniqueConcreteMethod", CC"("PROXY")"METHOD, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1uniqueConcreteMethod)}, {CC"RiSignature_lookupType", CC"("STRING RESOLVED_TYPE")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiSignature_1lookupType)}, {CC"RiConstantPool_lookupConstant", CC"("PROXY"I)"OBJECT, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupConstant)}, {CC"RiConstantPool_lookupMethod", CC"("PROXY"IB)"METHOD, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupMethod)},