8009379: Remove $ from generated class names

Mon, 04 Mar 2013 11:01:26 -0400

author
jlaskey
date
Mon, 04 Mar 2013 11:01:26 -0400
changeset 131
fe5211fc3114
parent 130
f90810d79b57
child 132
3d57f57acd9c

8009379: Remove $ from generated class names
Reviewed-by: attila, lagergren
Contributed-by: james.laskey@oracle.com

src/jdk/nashorn/internal/codegen/ClassEmitter.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/Compiler.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/CompilerConstants.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/MapCreator.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/ObjectCreator.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/ir/Symbol.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/objects/Global.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/objects/NativeJSAdapter.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/AccessorProperty.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/Context.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/ECMAErrors.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/runtime/PropertyMap.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/scripts/JO$.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/scripts/JO.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/scripts/JS$.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/scripts/JS.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/jdk/nashorn/internal/codegen/ClassEmitter.java	Mon Mar 04 11:44:54 2013 +0100
     1.2 +++ b/src/jdk/nashorn/internal/codegen/ClassEmitter.java	Mon Mar 04 11:01:26 2013 -0400
     1.3 @@ -188,7 +188,7 @@
     1.4          this.unitClassName        = unitClassName;
     1.5          this.constantMethodNeeded = new HashSet<>();
     1.6  
     1.7 -        cw.visit(V1_7, ACC_PUBLIC | ACC_SUPER, unitClassName, null, pathName(jdk.nashorn.internal.scripts.JS$.class.getName()), null);
     1.8 +        cw.visit(V1_7, ACC_PUBLIC | ACC_SUPER, unitClassName, null, pathName(jdk.nashorn.internal.scripts.JS.class.getName()), null);
     1.9          cw.visitSource(sourceName, null);
    1.10  
    1.11          defineCommonStatics(strictMode);
     2.1 --- a/src/jdk/nashorn/internal/codegen/Compiler.java	Mon Mar 04 11:44:54 2013 +0100
     2.2 +++ b/src/jdk/nashorn/internal/codegen/Compiler.java	Mon Mar 04 11:01:26 2013 -0400
     2.3 @@ -411,7 +411,7 @@
     2.4          final MethodEmitter initMethod = classEmitter.init(EnumSet.of(Flag.PRIVATE));
     2.5          initMethod.begin();
     2.6          initMethod.load(Type.OBJECT, 0);
     2.7 -        initMethod.newInstance(jdk.nashorn.internal.scripts.JS$.class);
     2.8 +        initMethod.newInstance(jdk.nashorn.internal.scripts.JS.class);
     2.9          initMethod.returnVoid();
    2.10          initMethod.end();
    2.11  
     3.1 --- a/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Mon Mar 04 11:44:54 2013 +0100
     3.2 +++ b/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Mon Mar 04 11:01:26 2013 -0400
     3.3 @@ -141,9 +141,9 @@
     3.4      INIT_ARGUMENTS("$arguments", 3),
     3.5  
     3.6      /** prefix for all ScriptObject subclasses with fields, @see ObjectGenerator */
     3.7 -    JS_OBJECT_PREFIX("JO$"),
     3.8 +    JS_OBJECT_PREFIX("JO"),
     3.9  
    3.10 -    /** name for allocate method in JO$ objects */
    3.11 +    /** name for allocate method in JO objects */
    3.12      ALLOCATE("allocate"),
    3.13  
    3.14      /** prefix for split methods, @see Splitter */
     4.1 --- a/src/jdk/nashorn/internal/codegen/MapCreator.java	Mon Mar 04 11:44:54 2013 +0100
     4.2 +++ b/src/jdk/nashorn/internal/codegen/MapCreator.java	Mon Mar 04 11:01:26 2013 -0400
     4.3 @@ -49,7 +49,7 @@
     4.4      /**
     4.5       * Constructor
     4.6       *
     4.7 -     * @param structure structure to generate map for (a JO$ subclass)
     4.8 +     * @param structure structure to generate map for (a JO subclass)
     4.9       * @param keys      list of keys for map
    4.10       * @param symbols   list of symbols for map
    4.11       */
     5.1 --- a/src/jdk/nashorn/internal/codegen/ObjectCreator.java	Mon Mar 04 11:44:54 2013 +0100
     5.2 +++ b/src/jdk/nashorn/internal/codegen/ObjectCreator.java	Mon Mar 04 11:01:26 2013 -0400
     5.3 @@ -146,7 +146,7 @@
     5.4  
     5.5      /**
     5.6       * Get the class name for the object class,
     5.7 -     * e.g. {@code com.nashorn.oracle.scripts.JO$2P0}
     5.8 +     * e.g. {@code com.nashorn.oracle.scripts.JO2P0}
     5.9       *
    5.10       * @return script class name
    5.11       */
     6.1 --- a/src/jdk/nashorn/internal/ir/Symbol.java	Mon Mar 04 11:44:54 2013 +0100
     6.2 +++ b/src/jdk/nashorn/internal/ir/Symbol.java	Mon Mar 04 11:01:26 2013 -0400
     6.3 @@ -517,7 +517,7 @@
     6.4  
     6.5      /**
     6.6       * Get the index of the field used to store this symbol, should it be an AccessorProperty
     6.7 -     * and get allocated in a JO$-prefixed ScriptObject subclass.
     6.8 +     * and get allocated in a JO-prefixed ScriptObject subclass.
     6.9       *
    6.10       * @return field index
    6.11       */
    6.12 @@ -528,7 +528,7 @@
    6.13  
    6.14      /**
    6.15       * Set the index of the field used to store this symbol, should it be an AccessorProperty
    6.16 -     * and get allocated in a JO$-prefixed ScriptObject subclass.
    6.17 +     * and get allocated in a JO-prefixed ScriptObject subclass.
    6.18       *
    6.19       * @param fieldIndex field index - a positive integer
    6.20       */
     7.1 --- a/src/jdk/nashorn/internal/objects/Global.java	Mon Mar 04 11:44:54 2013 +0100
     7.2 +++ b/src/jdk/nashorn/internal/objects/Global.java	Mon Mar 04 11:01:26 2013 -0400
     7.3 @@ -58,7 +58,7 @@
     7.4  import jdk.nashorn.internal.runtime.ScriptingFunctions;
     7.5  import jdk.nashorn.internal.runtime.Source;
     7.6  import jdk.nashorn.internal.runtime.linker.InvokeByName;
     7.7 -import jdk.nashorn.internal.scripts.JO$;
     7.8 +import jdk.nashorn.internal.scripts.JO;
     7.9  
    7.10  /**
    7.11   * Representation of global scope.
    7.12 @@ -1290,7 +1290,7 @@
    7.13       * @return New empty object.
    7.14       */
    7.15      public static ScriptObject newEmptyInstance() {
    7.16 -        final ScriptObject sobj = new JO$();
    7.17 +        final ScriptObject sobj = new JO();
    7.18          sobj.setProto(objectPrototype());
    7.19          return sobj;
    7.20      }
     8.1 --- a/src/jdk/nashorn/internal/objects/NativeJSAdapter.java	Mon Mar 04 11:44:54 2013 +0100
     8.2 +++ b/src/jdk/nashorn/internal/objects/NativeJSAdapter.java	Mon Mar 04 11:01:26 2013 -0400
     8.3 @@ -159,7 +159,7 @@
     8.4      }
     8.5  
     8.6      private static ScriptObject wrapAdaptee(final ScriptObject adaptee) {
     8.7 -        final ScriptObject sobj = new jdk.nashorn.internal.scripts.JO$();
     8.8 +        final ScriptObject sobj = new jdk.nashorn.internal.scripts.JO();
     8.9          sobj.setProto(adaptee);
    8.10          return sobj;
    8.11      }
     9.1 --- a/src/jdk/nashorn/internal/runtime/AccessorProperty.java	Mon Mar 04 11:44:54 2013 +0100
     9.2 +++ b/src/jdk/nashorn/internal/runtime/AccessorProperty.java	Mon Mar 04 11:01:26 2013 -0400
     9.3 @@ -94,7 +94,7 @@
     9.4      /**
     9.5       * Delegate constructor. This is used when adding properties to the Global scope, which
     9.6       * is necessary for outermost levels in a script (the ScriptObject is represented by
     9.7 -     * a JO$-prefixed ScriptObject class, but the properties need to be in the Global scope
     9.8 +     * a JO-prefixed ScriptObject class, but the properties need to be in the Global scope
     9.9       * and are thus rebound with that as receiver
    9.10       *
    9.11       * @param property  accessor property to rebind
    10.1 --- a/src/jdk/nashorn/internal/runtime/Context.java	Mon Mar 04 11:44:54 2013 +0100
    10.2 +++ b/src/jdk/nashorn/internal/runtime/Context.java	Mon Mar 04 11:01:26 2013 -0400
    10.3 @@ -214,7 +214,7 @@
    10.4      /** Current error manager. */
    10.5      private final ErrorManager errors;
    10.6  
    10.7 -    /** Empty map used for seed map for JO$ objects */
    10.8 +    /** Empty map used for seed map for JO objects */
    10.9      final PropertyMap emptyMap = PropertyMap.newEmptyMap(this);
   10.10  
   10.11      private static final ClassLoader myLoader = Context.class.getClassLoader();
   10.12 @@ -507,7 +507,7 @@
   10.13       * @see AccessorProperty
   10.14       * @see ScriptObject
   10.15       *
   10.16 -     * @param fullName  full name of class, e.g. jdk.nashorn.internal.objects.JO$2P1 contains 2 fields and 1 parameter.
   10.17 +     * @param fullName  full name of class, e.g. jdk.nashorn.internal.objects.JO2P1 contains 2 fields and 1 parameter.
   10.18       *
   10.19       * @return the {@code Class<?>} for this structure
   10.20       *
    11.1 --- a/src/jdk/nashorn/internal/runtime/ECMAErrors.java	Mon Mar 04 11:44:54 2013 +0100
    11.2 +++ b/src/jdk/nashorn/internal/runtime/ECMAErrors.java	Mon Mar 04 11:01:26 2013 -0400
    11.3 @@ -32,7 +32,7 @@
    11.4  import java.util.ResourceBundle;
    11.5  
    11.6  import jdk.nashorn.api.scripting.NashornException;
    11.7 -import jdk.nashorn.internal.scripts.JS$;
    11.8 +import jdk.nashorn.internal.scripts.JS;
    11.9  
   11.10  /**
   11.11   * Helper class to throw various standard "ECMA error" exceptions such as Error, ReferenceError, TypeError etc.
   11.12 @@ -55,7 +55,7 @@
   11.13      /** We assume that compiler generates script classes into the known package. */
   11.14      private static final String scriptPackage;
   11.15      static {
   11.16 -        String name = JS$.class.getName();
   11.17 +        String name = JS.class.getName();
   11.18          scriptPackage = name.substring(0, name.lastIndexOf('.'));
   11.19      }
   11.20  
    12.1 --- a/src/jdk/nashorn/internal/runtime/PropertyMap.java	Mon Mar 04 11:44:54 2013 +0100
    12.2 +++ b/src/jdk/nashorn/internal/runtime/PropertyMap.java	Mon Mar 04 11:01:26 2013 -0400
    12.3 @@ -153,7 +153,7 @@
    12.4          final Context context = Context.fromClass(structure);
    12.5  
    12.6          // Reduce the number of empty maps in the context.
    12.7 -        if (structure == jdk.nashorn.internal.scripts.JO$.class) {
    12.8 +        if (structure == jdk.nashorn.internal.scripts.JO.class) {
    12.9              return context.emptyMap;
   12.10          }
   12.11  
   12.12 @@ -180,7 +180,7 @@
   12.13       * @return New empty {@link PropertyMap}.
   12.14       */
   12.15      public static PropertyMap newEmptyMap(final Context context) {
   12.16 -        return new PropertyMap(jdk.nashorn.internal.scripts.JO$.class, context, EMPTY_MAP);
   12.17 +        return new PropertyMap(jdk.nashorn.internal.scripts.JO.class, context, EMPTY_MAP);
   12.18      }
   12.19  
   12.20      /**
    13.1 --- a/src/jdk/nashorn/internal/scripts/JO$.java	Mon Mar 04 11:44:54 2013 +0100
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,62 +0,0 @@
    13.4 -/*
    13.5 - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
    13.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    13.7 - *
    13.8 - * This code is free software; you can redistribute it and/or modify it
    13.9 - * under the terms of the GNU General Public License version 2 only, as
   13.10 - * published by the Free Software Foundation.  Oracle designates this
   13.11 - * particular file as subject to the "Classpath" exception as provided
   13.12 - * by Oracle in the LICENSE file that accompanied this code.
   13.13 - *
   13.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   13.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   13.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   13.17 - * version 2 for more details (a copy is included in the LICENSE file that
   13.18 - * accompanied this code).
   13.19 - *
   13.20 - * You should have received a copy of the GNU General Public License version
   13.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   13.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   13.23 - *
   13.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   13.25 - * or visit www.oracle.com if you need additional information or have any
   13.26 - * questions.
   13.27 - */
   13.28 -
   13.29 -package jdk.nashorn.internal.scripts;
   13.30 -
   13.31 -import jdk.nashorn.internal.runtime.PropertyMap;
   13.32 -import jdk.nashorn.internal.runtime.ScriptObject;
   13.33 -
   13.34 -/**
   13.35 - * Empty object class.
   13.36 - */
   13.37 -public class JO$ extends ScriptObject {
   13.38 -
   13.39 -    /**
   13.40 -     * Constructor
   13.41 -     */
   13.42 -    public JO$() {
   13.43 -        super();
   13.44 -    }
   13.45 -
   13.46 -    /**
   13.47 -     * Constructor given an initial property map
   13.48 -     *
   13.49 -     * @param map the property map
   13.50 -     */
   13.51 -    public JO$(final PropertyMap map) {
   13.52 -        super(map);
   13.53 -    }
   13.54 -
   13.55 -    /**
   13.56 -     * Used by FunctionObjectCreator. A method handle of this method is passed to the ScriptFunction constructor.
   13.57 -     *
   13.58 -     * @param map  the property map to use for allocatorMap
   13.59 -     *
   13.60 -     * @return newly allocated ScriptObject
   13.61 -     */
   13.62 -    public static ScriptObject allocate(final PropertyMap map) {
   13.63 -        return new JO$(map);
   13.64 -    }
   13.65 -}
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/src/jdk/nashorn/internal/scripts/JO.java	Mon Mar 04 11:01:26 2013 -0400
    14.3 @@ -0,0 +1,62 @@
    14.4 +/*
    14.5 + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
    14.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    14.7 + *
    14.8 + * This code is free software; you can redistribute it and/or modify it
    14.9 + * under the terms of the GNU General Public License version 2 only, as
   14.10 + * published by the Free Software Foundation.  Oracle designates this
   14.11 + * particular file as subject to the "Classpath" exception as provided
   14.12 + * by Oracle in the LICENSE file that accompanied this code.
   14.13 + *
   14.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   14.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   14.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   14.17 + * version 2 for more details (a copy is included in the LICENSE file that
   14.18 + * accompanied this code).
   14.19 + *
   14.20 + * You should have received a copy of the GNU General Public License version
   14.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   14.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   14.23 + *
   14.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   14.25 + * or visit www.oracle.com if you need additional information or have any
   14.26 + * questions.
   14.27 + */
   14.28 +
   14.29 +package jdk.nashorn.internal.scripts;
   14.30 +
   14.31 +import jdk.nashorn.internal.runtime.PropertyMap;
   14.32 +import jdk.nashorn.internal.runtime.ScriptObject;
   14.33 +
   14.34 +/**
   14.35 + * Empty object class.
   14.36 + */
   14.37 +public class JO extends ScriptObject {
   14.38 +
   14.39 +    /**
   14.40 +     * Constructor
   14.41 +     */
   14.42 +    public JO() {
   14.43 +        super();
   14.44 +    }
   14.45 +
   14.46 +    /**
   14.47 +     * Constructor given an initial property map
   14.48 +     *
   14.49 +     * @param map the property map
   14.50 +     */
   14.51 +    public JO(final PropertyMap map) {
   14.52 +        super(map);
   14.53 +    }
   14.54 +
   14.55 +    /**
   14.56 +     * Used by FunctionObjectCreator. A method handle of this method is passed to the ScriptFunction constructor.
   14.57 +     *
   14.58 +     * @param map  the property map to use for allocatorMap
   14.59 +     *
   14.60 +     * @return newly allocated ScriptObject
   14.61 +     */
   14.62 +    public static ScriptObject allocate(final PropertyMap map) {
   14.63 +        return new JO(map);
   14.64 +    }
   14.65 +}
    15.1 --- a/src/jdk/nashorn/internal/scripts/JS$.java	Mon Mar 04 11:44:54 2013 +0100
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,33 +0,0 @@
    15.4 -/*
    15.5 - * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
    15.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    15.7 - *
    15.8 - * This code is free software; you can redistribute it and/or modify it
    15.9 - * under the terms of the GNU General Public License version 2 only, as
   15.10 - * published by the Free Software Foundation.  Oracle designates this
   15.11 - * particular file as subject to the "Classpath" exception as provided
   15.12 - * by Oracle in the LICENSE file that accompanied this code.
   15.13 - *
   15.14 - * This code is distributed in the hope that it will be useful, but WITHOUT
   15.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   15.16 - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   15.17 - * version 2 for more details (a copy is included in the LICENSE file that
   15.18 - * accompanied this code).
   15.19 - *
   15.20 - * You should have received a copy of the GNU General Public License version
   15.21 - * 2 along with this work; if not, write to the Free Software Foundation,
   15.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   15.23 - *
   15.24 - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   15.25 - * or visit www.oracle.com if you need additional information or have any
   15.26 - * questions.
   15.27 - */
   15.28 -
   15.29 -package jdk.nashorn.internal.scripts;
   15.30 -
   15.31 -/**
   15.32 - * Root of script classes.
   15.33 - */
   15.34 -public class JS$ {
   15.35 -    // Empty
   15.36 -}
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/src/jdk/nashorn/internal/scripts/JS.java	Mon Mar 04 11:01:26 2013 -0400
    16.3 @@ -0,0 +1,33 @@
    16.4 +/*
    16.5 + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
    16.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    16.7 + *
    16.8 + * This code is free software; you can redistribute it and/or modify it
    16.9 + * under the terms of the GNU General Public License version 2 only, as
   16.10 + * published by the Free Software Foundation.  Oracle designates this
   16.11 + * particular file as subject to the "Classpath" exception as provided
   16.12 + * by Oracle in the LICENSE file that accompanied this code.
   16.13 + *
   16.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
   16.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   16.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   16.17 + * version 2 for more details (a copy is included in the LICENSE file that
   16.18 + * accompanied this code).
   16.19 + *
   16.20 + * You should have received a copy of the GNU General Public License version
   16.21 + * 2 along with this work; if not, write to the Free Software Foundation,
   16.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   16.23 + *
   16.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   16.25 + * or visit www.oracle.com if you need additional information or have any
   16.26 + * questions.
   16.27 + */
   16.28 +
   16.29 +package jdk.nashorn.internal.scripts;
   16.30 +
   16.31 +/**
   16.32 + * Root of script classes.
   16.33 + */
   16.34 +public class JS {
   16.35 +    // Empty
   16.36 +}

mercurial