Mercurial > hg > truffle
diff graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/CachedTest.java @ 21077:4cba24bef2ee
Truffle-DSL: fix unnecessary cast in generated isIdentical for types used just in cached expressions .
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 22 Apr 2015 15:04:01 +0200 |
parents | 62c43fcf5be2 |
children | b1530a6cce8c |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/CachedTest.java Wed Apr 22 11:00:26 2015 +0200 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/CachedTest.java Wed Apr 22 15:04:01 2015 +0200 @@ -40,6 +40,7 @@ import com.oracle.truffle.api.dsl.test.CachedTestFactory.TestMultipleCachesFactory; import com.oracle.truffle.api.dsl.test.CachedTestFactory.UnboundCacheFactory; import com.oracle.truffle.api.dsl.test.TypeSystemTest.ValueNode; +import com.oracle.truffle.api.nodes.*; @SuppressWarnings("unused") public class CachedTest { @@ -263,6 +264,26 @@ } + /* + * Node should not produce any warnings in isIdentical of the generated code. Unnecessary casts + * were generated for isIdentical on the fast path. + */ + @NodeChildren({@NodeChild, @NodeChild}) + static class RegressionTestWarningInIsIdentical extends ValueNode { + + @Specialization(guards = {"cachedName == name"}) + protected Object directAccess(String receiver, String name, // + @Cached("name") String cachedName, // + @Cached("create(receiver, name)") Object callHandle) { + return receiver; + } + + protected static Object create(String receiver, String name) { + return receiver; + } + + } + @NodeChild static class TestMultipleCaches extends ValueNode {