changeset 8256:4dc7034317ec

Cleanup.
author Christian Humer <christian.humer@gmail.com>
date Wed, 13 Mar 2013 20:04:42 +0100
parents 1384c39e2c53
children 141af6b3b72b
files graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/GenericParser.java graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeCodeGenerator.java graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeParser.java graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/SpecializationData.java graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/MessageContainer.java
diffstat 5 files changed, 8 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/GenericParser.java	Wed Mar 13 20:00:33 2013 +0100
+++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/GenericParser.java	Wed Mar 13 20:04:42 2013 +0100
@@ -61,7 +61,7 @@
 
     @Override
     public SpecializationData create(TemplateMethod method) {
-        SpecializationData data = new SpecializationData(method, true, false, false);
+        SpecializationData data = new SpecializationData(method, true, false);
         data.setUseSpecializationsForGeneric(Utils.getAnnotationValueBoolean(data.getMarkerAnnotation(), "useSpecializations"));
         return data;
     }
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeCodeGenerator.java	Wed Mar 13 20:00:33 2013 +0100
+++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeCodeGenerator.java	Wed Mar 13 20:04:42 2013 +0100
@@ -1001,7 +1001,7 @@
                 builder.startTryBlock();
             }
 
-            if (specialization.isSynthetic()) {
+            if (specialization.getMethod() == null) {
                 emitEncounteredSynthetic(builder);
             } else {
                 builder.startReturn();
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeParser.java	Wed Mar 13 20:00:33 2013 +0100
+++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/NodeParser.java	Wed Mar 13 20:04:42 2013 +0100
@@ -290,10 +290,7 @@
             MethodSpec specification = parser.createDefaultMethodSpec(specialization.getMethod(), null, null);
 
             ExecutableTypeData anyGenericReturnType = node.findAnyGenericExecutableType(context);
-            if (anyGenericReturnType == null) {
-                // TODO fail invalid executable type. should be validated by field. (assertion
-// failure!?)
-            }
+            assert anyGenericReturnType != null;
 
             ActualParameter returnType = new ActualParameter(specification.getReturnType(), anyGenericReturnType.getType().getPrimitiveType(), 0, false);
             List<ActualParameter> parameters = new ArrayList<>();
@@ -305,15 +302,13 @@
                     actualType = specializationParameter.getActualType();
                 } else {
                     ExecutableTypeData paramType = field.getNodeData().findAnyGenericExecutableType(context);
-                    if (paramType == null) {
-                        // TODO fail
-                    }
+                    assert paramType != null;
                     actualType = paramType.getType().getPrimitiveType();
                 }
                 parameters.add(new ActualParameter(parameterSpec, actualType, specializationParameter.getIndex(), specializationParameter.isHidden()));
             }
             TemplateMethod genericMethod = new TemplateMethod("Generic", node, specification, null, null, returnType, parameters);
-            genericSpecialization = new SpecializationData(genericMethod, true, false, true);
+            genericSpecialization = new SpecializationData(genericMethod, true, false);
 
             specializations.add(genericSpecialization);
         }
@@ -322,7 +317,7 @@
             CodeExecutableElement uninitializedMethod = new CodeExecutableElement(Utils.modifiers(Modifier.PUBLIC), context.getType(void.class), "doUninitialized");
             TemplateMethod uninializedMethod = new TemplateMethod("Uninitialized", node, genericSpecialization.getSpecification(), uninitializedMethod, genericSpecialization.getMarkerAnnotation(),
                             genericSpecialization.getReturnType(), genericSpecialization.getParameters());
-            specializations.add(new SpecializationData(uninializedMethod, false, true, true));
+            specializations.add(new SpecializationData(uninializedMethod, false, true));
         }
 
         Collections.sort(specializations, new Comparator<SpecializationData>() {
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/SpecializationData.java	Wed Mar 13 20:00:33 2013 +0100
+++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/node/SpecializationData.java	Wed Mar 13 20:04:42 2013 +0100
@@ -39,14 +39,11 @@
     private boolean useSpecializationsForGeneric = true;
     private NodeData node;
 
-    private final boolean synthetic;
-
     public SpecializationData(TemplateMethod template, int order, List<SpecializationThrowsData> exceptions) {
         super(template);
         this.order = order;
         this.generic = false;
         this.uninitialized = false;
-        this.synthetic = false;
         this.exceptions = exceptions;
 
         for (SpecializationThrowsData exception : exceptions) {
@@ -54,14 +51,13 @@
         }
     }
 
-    public SpecializationData(TemplateMethod template, boolean generic, boolean uninitialized, boolean synthetic) {
+    public SpecializationData(TemplateMethod template, boolean generic, boolean uninitialized) {
         super(template);
         this.order = Specialization.DEFAULT_ORDER;
         this.generic = generic;
         this.uninitialized = uninitialized;
         this.exceptions = Collections.emptyList();
         this.guards = new ArrayList<>();
-        this.synthetic = synthetic;
     }
 
     @Override
@@ -108,10 +104,6 @@
         this.guards = guards;
     }
 
-    public boolean isSynthetic() {
-        return synthetic;
-    }
-
     public int getOrder() {
         return order;
     }
--- a/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/MessageContainer.java	Wed Mar 13 20:00:33 2013 +0100
+++ b/graal/com.oracle.truffle.codegen.processor/src/com/oracle/truffle/codegen/processor/template/MessageContainer.java	Wed Mar 13 20:04:42 2013 +0100
@@ -146,7 +146,7 @@
         return messages;
     }
 
-    public static class Message {
+    public static final class Message {
 
         private final MessageContainer originalContainer;
         private final String text;