changeset 130:fe5211fc3114

8009379: Remove $ from generated class names Reviewed-by: attila, lagergren Contributed-by: james.laskey@oracle.com
author jlaskey
date Mon, 04 Mar 2013 11:01:26 -0400
parents f90810d79b57
children 3d57f57acd9c
files src/jdk/nashorn/internal/codegen/ClassEmitter.java src/jdk/nashorn/internal/codegen/Compiler.java src/jdk/nashorn/internal/codegen/CompilerConstants.java src/jdk/nashorn/internal/codegen/MapCreator.java src/jdk/nashorn/internal/codegen/ObjectCreator.java src/jdk/nashorn/internal/ir/Symbol.java src/jdk/nashorn/internal/objects/Global.java src/jdk/nashorn/internal/objects/NativeJSAdapter.java src/jdk/nashorn/internal/runtime/AccessorProperty.java src/jdk/nashorn/internal/runtime/Context.java src/jdk/nashorn/internal/runtime/ECMAErrors.java src/jdk/nashorn/internal/runtime/PropertyMap.java src/jdk/nashorn/internal/scripts/JO$.java src/jdk/nashorn/internal/scripts/JO.java src/jdk/nashorn/internal/scripts/JS$.java src/jdk/nashorn/internal/scripts/JS.java
diffstat 16 files changed, 113 insertions(+), 113 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk/nashorn/internal/codegen/ClassEmitter.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/codegen/ClassEmitter.java	Mon Mar 04 11:01:26 2013 -0400
@@ -188,7 +188,7 @@
         this.unitClassName        = unitClassName;
         this.constantMethodNeeded = new HashSet<>();
 
-        cw.visit(V1_7, ACC_PUBLIC | ACC_SUPER, unitClassName, null, pathName(jdk.nashorn.internal.scripts.JS$.class.getName()), null);
+        cw.visit(V1_7, ACC_PUBLIC | ACC_SUPER, unitClassName, null, pathName(jdk.nashorn.internal.scripts.JS.class.getName()), null);
         cw.visitSource(sourceName, null);
 
         defineCommonStatics(strictMode);
--- a/src/jdk/nashorn/internal/codegen/Compiler.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/codegen/Compiler.java	Mon Mar 04 11:01:26 2013 -0400
@@ -411,7 +411,7 @@
         final MethodEmitter initMethod = classEmitter.init(EnumSet.of(Flag.PRIVATE));
         initMethod.begin();
         initMethod.load(Type.OBJECT, 0);
-        initMethod.newInstance(jdk.nashorn.internal.scripts.JS$.class);
+        initMethod.newInstance(jdk.nashorn.internal.scripts.JS.class);
         initMethod.returnVoid();
         initMethod.end();
 
--- a/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Mon Mar 04 11:01:26 2013 -0400
@@ -141,9 +141,9 @@
     INIT_ARGUMENTS("$arguments", 3),
 
     /** prefix for all ScriptObject subclasses with fields, @see ObjectGenerator */
-    JS_OBJECT_PREFIX("JO$"),
+    JS_OBJECT_PREFIX("JO"),
 
-    /** name for allocate method in JO$ objects */
+    /** name for allocate method in JO objects */
     ALLOCATE("allocate"),
 
     /** prefix for split methods, @see Splitter */
--- a/src/jdk/nashorn/internal/codegen/MapCreator.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/codegen/MapCreator.java	Mon Mar 04 11:01:26 2013 -0400
@@ -49,7 +49,7 @@
     /**
      * Constructor
      *
-     * @param structure structure to generate map for (a JO$ subclass)
+     * @param structure structure to generate map for (a JO subclass)
      * @param keys      list of keys for map
      * @param symbols   list of symbols for map
      */
--- a/src/jdk/nashorn/internal/codegen/ObjectCreator.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/codegen/ObjectCreator.java	Mon Mar 04 11:01:26 2013 -0400
@@ -146,7 +146,7 @@
 
     /**
      * Get the class name for the object class,
-     * e.g. {@code com.nashorn.oracle.scripts.JO$2P0}
+     * e.g. {@code com.nashorn.oracle.scripts.JO2P0}
      *
      * @return script class name
      */
