diff --git a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java
index 3425e9fd0c0..69c28b29f53 100644
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ClassGenerator.java
@@ -152,14 +152,14 @@ public class ClassGenerator {
}
static MethodGenerator makeStaticInitializer(final ClassVisitor cv, final String name) {
- final int access = ACC_PUBLIC | ACC_STATIC;
+ final int access = ACC_PUBLIC | ACC_STATIC;
final String desc = DEFAULT_INIT_DESC;
final MethodVisitor mv = cv.visitMethod(access, name, desc, null, null);
return new MethodGenerator(mv, access, name, desc);
}
static MethodGenerator makeConstructor(final ClassVisitor cv) {
- final int access = ACC_PUBLIC;
+ final int access = 0;
final String name = INIT;
final String desc = DEFAULT_INIT_DESC;
final MethodVisitor mv = cv.visitMethod(access, name, desc, null, null);
diff --git a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java
index e90b53ecb81..7f45eab4fdd 100644
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java
@@ -25,6 +25,7 @@
package jdk.nashorn.internal.tools.nasgen;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_FINAL;
import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER;
import static jdk.internal.org.objectweb.asm.Opcodes.H_INVOKESTATIC;
@@ -80,7 +81,7 @@ public class ConstructorGenerator extends ClassGenerator {
byte[] getClassBytes() {
// new class extensing from ScriptObject
final String superClass = (constructor != null)? SCRIPTFUNCTIONIMPL_TYPE : SCRIPTOBJECT_TYPE;
- cw.visit(V1_7, ACC_PUBLIC | ACC_SUPER, className, null, superClass, null);
+ cw.visit(V1_7, ACC_FINAL, className, null, superClass, null);
if (memberCount > 0) {
// add fields
emitFields();
diff --git a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java
index 98048a294b2..8bb1de5c588 100644
--- a/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java
+++ b/nashorn/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java
@@ -25,6 +25,7 @@
package jdk.nashorn.internal.tools.nasgen;
+import static jdk.internal.org.objectweb.asm.Opcodes.ACC_FINAL;
import static jdk.internal.org.objectweb.asm.Opcodes.ACC_PUBLIC;
import static jdk.internal.org.objectweb.asm.Opcodes.ACC_SUPER;
import static jdk.internal.org.objectweb.asm.Opcodes.V1_7;
@@ -60,7 +61,7 @@ public class PrototypeGenerator extends ClassGenerator {
byte[] getClassBytes() {
// new class extensing from ScriptObject
- cw.visit(V1_7, ACC_PUBLIC | ACC_SUPER, className, null, PROTOTYPEOBJECT_TYPE, null);
+ cw.visit(V1_7, ACC_FINAL | ACC_SUPER, className, null, PROTOTYPEOBJECT_TYPE, null);
if (memberCount > 0) {
// add fields
emitFields();
diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml
index 98502bd9bbf..9a31be88592 100644
--- a/nashorn/make/build.xml
+++ b/nashorn/make/build.xml
@@ -47,10 +47,10 @@
-
-
-
-
+
+
+
+
@@ -60,9 +60,9 @@
-
-
-
+
+
+
@@ -294,19 +294,6 @@ grant codeBase "file:/${basedir}/test/script/basic/classloader.js" {
-
-
-
-
-
-
-
-
-
-
-
-
- Representation test failed - output differs!
diff --git a/nashorn/make/project.properties b/nashorn/make/project.properties
index dbd9efce80c..57c99866575 100644
--- a/nashorn/make/project.properties
+++ b/nashorn/make/project.properties
@@ -223,7 +223,6 @@ run.test.user.language=tr
run.test.user.country=TR
# -XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintNMethods
-# add '-Dtest.js.outofprocess' to run each test in a new sub-process
run.test.jvmargs.main=-server -Xmx${run.test.xmx} -XX:+TieredCompilation -ea -Dfile.encoding=UTF-8 -Duser.language=${run.test.user.language} -Duser.country=${run.test.user.country}
#-XX:+HeapDumpOnOutOfMemoryError -XX:-UseCompressedKlassPointers -XX:+PrintHeapAtGC -XX:ClassMetaspaceSize=300M
@@ -231,6 +230,9 @@ run.test.jvmargs.octane.main=-Xms${run.test.xms} ${run.test.jvmargs.main}
run.test.jvmsecurityargs=-Xverify:all -Djava.security.properties=${basedir}/make/java.security.override -Djava.security.manager -Djava.security.policy=${basedir}/build/nashorn.policy
+# VM options for script tests with @fork option
+test-sys-prop.test.fork.jvm.options=${run.test.jvmargs.main} ${run.test.jvmsecurityargs}
+
# path of rhino.jar for benchmarks
rhino.jar=
diff --git a/nashorn/src/jdk/nashorn/internal/objects/BoundScriptFunctionImpl.java b/nashorn/src/jdk/nashorn/internal/objects/BoundScriptFunctionImpl.java
index a8f311eb19f..d0e5b987f65 100644
--- a/nashorn/src/jdk/nashorn/internal/objects/BoundScriptFunctionImpl.java
+++ b/nashorn/src/jdk/nashorn/internal/objects/BoundScriptFunctionImpl.java
@@ -35,7 +35,7 @@ import jdk.nashorn.internal.runtime.ScriptRuntime;
* must track their {@code [[TargetFunction]]} property for purposes of correctly implementing {@code [[HasInstance]]};
* see {@link ScriptFunction#isInstance(ScriptObject)}.
*/
-class BoundScriptFunctionImpl extends ScriptFunctionImpl {
+final class BoundScriptFunctionImpl extends ScriptFunctionImpl {
private final ScriptFunction targetFunction;
BoundScriptFunctionImpl(ScriptFunctionData data, ScriptFunction targetFunction) {
diff --git a/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java b/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java
index 837fee8b789..4610afc2473 100644
--- a/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java
+++ b/nashorn/src/jdk/nashorn/internal/objects/PrototypeObject.java
@@ -75,7 +75,7 @@ public class PrototypeObject extends ScriptObject {
*
* @param map property map
*/
- public PrototypeObject(final PropertyMap map) {
+ PrototypeObject(final PropertyMap map) {
this(Global.instance(), map);
}
@@ -89,7 +89,7 @@ public class PrototypeObject extends ScriptObject {
* @param self self reference
* @return constructor, probably, but not necessarily, a {@link ScriptFunction}
*/
- public static Object getConstructor(final Object self) {
+ static Object getConstructor(final Object self) {
return (self instanceof PrototypeObject) ?
((PrototypeObject)self).getConstructor() :
UNDEFINED;
@@ -100,7 +100,7 @@ public class PrototypeObject extends ScriptObject {
* @param self self reference
* @param constructor constructor, probably, but not necessarily, a {@link ScriptFunction}
*/
- public static void setConstructor(final Object self, final Object constructor) {
+ static void setConstructor(final Object self, final Object constructor) {
if (self instanceof PrototypeObject) {
((PrototypeObject)self).setConstructor(constructor);
}
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java b/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java
index c9d2a04229f..702ca76ba1f 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java
@@ -51,7 +51,7 @@ import jdk.nashorn.internal.lookup.MethodHandleFactory;
* An AccessorProperty is the most generic property type. An AccessorProperty is
* represented as fields in a ScriptObject class.
*/
-public class AccessorProperty extends Property {
+public final class AccessorProperty extends Property {
private static final MethodHandles.Lookup lookup = MethodHandles.lookup();
private static final MethodHandle REPLACE_MAP = findOwnMH("replaceMap", Object.class, Object.class, PropertyMap.class, String.class, Class.class, Class.class);
@@ -149,7 +149,7 @@ public class AccessorProperty extends Property {
* @param property accessor property to rebind
* @param delegate delegate object to rebind receiver to
*/
- public AccessorProperty(final AccessorProperty property, final Object delegate) {
+ AccessorProperty(final AccessorProperty property, final Object delegate) {
super(property);
this.primitiveGetter = bindTo(property.primitiveGetter, delegate);
@@ -185,7 +185,7 @@ public class AccessorProperty extends Property {
* @param getter the property getter
* @param setter the property setter or null if non writable, non configurable
*/
- public AccessorProperty(final String key, final int flags, final int slot, final MethodHandle getter, final MethodHandle setter) {
+ AccessorProperty(final String key, final int flags, final int slot, final MethodHandle getter, final MethodHandle setter) {
super(key, flags, slot);
// we don't need to prep the setters these will never be invalidated as this is a nasgen
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java b/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java
index 469245f113a..f28ed6ae298 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/FinalScriptFunctionData.java
@@ -33,7 +33,7 @@ import java.lang.invoke.MethodHandle;
* This is a subclass that represents a script function that may not be regenerated.
* This is used for example for bound functions and builtins.
*/
-public final class FinalScriptFunctionData extends ScriptFunctionData {
+final class FinalScriptFunctionData extends ScriptFunctionData {
/**
* Constructor - used for bind
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java b/nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java
index 60cf76bb2e5..1d5603f6818 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ListAdapter.java
@@ -47,7 +47,7 @@ import jdk.nashorn.internal.runtime.linker.InvokeByName;
* operations respectively, while {@link #addLast(Object)} and {@link #removeLast()} will translate to {@code push} and
* {@code pop}.
*/
-public class ListAdapter extends AbstractList