Commit 1f7b7ea5 authored by Kevin Modzelewski's avatar Kevin Modzelewski

xxx: testing / workarounds

parent 3cc1f4d8
...@@ -1141,6 +1141,7 @@ void Assembler::skipBytes(int num) { ...@@ -1141,6 +1141,7 @@ void Assembler::skipBytes(int num) {
ForwardJump::ForwardJump(Assembler& assembler, ConditionCode condition) ForwardJump::ForwardJump(Assembler& assembler, ConditionCode condition)
: assembler(assembler), condition(condition), jmp_inst(assembler.curInstPointer()) { : assembler(assembler), condition(condition), jmp_inst(assembler.curInstPointer()) {
assembler.jmp_cond(JumpDestination::fromStart(assembler.bytesWritten() + max_jump_size), condition); assembler.jmp_cond(JumpDestination::fromStart(assembler.bytesWritten() + max_jump_size), condition);
jmp_end = assembler.curInstPointer();
} }
ForwardJump::~ForwardJump() { ForwardJump::~ForwardJump() {
...@@ -1149,6 +1150,8 @@ ForwardJump::~ForwardJump() { ...@@ -1149,6 +1150,8 @@ ForwardJump::~ForwardJump() {
RELEASE_ASSERT(offset < max_jump_size, ""); RELEASE_ASSERT(offset < max_jump_size, "");
assembler.setCurInstPointer(jmp_inst); assembler.setCurInstPointer(jmp_inst);
assembler.jmp_cond(JumpDestination::fromStart(assembler.bytesWritten() + offset), condition); assembler.jmp_cond(JumpDestination::fromStart(assembler.bytesWritten() + offset), condition);
while (assembler.curInstPointer() < jmp_end)
assembler.nop();
assembler.setCurInstPointer(new_pos); assembler.setCurInstPointer(new_pos);
} }
} }
......
...@@ -216,10 +216,11 @@ public: ...@@ -216,10 +216,11 @@ public:
// generated conditional jump with the correct offset depending on the number of bytes emitted in between. // generated conditional jump with the correct offset depending on the number of bytes emitted in between.
class ForwardJump { class ForwardJump {
private: private:
const int max_jump_size = 128; const int max_jump_size = 1048587;
Assembler& assembler; Assembler& assembler;
ConditionCode condition; ConditionCode condition;
uint8_t* jmp_inst; uint8_t* jmp_inst;
uint8_t* jmp_end;
public: public:
ForwardJump(Assembler& assembler, ConditionCode condition); ForwardJump(Assembler& assembler, ConditionCode condition);
......
...@@ -561,7 +561,9 @@ void JitFragmentWriter::emitSetLocal(InternedString s, int vreg, bool set_closur ...@@ -561,7 +561,9 @@ void JitFragmentWriter::emitSetLocal(InternedString s, int vreg, bool set_closur
} else { } else {
RewriterVar* prev = vregs_array->getAttr(8 * vreg); RewriterVar* prev = vregs_array->getAttr(8 * vreg);
vregs_array->setAttr(8 * vreg, v); 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();
} }
} }
......
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