Backout 472087bf4626 (Bug 984361) for link errors on a CLOSED TREE.

--HG--
extra : rebase_source : fdd7dba227e4c7481b3394aed30052c7909acda4
This commit is contained in:
Terrence Cole 2014-05-09 14:59:16 -07:00
parent d976882d48
commit b3430e644a
3 changed files with 8 additions and 44 deletions

View File

@ -8,8 +8,6 @@
#include "mozilla/DebugOnly.h"
#include "jsprf.h"
#include "jit/IonCode.h"
#include "js/SliceBudget.h"
#include "vm/ArgumentsObject.h"
@ -148,27 +146,12 @@ template <> bool ThingIsPermanentAtom<PropertyName>(PropertyName *name) { return
template<typename T>
static inline void
CheckMarkedThing(JSTracer *trc, T **thingp)
CheckMarkedThing(JSTracer *trc, T *thing)
{
JS_ASSERT(trc);
JS_ASSERT(thingp);
T *thing = *thingp;
#ifdef JS_CRASH_DIAGNOSTICS
if (!thing) {
char msgbuf[1024];
const char *label = trc->tracingName("<unknown>");
JS_snprintf(msgbuf, sizeof(msgbuf),
"[crash diagnostics] Marking nullptr \"%s\" @ %p of type %s",
label, thingp, TraceKindAsAscii(MapTypeToTraceKind<T>::kind));
MOZ_ReportAssertionFailure(msgbuf, __FILE__, __LINE__);
MOZ_CRASH();
}
#endif
JS_ASSERT(*thingp);
#ifdef DEBUG
JS_ASSERT(trc);
JS_ASSERT(thing);
/* This function uses data that's not available in the nursery. */
if (IsInsideNursery(trc->runtime(), thing))
return;
@ -216,16 +199,17 @@ CheckMarkedThing(JSTracer *trc, T **thingp)
JS_ASSERT_IF(IsThingPoisoned(thing) && rt->isHeapBusy(),
!InFreeList(thing->arenaHeader(), thing));
#endif
}
template<typename T>
static void
MarkInternal(JSTracer *trc, T **thingp)
{
CheckMarkedThing(trc, thingp);
JS_ASSERT(thingp);
T *thing = *thingp;
CheckMarkedThing(trc, thing);
if (!trc->callback) {
/*
* We may mark a Nursery thing outside the context of the
@ -292,7 +276,7 @@ MarkPermanentAtom(JSTracer *trc, JSAtom *atom, const char *name)
JS_ASSERT(atom->isPermanent());
CheckMarkedThing(trc, &atom);
CheckMarkedThing(trc, atom);
if (!trc->callback) {
// Atoms do not refer to other GC things so don't need to go on the mark stack.

View File

@ -305,22 +305,6 @@ const uint32_t Arena::FirstThingOffsets[] = {
#undef OFFSET
const char *
TraceKindAsAscii(JSGCTraceKind kind)
{
switch(kind) {
case JSTRACE_OBJECT: return "JSTRACE_OBJECT";
case JSTRACE_STRING: return "JSTRACE_STRING";
case JSTRACE_SCRIPT: return "JSTRACE_SCRIPT";
case JSTRACE_LAZY_SCRIPT: return "JSTRACE_SCRIPT";
case JSTRACE_JITCODE: return "JSTRACE_JITCODE";
case JSTRACE_SHAPE: return "JSTRACE_SHAPE";
case JSTRACE_BASE_SHAPE: return "JSTRACE_BASE_SHAPE";
case JSTRACE_TYPE_OBJECT: return "JSTRACE_TYPE_OBJECT";
default: return "INVALID";
}
}
/*
* Finalization order for incrementally swept things.
*/

View File

@ -161,10 +161,6 @@ template <> struct MapTypeToTraceKind<JSLinearString> { static const JSGCTrace
template <> struct MapTypeToTraceKind<PropertyName> { static const JSGCTraceKind kind = JSTRACE_STRING; };
template <> struct MapTypeToTraceKind<jit::JitCode> { static const JSGCTraceKind kind = JSTRACE_JITCODE; };
/* Return a printable string for the given kind, for diagnostic purposes. */
const char *
TraceKindAsAscii(JSGCTraceKind kind);
/* Map from C++ type to finalize kind. JSObject does not have a 1:1 mapping, so must use Arena::thingSize. */
template <typename T> struct MapTypeToFinalizeKind {};
template <> struct MapTypeToFinalizeKind<JSScript> { static const AllocKind kind = FINALIZE_SCRIPT; };