comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java @ 12635:ba6593e52d22

Truffle-DSL: fixed additional wrong @SlowPath usage on generic. (GRAAL-490 #resolve)
author Christian Humer <christian.humer@gmail.com>
date Mon, 28 Oct 2013 11:06:51 +0100
parents 0d3e4d940925
children 9b23caa3ad31
comparison
equal deleted inserted replaced
12613:595f01abb887 12635:ba6593e52d22
1375 1375
1376 private CodeExecutableElement createGenericExecute(NodeData node, SpecializationGroup group) { 1376 private CodeExecutableElement createGenericExecute(NodeData node, SpecializationGroup group) {
1377 TypeMirror genericReturnType = node.getGenericSpecialization().getReturnType().getType(); 1377 TypeMirror genericReturnType = node.getGenericSpecialization().getReturnType().getType();
1378 CodeExecutableElement method = new CodeExecutableElement(modifiers(PROTECTED), genericReturnType, EXECUTE_GENERIC_NAME); 1378 CodeExecutableElement method = new CodeExecutableElement(modifiers(PROTECTED), genericReturnType, EXECUTE_GENERIC_NAME);
1379 1379
1380 if (!node.getGenericSpecialization().hasFrame(getContext())) { 1380 if (!node.needsFrame(getContext())) {
1381 method.getAnnotationMirrors().add(new CodeAnnotationMirror(getContext().getTruffleTypes().getSlowPath())); 1381 method.getAnnotationMirrors().add(new CodeAnnotationMirror(getContext().getTruffleTypes().getSlowPath()));
1382 } 1382 }
1383 addInternalValueParameters(method, node.getGenericSpecialization(), node.needsFrame(), false); 1383 addInternalValueParameters(method, node.getGenericSpecialization(), node.needsFrame(getContext()), false);
1384 final CodeTreeBuilder builder = method.createBuilder(); 1384 final CodeTreeBuilder builder = method.createBuilder();
1385 1385
1386 builder.tree(createExecuteTree(builder, node.getGenericSpecialization(), group, false, new CodeBlock<SpecializationData>() { 1386 builder.tree(createExecuteTree(builder, node.getGenericSpecialization(), group, false, new CodeBlock<SpecializationData>() {
1387 1387
1388 public CodeTree create(CodeTreeBuilder b, SpecializationData current) { 1388 public CodeTree create(CodeTreeBuilder b, SpecializationData current) {
1801 if (replace == null) { 1801 if (replace == null) {
1802 replace = replaceCall; 1802 replace = replaceCall;
1803 } 1803 }
1804 if (current.isGeneric()) { 1804 if (current.isGeneric()) {
1805 builder.startReturn().tree(replace).string(".").startCall(EXECUTE_GENERIC_NAME); 1805 builder.startReturn().tree(replace).string(".").startCall(EXECUTE_GENERIC_NAME);
1806 addInternalValueParameterNames(builder, source, current, null, current.getNode().needsFrame(), true, null); 1806 addInternalValueParameterNames(builder, source, current, null, current.getNode().needsFrame(getContext()), true, null);
1807 builder.end().end(); 1807 builder.end().end();
1808 } else if (current.getMethod() == null) { 1808 } else if (current.getMethod() == null) {
1809 if (replaceCall != null) { 1809 if (replaceCall != null) {
1810 builder.statement(replaceCall); 1810 builder.statement(replaceCall);
1811 } 1811 }
2966 returnBuilder.end(); 2966 returnBuilder.end();
2967 } else if (specialization.getMethod() == null && !node.needsRewrites(context)) { 2967 } else if (specialization.getMethod() == null && !node.needsRewrites(context)) {
2968 emitEncounteredSynthetic(builder, specialization); 2968 emitEncounteredSynthetic(builder, specialization);
2969 } else if (specialization.isGeneric()) { 2969 } else if (specialization.isGeneric()) {
2970 returnBuilder.startCall("super", EXECUTE_GENERIC_NAME); 2970 returnBuilder.startCall("super", EXECUTE_GENERIC_NAME);
2971 addInternalValueParameterNames(returnBuilder, specialization, specialization, null, node.needsFrame(), true, null); 2971 addInternalValueParameterNames(returnBuilder, specialization, specialization, null, node.needsFrame(getContext()), true, null);
2972 returnBuilder.end(); 2972 returnBuilder.end();
2973 } else { 2973 } else {
2974 returnBuilder.tree(createTemplateMethodCall(returnBuilder, null, specialization, specialization, null)); 2974 returnBuilder.tree(createTemplateMethodCall(returnBuilder, null, specialization, specialization, null));
2975 } 2975 }
2976 2976