--- a/src/jdk/nashorn/internal/ir/Symbol.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/ir/Symbol.java	Mon Mar 04 11:01:26 2013 -0400
@@ -517,7 +517,7 @@
 
     /**
      * Get the index of the field used to store this symbol, should it be an AccessorProperty
-     * and get allocated in a JO$-prefixed ScriptObject subclass.
+     * and get allocated in a JO-prefixed ScriptObject subclass.
      *
      * @return field index
      */
@@ -528,7 +528,7 @@
 
     /**
      * Set the index of the field used to store this symbol, should it be an AccessorProperty
-     * and get allocated in a JO$-prefixed ScriptObject subclass.
+     * and get allocated in a JO-prefixed ScriptObject subclass.
      *
      * @param fieldIndex field index - a positive integer
      */
--- a/src/jdk/nashorn/internal/objects/Global.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/objects/Global.java	Mon Mar 04 11:01:26 2013 -0400
@@ -58,7 +58,7 @@
 import jdk.nashorn.internal.runtime.ScriptingFunctions;
 import jdk.nashorn.internal.runtime.Source;
 import jdk.nashorn.internal.runtime.linker.InvokeByName;
-import jdk.nashorn.internal.scripts.JO$;
+import jdk.nashorn.internal.scripts.JO;
 
 /**
  * Representation of global scope.
@@ -1290,7 +1290,7 @@
      * @return New empty object.
      */
     public static ScriptObject newEmptyInstance() {
-        final ScriptObject sobj = new JO$();
+        final ScriptObject sobj = new JO();
         sobj.setProto(objectPrototype());
         return sobj;
     }
--- a/src/jdk/nashorn/internal/objects/NativeJSAdapter.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/objects/NativeJSAdapter.java	Mon Mar 04 11:01:26 2013 -0400
@@ -159,7 +159,7 @@
     }
 
     private static ScriptObject wrapAdaptee(final ScriptObject adaptee) {
-        final ScriptObject sobj = new jdk.nashorn.internal.scripts.JO$();
+        final ScriptObject sobj = new jdk.nashorn.internal.scripts.JO();
         sobj.setProto(adaptee);
         return sobj;
     }
--- a/src/jdk/nashorn/internal/runtime/AccessorProperty.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/runtime/AccessorProperty.java	Mon Mar 04 11:01:26 2013 -0400
@@ -94,7 +94,7 @@
     /**
      * Delegate constructor. This is used when adding properties to the Global scope, which
      * is necessary for outermost levels in a script (the ScriptObject is represented by
-     * a JO$-prefixed ScriptObject class, but the properties need to be in the Global scope
+     * a JO-prefixed ScriptObject class, but the properties need to be in the Global scope
      * and are thus rebound with that as receiver
      *
      * @param property  accessor property to rebind
--- a/src/jdk/nashorn/internal/runtime/Context.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/runtime/Context.java	Mon Mar 04 11:01:26 2013 -0400
@@ -214,7 +214,7 @@
     /** Current error manager. */
     private final ErrorManager errors;
 
-    /** Empty map used for seed map for JO$ objects */
+    /** Empty map used for seed map for JO objects */
     final PropertyMap emptyMap = PropertyMap.newEmptyMap(this);
 
     private static final ClassLoader myLoader = Context.class.getClassLoader();
@@ -507,7 +507,7 @@
      * @see AccessorProperty
      * @see ScriptObject
      *
-     * @param fullName  full name of class, e.g. jdk.nashorn.internal.objects.JO$2P1 contains 2 fields and 1 parameter.
+     * @param fullName  full name of class, e.g. jdk.nashorn.internal.objects.JO2P1 contains 2 fields and 1 parameter.
      *
      * @return the {@code Class<?>} for this structure
      *
--- a/src/jdk/nashorn/internal/runtime/ECMAErrors.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/runtime/ECMAErrors.java	Mon Mar 04 11:01:26 2013 -0400
@@ -32,7 +32,7 @@
 import java.util.ResourceBundle;
 
 import jdk.nashorn.api.scripting.NashornException;
