Creates a new code relocator for copying AArch64 instructions from one memory location to another, taking care to adjust position-dependent instructions accordingly.
Source address to copy instructions from.
Arm64Writer pointed at the desired target memory address.
Indicates whether end-of-block has been reached, i.e. we've reached a branch of any kind, like CALL, JMP, BL, RET.
Indicates whether end-of-input has been reached, e.g. we've reached JMP/B/RET, an instruction after which there may or may not be valid code.
Latest Instruction read so far. Starts out null and changes
on every call to readOne().
Eagerly cleans up memory.
Determines whether either of the IP registers, X16 and X17, is live
at pc.
Peeks at the next Instruction to be written or skipped.
Peeks at the address of the next instruction to be written or skipped.
Picks a register that an exit branching to target may use, or
null if none is known to be free.
Reads the next instruction into the relocator's internal buffer and returns the number of bytes read so far, including previous calls.
You may keep calling this method to keep buffering, or immediately
call either writeOne() or skipOne(). Or, you can buffer up
until the desired point and then call writeAll().
Returns zero when end-of-input is reached, which means the eoi
property is now true.
Reads further until a scratch register is available for jumping
back to the input code, or the end of input is reached. Returns
false if neither happens.
Sets the range of code that register liveness analysis may look at. Branches leaving it are assumed to clobber X16 and X17.
Sets the register that exits from the relocated code may use when it is still untouched by the relocated instructions.
Skips the instruction that would have been written next.
Writes all buffered instructions.
Writes the next buffered instruction.
Relocates machine code for arm64.