Bug 650161 - Unify the finalization and moving GC callbacks into a weak pointer update callback r=terrence r=bholley

This commit is contained in:
Jon Coppeard
2014-09-24 12:54:11 +01:00
parent 2a9e787f41
commit 35fa24ed09
19 changed files with 159 additions and 132 deletions

View File

@@ -54,8 +54,6 @@ class IdToObjectMap
JSObject *find(ObjectId id);
void remove(ObjectId id);
void fixupAfterMovingGC();
private:
Table table_;
};
@@ -71,14 +69,13 @@ class ObjectToIdMap
~ObjectToIdMap();
bool init();
void trace(JSTracer *trc);
void sweep();
bool add(JSContext *cx, JSObject *obj, ObjectId id);
ObjectId find(JSObject *obj);
void remove(JSObject *obj);
void fixupAfterMovingGC();
private:
static void keyMarkCallback(JSTracer *trc, JSObject *key, void *data);
@@ -104,8 +101,6 @@ class JavaScriptShared
bool Unwrap(JSContext *cx, const InfallibleTArray<CpowEntry> &aCpows, JS::MutableHandleObject objp);
bool Wrap(JSContext *cx, JS::HandleObject aObj, InfallibleTArray<CpowEntry> *outCpows);
void fixupAfterMovingGC();
protected:
bool toVariant(JSContext *cx, JS::HandleValue from, JSVariant *to);
bool fromVariant(JSContext *cx, const JSVariant &from, JS::MutableHandleValue to);