mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 754150 - Add write barrier on JITChunk (r=bhackett)
This commit is contained in:
parent
b61d1b7021
commit
c1a8f61f0e
40
js/src/jit-test/tests/basic/bug754150.js
Normal file
40
js/src/jit-test/tests/basic/bug754150.js
Normal file
@ -0,0 +1,40 @@
|
||||
// |jit-test| error: TypeError;
|
||||
function printStatus (msg) {}
|
||||
function toPrinted(value) {
|
||||
value = value.replace(/\\n/g, 'NL')
|
||||
}
|
||||
function reportCompare (expected, actual, description) {
|
||||
printStatus ("Expected value '" + toPrinted(expected) + "' matched actual value '" + toPrinted(actual) + "'");
|
||||
}
|
||||
var UBound = 0;
|
||||
var statusitems = [];
|
||||
var actual = '';
|
||||
var actualvalues = [];
|
||||
var expect= '';
|
||||
var expectedvalues = [];
|
||||
testThis('x()');
|
||||
testThis('"abc"()');
|
||||
testThis('x()');
|
||||
testThis('Date(12345)()');
|
||||
testThis('x()');
|
||||
testThis('1()');
|
||||
testThis('x()');
|
||||
testThis('void(0)()');
|
||||
testThis('x()');
|
||||
testThis('[1,2,3,4,5](1)');
|
||||
gczeal(4);
|
||||
testThis('x(1)');
|
||||
checkThis('(function (y) {return y+1;})("abc")');
|
||||
checkThis('f("abc")');
|
||||
function testThis(sInvalidSyntax) {
|
||||
expectedvalues[UBound] = expect;
|
||||
actualvalues[UBound] = actual;
|
||||
UBound++;
|
||||
}
|
||||
function checkThis(sValidSyntax) {
|
||||
for (var i=0; i<UBound; i++)
|
||||
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
|
||||
}
|
||||
var actualvalues = [];
|
||||
for (var i=0; i<UBound; i++)
|
||||
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
|
@ -1302,6 +1302,13 @@ JITScript::destroyChunk(FreeOp *fop, unsigned chunkIndex, bool resetUses)
|
||||
ChunkDescriptor &desc = chunkDescriptor(chunkIndex);
|
||||
|
||||
if (desc.chunk) {
|
||||
/*
|
||||
* Write barrier: Before we destroy the chunk, trace through the objects
|
||||
* it holds.
|
||||
*/
|
||||
if (script->compartment()->needsBarrier())
|
||||
desc.chunk->trace(script->compartment()->barrierTracer());
|
||||
|
||||
Probes::discardMJITCode(fop, this, desc.chunk, desc.chunk->code.m_code.executableAddress());
|
||||
fop->delete_(desc.chunk);
|
||||
desc.chunk = NULL;
|
||||
@ -1532,8 +1539,10 @@ void
|
||||
JITChunk::trace(JSTracer *trc)
|
||||
{
|
||||
JSObject **rootedTemplates_ = rootedTemplates();
|
||||
for (size_t i = 0; i < nRootedTemplates; i++)
|
||||
for (size_t i = 0; i < nRootedTemplates; i++) {
|
||||
/* We use a manual write barrier in destroyChunk. */
|
||||
MarkObjectUnbarriered(trc, &rootedTemplates_[i], "jitchunk_template");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user