Bug 1150714 - Mark and sweep JitcodeGlobalMap IC entries. (r=djvj)

This commit is contained in:
Shu-yu Guo 2015-04-06 18:38:31 -07:00
parent 7f4efc338e
commit 55e0f251af
2 changed files with 22 additions and 2 deletions

View File

@ -794,7 +794,7 @@ JitcodeGlobalTable::sweep(JSRuntime* rt)
if (entry->baseEntry().isJitcodeAboutToBeFinalized())
e.removeFront();
else
entry->sweep();
entry->sweep(rt);
}
}
@ -930,6 +930,22 @@ JitcodeGlobalEntry::IonEntry::isMarkedFromAnyThread()
return true;
}
bool
JitcodeGlobalEntry::IonCacheEntry::markIfUnmarked(JSTracer* trc)
{
JitcodeGlobalEntry entry;
RejoinEntry(trc->runtime(), *this, nativeStartAddr(), &entry);
return entry.markIfUnmarked(trc);
}
void
JitcodeGlobalEntry::IonCacheEntry::sweep(JSRuntime* rt)
{
JitcodeGlobalEntry entry;
RejoinEntry(rt, *this, nativeStartAddr(), &entry);
entry.sweep(rt);
}
bool
JitcodeGlobalEntry::IonCacheEntry::isMarkedFromAnyThread(JSRuntime* rt)
{

View File

@ -446,6 +446,8 @@ class JitcodeGlobalEntry
void youngestFrameLocationAtAddr(JSRuntime* rt, void* ptr,
JSScript** script, jsbytecode** pc) const;
bool markIfUnmarked(JSTracer* trc);
void sweep(JSRuntime* rt);
bool isMarkedFromAnyThread(JSRuntime* rt);
};
@ -828,6 +830,7 @@ class JitcodeGlobalEntry
markedAny |= baselineEntry().markIfUnmarked(trc);
break;
case IonCache:
markedAny |= ionCacheEntry().markIfUnmarked(trc);
case Dummy:
break;
default:
@ -836,7 +839,7 @@ class JitcodeGlobalEntry
return markedAny;
}
void sweep() {
void sweep(JSRuntime* rt) {
switch (kind()) {
case Ion:
ionEntry().sweep();
@ -845,6 +848,7 @@ class JitcodeGlobalEntry
baselineEntry().sweep();
break;
case IonCache:
ionCacheEntry().sweep(rt);
case Dummy:
break;
default: