Bug 849302 - Allow rooting of IonCode objects. r=terrence

This commit is contained in:
Kannan Vijayan 2013-03-09 11:02:51 -05:00
parent 8441d08fb4
commit e47d598128
3 changed files with 4 additions and 0 deletions

View File

@ -27,6 +27,7 @@
#include "jsgcinlines.h"
#include "jsobjinlines.h"
#include "ion/IonCode.h"
#ifdef MOZ_VALGRIND
# include <valgrind/memcheck.h>
@ -60,6 +61,7 @@ MarkExactStackRoot(JSTracer *trc, Rooted<void*> *rooter, ThingRootKind kind)
case THING_ROOT_BASE_SHAPE: MarkBaseShapeRoot(trc, (BaseShape **)addr, "exact-baseshape"); break;
case THING_ROOT_TYPE: MarkTypeRoot(trc, (types::Type *)addr, "exact-type"); break;
case THING_ROOT_TYPE_OBJECT: MarkTypeObjectRoot(trc, (types::TypeObject **)addr, "exact-typeobject"); break;
case THING_ROOT_ION_CODE: MarkIonCodeRoot(trc, (ion::IonCode **)addr, "exact-ioncode"); break;
case THING_ROOT_VALUE: MarkValueRoot(trc, (Value *)addr, "exact-value"); break;
case THING_ROOT_ID: MarkIdRoot(trc, (jsid *)addr, "exact-id"); break;
case THING_ROOT_PROPERTY_ID: MarkIdRoot(trc, &((js::PropertyId *)addr)->asId(), "exact-propertyid"); break;

View File

@ -134,6 +134,7 @@ class IonCode : public gc::Cell
static void readBarrier(IonCode *code);
static void writeBarrierPre(IonCode *code);
static void writeBarrierPost(IonCode *code, void *addr);
static inline ThingRootKind rootKind() { return THING_ROOT_ION_CODE; }
};
class SnapshotWriter;

View File

@ -228,6 +228,7 @@ enum ThingRootKind
THING_ROOT_BASE_SHAPE,
THING_ROOT_TYPE_OBJECT,
THING_ROOT_STRING,
THING_ROOT_ION_CODE,
THING_ROOT_SCRIPT,
THING_ROOT_ID,
THING_ROOT_PROPERTY_ID,