Mercurial > hg > graal-compiler
changeset 12386:91dbb0b7dc8b
Merge.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 06 Sep 2013 21:37:50 +0200 |
parents | 2391d44f9d2c (diff) e12218338164 (current diff) |
children | aff825fef0fd |
files | |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java Fri Sep 06 18:11:30 2013 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java Fri Sep 06 21:37:50 2013 +0200 @@ -2003,6 +2003,10 @@ startCallTypeSystemMethod(getContext(), builder, child.getNodeData(), cast.getMethodName()); } + if (targetExecutable.getType().needsCastTo(context, targetParameter.getTypeSystemType()) && cast == null) { + startCallTypeSystemMethod(getContext(), builder, child.getNodeData(), TypeSystemCodeGenerator.expectTypeMethodName(targetParameter.getTypeSystemType())); + } + NodeData node = getModel().getNode(); ActualParameter sourceParameter = sourceExecutable.findParameter(targetParameter.getLocalName()); if (sourceParameter == null) { @@ -2011,6 +2015,11 @@ CodeTree var = CodeTreeBuilder.singleString(valueNameEvaluated(targetParameter)); builder.tree(createExpectExecutableType(node, sourceParameter.getTypeSystemType(), targetExecutable, var)); } + + if (targetExecutable.getType().needsCastTo(context, targetParameter.getTypeSystemType())) { + builder.end().end(); + } + if (cast != null) { builder.end().end(); } @@ -2049,6 +2058,10 @@ } private boolean hasUnexpectedType(ExecutableTypeData target, ActualParameter sourceParameter, TypeData type) { + boolean targetCast = target.getType().needsCastTo(context, type); + if (targetCast && getModel().getNode().getTypeSystem().lookupCast(target.getType(), type) == null) { + return true; + } if (sourceParameter == null) { return target.hasUnexpectedValue(getContext()); } else {