Commit a93836fd authored by Marius Wachtler's avatar Marius Wachtler

bjit+rewriter: use const_loader.loadConstIntoReg more often

this saves a few bytes by replacing some movabs imm64, reg with smaller instructions
parent 33baefb0
......@@ -1036,7 +1036,7 @@ void Rewriter::_setupCall(bool has_side_effects, llvm::ArrayRef<RewriterVar*> ar
uintptr_t counter_addr = (uintptr_t)(&picked_slot->num_inside);
if (isLargeConstant(counter_addr)) {
assembler::Register reg = allocReg(Location::any(), preserve);
assembler->mov(assembler::Immediate(counter_addr), reg);
const_loader.loadConstIntoReg(counter_addr, reg);
assembler->incl(assembler::Indirect(reg, 0));
} else {
assembler->incl(assembler::Immediate(counter_addr));
......@@ -1540,7 +1540,7 @@ void Rewriter::commit() {
uintptr_t counter_addr = (uintptr_t)(&picked_slot->num_inside);
if (isLargeConstant(counter_addr)) {
assembler::Register reg = allocReg(Location::any(), getReturnDestination());
assembler->mov(assembler::Immediate(counter_addr), reg);
const_loader.loadConstIntoReg(counter_addr, reg);
assembler->decl(assembler::Indirect(reg, 0));
} else {
assembler->decl(assembler::Immediate(counter_addr));
......
......@@ -1011,8 +1011,7 @@ void JitFragmentWriter::_emitGetLocal(RewriterVar* val_var, const char* name) {
_setupCall(false, {});
{
assembler::ForwardJump jnz(*assembler, assembler::COND_NOT_ZERO);
assembler->mov(assembler::Immediate((uint64_t)name), assembler::RDI);
const_loader.loadConstIntoReg((uint64_t)name, assembler::RDI);
_callOptimalEncoding(assembler::R11, (void*)assertNameDefinedHelper);
registerDecrefInfoHere();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment