|
@@ -337,18 +337,11 @@ inline JSFileResult TestRunner::run_file_test(const String& test_path)
|
|
|
}
|
|
|
|
|
|
if (g_run_bytecode) {
|
|
|
- auto unit = JS::Bytecode::Generator::generate(m_test_script->parse_node());
|
|
|
- if (g_dump_bytecode) {
|
|
|
- for (auto& block : unit.basic_blocks)
|
|
|
- block.dump(unit);
|
|
|
- if (!unit.string_table->is_empty()) {
|
|
|
- outln();
|
|
|
- unit.string_table->dump();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ auto executable = JS::Bytecode::Generator::generate(m_test_script->parse_node());
|
|
|
+ if (g_dump_bytecode)
|
|
|
+ executable.dump();
|
|
|
JS::Bytecode::Interpreter bytecode_interpreter(interpreter->global_object(), interpreter->realm());
|
|
|
- bytecode_interpreter.run(unit);
|
|
|
+ bytecode_interpreter.run(executable);
|
|
|
} else {
|
|
|
interpreter->run(interpreter->global_object(), m_test_script->parse_node());
|
|
|
}
|
|
@@ -359,18 +352,11 @@ inline JSFileResult TestRunner::run_file_test(const String& test_path)
|
|
|
if (file_script.is_error())
|
|
|
return { test_path, file_script.error() };
|
|
|
if (g_run_bytecode) {
|
|
|
- auto unit = JS::Bytecode::Generator::generate(file_script.value()->parse_node());
|
|
|
- if (g_dump_bytecode) {
|
|
|
- for (auto& block : unit.basic_blocks)
|
|
|
- block.dump(unit);
|
|
|
- if (!unit.string_table->is_empty()) {
|
|
|
- outln();
|
|
|
- unit.string_table->dump();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ auto executable = JS::Bytecode::Generator::generate(file_script.value()->parse_node());
|
|
|
+ if (g_dump_bytecode)
|
|
|
+ executable.dump();
|
|
|
JS::Bytecode::Interpreter bytecode_interpreter(interpreter->global_object(), interpreter->realm());
|
|
|
- bytecode_interpreter.run(unit);
|
|
|
+ bytecode_interpreter.run(executable);
|
|
|
} else {
|
|
|
interpreter->run(interpreter->global_object(), file_script.value()->parse_node());
|
|
|
}
|