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

Commit eb88e5b

Browse files
committed
优化数学表达式的JIT编译逻辑,新增编译成功和失败的日志输出,提升调试信息的可用性。
1 parent fbcf6e0 commit eb88e5b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/interpreter/expression_evaluator.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,19 @@ impl<'a> Interpreter<'a> {
8383

8484
// 获取JIT编译器并检查是否应该编译
8585
let jit = jit::get_jit();
86+
87+
// 首先检查是否应该编译(这会增加热点计数器)
8688
if jit.should_compile_math_expression(&key) {
8789
// 尝试编译数学表达式
88-
match jit.compile_math_expression(expr, key.clone(), false) {
90+
match jit.compile_math_expression(expr, key.clone(), true) {
8991
Ok(_compiled) => {
92+
println!("✅ 数学表达式JIT编译成功: {}", key);
9093
// 编译成功,记录在统计中
9194
// 注意:这里我们暂时返回None,因为实际执行需要更复杂的实现
9295
// 但是编译过程已经被记录在统计中
9396
},
94-
Err(_) => {
97+
Err(e) => {
98+
println!("❌ 数学表达式JIT编译失败: {} - {}", key, e);
9599
// 编译失败,继续使用解释执行
96100
}
97101
}

0 commit comments

Comments
 (0)