changeset 13465:e2a14719e833

refactored FastNodeClassRegistry to work around javac bug where it could not resolve NodeClass.Registry Compiling Java sources for com.oracle.graal.hotspot with javac... /Users/dsimon/linz/basic-graal/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java:216: error: package NodeClass does not exist static class FastNodeClassRegistry extends NodeClass.Registry { ^
author Doug Simon <doug.simon@oracle.com>
date Thu, 19 Dec 2013 11:42:16 +0100
parents 2236d18302e0
children 51d31106cd5e
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/FastNodeClassRegistry.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java
diffstat 2 files changed, 51 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/FastNodeClassRegistry.java	Thu Dec 19 11:42:16 2013 +0100
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.hotspot.bridge;
+
+import com.oracle.graal.graph.*;
+import com.oracle.graal.hotspot.meta.*;
+
+/**
+ * A fast-path for {@link NodeClass} retrieval using {@link HotSpotResolvedObjectType}.
+ */
+class FastNodeClassRegistry extends NodeClass.Registry {
+
+    @SuppressWarnings("unused")
+    static void initialize() {
+        new FastNodeClassRegistry();
+    }
+
+    private static HotSpotResolvedObjectType type(Class<? extends Node> key) {
+        return (HotSpotResolvedObjectType) HotSpotResolvedObjectType.fromClass(key);
+    }
+
+    @Override
+    public NodeClass get(Class<? extends Node> key) {
+        return type(key).getNodeClass();
+    }
+
+    @Override
+    protected void registered(Class<? extends Node> key, NodeClass value) {
+        type(key).setNodeClass(value);
+    }
+}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Thu Dec 19 11:38:44 2013 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Thu Dec 19 11:42:16 2013 +0100
@@ -20,7 +20,6 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-
 package com.oracle.graal.hotspot.bridge;
 
 import static com.oracle.graal.compiler.GraalDebugConfig.*;
@@ -211,31 +210,6 @@
     }
 
     /**
-     * A fast-path for {@link NodeClass} retrieval using {@link HotSpotResolvedObjectType}.
-     */
-    static class FastNodeClassRegistry extends NodeClass.Registry {
-
-        @SuppressWarnings("unused")
-        static void initialize() {
-            new FastNodeClassRegistry();
-        }
-
-        private static HotSpotResolvedObjectType type(Class<? extends Node> key) {
-            return (HotSpotResolvedObjectType) HotSpotResolvedObjectType.fromClass(key);
-        }
-
-        @Override
-        public NodeClass get(Class<? extends Node> key) {
-            return type(key).getNodeClass();
-        }
-
-        @Override
-        protected void registered(Class<? extends Node> key, NodeClass value) {
-            type(key).setNodeClass(value);
-        }
-    }
-
-    /**
      * Take action related to entering a new execution phase.
      * 
      * @param phase the execution phase being entered