Bug 1162296 - Use generic value traversal when scanning unboxed memory; r=jonco

--HG--
extra : rebase_source : 904492a7b966621a5fbc8905a0146891212f2f48
This commit is contained in:
Terrence Cole 2015-05-06 10:26:34 -07:00
Родитель 5c59035182
Коммит 26d790d19f
3 изменённых файлов: 9 добавлений и 9 удалений

Просмотреть файл

@ -782,6 +782,13 @@ js::GCMarker::traverse(S source, jsid id)
DispatchIdTyped(TraverseFunctor<jsid, S>(), id, this, source);
}
template <typename S>
void
js::GCMarker::traverse(S source, Value v)
{
DispatchValueTyped(TraverseFunctor<Value, S>(), v, this, source);
}
template <typename T>
bool
js::GCMarker::mark(T* thing)
@ -1202,7 +1209,6 @@ GCMarker::processMarkStackTop(SliceBudget& budget)
unboxedTraceList++;
while (*unboxedTraceList != -1) {
JSObject* obj2 = *reinterpret_cast<JSObject**>(unboxedMemory + *unboxedTraceList);
MOZ_ASSERT_IF(obj2, obj->compartment() == obj2->compartment());
if (obj2)
traverse(obj, obj2);
unboxedTraceList++;
@ -1210,13 +1216,7 @@ GCMarker::processMarkStackTop(SliceBudget& budget)
unboxedTraceList++;
while (*unboxedTraceList != -1) {
const Value& v = *reinterpret_cast<Value*>(unboxedMemory + *unboxedTraceList);
if (v.isString()) {
traverse(obj, v.toString());
} else if (v.isObject()) {
traverse(obj, &v.toObject());
} else if (v.isSymbol()) {
traverse(obj, v.toSymbol());
}
traverse(obj, v);
unboxedTraceList++;
}
return;

Просмотреть файл

@ -153,6 +153,7 @@ class GCMarker : public JSTracer
// C++ requires explicit declarations of partial template instantiations.
template <typename S> void traverse(S source, jsid target);
template <typename S> void traverse(S source, Value target);
/*
* Care must be taken changing the mark color from gray to black. The cycle

Просмотреть файл

@ -22,7 +22,6 @@ js::Nursery::getForwardedPointer(JSObject** ref) const
const gc::RelocationOverlay* overlay = reinterpret_cast<const gc::RelocationOverlay*>(*ref);
if (!overlay->isForwarded())
return false;
/* This static cast from Cell* restricts T to valid (GC thing) types. */
*ref = static_cast<JSObject*>(overlay->forwardingAddress());
return true;
}