Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/PolymorphicTest2.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 | 5148aab962af |
children |
comparison
equal
deleted
inserted
replaced
18760:6fa3999631d8 | 18761:a665483c3881 |
---|---|
46 } | 46 } |
47 | 47 |
48 @SuppressWarnings("unused") | 48 @SuppressWarnings("unused") |
49 abstract static class Polymorphic1 extends BinaryNode { | 49 abstract static class Polymorphic1 extends BinaryNode { |
50 | 50 |
51 @Specialization(order = 1) | 51 @Specialization |
52 int add(int left, int right) { | 52 int add(int left, int right) { |
53 return 42; | 53 return 42; |
54 } | 54 } |
55 | 55 |
56 @Specialization(order = 2) | 56 @Specialization |
57 int add(boolean left, boolean right) { | 57 int add(boolean left, boolean right) { |
58 return 21; | 58 return 21; |
59 } | 59 } |
60 | 60 |
61 @Specialization(order = 4) | 61 @Specialization |
62 String add(boolean left, int right) { | 62 String add(boolean left, int right) { |
63 return "(boolean,int)"; | 63 return "(boolean,int)"; |
64 } | 64 } |
65 | 65 |
66 } | 66 } |