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

Comparison Redirectors #530

Open
LlamaLad7 opened this issue Nov 6, 2021 · 1 comment
Open

Comparison Redirectors #530

LlamaLad7 opened this issue Nov 6, 2021 · 1 comment

Comments

@LlamaLad7
Copy link
Contributor

LlamaLad7 commented Nov 6, 2021

Basically replacing specialised comparison instructions, such as LCMP, IF_ACMPEQ, IF_ICMPGT etc with calls to handler methods that take two arguments and return a boolean.
Could possibly use the existing JUMP point, but that wouldn't be able to handle float, double and long comparisons, and may lead to confusion, as the jump itself is not really being changed, rather the comparison that triggers the jump.
For these reasons a specialised COMPARE injection point might be best.

@Mumfrey
Copy link
Member

Mumfrey commented Nov 8, 2021

The more I think about it the more this makes sense as at least a pale reflection of what I always really wanted rerouters to do. @Redirect is already fairly heavily overloaded so I'm minded to do this as a "specialised redirect" the same way @ModifyConstant is. That provides some scope for having the injection point declared in a more intuitive way (see, CONSTANT vs the @Constant style) where required.

So this is two parts:

  • A specialised injector to handle the condition, which is ultimately just modifying what's on top of the stack
  • A specialised companion injection point which works like BeforeConstant in an enhanced or standard mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants