8223451: Make optimistic types disabled by default
Reviewed-by: sundar, jlaskey, attila
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties Thu Jul 11 15:38:09 2019 +0200
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties Thu Jul 11 16:43:15 2019 +0200
@@ -288,7 +288,7 @@
name="--optimistic-types", \
short_name="-ot", \
desc="Use optimistic type assumptions with deoptimizing recompilation. This makes the compiler try, for any program symbol whose type cannot be proven at compile time, to type it as narrow and primitive as possible. If the runtime encounters an error because symbol type is too narrow, a wider method will be generated until steady stage is reached. While this produces as optimal Java Bytecode as possible, erroneous type guesses will lead to longer warmup. Optimistic typing is currently enabled by default, but can be disabled for faster startup performance.", \
- default=true \
+ default=false \
}
nashorn.option.parse.only = { \
--- a/test/nashorn/script/nosecurity/logcoverage.js Thu Jul 11 15:38:09 2019 +0200
+++ b/test/nashorn/script/nosecurity/logcoverage.js Thu Jul 11 16:43:15 2019 +0200
@@ -27,7 +27,7 @@
*
* @test
* @fork
- * @option -Dnashorn.debug=true
+ * @option -Dnashorn.debug=true -ot=true
*/
/*
@@ -98,8 +98,8 @@
print("check ok!");
}
-str = runScriptEngine(["--log=codegen,compiler=finest,methodhandles=finest,fields=finest"], __DIR__ + "../basic/NASHORN-19.js");
-str += runScriptEngine(["--log=codegen,compiler=finest,methodhandles=finest,fields=finest"], __DIR__ + "../basic/varargs.js");
+str = runScriptEngine(["--log=codegen,compiler=finest,methodhandles=finest,fields=finest", "-ot=true"], __DIR__ + "../basic/NASHORN-19.js");
+str += runScriptEngine(["--log=codegen,compiler=finest,methodhandles=finest,fields=finest", "-ot=true"], __DIR__ + "../basic/varargs.js");
check(str, methodsCalled);
check(str, ['return', 'get', 'set', '[fields]']);