Prechádzať zdrojové kódy

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. :^)
Andreas Kling 2 rokov pred
rodič
commit
d9b543da68

+ 3 - 1
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>();

+ 3 - 1
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);