Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor - Stops clobbering FRAME_PTR_REG in ANCHOR_INTERNAL_FUNCTION_CALL_REG #637

Merged

Conversation

Lichtso
Copy link

@Lichtso Lichtso commented Nov 26, 2024

No description provided.

self.emit_ins(X86Instruction::mov(OperandSize::S64, reg, REGISTER_MAP[FRAME_PTR_REG]));
// REGISTER_SCRATCH contains self.pc, and we must store it for proper error handling.
// We can discard the value if callx succeeds, so we are not incrementing the stack pointer (RSP).
self.emit_ins(X86Instruction::store(OperandSize::S64, REGISTER_SCRATCH, RSP, X86IndirectAccess::OffsetIndexShift(-24, RSP, 0)));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to use another x86 register here? I'm concerned that adding loads and stores may impact performance.

Copy link
Author

@Lichtso Lichtso Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the same store that was inside the anchored subroutine before, just inlined here. The only thing this makes worse is more bytes emitted per callx.

@Lichtso Lichtso force-pushed the refactor/FRAME_PTR_REG_in_ANCHOR_INTERNAL_FUNCTION_CALL_REG branch from 52168af to ea2b29a Compare November 27, 2024 11:29
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.99%. Comparing base (1223789) to head (ea2b29a).
Report is 27 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #637      +/-   ##
==========================================
- Coverage   90.09%   89.99%   -0.11%     
==========================================
  Files          22       22              
  Lines        9726    10314     +588     
==========================================
+ Hits         8763     9282     +519     
- Misses        963     1032      +69     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Lichtso Lichtso merged commit c16589f into main Nov 27, 2024
12 checks passed
@Lichtso Lichtso deleted the refactor/FRAME_PTR_REG_in_ANCHOR_INTERNAL_FUNCTION_CALL_REG branch November 27, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants