comparison truffle/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/CachedTest.java @ 22516:687bc1dda125

Truffle-DSL: fix wrong resolution when multiple public static methods are imported from a cached type.
author Christian Humer <christian.humer@oracle.com>
date Fri, 18 Dec 2015 14:41:06 +0100
parents dbbcd8eb5dae
children
comparison
equal deleted inserted replaced
22515:d51cc0af8612 22516:687bc1dda125
308 assertEquals(42, root.call(22)); 308 assertEquals(42, root.call(22));
309 assertEquals(42, root.call(23)); 309 assertEquals(42, root.call(23));
310 } 310 }
311 311
312 @NodeChild 312 @NodeChild
313 static class TestCachedWithProfile extends ValueNode {
314
315 @Specialization
316 static int do1(int value, @Cached("create()") MySubClass mySubclass) {
317 return 42;
318 }
319 }
320
321 public static class MyClass {
322
323 public static MyClass create() {
324 return new MyClass();
325 }
326 }
327
328 public static class MySubClass extends MyClass {
329
330 public static MySubClass create() {
331 return new MySubClass();
332 }
333
334 }
335
336 @NodeChild
313 static class TestCachesOrder extends ValueNode { 337 static class TestCachesOrder extends ValueNode {
314 338
315 @Specialization(guards = "boundByGuard != 0") 339 @Specialization(guards = "boundByGuard != 0")
316 static int do1(int value, // 340 static int do1(int value, //
317 @Cached("get(value)") int intermediateValue, // 341 @Cached("get(value)") int intermediateValue, //