mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
test262-runner: Add option to enable bytecode optimizations
This commit is contained in:
parent
6dbe7b06b3
commit
1141e2b56a
Notes:
sideshowbarker
2024-07-17 07:35:03 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/1141e2b56a Pull-request: https://github.com/SerenityOS/serenity/pull/16294
1 changed files with 4 additions and 1 deletions
|
@ -33,6 +33,7 @@
|
|||
|
||||
static String s_current_test = "";
|
||||
static bool s_use_bytecode = false;
|
||||
static bool s_enable_bytecode_optimizations = false;
|
||||
static bool s_parse_only = false;
|
||||
static String s_harness_file_directory;
|
||||
static bool s_automatic_harness_detection_mode = false;
|
||||
|
@ -95,7 +96,8 @@ static Result<void, TestError> run_program(InterpreterT& interpreter, ScriptOrMo
|
|||
result = JS::throw_completion(JS::InternalError::create(interpreter.realm(), String::formatted("TODO({})", unit_result.error().to_string())));
|
||||
} else {
|
||||
auto unit = unit_result.release_value();
|
||||
auto& passes = JS::Bytecode::Interpreter::optimization_pipeline();
|
||||
auto optimization_level = s_enable_bytecode_optimizations ? JS::Bytecode::Interpreter::OptimizationLevel::Optimize : JS::Bytecode::Interpreter::OptimizationLevel::Default;
|
||||
auto& passes = JS::Bytecode::Interpreter::optimization_pipeline(optimization_level);
|
||||
passes.perform(*unit);
|
||||
result = interpreter.run(*unit);
|
||||
}
|
||||
|
@ -586,6 +588,7 @@ int main(int argc, char** argv)
|
|||
args_parser.set_general_help("LibJS test262 runner for streaming tests");
|
||||
args_parser.add_option(s_harness_file_directory, "Directory containing the harness files", "harness-location", 'l', "harness-files");
|
||||
args_parser.add_option(s_use_bytecode, "Use the bytecode interpreter", "use-bytecode", 'b');
|
||||
args_parser.add_option(s_enable_bytecode_optimizations, "Enable the bytecode optimization passes", "enable-bytecode-optimizations", 'e');
|
||||
args_parser.add_option(s_parse_only, "Only parse the files", "parse-only", 'p');
|
||||
args_parser.add_option(timeout, "Seconds before test should timeout", "timeout", 't', "seconds");
|
||||
args_parser.add_option(enable_debug_printing, "Enable debug printing", "debug", 'd');
|
||||
|
|
Loading…
Add table
Reference in a new issue