# HG changeset patch # User attila # Date 1410269638 -7200 # Node ID ed05e2f4c2dbac2279d301d8a96630e3073e99b1 # Parent 3ed48a01100c1101d53753df285d4986dc8dbb05 8057930: remove eval ID Reviewed-by: hannesw, sundar diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/Lower.java Tue Sep 09 15:33:58 2014 +0200 @@ -71,7 +71,6 @@ import jdk.nashorn.internal.ir.visitor.NodeVisitor; import jdk.nashorn.internal.parser.Token; import jdk.nashorn.internal.parser.TokenType; -import jdk.nashorn.internal.runtime.CodeInstaller; import jdk.nashorn.internal.runtime.Context; import jdk.nashorn.internal.runtime.JSType; import jdk.nashorn.internal.runtime.Source; @@ -93,9 +92,6 @@ private final DebugLogger log; - // needed only to get unique eval id - private final CodeInstaller installer; - /** * Constructor. */ @@ -143,7 +139,6 @@ } }); - this.installer = compiler.getCodeInstaller(); this.log = initLogger(compiler.getContext()); } @@ -566,16 +561,13 @@ private String evalLocation(final IdentNode node) { final Source source = lc.getCurrentFunction().getSource(); final int pos = node.position(); - // Code installer is null when running with --compile-only, use 0 as id in that case - final long id = installer == null ? 0 : installer.getUniqueEvalId(); return new StringBuilder(). append(source.getName()). append('#'). append(source.getLine(pos)). append(':'). append(source.getColumn(pos)). - append("@"). - append(id). + append(""). toString(); } diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeInstaller.java --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeInstaller.java Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/CodeInstaller.java Tue Sep 09 15:33:58 2014 +0200 @@ -80,12 +80,6 @@ public long getUniqueScriptId(); /** - * Get next unique eval id - * @return unique eval id - */ - public long getUniqueEvalId(); - - /** * Store a compiled script for later reuse * @param source the script source * @param mainClassName the main class name diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/Context.java Tue Sep 09 15:33:58 2014 +0200 @@ -196,11 +196,6 @@ } @Override - public long getUniqueEvalId() { - return context.getUniqueEvalId(); - } - - @Override public void storeScript(final String classInfoFile, final Source source, final String mainClassName, final Map classBytes, final Map initializers, final Object[] constants, final int compilationId) { @@ -334,9 +329,6 @@ /** Unique id for script. Used only when --loader-per-compile=false */ private final AtomicLong uniqueScriptId; - /** Unique id for 'eval' */ - private final AtomicLong uniqueEvalId; - /** Optional class filter to use for Java classes. Can be null. */ private final ClassFilter classFilter; @@ -450,7 +442,6 @@ this.uniqueScriptId = new AtomicLong(); } this.errors = errors; - this.uniqueEvalId = new AtomicLong(); // if user passed -classpath option, make a class loader with that and set it as // thread context class loader so that script can access classes from that path. @@ -1190,10 +1181,6 @@ }, CREATE_LOADER_ACC_CTXT); } - private long getUniqueEvalId() { - return uniqueEvalId.getAndIncrement(); - } - private long getUniqueScriptId() { return uniqueScriptId.getAndIncrement(); } diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/test/script/basic/JDK-8030182_2.js --- a/nashorn/test/script/basic/JDK-8030182_2.js Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/test/script/basic/JDK-8030182_2.js Tue Sep 09 15:33:58 2014 +0200 @@ -41,6 +41,6 @@ try { eval(str); } catch (e) { - print(e.stack.replace(/\\/g, '/').replace(/@[0-9]+/, '@')); + print(e.stack.replace(/\\/g, '/')); } diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED --- a/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/test/script/basic/JDK-8030182_2.js.EXPECTED Tue Sep 09 15:33:58 2014 +0200 @@ -1,3 +1,3 @@ ReferenceError: "g" is not defined - at (test/script/basic/JDK-8030182_2.js#42:4@:-1) + at (test/script/basic/JDK-8030182_2.js#42:4:-1) at (test/script/basic/JDK-8030182_2.js:42) diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/test/script/basic/es6/const-empty.js.EXPECTED --- a/nashorn/test/script/basic/es6/const-empty.js.EXPECTED Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/test/script/basic/es6/const-empty.js.EXPECTED Tue Sep 09 15:33:58 2014 +0200 @@ -1,3 +1,3 @@ -SyntaxError: test/script/basic/es6/const-empty.js#33:4@1:2:7 Missing assignment to constant "x" +SyntaxError: test/script/basic/es6/const-empty.js#33:4:2:7 Missing assignment to constant "x" const x; ^ diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/test/script/basic/es6/const-redeclare-extra.js.EXPECTED --- a/nashorn/test/script/basic/es6/const-redeclare-extra.js.EXPECTED Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/test/script/basic/es6/const-redeclare-extra.js.EXPECTED Tue Sep 09 15:33:58 2014 +0200 @@ -1,9 +1,9 @@ -SyntaxError: test/script/basic/es6/const-redeclare-extra.js#36:8@2:3:8 Variable "x" has already been declared +SyntaxError: test/script/basic/es6/const-redeclare-extra.js#36:8:3:8 Variable "x" has already been declared var x = {}; ^ -SyntaxError: test/script/basic/es6/const-redeclare-extra.js#36:8@4:2:8 Variable "x" has already been declared +SyntaxError: test/script/basic/es6/const-redeclare-extra.js#36:8:2:8 Variable "x" has already been declared var x = 2; ^ -SyntaxError: test/script/basic/es6/const-redeclare-extra.js#36:8@4:2:13 Variable "x" has already been declared +SyntaxError: test/script/basic/es6/const-redeclare-extra.js#36:8:2:13 Variable "x" has already been declared function x () {} ^ diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/test/script/basic/es6/const-redeclare.js.EXPECTED --- a/nashorn/test/script/basic/es6/const-redeclare.js.EXPECTED Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/test/script/basic/es6/const-redeclare.js.EXPECTED Tue Sep 09 15:33:58 2014 +0200 @@ -1,3 +1,3 @@ -SyntaxError: test/script/basic/es6/const-redeclare.js#33:4@1:2:6 Variable "x" has already been declared +SyntaxError: test/script/basic/es6/const-redeclare.js#33:4:2:6 Variable "x" has already been declared const x = 2; ^ diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/test/script/basic/es6/let-redeclare-extra.js.EXPECTED --- a/nashorn/test/script/basic/es6/let-redeclare-extra.js.EXPECTED Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/test/script/basic/es6/let-redeclare-extra.js.EXPECTED Tue Sep 09 15:33:58 2014 +0200 @@ -1,15 +1,15 @@ -SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8@2:2:8 Variable "x" has already been declared +SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8:2:8 Variable "x" has already been declared let x = 2; ^ -SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8@4:3:8 Variable "x" has already been declared +SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8:3:8 Variable "x" has already been declared var x = 2; ^ -SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8@4:2:8 Variable "x" has already been declared +SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8:2:8 Variable "x" has already been declared var x = 2; ^ -SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8@4:2:10 Variable "x" has already been declared +SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8:2:10 Variable "x" has already been declared const x = function (){}; ^ -SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8@4:3:13 Variable "a" has already been declared +SyntaxError: test/script/basic/es6/let-redeclare-extra.js#35:8:3:13 Variable "a" has already been declared function a () {}; ^ diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/test/script/basic/es6/let-redeclare.js.EXPECTED --- a/nashorn/test/script/basic/es6/let-redeclare.js.EXPECTED Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/test/script/basic/es6/let-redeclare.js.EXPECTED Tue Sep 09 15:33:58 2014 +0200 @@ -1,3 +1,3 @@ -SyntaxError: test/script/basic/es6/let-redeclare.js#33:4@1:2:4 Variable "x" has already been declared +SyntaxError: test/script/basic/es6/let-redeclare.js#33:4:2:4 Variable "x" has already been declared let x = 2; ^ diff -r 3ed48a01100c -r ed05e2f4c2db nashorn/test/script/basic/es6/let_const_reuse.js.EXPECTED --- a/nashorn/test/script/basic/es6/let_const_reuse.js.EXPECTED Mon Sep 08 18:40:58 2014 +0200 +++ b/nashorn/test/script/basic/es6/let_const_reuse.js.EXPECTED Tue Sep 09 15:33:58 2014 +0200 @@ -1,8 +1,8 @@ ReferenceError: "a" is not defined -SyntaxError: test/script/basic/es6/let_const_reuse.js#35:9@4:3:8 Assignment to constant "a" +SyntaxError: test/script/basic/es6/let_const_reuse.js#35:9:3:8 Assignment to constant "a" a-- ^ -SyntaxError: test/script/basic/es6/let_const_reuse.js#35:9@4:3:8 Assignment to constant "a" +SyntaxError: test/script/basic/es6/let_const_reuse.js#35:9:3:8 Assignment to constant "a" a-- ^ ReferenceError: "a" is not defined