summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-10-19 14:35:26 +0200
committerAndreas Kling <kling@serenityos.org>2022-10-19 14:37:57 +0200
commitd9b543da68fd8e9f4d7a06e462380390c323395a (patch)
tree7800941bff0d2ed99dd0e1edaa802b998c8eee45 /Userland/Libraries
parent8fc4c5d27bbac040e123d98ebe3d1b463b865d92 (diff)
downloadserenity-d9b543da68fd8e9f4d7a06e462380390c323395a.zip
LibJS: Disable bytecode optimizations by default
The optimization passes are not stable, which makes test262 flaky. Address this by introducing a new OptimizationLevel::None and making it the default. This removes all the flakiness from test262 in my testing. We can enable optimizations by default again once they have been made stable. :^)
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Interpreter.cpp4
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Interpreter.h4
2 files changed, 6 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
index d5934759d9..492fa85874 100644
--- a/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.cpp
@@ -217,7 +217,9 @@ Bytecode::PassManager& Interpreter::optimization_pipeline(Interpreter::Optimizat
return *entry;
auto pm = make<PassManager>();
- if (level == OptimizationLevel::Default) {
+ if (level == OptimizationLevel::None) {
+ // No optimization.
+ } else if (level == OptimizationLevel::Optimize) {
pm->add<Passes::GenerateCFG>();
pm->add<Passes::UnifySameBlocks>();
pm->add<Passes::GenerateCFG>();
diff --git a/Userland/Libraries/LibJS/Bytecode/Interpreter.h b/Userland/Libraries/LibJS/Bytecode/Interpreter.h
index eafa76e6db..82883ced7f 100644
--- a/Userland/Libraries/LibJS/Bytecode/Interpreter.h
+++ b/Userland/Libraries/LibJS/Bytecode/Interpreter.h
@@ -66,8 +66,10 @@ public:
Executable const& current_executable() { return *m_current_executable; }
enum class OptimizationLevel {
- Default,
+ None,
+ Optimize,
__Count,
+ Default = None,
};
static Bytecode::PassManager& optimization_pipeline(OptimizationLevel = OptimizationLevel::Default);