Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java @ 20950:a778fbcb8d8e
Truffle-DSL: fix polymorphic return type was always object if type had implicit casts.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Tue, 14 Apr 2015 19:23:33 +0200 |
parents | a2e295c6cf7c |
children | 833e088ee7d3 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Tue Apr 14 19:23:33 2015 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/parser/NodeParser.java Tue Apr 14 19:23:33 2015 +0200 @@ -1355,6 +1355,7 @@ if (genericParameter.getLocalName().equals(TemplateMethod.FRAME_NAME)) { continue; } + boolean isReturnParameter = genericParameter == generic.getReturnType(); if (!genericParameter.getSpecification().isSignature()) { polymorphicType = genericParameter.getType(); } else { @@ -1376,18 +1377,14 @@ if (usedTypes.size() == 1) { polymorphicType = usedTypes.iterator().next(); - if (node.getTypeSystem().hasImplicitSourceTypes(polymorphicType)) { + if (!isReturnParameter && node.getTypeSystem().hasImplicitSourceTypes(polymorphicType)) { polymorphicType = context.getType(Object.class); } } else { - if (generic.getFrame() == genericParameter) { - polymorphicType = context.getType(Frame.class); - } else { - polymorphicType = context.getType(Object.class); - } + polymorphicType = context.getType(Object.class); } } - if (genericParameter == generic.getReturnType()) { + if (isReturnParameter) { returnType = polymorphicType; } else { types.add(new CodeVariableElement(polymorphicType, "param" + index));