< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java

Print this page
rev 52509 : [mq]: graal


 131     private interface TestSpec {
 132         void spec(LIRGeneratorTool tool, LIRFrameState state, Consumer<LIRFrameState> safepoint);
 133     }
 134 
 135     public static void testMethod() {
 136     }
 137 
 138     private void test(TestSpec spec) {
 139         test(getDebugContext(), spec);
 140     }
 141 
 142     private void test(DebugContext debug, TestSpec spec) {
 143         ResolvedJavaMethod method = getResolvedJavaMethod("testMethod");
 144 
 145         StructuredGraph graph = parseForCompile(method, debug);
 146         TestNode test = graph.add(new TestNode(spec));
 147         graph.addAfterFixed(graph.start(), test);
 148 
 149         CompilationResult compResult = compile(method, graph);
 150         CodeCacheProvider codeCache = getCodeCache();
 151         HotSpotCompiledCode compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(codeCache, method, null, compResult);
 152         codeCache.addCode(method, compiledCode, null, null);
 153     }
 154 
 155     @Test(expected = Error.class)
 156     public void testInvalidShortOop() {
 157         test((tool, state, safepoint) -> {
 158             PlatformKind kind = tool.target().arch.getPlatformKind(JavaKind.Short);
 159             LIRKind lirKind = LIRKind.reference(kind);
 160 
 161             Variable var = tool.newVariable(lirKind);
 162             tool.append(new ValueDef(var));
 163             safepoint.accept(state);
 164             tool.append(new ValueUse(var));
 165         });
 166     }
 167 
 168     @Test(expected = Error.class)
 169     public void testInvalidShortDerivedOop() {
 170         test((tool, state, safepoint) -> {
 171             Variable baseOop = tool.newVariable(LIRKind.fromJavaKind(tool.target().arch, JavaKind.Object));




 131     private interface TestSpec {
 132         void spec(LIRGeneratorTool tool, LIRFrameState state, Consumer<LIRFrameState> safepoint);
 133     }
 134 
 135     public static void testMethod() {
 136     }
 137 
 138     private void test(TestSpec spec) {
 139         test(getDebugContext(), spec);
 140     }
 141 
 142     private void test(DebugContext debug, TestSpec spec) {
 143         ResolvedJavaMethod method = getResolvedJavaMethod("testMethod");
 144 
 145         StructuredGraph graph = parseForCompile(method, debug);
 146         TestNode test = graph.add(new TestNode(spec));
 147         graph.addAfterFixed(graph.start(), test);
 148 
 149         CompilationResult compResult = compile(method, graph);
 150         CodeCacheProvider codeCache = getCodeCache();
 151         HotSpotCompiledCode compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(codeCache, method, null, compResult, getInitialOptions());
 152         codeCache.addCode(method, compiledCode, null, null);
 153     }
 154 
 155     @Test(expected = Error.class)
 156     public void testInvalidShortOop() {
 157         test((tool, state, safepoint) -> {
 158             PlatformKind kind = tool.target().arch.getPlatformKind(JavaKind.Short);
 159             LIRKind lirKind = LIRKind.reference(kind);
 160 
 161             Variable var = tool.newVariable(lirKind);
 162             tool.append(new ValueDef(var));
 163             safepoint.accept(state);
 164             tool.append(new ValueUse(var));
 165         });
 166     }
 167 
 168     @Test(expected = Error.class)
 169     public void testInvalidShortDerivedOop() {
 170         test((tool, state, safepoint) -> {
 171             Variable baseOop = tool.newVariable(LIRKind.fromJavaKind(tool.target().arch, JavaKind.Object));


< prev index next >