зеркало из https://github.com/mozilla/pjs.git
Bug 731837 - Fix GC mark time regression from IGC (r=igor,a=tracking-firefox)
This commit is contained in:
Родитель
dd1903f6dd
Коммит
76d0dcf3fe
|
@ -1860,9 +1860,6 @@ struct GCMarker : public JSTracer {
|
|||
void pushValueArray(JSObject *obj, void *start, void *end) {
|
||||
checkCompartment(obj);
|
||||
|
||||
if (start == end)
|
||||
return;
|
||||
|
||||
JS_ASSERT(start <= end);
|
||||
uintptr_t tagged = reinterpret_cast<uintptr_t>(obj) | GCMarker::ValueArrayTag;
|
||||
uintptr_t startAddr = reinterpret_cast<uintptr_t>(start);
|
||||
|
@ -1883,6 +1880,7 @@ struct GCMarker : public JSTracer {
|
|||
bool restoreValueArray(JSObject *obj, void **vpp, void **endp);
|
||||
void saveValueRanges();
|
||||
inline void processMarkStackTop(SliceBudget &budget);
|
||||
void processMarkStackOther(uintptr_t tag, uintptr_t addr);
|
||||
|
||||
void appendGrayRoot(void *thing, JSGCTraceKind kind);
|
||||
|
||||
|
|
|
@ -918,7 +918,9 @@ GCMarker::saveValueRanges()
|
|||
} else {
|
||||
HeapSlot *vp = obj->fixedSlots();
|
||||
unsigned nfixed = obj->numFixedSlots();
|
||||
if (arr->start >= vp && arr->start < vp + nfixed) {
|
||||
if (arr->start == arr->end) {
|
||||
arr->index = obj->slotSpan();
|
||||
} else if (arr->start >= vp && arr->start < vp + nfixed) {
|
||||
JS_ASSERT(arr->end == vp + Min(nfixed, obj->slotSpan()));
|
||||
arr->index = arr->start - vp;
|
||||
} else {
|
||||
|
@ -977,6 +979,25 @@ GCMarker::restoreValueArray(JSObject *obj, void **vpp, void **endp)
|
|||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
GCMarker::processMarkStackOther(uintptr_t tag, uintptr_t addr)
|
||||
{
|
||||
if (tag == TypeTag) {
|
||||
ScanTypeObject(this, reinterpret_cast<types::TypeObject *>(addr));
|
||||
} else if (tag == SavedValueArrayTag) {
|
||||
JS_ASSERT(!(addr & Cell::CellMask));
|
||||
JSObject *obj = reinterpret_cast<JSObject *>(addr);
|
||||
HeapValue *vp, *end;
|
||||
if (restoreValueArray(obj, (void **)&vp, (void **)&end))
|
||||
pushValueArray(obj, vp, end);
|
||||
else
|
||||
pushObject(obj);
|
||||
} else {
|
||||
JS_ASSERT(tag == XmlTag);
|
||||
MarkChildren(this, reinterpret_cast<JSXML *>(addr));
|
||||
}
|
||||
}
|
||||
|
||||
inline void
|
||||
GCMarker::processMarkStackTop(SliceBudget &budget)
|
||||
{
|
||||
|
@ -1011,31 +1032,12 @@ GCMarker::processMarkStackTop(SliceBudget &budget)
|
|||
goto scan_obj;
|
||||
}
|
||||
|
||||
if (tag == TypeTag) {
|
||||
ScanTypeObject(this, reinterpret_cast<types::TypeObject *>(addr));
|
||||
} else if (tag == SavedValueArrayTag) {
|
||||
JS_ASSERT(!(addr & Cell::CellMask));
|
||||
obj = reinterpret_cast<JSObject *>(addr);
|
||||
if (restoreValueArray(obj, (void **)&vp, (void **)&end))
|
||||
goto scan_value_array;
|
||||
else
|
||||
goto scan_obj;
|
||||
} else {
|
||||
JS_ASSERT(tag == XmlTag);
|
||||
MarkChildren(this, reinterpret_cast<JSXML *>(addr));
|
||||
}
|
||||
budget.step();
|
||||
processMarkStackOther(tag, addr);
|
||||
return;
|
||||
|
||||
scan_value_array:
|
||||
JS_ASSERT(vp <= end);
|
||||
while (vp != end) {
|
||||
budget.step();
|
||||
if (budget.isOverBudget()) {
|
||||
pushValueArray(obj, vp, end);
|
||||
return;
|
||||
}
|
||||
|
||||
const Value &v = *vp++;
|
||||
if (v.isString()) {
|
||||
JSString *str = v.toString();
|
||||
|
|
Загрузка…
Ссылка в новой задаче