changeset 7799:5ecf528d4131

Removed unnecessary casts from generated specialized execute methods.
author Christian Humer <christian.humer@gmail.com>
date Mon, 18 Feb 2013 12:22:00 +0100
parents 6ad077b60cb3
children 418635acf875
files graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeCodeGenerator.java
diffstat 1 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeCodeGenerator.java	Fri Feb 15 20:04:03 2013 +0100
+++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeCodeGenerator.java	Mon Feb 18 12:22:00 2013 +0100
@@ -186,18 +186,20 @@
         TypeSystemData typeSystem = specialization.getNode().getTypeSystem();
         // Implict guards based on method signature
         String andOperator = prefix;
-        for (NodeFieldData field : specialization.getNode().getFields()) {
-            ActualParameter param = specialization.findParameter(field.getName());
-            TypeData type = param.getActualTypeData(typeSystem);
-            if (type == null || type.isGeneric()) {
-                continue;
+        if (needsCast) {
+            for (NodeFieldData field : specialization.getNode().getFields()) {
+                ActualParameter param = specialization.findParameter(field.getName());
+                TypeData type = param.getActualTypeData(typeSystem);
+                if (type == null || type.isGeneric()) {
+                    continue;
+                }
+
+                body.string(andOperator);
+                startCallTypeSystemMethod(context, body, specialization.getNode(), TypeSystemCodeGenerator.isTypeMethodName(type));
+                body.string(valueName(specialization, param));
+                body.end().end(); // call
+                andOperator = " && ";
             }
-
-            body.string(andOperator);
-            startCallTypeSystemMethod(context, body, specialization.getNode(), TypeSystemCodeGenerator.isTypeMethodName(type));
-            body.string(valueName(specialization, param));
-            body.end().end(); // call
-            andOperator = " && ";
         }
 
         if (specialization.getGuards().length > 0) {