diff graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java @ 19282:ae81dd154fb6

Truffle-DSL: remove old DSL layout; Make new layout the default.
author Christian Humer <christian.humer@gmail.com>
date Thu, 22 Jan 2015 20:44:24 +0100
parents 4ce856e65728
children 833e088ee7d3
line wrap: on
line diff
--- a/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java	Thu Jan 22 20:42:48 2015 +0100
+++ b/graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeCodeGenerator.java	Thu Jan 22 20:44:24 2015 +0100
@@ -122,38 +122,14 @@
     }
 
     private static String getAccessorClassName(NodeData node) {
-        return node.isGenerateFactory() ? NodeFactoryFactory.factoryClassName(node) : NodeBaseFactory.baseClassName(node);
+        return node.isGenerateFactory() ? NodeFactoryFactory.factoryClassName(node) : NodeGenFactory.nodeTypeName(node);
     }
 
     private static List<CodeTypeElement> generateNodes(ProcessorContext context, NodeData node) {
         if (!node.needsFactory()) {
             return Collections.emptyList();
         }
-        if (node.getTypeSystem().getOptions().useNewLayout()) {
-            return Arrays.asList(new NodeGenFactory(context, node).create());
-        } else {
-            return generateNodesOld(context, node);
-        }
-    }
-
-    private static List<CodeTypeElement> generateNodesOld(ProcessorContext context, NodeData node) {
-        List<CodeTypeElement> nodeTypes = new ArrayList<>();
-        SpecializationData generic = node.getGenericSpecialization() == null ? node.getSpecializations().get(0) : node.getGenericSpecialization();
-        CodeTypeElement baseNode = new NodeBaseFactory(context, node, generic).create();
-        nodeTypes.add(baseNode);
-
-        for (SpecializationData specialization : node.getSpecializations()) {
-            if (!specialization.isReachable() || specialization.isFallback()) {
-                continue;
-            }
-            if (specialization.isPolymorphic() && node.isPolymorphic(context)) {
-                nodeTypes.add(new PolymorphicNodeFactory(context, node, specialization, baseNode).create());
-                continue;
-            }
-
-            nodeTypes.add(new SpecializedNodeFactory(context, node, specialization, baseNode).create());
-        }
-        return nodeTypes;
+        return Arrays.asList(new NodeGenFactory(context, node).create());
     }
 
     private static ExecutableElement createGetFactories(ProcessorContext context, NodeData node) {