Mercurial > hg > graal-jvmci-8
changeset 21088:355ebfa2ba95
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Wed, 22 Apr 2015 15:48:18 +0200 |
parents | 056f90577ed1 (current diff) 4cba24bef2ee (diff) |
children | bb63a1b5487c |
files | |
diffstat | 2 files changed, 25 insertions(+), 4 deletions(-) [+] |
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 15:36:53 2015 +0200 +++ b/graal/com.oracle.truffle.api.dsl.test/src/com/oracle/truffle/api/dsl/test/CachedTest.java Wed Apr 22 15:48:18 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 {
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeGenFactory.java Wed Apr 22 15:36:53 2015 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeGenFactory.java Wed Apr 22 15:48:18 2015 +0200 @@ -1981,7 +1981,7 @@ } else { castGuards = new HashSet<>(); for (TypeGuard castGuard : group.getTypeGuards()) { - if (isTypeGuardUsedInAnyGuardOrCacheBelow(group, currentValues, castGuard)) { + if (isTypeGuardUsedInAnyGuardOrCacheBelow(group, currentValues, castGuard, execution.isFastPath())) { castGuards.add(castGuard); } } @@ -2059,7 +2059,7 @@ return true; } - private boolean isTypeGuardUsedInAnyGuardOrCacheBelow(SpecializationGroup group, LocalContext currentValues, TypeGuard typeGuard) { + private boolean isTypeGuardUsedInAnyGuardOrCacheBelow(SpecializationGroup group, LocalContext currentValues, TypeGuard typeGuard, boolean fastPath) { String localName = currentValues.getValue(typeGuard.getSignatureIndex()).getName(); SpecializationData specialization = group.getSpecialization(); @@ -2068,7 +2068,7 @@ return true; } } - if (specialization != null) { + if (!fastPath && specialization != null) { for (CacheExpression cache : specialization.getCaches()) { if (isVariableBoundIn(specialization, cache.getExpression(), localName, currentValues)) { return true; @@ -2077,7 +2077,7 @@ } for (SpecializationGroup child : group.getChildren()) { - if (isTypeGuardUsedInAnyGuardOrCacheBelow(child, currentValues, typeGuard)) { + if (isTypeGuardUsedInAnyGuardOrCacheBelow(child, currentValues, typeGuard, fastPath)) { return true; } }