Mixin icon indicating copy to clipboard operation
Mixin copied to clipboard

Comparison Redirectors

Open LlamaLad7 opened this issue 2 years ago • 1 comments

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.

LlamaLad7 avatar Nov 06 '21 15:11 LlamaLad7

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

Mumfrey avatar Nov 08 '21 18:11 Mumfrey