Bug 757199 - Don't use an addprop IC during incremental GC (r=bhackett)

This commit is contained in:
Bill McCloskey 2012-06-27 13:46:57 -07:00
parent 4d806b8d34
commit 2cd5e60c25
3 changed files with 36 additions and 0 deletions

View File

@ -24,5 +24,9 @@ if (!("selectforgc" in this)) {
selectforgc = function() { }
}
if (!("verifybarriers" in this)) {
verifybarriers = function() { }
}
if ("options" in this)
options("allow_xml");

View File

@ -0,0 +1,23 @@
function ctor()
{
this.a = 1;
this.b = 2;
}
function f2(o)
{
o.c = 12;
}
function f()
{
var x = new ctor();
verifybarriers();
f2(x);
verifybarriers();
}
f();
f();
var o = {};
for (var i=0; i<1000; i++)
o['a'+i] = 3;
f();
f();

View File

@ -560,6 +560,15 @@ class SetPropCompiler : public PICStubCompiler
if (obj->numDynamicSlots() != slots)
return disable("insufficient slot capacity");
#ifdef JSGC_INCREMENTAL_MJ
/*
* Since we're changing the object's shape, we need a write
* barrier. Taking the slow path is the easiest way to get one.
*/
if (cx->compartment->needsBarrier())
return disable("ADDPROP write barrier required");
#endif
if (pic.typeMonitored && !updateMonitoredTypes())
return Lookup_Uncacheable;