зеркало из 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) {
|
void pushValueArray(JSObject *obj, void *start, void *end) {
|
||||||
checkCompartment(obj);
|
checkCompartment(obj);
|
||||||
|
|
||||||
if (start == end)
|
|
||||||
return;
|
|
||||||
|
|
||||||
JS_ASSERT(start <= end);
|
JS_ASSERT(start <= end);
|
||||||
uintptr_t tagged = reinterpret_cast<uintptr_t>(obj) | GCMarker::ValueArrayTag;
|
uintptr_t tagged = reinterpret_cast<uintptr_t>(obj) | GCMarker::ValueArrayTag;
|
||||||
uintptr_t startAddr = reinterpret_cast<uintptr_t>(start);
|
uintptr_t startAddr = reinterpret_cast<uintptr_t>(start);
|
||||||
|
@ -1883,6 +1880,7 @@ struct GCMarker : public JSTracer {
|
||||||
bool restoreValueArray(JSObject *obj, void **vpp, void **endp);
|
bool restoreValueArray(JSObject *obj, void **vpp, void **endp);
|
||||||
void saveValueRanges();
|
void saveValueRanges();
|
||||||
inline void processMarkStackTop(SliceBudget &budget);
|
inline void processMarkStackTop(SliceBudget &budget);
|
||||||
|
void processMarkStackOther(uintptr_t tag, uintptr_t addr);
|
||||||
|
|
||||||
void appendGrayRoot(void *thing, JSGCTraceKind kind);
|
void appendGrayRoot(void *thing, JSGCTraceKind kind);
|
||||||
|
|
||||||
|
|
|
@ -918,7 +918,9 @@ GCMarker::saveValueRanges()
|
||||||
} else {
|
} else {
|
||||||
HeapSlot *vp = obj->fixedSlots();
|
HeapSlot *vp = obj->fixedSlots();
|
||||||
unsigned nfixed = obj->numFixedSlots();
|
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()));
|
JS_ASSERT(arr->end == vp + Min(nfixed, obj->slotSpan()));
|
||||||
arr->index = arr->start - vp;
|
arr->index = arr->start - vp;
|
||||||
} else {
|
} else {
|
||||||
|
@ -977,6 +979,25 @@ GCMarker::restoreValueArray(JSObject *obj, void **vpp, void **endp)
|
||||||
return true;
|
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
|
inline void
|
||||||
GCMarker::processMarkStackTop(SliceBudget &budget)
|
GCMarker::processMarkStackTop(SliceBudget &budget)
|
||||||
{
|
{
|
||||||
|
@ -1011,31 +1032,12 @@ GCMarker::processMarkStackTop(SliceBudget &budget)
|
||||||
goto scan_obj;
|
goto scan_obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tag == TypeTag) {
|
processMarkStackOther(tag, addr);
|
||||||
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();
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
scan_value_array:
|
scan_value_array:
|
||||||
JS_ASSERT(vp <= end);
|
JS_ASSERT(vp <= end);
|
||||||
while (vp != end) {
|
while (vp != end) {
|
||||||
budget.step();
|
|
||||||
if (budget.isOverBudget()) {
|
|
||||||
pushValueArray(obj, vp, end);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const Value &v = *vp++;
|
const Value &v = *vp++;
|
||||||
if (v.isString()) {
|
if (v.isString()) {
|
||||||
JSString *str = v.toString();
|
JSString *str = v.toString();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче