зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1149352 - Part 0: Only mark live entries when marking a range; r=meow
This commit is contained in:
Родитель
99a4fd3d60
Коммит
4d97c7441f
|
@ -431,19 +431,23 @@ js::TraceRoot(JSTracer* trc, T* thingp, const char* name)
|
|||
|
||||
template <typename T>
|
||||
void
|
||||
js::TraceRange(JSTracer* trc, size_t len, BarrieredBase<T>* thingp, const char* name)
|
||||
js::TraceRange(JSTracer* trc, size_t len, BarrieredBase<T>* vec, const char* name)
|
||||
{
|
||||
for (auto i : MakeRange(len))
|
||||
DispatchToTracer(trc, ConvertToBase(thingp[i].unsafeGet()), name, i);
|
||||
for (auto i : MakeRange(len)) {
|
||||
if (InternalGCMethods<T>::isMarkable(vec[i].get()))
|
||||
DispatchToTracer(trc, ConvertToBase(vec[i].unsafeGet()), name, i);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
js::TraceRootRange(JSTracer* trc, size_t len, T* thingp, const char* name)
|
||||
js::TraceRootRange(JSTracer* trc, size_t len, T* vec, const char* name)
|
||||
{
|
||||
JS_ROOT_MARKING_ASSERT(trc);
|
||||
for (auto i : MakeRange(len))
|
||||
DispatchToTracer(trc, ConvertToBase(&thingp[i]), name, i);
|
||||
for (auto i : MakeRange(len)) {
|
||||
if (InternalGCMethods<T>::isMarkable(vec[i]))
|
||||
DispatchToTracer(trc, ConvertToBase(&vec[i]), name, i);
|
||||
}
|
||||
}
|
||||
|
||||
// Instantiate a copy of the Tracing templates for each derived type.
|
||||
|
|
|
@ -62,12 +62,12 @@ TraceManuallyBarrieredEdge(JSTracer* trc, T* thingp, const char* name);
|
|||
// Trace all edges contained in the given array.
|
||||
template <typename T>
|
||||
void
|
||||
TraceRange(JSTracer* trc, size_t len, BarrieredBase<T>* thingp, const char* name);
|
||||
TraceRange(JSTracer* trc, size_t len, BarrieredBase<T>* vec, const char* name);
|
||||
|
||||
// Trace all root edges in the given array.
|
||||
template <typename T>
|
||||
void
|
||||
TraceRootRange(JSTracer* trc, size_t len, T* thingp, const char* name);
|
||||
TraceRootRange(JSTracer* trc, size_t len, T* vec, const char* name);
|
||||
|
||||
// Trace an edge that crosses compartment boundaries. If the compartment of the
|
||||
// destination thing is not being GC'd, then the edge will not be traced.
|
||||
|
|
Загрузка…
Ссылка в новой задаче