Bug 839258 - Fix write barrier issue with updating stubCode pointers on stubs. r=bhackett

This commit is contained in:
Kannan Vijayan 2013-03-01 16:12:23 -05:00
parent 1e9c7eaed2
commit 75ceadccfe
2 changed files with 12 additions and 1 deletions

View File

@ -90,6 +90,16 @@ ICStub::markCode(JSTracer *trc, const char *name)
MarkIonCodeUnbarriered(trc, &stubIonCode, name);
}
void
ICStub::updateCode(IonCode *code)
{
// Write barrier on the old code.
#ifdef JSGC_INCREMENTAL
IonCode::writeBarrierPre(ionCode());
#endif
stubCode_ = code->raw();
}
/* static */ void
ICStub::trace(JSTracer *trc)
{

View File

@ -423,6 +423,7 @@ class ICStub
};
void markCode(JSTracer *trc, const char *name);
void updateCode(IonCode *stubCode);
void trace(JSTracer *trc);
protected:
@ -1007,7 +1008,7 @@ class TypeCheckPrimitiveSetStub : public ICStub
if (!code)
return NULL;
extra_ = flags;
stubCode_ = code->raw();
updateCode(code);
return this;
}