8223451: Make optimistic types disabled by default
authorhannesw
Thu, 11 Jul 2019 16:43:15 +0200
changeset 55657 107ebf94ddcc
parent 55656 1346086863a3
child 55658 a35a210e6c0f
8223451: Make optimistic types disabled by default Reviewed-by: sundar, jlaskey, attila
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties
test/nashorn/script/nosecurity/logcoverage.js
--- 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]']);