mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +00:00
test262-runner+js: Respect the bytecode optimizations enabled flag
This commit is contained in:
parent
aa0ed4ab4e
commit
e012565898
4 changed files with 15 additions and 14 deletions
|
@ -32,6 +32,13 @@ void Interpreter::set_enabled(bool enabled)
|
|||
s_bytecode_interpreter_enabled = enabled;
|
||||
}
|
||||
|
||||
static bool s_optimizations_enabled = false;
|
||||
|
||||
void Interpreter::set_optimizations_enabled(bool enabled)
|
||||
{
|
||||
s_optimizations_enabled = enabled;
|
||||
}
|
||||
|
||||
bool g_dump_bytecode = false;
|
||||
|
||||
Interpreter::Interpreter(VM& vm)
|
||||
|
@ -104,7 +111,7 @@ ThrowCompletionOr<Value> Interpreter::run(Script& script_record, JS::GCPtr<Envir
|
|||
} else {
|
||||
auto executable = executable_result.release_value();
|
||||
|
||||
if (m_optimizations_enabled) {
|
||||
if (s_optimizations_enabled) {
|
||||
auto& passes = optimization_pipeline();
|
||||
passes.perform(*executable);
|
||||
}
|
||||
|
@ -173,11 +180,6 @@ ThrowCompletionOr<Value> Interpreter::run(SourceTextModule& module)
|
|||
return js_undefined();
|
||||
}
|
||||
|
||||
void Interpreter::set_optimizations_enabled(bool enabled)
|
||||
{
|
||||
m_optimizations_enabled = enabled;
|
||||
}
|
||||
|
||||
Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Realm& realm, Executable const& executable, BasicBlock const* entry_point, RegisterWindow* in_frame)
|
||||
{
|
||||
dbgln_if(JS_BYTECODE_DEBUG, "Bytecode::Interpreter will run unit {:p}", &executable);
|
||||
|
|
|
@ -31,6 +31,7 @@ class Interpreter {
|
|||
public:
|
||||
[[nodiscard]] static bool enabled();
|
||||
static void set_enabled(bool);
|
||||
static void set_optimizations_enabled(bool);
|
||||
|
||||
explicit Interpreter(VM&);
|
||||
~Interpreter();
|
||||
|
@ -38,8 +39,6 @@ public:
|
|||
Realm& realm();
|
||||
VM& vm() { return m_vm; }
|
||||
|
||||
void set_optimizations_enabled(bool);
|
||||
|
||||
ThrowCompletionOr<Value> run(Script&, JS::GCPtr<Environment> lexical_environment_override = nullptr);
|
||||
ThrowCompletionOr<Value> run(SourceTextModule&);
|
||||
|
||||
|
@ -123,7 +122,6 @@ private:
|
|||
OwnPtr<JS::Interpreter> m_ast_interpreter;
|
||||
BasicBlock const* m_current_block { nullptr };
|
||||
InstructionStreamIterator* m_pc { nullptr };
|
||||
bool m_optimizations_enabled { false };
|
||||
};
|
||||
|
||||
extern bool g_dump_bytecode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue