changeset 11506:e6645c18d154

Truffle-DSL: reduced generated code size by not generating primarily unused primitive type execute methods.
author Christian Humer <christian.humer@gmail.com>
date Fri, 30 Aug 2013 17:45:53 +0200
parents 578fc20b9380
children d6a5ab791b0d
files graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java	Fri Aug 30 17:40:16 2013 +0200
+++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/node/NodeCodeGenerator.java	Fri Aug 30 17:45:53 2013 +0200
@@ -2392,15 +2392,13 @@
         }
 
         private CodeTree createExecuteBody(CodeTreeBuilder parent, SpecializationData specialization, ExecutableTypeData execType) {
-            TypeData primaryType = specialization.getReturnType().getTypeSystemType();
-
             CodeTreeBuilder builder = new CodeTreeBuilder(parent);
 
             List<ExecutableTypeData> primaryExecutes = findFunctionalExecutableType(specialization, execType.getEvaluatedCount());
 
             if (primaryExecutes.contains(execType) || primaryExecutes.isEmpty()) {
                 builder.tree(createFunctionalExecute(builder, specialization, execType));
-            } else if (needsCastingExecuteMethod(execType, primaryType)) {
+            } else if (needsCastingExecuteMethod(execType)) {
                 assert !primaryExecutes.isEmpty();
                 builder.tree(createCastingExecute(builder, specialization, execType, primaryExecutes.get(0)));
             } else {
@@ -2431,13 +2429,10 @@
             return method;
         }
 
-        private boolean needsCastingExecuteMethod(ExecutableTypeData execType, TypeData primaryType) {
+        private boolean needsCastingExecuteMethod(ExecutableTypeData execType) {
             if (execType.isAbstract()) {
                 return true;
             }
-            if (Utils.isPrimitiveOrVoid(primaryType.getPrimitiveType()) && Utils.isPrimitiveOrVoid(execType.getType().getPrimitiveType())) {
-                return true;
-            }
             if (execType.getType().isGeneric()) {
                 return true;
             }