From d9b543da68fd8e9f4d7a06e462380390c323395a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 19 Oct 2022 14:35:26 +0200 Subject: 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. :^) --- Userland/Libraries/LibJS/Bytecode/Interpreter.cpp | 4 +++- Userland/Libraries/LibJS/Bytecode/Interpreter.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries') 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(); - if (level == OptimizationLevel::Default) { + if (level == OptimizationLevel::None) { + // No optimization. + } else if (level == OptimizationLevel::Optimize) { pm->add(); pm->add(); pm->add(); 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); -- cgit v1.2.3