< prev index next >

test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java

Print this page

        

*** 59,70 **** import java.lang.reflect.Method; import jdk.vm.ci.hotspot.HotSpotVMEventListener; import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; ! import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethodImpl; public class JvmciNotifyInstallEventTest implements HotSpotVMEventListener { private static final String METHOD_NAME = "testMethod"; private static final boolean IS_POSITIVE = !Boolean.getBoolean( "compiler.jvmci.events.JvmciNotifyInstallEventTest.noevent"); --- 59,71 ---- import java.lang.reflect.Method; import jdk.vm.ci.hotspot.HotSpotVMEventListener; import jdk.vm.ci.code.CompilationResult; import jdk.vm.ci.code.InstalledCode; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; + import jdk.vm.ci.hotspot.HotSpotCompilationRequest; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; ! import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; public class JvmciNotifyInstallEventTest implements HotSpotVMEventListener { private static final String METHOD_NAME = "testMethod"; private static final boolean IS_POSITIVE = !Boolean.getBoolean( "compiler.jvmci.events.JvmciNotifyInstallEventTest.noevent");
*** 97,117 **** try { testMethod = SimpleClass.class.getDeclaredMethod(METHOD_NAME); } catch (NoSuchMethodException e) { throw new Error("TEST BUG: Can't find " + METHOD_NAME, e); } ! HotSpotResolvedJavaMethodImpl method = CTVMUtilities .getResolvedMethod(SimpleClass.class, testMethod); CompilationResult compResult = new CompilationResult(METHOD_NAME); // to pass sanity check of default -1 compResult.setTotalFrameSize(0); ! codeCache.installMethod(method, compResult, /* jvmciEnv = */ 0L, /* isDefault = */ false); Asserts.assertEQ(gotInstallNotification, 1, "Got unexpected event count after 1st install attempt"); // since "empty" compilation result is ok, a second attempt should be ok ! codeCache.installMethod(method, compResult, /* jvmciEnv = */ 0L, /* isDefault = */ false); Asserts.assertEQ(gotInstallNotification, 2, "Got unexpected event count after 2nd install attempt"); } --- 98,119 ---- try { testMethod = SimpleClass.class.getDeclaredMethod(METHOD_NAME); } catch (NoSuchMethodException e) { throw new Error("TEST BUG: Can't find " + METHOD_NAME, e); } ! HotSpotResolvedJavaMethod method = CTVMUtilities .getResolvedMethod(SimpleClass.class, testMethod); CompilationResult compResult = new CompilationResult(METHOD_NAME); + HotSpotCompilationRequest compRequest = new HotSpotCompilationRequest(method, -1, 0L); // to pass sanity check of default -1 compResult.setTotalFrameSize(0); ! codeCache.installCode(compRequest, compResult, /* installedCode = */ null, /* speculationLog = */ null, /* isDefault = */ false); Asserts.assertEQ(gotInstallNotification, 1, "Got unexpected event count after 1st install attempt"); // since "empty" compilation result is ok, a second attempt should be ok ! codeCache.installCode(compRequest, compResult, /* installedCode = */ null, /* speculationLog = */ null, /* isDefault = */ false); Asserts.assertEQ(gotInstallNotification, 2, "Got unexpected event count after 2nd install attempt"); }
< prev index next >