Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/SourceSectionTest.java @ 18761:a665483c3881
Truffle-DSL: new node layout implementation.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 29 Dec 2014 23:38:54 +0100 |
parents | c5db657d93c1 |
children | 08aa0372dad4 |
comparison
equal
deleted
inserted
replaced
18760:6fa3999631d8 | 18761:a665483c3881 |
---|---|
29 import org.junit.*; | 29 import org.junit.*; |
30 import org.junit.experimental.theories.*; | 30 import org.junit.experimental.theories.*; |
31 import org.junit.runner.*; | 31 import org.junit.runner.*; |
32 | 32 |
33 import com.oracle.truffle.api.dsl.*; | 33 import com.oracle.truffle.api.dsl.*; |
34 import com.oracle.truffle.api.dsl.internal.*; | |
34 import com.oracle.truffle.api.dsl.test.SourceSectionTestFactory.SourceSection0Factory; | 35 import com.oracle.truffle.api.dsl.test.SourceSectionTestFactory.SourceSection0Factory; |
35 import com.oracle.truffle.api.dsl.test.SourceSectionTestFactory.SourceSection1Factory; | 36 import com.oracle.truffle.api.dsl.test.SourceSectionTestFactory.SourceSection1Factory; |
36 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ArgumentNode; | 37 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ArgumentNode; |
37 import com.oracle.truffle.api.dsl.test.TypeSystemTest.TestRootNode; | 38 import com.oracle.truffle.api.dsl.test.TypeSystemTest.TestRootNode; |
38 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; | 39 import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; |
59 } | 60 } |
60 | 61 |
61 private static void expectSourceSection(Node root, SourceSection section) { | 62 private static void expectSourceSection(Node root, SourceSection section) { |
62 assertThat(root.getSourceSection(), is(sameInstance(section))); | 63 assertThat(root.getSourceSection(), is(sameInstance(section))); |
63 for (Node child : root.getChildren()) { | 64 for (Node child : root.getChildren()) { |
64 if (child instanceof ArgumentNode) { | 65 if (child instanceof ArgumentNode || child instanceof SpecializationNode) { |
65 continue; | 66 continue; |
66 } | 67 } |
67 if (child != null) { | 68 if (child != null) { |
68 expectSourceSection(child, section); | 69 expectSourceSection(child, section); |
69 } | 70 } |