Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit ff410ba

Browse files
committed
优化JIT编译器中的输出方式,使用调试打印替代标准输出,提升代码可读性和调试便利性。
1 parent 8ec96c0 commit ff410ba

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/interpreter/jit.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,18 +1354,14 @@ impl JitCompiler {
13541354
key: String,
13551355
debug_mode: bool
13561356
) -> Result<CompiledMathExpression, String> {
1357-
if debug_mode {
1358-
println!("🧮 JIT: 尝试编译数学表达式 {}", key);
1359-
}
1357+
crate::jit_debug_println!("🧮 JIT: 尝试编译数学表达式 {}", key);
13601358

13611359
// 识别表达式类型和选择优化策略
13621360
let expr_type = self.identify_math_expression_type(expression);
13631361
let complexity = self.calculate_expression_complexity(expression);
13641362
let optimization = self.select_math_optimization(&expr_type, complexity);
13651363

1366-
if debug_mode {
1367-
println!("🔍 JIT: 表达式类型: {:?}, 优化策略: {:?}", expr_type, optimization);
1368-
}
1364+
crate::jit_debug_println!("🔍 JIT: 表达式类型: {:?}, 优化策略: {:?}", expr_type, optimization);
13691365

13701366
// 根据优化策略选择编译方法
13711367
let compiled_result = match optimization {
@@ -1413,9 +1409,7 @@ impl JitCompiler {
14131409
expr_type: MathExpressionType,
14141410
debug_mode: bool
14151411
) -> Result<CompiledMathExpression, String> {
1416-
if debug_mode {
1417-
println!("🚀 JIT: SIMD编译数学表达式");
1418-
}
1412+
crate::jit_debug_println!("🚀 JIT: SIMD编译数学表达式");
14191413

14201414
// 简化实现:创建占位符编译结果
14211415
let signature = MathExpressionSignature {
@@ -1498,9 +1492,7 @@ impl JitCompiler {
14981492
expr_type: MathExpressionType,
14991493
debug_mode: bool
15001494
) -> Result<CompiledMathExpression, String> {
1501-
if debug_mode {
1502-
println!("🔧 JIT: 标准编译数学表达式");
1503-
}
1495+
crate::jit_debug_println!("🔧 JIT: 标准编译数学表达式");
15041496

15051497
let signature = MathExpressionSignature {
15061498
expression_desc: key.clone(),

0 commit comments

Comments
 (0)