Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java @ 16822:84f1c44b5e9b
Truffle-DSL: fixed resolve of executeWith.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 13 Aug 2014 18:06:26 +0200 |
parents | 224a89858453 |
children | 2db61eddcb97 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java Wed Aug 13 18:06:26 2014 +0200 +++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java Wed Aug 13 18:06:26 2014 +0200 @@ -322,12 +322,12 @@ /** * <pre> * variant1 $condition != null - * + * * $type $name = defaultValue($type); * if ($condition) { * $name = $value; * } - * + * * variant2 $condition != null * $type $name = $value; * </pre> @@ -2629,14 +2629,14 @@ primaryExecutes = findFunctionalExecutableType(specialization, lastEvaluatedCount); } - CodeTreeBuilder builder = new CodeTreeBuilder(null); - builder.getTree().setEnclosingElement(execType.getMessageElement()); - + CodeExecutableElement executeMethod = createExecutableTypeOverride(execType, true); + clazz.add(executeMethod); + CodeTreeBuilder builder = executeMethod.getBuilder(); CodeTree result = createExecuteBody(builder, specialization, execType, primaryExecutes); if (result != null) { - CodeExecutableElement method = createExecutableTypeOverride(execType, true); - method.createBuilder().tree(result); - clazz.add(method); + builder.tree(result); + } else { + clazz.remove(executeMethod); } } }