MCPcopy Create free account
hub / github.com/GJDuck/e9patch / sendSaveRegToStack

Function sendSaveRegToStack

src/e9tool/e9metadata.cpp:566–581  ·  view source on GitHub ↗

* Send instructions that ensure the given register is saved. */

Source from the content-addressed store, hash-verified

564 * Send instructions that ensure the given register is saved.
565 */
566static bool sendSaveRegToStack(FILE *out, CallInfo &info, Register reg)
567{
568 if (info.isSaved(reg))
569 return true;
570 Register rscratch = (info.isClobbered(REGISTER_RAX)? REGISTER_RAX:
571 info.getScratch());
572 auto result = sendPush(out, info.rsp_offset, info.before, reg, rscratch);
573 if (result.first)
574 {
575 // Push was successful:
576 info.push(reg);
577 if (result.second)
578 info.clobber(rscratch);
579 }
580 return result.first;
581}
582
583/*
584 * Send a load (mov/lea) from a memory operand to a register.

Callers 2

sendLoadRegToArgFunction · 0.85
sendLoadArgumentMetadataFunction · 0.85

Calls 6

sendPushFunction · 0.85
isSavedMethod · 0.80
isClobberedMethod · 0.80
getScratchMethod · 0.80
clobberMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected