Closed neumannt closed 2 months ago
Thank you for the patch. It looks good for me. AUTO_GROW
mode is a remnant of x64 and is unused.
@kawakami-k, what do you think about this?
@herumi I agree to remove AUTO_GROW support from Xbyak_aarch64. How about waiting a couple of weeks for this patch to be merged to make sure no one will have a problem with this patch?
I think we still need the AUTO_GROW
functionality in itself in the sense that the code array has to grow as needed. But the generated code is unaffected by that, we can emit branch instructions immediately.
@neumannt Yes, we can retain the AUTO_GROW
functionality and maintain backward compatibility. However, nowadays, the DontSetProtectRWE
flag is typically set in the CodeGenerator constructor for security reasons, so the AUTO_GROW
feature is likely no longer in use.
@neumannt Thank you for the contribution!
All jumps are performed relative to the current position, and the encoding is computed based upon jmpAddr - codeOffset. Which means that the encoding is unaffected by the absolute position of the code in memory. Thus, it is not necessary to treat the auto-grow mode differently, the encoding can always be computed eagerly.