-import jdk.nashorn.internal.scripts.JS$;
+import jdk.nashorn.internal.scripts.JS;
 
 /**
  * Helper class to throw various standard "ECMA error" exceptions such as Error, ReferenceError, TypeError etc.
@@ -55,7 +55,7 @@
     /** We assume that compiler generates script classes into the known package. */
     private static final String scriptPackage;
     static {
-        String name = JS$.class.getName();
+        String name = JS.class.getName();
         scriptPackage = name.substring(0, name.lastIndexOf('.'));
     }
 
--- a/src/jdk/nashorn/internal/runtime/PropertyMap.java	Mon Mar 04 11:44:54 2013 +0100
+++ b/src/jdk/nashorn/internal/runtime/PropertyMap.java	Mon Mar 04 11:01:26 2013 -0400
@@ -153,7 +153,7 @@
         final Context context = Context.fromClass(structure);
 
         // Reduce the number of empty maps in the context.
-        if (structure == jdk.nashorn.internal.scripts.JO$.class) {
+        if (structure == jdk.nashorn.internal.scripts.JO.class) {
             return context.emptyMap;
         }
 
@@ -180,7 +180,7 @@
      * @return New empty {@link PropertyMap}.
      */
     public static PropertyMap newEmptyMap(final Context context) {
-        return new PropertyMap(jdk.nashorn.internal.scripts.JO$.class, context, EMPTY_MAP);
+        return new PropertyMap(jdk.nashorn.internal.scripts.JO.class, context, EMPTY_MAP);
     }
 
     /**
--- a/src/jdk/nashorn/internal/scripts/JO$.java	Mon Mar 04 11:44:54 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2010, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.nashorn.internal.scripts;
-
-import jdk.nashorn.internal.runtime.PropertyMap;
-import jdk.nashorn.internal.runtime.ScriptObject;
-
-/**
- * Empty object class.
- */
-public class JO$ extends ScriptObject {
-
-    /**
-     * Constructor
-     */
-    public JO$() {
-        super();
-    }
-
-    /**
-     * Constructor given an initial property map
-     *
-     * @param map the property map
-     */
-    public JO$(final PropertyMap map) {
-        super(map);
-    }
-
-    /**
-     * Used by FunctionObjectCreator. A method handle of this method is passed to the ScriptFunction constructor.
-     *
-     * @param map  the property map to use for allocatorMap
-     *
-     * @return newly allocated ScriptObject
-     */
-    public static ScriptObject allocate(final PropertyMap map) {
-        return new JO$(map);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk/nashorn/internal/scripts/JO.java	Mon Mar 04 11:01:26 2013 -0400
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2010, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 jdk.nashorn.internal.scripts;
+
+import jdk.nashorn.internal.runtime.PropertyMap;
+import jdk.nashorn.internal.runtime.ScriptObject;
+
+/**
+ * Empty object class.
+ */
+public class JO extends ScriptObject {
+
+    /**
+     * Constructor
+     */
+    public JO() {
+        super();
+    }
+
+    /**
+     * Constructor given an initial property map
+     *
+     * @param map the property map
+     */
+    public JO(final PropertyMap map) {
+        super(map);
+    }
+
+    /**
+     * Used by FunctionObjectCreator. A method handle of this method is passed to the ScriptFunction constructor.
+     *
+     * @param map  the property map to use for allocatorMap
+     *
+     * @return newly allocated ScriptObject
+     */
+    public static ScriptObject allocate(final PropertyMap map) {
+        return new JO(map);
+    }
+}
--- a/src/jdk/nashorn/internal/scripts/JS$.java	Mon Mar 04 11:44:54 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * 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 jdk.nashorn.internal.scripts;
-
-/**
- * Root of script classes.
- */
-public class JS$ {
-    // Empty
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk/nashorn/internal/scripts/JS.java	Mon Mar 04 11:01:26 2013 -0400
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 jdk.nashorn.internal.scripts;
+
+/**
+ * Root of script classes.
+ */
+public class JS {
+    // Empty
+}