annotate truffle/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/SpecializationGroupingTest.java @ 22241:14e6dfb1ef05

Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation" - Caused by lack of a "vm" known to the Accessor during most testing, making the Instrumenter unavailable, which is now required to create a CallTarget - Modified the Instrumenter/Accessor with a static field that can be reflectively "poked" with a vm value for testing - Create a pair of methods to globally enable/disable testing mode to modify that static field and restore it when tests complete.
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Tue, 22 Sep 2015 20:31:19 -0700
parents dc83cc1f94f2
children 0d36601f233e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11195
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
1 /*
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
2 * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
4 *
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
8 *
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
13 * accompanied this code).
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
14 *
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
18 *
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
21 * questions.
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
22 */
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
23 package com.oracle.truffle.api.dsl.test;
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
24
22241
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
25 import org.junit.After;
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
26 import org.junit.Assert;
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
27 import org.junit.Before;
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
28 import org.junit.Test;
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
29
22157
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
30 import com.oracle.truffle.api.CallTarget;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
31 import com.oracle.truffle.api.dsl.NodeChild;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
32 import com.oracle.truffle.api.dsl.Specialization;
11470
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
33 import com.oracle.truffle.api.dsl.test.SpecializationGroupingTestFactory.TestElseConnectionBug1Factory;
11481
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
34 import com.oracle.truffle.api.dsl.test.SpecializationGroupingTestFactory.TestElseConnectionBug2Factory;
11195
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
35 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode;
22241
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
36 import com.oracle.truffle.api.dsl.test.utilities.InstrumentationTestMode;
22157
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
37 import com.oracle.truffle.api.frame.VirtualFrame;
dc83cc1f94f2 Using fully qualified imports
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents: 21951
diff changeset
38 import com.oracle.truffle.api.nodes.SlowPathException;
11195
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
39
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
40 /**
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
41 * Tests execution counts of guards. While we do not make guarantees for guard invocation except for
12401
85dcc7f59c34 Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents: 11484
diff changeset
42 * their execution order our implementation reduces the calls to guards as much as possible for the
85dcc7f59c34 Truffle-DSL: fixed incorrect else guard connections for executeAndSpecialize.
Christian Humer <christian.humer@gmail.com>
parents: 11484
diff changeset
43 * generic case.
11195
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
44 */
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
45 public class SpecializationGroupingTest {
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
46
22241
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
47 @Before
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
48 public void before() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
49 InstrumentationTestMode.set(true);
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
50 }
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
51
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
52 @After
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
53 public void after() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
54 InstrumentationTestMode.set(false);
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
55 }
14e6dfb1ef05 Truffle/Testing: massive rework of tests to accommodate recent instrumentation change with respect to "applyInstrumentation"
Michael Van De Vanter <michael.van.de.vanter@oracle.com>
parents: 22157
diff changeset
56
11195
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
57 @Test
11470
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
58 public void testElseConnectionBug1() {
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
59 CallTarget target = TestHelper.createCallTarget(TestElseConnectionBug1Factory.create(new GenericInt()));
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
60 Assert.assertEquals(42, target.call());
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
61 }
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
62
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
63 @SuppressWarnings("unused")
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
64 @NodeChild(value = "genericChild", type = GenericInt.class)
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
65 public abstract static class TestElseConnectionBug1 extends ValueNode {
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
66
19283
08aa0372dad4 Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents: 18761
diff changeset
67 @Specialization(rewriteOn = {SlowPathException.class}, guards = "isInitialized(value)")
16756
5148aab962af Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents: 12401
diff changeset
68 public int do1(int value) throws SlowPathException {
11470
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
69 throw new SlowPathException();
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
70 }
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
71
19283
08aa0372dad4 Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents: 18761
diff changeset
72 @Specialization(contains = "do1", guards = "isInitialized(value)")
16756
5148aab962af Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents: 12401
diff changeset
73 public int do2(int value) {
11470
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
74 return value == 42 ? value : 0;
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
75 }
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
76
19283
08aa0372dad4 Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents: 18761
diff changeset
77 @Specialization(guards = "!isInitialized(value)")
16756
5148aab962af Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents: 12401
diff changeset
78 public Object do3(int value) {
11470
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
79 throw new AssertionError();
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
80 }
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
81
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
82 boolean isInitialized(int value) {
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
83 return true;
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
84 }
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
85 }
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
86
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
87 public static final class GenericInt extends ValueNode {
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
88
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
89 @Override
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
90 public Object execute(VirtualFrame frame) {
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
91 return executeInt(frame);
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
92 }
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
93
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
94 @Override
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
95 public int executeInt(VirtualFrame frame) {
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
96 return 42;
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
97 }
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
98
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
99 }
b010fd3de42d Truffle-DSL: added a test that covers wrong a wrong else connection bug.
Christian Humer <christian.humer@gmail.com>
parents: 11195
diff changeset
100
11481
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
101 @Test
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
102 public void testElseConnectionBug2() {
16756
5148aab962af Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents: 12401
diff changeset
103 TestHelper.assertRuns(TestElseConnectionBug2Factory.getInstance(), new Object[]{42}, new Object[]{42});
11481
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
104 }
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
105
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
106 @SuppressWarnings("unused")
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
107 @NodeChild
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
108 public abstract static class TestElseConnectionBug2 extends ValueNode {
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
109
19283
08aa0372dad4 Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents: 18761
diff changeset
110 @Specialization(guards = "guard0(value)")
16756
5148aab962af Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents: 12401
diff changeset
111 public int do1(int value) {
11481
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
112 throw new AssertionError();
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
113 }
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
114
19283
08aa0372dad4 Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents: 18761
diff changeset
115 @Specialization(guards = "guard1(value)")
16756
5148aab962af Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents: 12401
diff changeset
116 public int do2(int value) {
11481
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
117 throw new AssertionError();
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
118 }
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
119
19283
08aa0372dad4 Truffle-DSL: implement new guard expression syntax.
Christian Humer <christian.humer@gmail.com>
parents: 18761
diff changeset
120 @Specialization(guards = "!guard0(value)")
16756
5148aab962af Truffle-DSL: updated tests for the new generation layout.
Christian Humer <christian.humer@gmail.com>
parents: 12401
diff changeset
121 public int do3(int value) {
11481
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
122 return value;
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
123 }
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
124
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
125 boolean guard0(int value) {
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
126 return false;
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
127 }
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
128
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
129 boolean guard1(int value) {
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
130 return false;
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
131 }
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
132 }
a317acdd5f2c Truffle-DSL: fixed a bug in else connections of generic generated methods.
Christian Humer <christian.humer@gmail.com>
parents: 11470
diff changeset
133
11195
4f52b08bd2f9 Truffle-DSL: Implemented specialization grouping for generic cases.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
134 }