@@ -75,6 +75,7 @@ def run_streaming_script(
7575 libjs_test262_runner : Path ,
7676 test262_root : Path ,
7777 use_bytecode : bool ,
78+ enable_bytecode_optimizations : bool ,
7879 extra_runner_options : list [str ],
7980 timeout : int ,
8081 memory_limit : int ,
@@ -88,6 +89,7 @@ def limit_memory():
8889 command = [
8990 str (libjs_test262_runner ),
9091 * (["-b" ] if use_bytecode else []),
92+ * (["-e" ] if enable_bytecode_optimizations else []),
9193 * extra_runner_options ,
9294 "--harness-location" ,
9395 str ((test262_root / "harness" ).resolve ()),
@@ -112,6 +114,7 @@ def run_tests(
112114 test262_root : Path ,
113115 test_file_paths : list [Path ],
114116 use_bytecode : bool ,
117+ enable_bytecode_optimizations : bool ,
115118 extra_runner_options : list [str ],
116119 timeout : int ,
117120 memory_limit : int ,
@@ -147,6 +150,7 @@ def add_result(
147150 libjs_test262_runner ,
148151 test262_root ,
149152 use_bytecode ,
153+ enable_bytecode_optimizations ,
150154 extra_runner_options ,
151155 timeout ,
152156 memory_limit ,
@@ -258,6 +262,7 @@ def __init__(
258262 silent : bool = False ,
259263 verbose : bool = False ,
260264 use_bytecode : bool = False ,
265+ enable_bytecode_optimizations : bool = False ,
261266 track_per_file : bool = False ,
262267 fail_only : bool = False ,
263268 extra_runner_options : list [str ] | None = None ,
@@ -272,6 +277,7 @@ def __init__(
272277 self .silent = silent
273278 self .verbose = verbose
274279 self .use_bytecode = use_bytecode
280+ self .enable_bytecode_optimizations = enable_bytecode_optimizations
275281 self .track_per_file = track_per_file
276282 self .fail_only = fail_only
277283 self .files : list [Path ] = []
@@ -400,6 +406,7 @@ def process_list(self, files: list[Path]) -> list[TestRun]:
400406 self .test262_root ,
401407 files ,
402408 use_bytecode = self .use_bytecode ,
409+ enable_bytecode_optimizations = self .enable_bytecode_optimizations ,
403410 extra_runner_options = self .extra_runner_options ,
404411 timeout = self .timeout ,
405412 memory_limit = self .memory_limit ,
@@ -518,6 +525,12 @@ def main() -> None:
518525 action = "store_true" ,
519526 help = "Use the bytecode interpreter to run the tests" ,
520527 )
528+ parser .add_argument (
529+ "-e" ,
530+ "--enable-bytecode-optimizations" ,
531+ action = "store_true" ,
532+ help = "Enable the bytecode optimization passes" ,
533+ )
521534 parser .add_argument (
522535 "-t" ,
523536 "--test262-root" ,
@@ -619,6 +632,7 @@ def main() -> None:
619632 args .silent ,
620633 args .verbose ,
621634 args .use_bytecode ,
635+ args .enable_bytecode_optimizations ,
622636 args .per_file is not None ,
623637 args .fail_only ,
624638 extra_runner_options ,
0 commit comments