Subj : Re: Serializing Object Graphs To : Eric Brueggemann From : Brendan Eich Date : Wed Apr 09 2003 11:29 pm > I've identified the following slot-setting calls:* > jslock.c: js_SetSlotThreadSafe > jsobj.c: js_Clear > jsobj.c: js_SetRequiredSlot > jsobj.h: LOCKED_OBJ_SET_SLOT > * not using TOO_MUCH_GC or LiveConnect > > At the point that obj->slots[slot] is being filled, are the following > always true? > 1. OBJ_SCOPE(obj) == obj You mean OBJ_SCOPE(obj)->object == obj, I think, and only if OBJ_IS_NATIVE(obj). > 2. slot <-> (atom | tinyid) can be found in OBJ_SCOPE(obj) Yes, currently. A patch in one of my trees for bug http://bugzilla.mozilla.org/show_bug.cgi?id=123668 may relax the (corrected) first invariant. > If so, the modify case should be easy to log and roll back. Still > looking into the add and delete cases. Any pointers? For native objects, js_DefineProperty, js_SetProperty, js_DeleteProperty, and js_Clear in jsobj.c, or the lower-level scope operations js_AddScopeProperty, js_ChangeScopePropertyAttrs, js_RemoveScopeProperty, and js_ClearScope in jsscope.c. If you care about non-native objects, you may want to think about generalizing "above" the object-ops layer. Stackable ops, perhaps. But I really don't want any overhead in the engine there. > btw. this is whole scope tree implementation is neat stuff! Thanks! /be .