Skip to content

Conversation

@matthew-mojira
Copy link
Contributor

No description provided.

@matthew-mojira matthew-mojira marked this pull request as draft January 29, 2026 16:37
@matthew-mojira matthew-mojira changed the title Migrate fast interpreter to use macro assembler Migrate fast interpreter gen to use macro assembler Jan 29, 2026
genCopyStackValsToVfp(cnt, r_tmp1);
// Deallocate interpreter frame and return to calling code.
asm.movd_r_i(Target.V3_RET_GPRS[0], 0);
asm.movd_r_i(G(Target.V3_RET_GPRS[0]), 0);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of methods in MacroAssembler for emitting a constant into a register. I think emit_mov_r_i will do here.

saveCallerIVars();
callRuntime(refRuntimeCall(X86_64RT.runtime_checkFuncSigSubtyping), [r_instance, sig_index, r_func_arg], false);
asm.movq_r_r(r_func_arg, Target.V3_RET_GPRS[0]);
asm.movq_r_r(r_func_arg, G(Target.V3_RET_GPRS[0]));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is masm.emit_mov_r_r(kind, reg, reg) for this one.

asm.q.add_r_r(r_stp, handler_length);
}
private def adjustSp(size: int) {
if (size > 0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should let the macro assembler do this check for negative sizes. IIRC the 1-byte addi on intel will do sign extension, which will make it smaller than subi for negative values that fit in one byte.

def TRAPS_STUB = X86_64SpcTrapsStub.new();
def TRAPS_PREGEN = X86_64PreGenStub.new("spc-trap", TRAPS_STUB, genTrapsStub);

def genSpcEntryFunc(ic: X86_64InterpreterCode, w: DataWriter) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a follow-up PR, we might be able to pull this up to the arch-independent part of SPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants