From 8582a61317a5a4db3c293a12138b07501fd255c5 Mon Sep 17 00:00:00 2001 From: "Victor M. Alvarez" Date: Mon, 18 Nov 2024 13:51:59 +0100 Subject: [PATCH] chore: enable hoisting by default. --- lib/src/compiler/ir/tests/mod.rs | 9 ++++++++- lib/src/compiler/mod.rs | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/src/compiler/ir/tests/mod.rs b/lib/src/compiler/ir/tests/mod.rs index d3d63de9..8ee3f3a3 100644 --- a/lib/src/compiler/ir/tests/mod.rs +++ b/lib/src/compiler/ir/tests/mod.rs @@ -103,7 +103,12 @@ fn ir() { let mut compiler = Compiler::new(); let w = BufWriter::new(output_file); - compiler.set_ir_writer(w).add_source(source.as_str()).unwrap(); + compiler + .common_subexpression_elimination(false) + .hoisting(false) + .set_ir_writer(w) + .add_source(source.as_str()) + .unwrap(); #[cfg(feature = "constant-folding")] { @@ -114,6 +119,7 @@ fn ir() { compiler .common_subexpression_elimination(true) + .hoisting(false) .set_ir_writer(w) .add_source(source.as_str()) .unwrap(); @@ -124,6 +130,7 @@ fn ir() { let w = BufWriter::new(output_file); compiler + .common_subexpression_elimination(false) .hoisting(true) .set_ir_writer(w) .add_source(source.as_str()) diff --git a/lib/src/compiler/mod.rs b/lib/src/compiler/mod.rs index b2e72432..b5d1a4e7 100644 --- a/lib/src/compiler/mod.rs +++ b/lib/src/compiler/mod.rs @@ -454,7 +454,7 @@ impl<'a> Compiler<'a> { wasm_exports, relaxed_re_syntax: false, cse: false, - hoisting: false, + hoisting: true, error_on_slow_pattern: false, error_on_slow_loop: false, next_pattern_id: PatternId(0),