Merge
authorlana
Thu, 05 May 2016 19:10:51 +0000
changeset 37832 6e57193e2adf
parent 37826 b6d9cd218e34 (current diff)
parent 37831 0f5f3db80eae (diff)
child 37833 ae7b3314b209
Merge
--- a/nashorn/buildtools/nasgen/build.xml	Thu May 05 17:35:50 2016 +0000
+++ b/nashorn/buildtools/nasgen/build.xml	Thu May 05 19:10:51 2016 +0000
@@ -42,7 +42,7 @@
            destdir="${build.classes.dir}"
            debug="${javac.debug}"
            includeantruntime="false" fork="true">
-      <compilerarg value="-XaddExports:${nasgen.module.imports}"/>
+      <compilerarg line="${nasgen.module.imports}"/>
       <compilerarg value="-Xlint:unchecked"/>
       <compilerarg value="-Xlint:deprecation"/>
       <compilerarg value="-XDignore.symbol.file"/>
--- a/nashorn/buildtools/nasgen/project.properties	Thu May 05 17:35:50 2016 +0000
+++ b/nashorn/buildtools/nasgen/project.properties	Thu May 05 19:10:51 2016 +0000
@@ -40,8 +40,8 @@
 javac.debug=true
 
 nasgen.module.imports=\
-    java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED,\
-    java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
+    -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
+    -XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
 
 meta.inf.dir=${src.dir}/META-INF
 run.classpath=\
