Mercurial > hg > graal-jvmci-8
comparison 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 |
comparison
equal
deleted
inserted
replaced
16821:224a89858453 | 16822:84f1c44b5e9b |
---|---|
320 } | 320 } |
321 | 321 |
322 /** | 322 /** |
323 * <pre> | 323 * <pre> |
324 * variant1 $condition != null | 324 * variant1 $condition != null |
325 * | 325 * |
326 * $type $name = defaultValue($type); | 326 * $type $name = defaultValue($type); |
327 * if ($condition) { | 327 * if ($condition) { |
328 * $name = $value; | 328 * $name = $value; |
329 * } | 329 * } |
330 * | 330 * |
331 * variant2 $condition != null | 331 * variant2 $condition != null |
332 * $type $name = $value; | 332 * $type $name = $value; |
333 * </pre> | 333 * </pre> |
334 * | 334 * |
335 * . | 335 * . |
2627 if (execType.getEvaluatedCount() != lastEvaluatedCount) { | 2627 if (execType.getEvaluatedCount() != lastEvaluatedCount) { |
2628 lastEvaluatedCount = execType.getEvaluatedCount(); | 2628 lastEvaluatedCount = execType.getEvaluatedCount(); |
2629 primaryExecutes = findFunctionalExecutableType(specialization, lastEvaluatedCount); | 2629 primaryExecutes = findFunctionalExecutableType(specialization, lastEvaluatedCount); |
2630 } | 2630 } |
2631 | 2631 |
2632 CodeTreeBuilder builder = new CodeTreeBuilder(null); | 2632 CodeExecutableElement executeMethod = createExecutableTypeOverride(execType, true); |
2633 builder.getTree().setEnclosingElement(execType.getMessageElement()); | 2633 clazz.add(executeMethod); |
2634 | 2634 CodeTreeBuilder builder = executeMethod.getBuilder(); |
2635 CodeTree result = createExecuteBody(builder, specialization, execType, primaryExecutes); | 2635 CodeTree result = createExecuteBody(builder, specialization, execType, primaryExecutes); |
2636 if (result != null) { | 2636 if (result != null) { |
2637 CodeExecutableElement method = createExecutableTypeOverride(execType, true); | 2637 builder.tree(result); |
2638 method.createBuilder().tree(result); | 2638 } else { |
2639 clazz.add(method); | 2639 clazz.remove(executeMethod); |
2640 } | 2640 } |
2641 } | 2641 } |
2642 } | 2642 } |
2643 | 2643 |
2644 protected void createCachedExecuteMethods(SpecializationData specialization) { | 2644 protected void createCachedExecuteMethods(SpecializationData specialization) { |