From a8ece5cffc60a81806dfe0d2b3b5f41580270904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hannes=20Walln=C3=B6fer?= Date: Fri, 8 Aug 2014 12:50:46 +0200 Subject: [PATCH] 8043956: Make code caching work with optimistic typing and lazy compilation Reviewed-by: attila, lagergren --- nashorn/make/project.properties | 4 +- .../internal/codegen/CodeGenerator.java | 14 +- .../internal/codegen/CompilationPhase.java | 25 ++- .../nashorn/internal/codegen/CompileUnit.java | 53 ----- .../nashorn/internal/codegen/Compiler.java | 95 +++++--- .../internal/codegen/ConstantData.java | 18 +- .../internal/codegen/FindScopeDepths.java | 1 - .../codegen/OptimisticTypesPersistence.java | 52 +---- .../nashorn/internal/codegen/types/Type.java | 77 +++++++ .../jdk/nashorn/internal/ir/FunctionNode.java | 69 +----- .../internal/parser/AbstractParser.java | 7 +- .../jdk/nashorn/internal/parser/Parser.java | 7 +- .../internal/runtime/AccessorProperty.java | 32 +-- .../internal/runtime/CodeInstaller.java | 11 +- .../nashorn/internal/runtime/CodeStore.java | 96 +++++--- .../internal/runtime/CompiledFunction.java | 37 ++- .../internal/runtime/CompiledFunctions.java | 183 --------------- .../jdk/nashorn/internal/runtime/Context.java | 80 ++++--- .../runtime/FinalScriptFunctionData.java | 35 ++- .../internal/runtime/FunctionInitializer.java | 151 +++++++++++++ .../RecompilableScriptFunctionData.java | 210 +++++++++++------- .../internal/runtime/ScriptFunctionData.java | 87 +++++++- .../jdk/nashorn/internal/runtime/Source.java | 19 ++ .../internal/runtime/SpillProperty.java | 8 + ...{CompiledScript.java => StoredScript.java} | 40 ++-- nashorn/src/jdk/nashorn/tools/Shell.java | 1 - nashorn/test/script/trusted/JDK-8006529.js | 4 +- .../runtime/CodeStoreAndPathTest.java | 2 +- 28 files changed, 788 insertions(+), 630 deletions(-) delete mode 100644 nashorn/src/jdk/nashorn/internal/runtime/CompiledFunctions.java create mode 100644 nashorn/src/jdk/nashorn/internal/runtime/FunctionInitializer.java rename nashorn/src/jdk/nashorn/internal/runtime/{CompiledScript.java => StoredScript.java} (78%) diff --git a/nashorn/make/project.properties b/nashorn/make/project.properties index 642793a8e66..9546a40929e 100644 --- a/nashorn/make/project.properties +++ b/nashorn/make/project.properties @@ -217,7 +217,7 @@ test262-test-sys-prop.test.js.framework=\ ${test262.dir}/test/harness/sta.js # testmarkdown test root -testmarkdown-test-sys-prop.test.js.roots=${testmarkdown.dir} +testmarkdown-test-sys-prop.test.js.roots=${testmarkdown.dir} # execute testmarkdown tests in shared nashorn context or not? testmarkdown-test-sys-prop.test.js.shared.context=false @@ -227,7 +227,7 @@ testmarkdown-test-sys-prop.test.js.framework=\ ${test.script.dir}${file.separator}markdown.js # testjfx test root -testjfx-test-sys-prop.test.js.roots=${testjfx.dir} +testjfx-test-sys-prop.test.js.roots=${testjfx.dir} # execute testjfx tests in shared nashorn context or not? testjfx-test-sys-prop.test.js.shared.context=false diff --git a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java index 5b7bf91ab2a..73dfdaa41be 100644 --- a/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java +++ b/nashorn/src/jdk/nashorn/internal/codegen/CodeGenerator.java @@ -250,8 +250,6 @@ final class CodeGenerator extends NodeOperatorVisitor scopeEntryLabels = new ArrayDeque<>(); - private final Set initializedFunctionIds = new HashSet<>(); - private static final Label METHOD_BOUNDARY = new Label(""); private final Deque