8009379: Remove $ from generated class names
Reviewed-by: attila, lagergren
This commit is contained in:
parent
242e864599
commit
dc1c8a5cd7
@ -188,7 +188,7 @@ public class ClassEmitter implements Emitter {
|
||||
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);
|
||||
|
@ -411,7 +411,7 @@ public final class Compiler {
|
||||
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();
|
||||
|
||||
|
@ -141,9 +141,9 @@ public enum CompilerConstants {
|
||||
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 */
|
||||
|
@ -49,7 +49,7 @@ public class MapCreator {
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
@ -146,7 +146,7 @@ public abstract class ObjectCreator {
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
@ -517,7 +517,7 @@ public final class Symbol implements Comparable<Symbol> {
|
||||
|
||||
/**
|
||||
* 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 @@ public final class Symbol implements Comparable<Symbol> {
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
@ -58,7 +58,7 @@ import jdk.nashorn.internal.runtime.ScriptRuntime;
|
||||
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 @@ public final class Global extends ScriptObject implements GlobalObject, Scope {
|
||||
* @return New empty object.
|
||||
*/
|
||||
public static ScriptObject newEmptyInstance() {
|
||||
final ScriptObject sobj = new JO$();
|
||||
final ScriptObject sobj = new JO();
|
||||
sobj.setProto(objectPrototype());
|
||||
return sobj;
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public final class NativeJSAdapter extends ScriptObject {
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class AccessorProperty extends Property {
|
||||
/**
|
||||
* 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
|
||||
|
@ -214,7 +214,7 @@ public final class Context {
|
||||
/** 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 @@ public final class Context {
|
||||
* @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
|
||||
*
|
||||
|
@ -32,7 +32,7 @@ import java.util.Locale;
|
||||
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 @@ public final class ECMAErrors {
|
||||
/** 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('.'));
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ public final class PropertyMap implements Iterable<Object>, PropertyListener {
|
||||
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 @@ public final class PropertyMap implements Iterable<Object>, PropertyListener {
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,12 +31,12 @@ import jdk.nashorn.internal.runtime.ScriptObject;
|
||||
/**
|
||||
* Empty object class.
|
||||
*/
|
||||
public class JO$ extends ScriptObject {
|
||||
public class JO extends ScriptObject {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public JO$() {
|
||||
public JO() {
|
||||
super();
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ public class JO$ extends ScriptObject {
|
||||
*
|
||||
* @param map the property map
|
||||
*/
|
||||
public JO$(final PropertyMap map) {
|
||||
public JO(final PropertyMap map) {
|
||||
super(map);
|
||||
}
|
||||
|
||||
@ -57,6 +57,6 @@ public class JO$ extends ScriptObject {
|
||||
* @return newly allocated ScriptObject
|
||||
*/
|
||||
public static ScriptObject allocate(final PropertyMap map) {
|
||||
return new JO$(map);
|
||||
return new JO(map);
|
||||
}
|
||||
}
|
@ -28,6 +28,6 @@ package jdk.nashorn.internal.scripts;
|
||||
/**
|
||||
* Root of script classes.
|
||||
*/
|
||||
public class JS$ {
|
||||
public class JS {
|
||||
// Empty
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user