mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1055034 r=mjrosenb
This commit is contained in:
parent
dcaaaee21d
commit
6296053b68
13
js/src/jit-test/tests/gc/bug-1055034.js
Normal file
13
js/src/jit-test/tests/gc/bug-1055034.js
Normal file
@ -0,0 +1,13 @@
|
||||
function range(n, m) {
|
||||
var result = [];
|
||||
for (var i = n; i < m; i++)
|
||||
result.push(i);
|
||||
return result;
|
||||
}
|
||||
function run(arr, func) {
|
||||
var expected = arr["map"].apply(arr, [func]);
|
||||
function f(m) { return arr["mapPar"].apply(arr, [func, m]); }
|
||||
f({mode:"compile"});
|
||||
f({mode:"seq"});
|
||||
}
|
||||
run(range(0, 1024), function (i) { var a = []; a.length = i; });
|
@ -808,8 +808,14 @@ TraceOneDataRelocation(JSTracer *trc, Iter *iter, MacroAssemblerARM *masm)
|
||||
// No barrier needed since these are constants.
|
||||
gc::MarkGCThingUnbarriered(trc, &ptr, "ion-masm-ptr");
|
||||
|
||||
if (ptr != prior)
|
||||
if (ptr != prior) {
|
||||
masm->ma_movPatchable(Imm32(int32_t(ptr)), dest, Assembler::Always, rs, ins);
|
||||
// L_LDR won't cause any instructions to be updated.
|
||||
if (rs != Assembler::L_LDR) {
|
||||
AutoFlushICache::flush(uintptr_t(ins), 4);
|
||||
AutoFlushICache::flush(uintptr_t(ins->next()), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -280,17 +280,27 @@ Assembler::TraceJumpRelocations(JSTracer *trc, JitCode *code, CompactBufferReade
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
TraceOneDataRelocation(JSTracer *trc, Instruction *inst)
|
||||
{
|
||||
void *ptr = (void *)Assembler::ExtractLuiOriValue(inst, inst->next());
|
||||
void *prior = ptr;
|
||||
|
||||
// No barrier needed since these are constants.
|
||||
gc::MarkGCThingUnbarriered(trc, reinterpret_cast<void **>(&ptr), "ion-masm-ptr");
|
||||
if (ptr != prior) {
|
||||
Assembler::UpdateLuiOriValue(inst, inst->next(), uint32_t(ptr));
|
||||
AutoFlushICache::flush(uintptr_t(inst), 8);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
TraceDataRelocations(JSTracer *trc, uint8_t *buffer, CompactBufferReader &reader)
|
||||
{
|
||||
while (reader.more()) {
|
||||
size_t offset = reader.readUnsigned();
|
||||
Instruction *inst = (Instruction*)(buffer + offset);
|
||||
void *ptr = (void *)Assembler::ExtractLuiOriValue(inst, inst->next());
|
||||
|
||||
// No barrier needed since these are constants.
|
||||
gc::MarkGCThingUnbarriered(trc, reinterpret_cast<void **>(&ptr), "ion-masm-ptr");
|
||||
Assembler::UpdateLuiOriValue(inst, inst->next(), uint32_t(ptr));
|
||||
TraceOneDataRelocation(trc, inst);
|
||||
}
|
||||
}
|
||||
|
||||
@ -300,12 +310,7 @@ TraceDataRelocations(JSTracer *trc, MIPSBuffer *buffer, CompactBufferReader &rea
|
||||
while (reader.more()) {
|
||||
BufferOffset bo (reader.readUnsigned());
|
||||
MIPSBuffer::AssemblerBufferInstIterator iter(bo, buffer);
|
||||
|
||||
void *ptr = (void *)Assembler::ExtractLuiOriValue(iter.cur(), iter.next());
|
||||
|
||||
// No barrier needed since these are constants.
|
||||
gc::MarkGCThingUnbarriered(trc, reinterpret_cast<void **>(&ptr), "ion-masm-ptr");
|
||||
Assembler::UpdateLuiOriValue(iter.cur(), iter.next(), uint32_t(ptr));
|
||||
TraceOneDataRelocation(trc, iter.cur());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user