--- a/nashorn/make/BuildNashorn.gmk	Thu May 05 17:35:50 2016 +0000
+++ b/nashorn/make/BuildNashorn.gmk	Thu May 05 19:10:51 2016 +0000
@@ -76,9 +76,10 @@
 ifeq ($(BOOT_JDK_MODULAR), true)
   NASGEN_OPTIONS := \
       -cp $(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
-      -Xpatch:$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
+      -Xpatch:java.base=$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes \
       -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
-      -XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
+      -XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED \
+      #
 else
   NASGEN_OPTIONS := \
       -Xbootclasspath/p:$(BUILDTOOLS_OUTPUTDIR)/nasgen_classes
--- a/nashorn/make/build-nasgen.xml	Thu May 05 17:35:50 2016 +0000
+++ b/nashorn/make/build-nasgen.xml	Thu May 05 19:10:51 2016 +0000
@@ -36,7 +36,7 @@
                 <pathelement location="${basedir}/jcov2/lib/jcov_j2se_rt.jar"/>
                 <pathelement location="${basedir}/buildtools/nasgen/dist/nasgen.jar"/>
             </classpath>
-            <jvmarg value="-XaddExports:${nasgen.module.imports}"/>
+            <jvmarg line="${nasgen.module.imports}"/>
             <arg value="${nashorn.module.classes.dir}"/>
             <arg value="jdk.nashorn.internal.objects"/>
             <arg value="${nashorn.module.classes.dir}"/>
--- a/nashorn/make/build.xml	Thu May 05 17:35:50 2016 +0000
+++ b/nashorn/make/build.xml	Thu May 05 19:10:51 2016 +0000
@@ -35,7 +35,6 @@
     <path id="nashorn.jar.path">
          <pathelement location="${nashorn.jar}"/>
     </path>
-    <property name="nashorn.override.option" value="-Xpatch:${build.classes.dir}"/>
     <condition property="svn.executable" value="/usr/local/bin/svn" else="svn">
       <available file="/usr/local/bin/svn"/>
     </condition>
@@ -176,6 +175,10 @@
       <compilerarg value="-Xdiags:verbose"/>
       <compilerarg value="-parameters"/>
     </javac>
+    <!-- -Xpatch does not like module-info.class files! -->
+    <delete>
+      <fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
+    </delete>
     <javac srcdir="${nashorn.module.src.dir}"
            destdir="${nashorn.module.classes.dir}"
            source="${javac.source}"
@@ -187,8 +190,12 @@
       <compilerarg value="-XDignore.symbol.file"/>
       <compilerarg value="-Xdiags:verbose"/>
       <compilerarg value="-parameters"/>
-      <compilerarg value="${nashorn.override.option}"/>
+      <compilerarg line="${nashorn.override.option}"/>
     </javac>
+    <!-- -Xpatch does not like module-info.class files! -->
+    <delete>
+      <fileset dir="${build.classes.dir}" includes="**/module-info.class"/>
+    </delete>
     <javac srcdir="${nashorn.shell.module.src.dir}"
            destdir="${nashorn.shell.module.classes.dir}"
            source="${javac.source}"
@@ -200,7 +207,7 @@
       <compilerarg value="-XDignore.symbol.file"/>
       <compilerarg value="-Xdiags:verbose"/>
       <compilerarg value="-parameters"/>
-      <compilerarg value="${nashorn.override.option}"/>
+      <compilerarg line="${nashorn.override.option}"/>
     </javac>
     <!-- -Xpatch does not like module-info.class files! -->
     <delete>
@@ -348,11 +355,11 @@
            debug="${javac.debug}"
            encoding="${javac.encoding}"
            includeantruntime="false" fork="true">
-        <compilerarg value="${nashorn.override.option}"/>
+        <compilerarg line="${nashorn.override.option}"/>
         <compilerarg value="-Xlint:unchecked"/>
         <compilerarg value="-Xlint:deprecation"/>
         <compilerarg value="-Xdiags:verbose"/>
-        <compilerarg value="-XaddExports:${test.module.imports}"/>
+        <compilerarg line="${test.module.imports}"/>
     </javac>
 
     <copy todir="${build.test.classes.dir}/META-INF/services">
--- a/nashorn/make/project.properties	Thu May 05 17:35:50 2016 +0000
+++ b/nashorn/make/project.properties	Thu May 05 19:10:51 2016 +0000
@@ -47,6 +47,11 @@
 build.zip=${build.dir}/nashorn.zip
 build.gzip=${build.dir}/nashorn.tar.gz
 
+nashorn.override.option=\
+ -Xpatch:jdk.scripting.nashorn=${build.classes.dir}/jdk.scripting.nashorn \
+ -Xpatch:jdk.scripting.nashorn.shell=${build.classes.dir}/jdk.scripting.nashorn.shell \
+ -Xpatch:jdk.dynalink=${build.classes.dir}/jdk.dynalink
+
 # project directory of <nashorn> ant task
 nashorntask.dir=buildtools/nashorntask
 
@@ -57,8 +62,8 @@
 nasgen.tool=jdk.nashorn.internal.tools.nasgen.Main
 
 nasgen.module.imports=\
-    java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED,\
-    java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
+    -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
+    -XaddExports:java.base/jdk.internal.org.objectweb.asm.util=ALL-UNNAMED
 
 # parallel test runner tool
 parallel.test.runner=jdk.nashorn.internal.test.framework.ParallelTestRunner
@@ -132,19 +137,19 @@
     ${file.reference.snakeyaml.jar}
 
 test.module.imports=\
-    jdk.scripting.nashorn/jdk.nashorn.internal.ir=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.codegen=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.parser=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.objects=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.runtime.doubleconv=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.runtime.events=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.runtime.options=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp.joni=ALL-UNNAMED,\
-    jdk.scripting.nashorn/jdk.nashorn.tools=ALL-UNNAMED,\
-    java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.ir=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.codegen=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.parser=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.objects=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.doubleconv=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.linker=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.events=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.options=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.internal.runtime.regexp.joni=ALL-UNNAMED \
+    -XaddExports:jdk.scripting.nashorn/jdk.nashorn.tools=ALL-UNNAMED \
+    -XaddExports:java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED
 
 meta.inf.dir=${nashorn.module.src.dir}/META-INF
 
@@ -342,8 +347,8 @@
 
 run.test.jvmargs.common=\
   -server \
-  -XaddExports:${test.module.imports} \
-  -Xpatch:${build.classes.dir} \
+  ${test.module.imports} \
+  ${nashorn.override.option} \
   -Dfile.encoding=UTF-8 \
   -Duser.language=${run.test.user.language} \
   -Duser.country=${run.test.user.country} \
--- a/nashorn/test/TEST.ROOT	Thu May 05 17:35:50 2016 +0000
+++ b/nashorn/test/TEST.ROOT	Thu May 05 19:10:51 2016 +0000
@@ -8,4 +8,7 @@
 groups=TEST.groups
 
 # Minimum jtreg version
-requiredVersion=4.2 b01
+requiredVersion=4.2 b02
+
+# Use new form of -Xpatch
+useNewXpatch=true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/JDK-8144711.js	Thu May 05 19:10:51 2016 +0000
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2016, 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.
+ */
+
+/**
+ * JDK-8144711: (x) => x + 1 causes Assertion failure instead of SyntaxError
+ *
+ * @test
+ * @run
+ */
+
+try {
+    eval("(x) => x + 1");
+    throw new Error ("should not reach here");
+} catch (e) {
+    Assert.assertTrue(e instanceof SyntaxError);
+}