diff --git a/src/asm_writing/assembler.cpp b/src/asm_writing/assembler.cpp index 815337ec4af260ff77484e29e6c162c6d99163ab..baef315b04a82c46a6c5b5a512763fdcfd36e721 100644 --- a/src/asm_writing/assembler.cpp +++ b/src/asm_writing/assembler.cpp @@ -1141,6 +1141,7 @@ void Assembler::skipBytes(int num) { ForwardJump::ForwardJump(Assembler& assembler, ConditionCode condition) : assembler(assembler), condition(condition), jmp_inst(assembler.curInstPointer()) { assembler.jmp_cond(JumpDestination::fromStart(assembler.bytesWritten() + max_jump_size), condition); + jmp_end = assembler.curInstPointer(); } ForwardJump::~ForwardJump() { @@ -1149,6 +1150,8 @@ ForwardJump::~ForwardJump() { RELEASE_ASSERT(offset < max_jump_size, ""); assembler.setCurInstPointer(jmp_inst); assembler.jmp_cond(JumpDestination::fromStart(assembler.bytesWritten() + offset), condition); + while (assembler.curInstPointer() < jmp_end) + assembler.nop(); assembler.setCurInstPointer(new_pos); } } diff --git a/src/asm_writing/assembler.h b/src/asm_writing/assembler.h index ce586d6defbdfc83eb2ee22bf9dc71af4d8257fe..26fa568b461b5cc6701419171a650c4b0e686661 100644 --- a/src/asm_writing/assembler.h +++ b/src/asm_writing/assembler.h @@ -216,10 +216,11 @@ public: // generated conditional jump with the correct offset depending on the number of bytes emitted in between. class ForwardJump { private: - const int max_jump_size = 128; + const int max_jump_size = 1048587; Assembler& assembler; ConditionCode condition; uint8_t* jmp_inst; + uint8_t* jmp_end; public: ForwardJump(Assembler& assembler, ConditionCode condition); diff --git a/src/codegen/baseline_jit.cpp b/src/codegen/baseline_jit.cpp index 77e1dc7190915c14765e430e7af7b3ab004eea39..637c7818238f5c76591e6a3c5387280a80aa5338 100644 --- a/src/codegen/baseline_jit.cpp +++ b/src/codegen/baseline_jit.cpp @@ -561,7 +561,9 @@ void JitFragmentWriter::emitSetLocal(InternedString s, int vreg, bool set_closur } else { RewriterVar* prev = vregs_array->getAttr(8 * vreg); vregs_array->setAttr(8 * vreg, v); - prev->xdecref(); + // XXX: this either needs to be an xdecref or we should check liveness analysis. + prev->decref(); + //prev->xdecref(); } }