fix(compiler): move register tracking side-effect out of ZEN_ASSERT in copyParam#474
fix(compiler): move register tracking side-effect out of ZEN_ASSERT in copyParam#474ys8888john wants to merge 2 commits into
Conversation
⚡ Performance Regression Check Results✅ Performance Check Passed (interpreter)Performance Benchmark Results (threshold: 25%)
Summary: 194 benchmarks, 0 regressions ✅ Performance Check Passed (multipass)Performance Benchmark Results (threshold: 25%)
Summary: 194 benchmarks, 0 regressions |
| Opnd); | ||
| if (Kind == WASMTypeKind::INTEGER) { | ||
| ZEN_ASSERT(GpRegUsed |= (1 << Reg)); | ||
| GpRegUsed |= (1 << Reg); |
There was a problem hiding this comment.
add change doc and test cases for this
There was a problem hiding this comment.
Change doc added. The original ZEN_ASSERT(GpRegUsed |= (1 << Reg)) was always true so bitwise OR with (1 << Reg) always yields a non-zero result so the assert had no real checking value. The fix simply moves the side-effect out of the assert. Since GpRegUsed is only consumed by another assert (the conflict check above), there's no observable difference in generated code between the buggy and fixed versions, so no test case can meaningfully validate this change.
There was a problem hiding this comment.
Pull request overview
Updates single-pass compiler call-argument handling to avoid relying on ZEN_ASSERT for a side-effect when tracking used registers during copyParam.
Changes:
- Move register-used bitmask updates (
GpRegUsed/FpRegUsed) out ofZEN_ASSERTand into normal statements. - Preserve existing argument move logic while ensuring register tracking always executes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
071817d to
1e49fea
Compare
|
@ys8888john conflict |
…n copyParam Co-authored-by: Aone Copilot <copilot@aone.alibaba-inc.com>
…n copyParam
1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):
2. What is the scope of this PR (e.g. component or file name):
3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):
4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):
5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:
6. Release note