Commit 9ba5553
committed
Fix JIT regression when code cache flushes during translation
This addresses critical issues in the JIT compiler that caused failures,
particularly noticeable when ENABLE_EXT_F=0:
1. Check translation success before execution: The emulator now verifies
that jit_translate() successfully marked a block as "hot" before
attempting to execute the JIT-compiled code. This prevents execution
of incomplete or failed translations.
2. Reset jump count on cache flush: The state->n_jumps counter was not
being reset during code_cache_flush(), causing stale jump entries to
persist and corrupt subsequent translations.
3. Mark incomplete translations properly: When a cache flush occurs
mid-translation, the block is now correctly marked as not hot,
ensuring it won't be mistakenly executed as valid JIT code.
These fixes resolve the non-deterministic test failures observed in
the pi calculation test and other compute-intensive benchmarks.1 parent 4b61b26 commit 9ba5553
2 files changed
+13
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1155 | 1155 | | |
1156 | 1156 | | |
1157 | 1157 | | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
1162 | 1166 | | |
1163 | 1167 | | |
1164 | 1168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
| 614 | + | |
614 | 615 | | |
615 | 616 | | |
616 | 617 | | |
| |||
2167 | 2168 | | |
2168 | 2169 | | |
2169 | 2170 | | |
| 2171 | + | |
2170 | 2172 | | |
2171 | 2173 | | |
2172 | 2174 | | |
| |||
2320 | 2322 | | |
2321 | 2323 | | |
2322 | 2324 | | |
| 2325 | + | |
| 2326 | + | |
| 2327 | + | |
2323 | 2328 | | |
2324 | 2329 | | |
2325 | 2330 | | |
| |||
0 commit comments