Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeCodeGenerator.java @ 9848:a5d3e0973e83
Fixed @Specialization#executeWith order was ignored.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 03 Jun 2013 20:28:50 +0200 |
parents | 476cbd115289 |
children | 746fa60be266 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeCodeGenerator.java Mon Jun 03 18:27:43 2013 +0200 +++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeCodeGenerator.java Mon Jun 03 20:28:50 2013 +0200 @@ -1843,19 +1843,29 @@ builder.startCall(execType.getMethodName()); - List<ActualParameter> signatureParameters = getModel().getSignatureParameters(); int index = 0; for (ActualParameter parameter : execType.getParameters()) { if (!parameter.getSpecification().isSignature()) { builder.string(parameter.getLocalName()); } else { - if (index < signatureParameters.size()) { - ActualParameter specializationParam = signatureParameters.get(index); + if (index < targetField.getExecuteWith().size()) { + NodeChildData child = targetField.getExecuteWith().get(index); + + ParameterSpec spec = getModel().getSpecification().findParameterSpec(child.getName()); + List<ActualParameter> specializationParams = getModel().findParameters(spec); + + if (specializationParams.isEmpty()) { + builder.defaultValue(parameter.getType()); + continue; + } + + ActualParameter specializationParam = specializationParams.get(0); TypeData targetType = parameter.getTypeSystemType(); TypeData sourceType = specializationParam.getTypeSystemType(); String localName = specializationParam.getLocalName(); + if (unexpectedParameter != null && unexpectedParameter.getLocalName().equals(specializationParam.getLocalName())) { localName = "ex.getResult()"; sourceType = getModel().getNode().getTypeSystem().getGenericTypeData();