void ForkJoinNursery::forwardFromUpdatable(ForkJoinNurseryCollectionTracer *trc) { JSObject *obj = shared_->updatable(); if (obj) traceObject(trc, obj); }
ObjectTree::ObjectTree(QWidget *parent) : QVBox(parent) { copying = false; cutting = false; referencing = false; list = new ObjectListView(this); list->addColumn("Objects"); list->addColumn("Value"); list->addColumn("Def"); list->setRootIsDecorated(true); list->setItemMargin(3); list->setTreeStepSize(15); list->setAcceptDrops(true); menu = new QMenu(list); menu->addAction(QIcon(QPixmap("icons/add.png")), "Add", this, SLOT(addAttribute())); menu->addAction(QIcon(QPixmap("icons/remove.png")), "Delete", this, SLOT(deleteObject())); menu->addAction(QIcon(QPixmap("icons/object.png")), "View", this, SLOT(viewObject())); menu->addAction(QIcon(QPixmap("icons/filesaveobj.png")), "Save...", this, SLOT(saveObject())); menu->addSeparator(); menu->addAction(QIcon(QPixmap("icons/editcut.png")), "Cut", this, SLOT(objcut())); menu->addAction(QIcon(QPixmap("icons/editcopy.png")), "Copy", this, SLOT(objcopy())); menu->addAction(QIcon(QPixmap("icons/definition.png")), "Reference", this, SLOT(objref())); menu->addSeparator(); menu->addAction(QIcon(QPixmap("icons/trace.png")), "Trace", this, SLOT(traceObject())); menu->addAction(QIcon(QPixmap("icons/monitor.png")), "Monitor"); menu->addAction(QIcon(QPixmap("icons/edit.png")), "Edit", this, SLOT(editObject())); icon_array = new QPixmap[NUM_OBJTYPES]; for (int i=0; i<NUM_OBJTYPES; i++) { icon_array[i] = QPixmap(icon_files[i]); } icon_def = new QPixmap(icon_deffile); new ObjectItem(list, Null, Null, core::root, "root", false); //new ObjectItem(list, Null, Null, doste::Current, "current", false); //aname = new AttribNameDialog(); connect(list, SIGNAL(expanded(QTreeWidgetItem*)), this, SLOT(expanded(QTreeWidgetItem*))); connect(list, SIGNAL(collapsed(QTreeWidgetItem*)), this, SLOT(collapsed(QTreeWidgetItem*))); connect(list, SIGNAL(itemRenamed(QTreeWidgetItem *, int, const QString&)), this, SLOT(itemRenamed(QTreeWidgetItem*, int, const QString&))); connect(list, SIGNAL(rightButtonClicked(QTreeWidgetItem *, const QPoint&, int)), this, SLOT(rightButtonClicked(QTreeWidgetItem*, const QPoint&, int))); connect(list, SIGNAL(onItem(QTreeWidgetItem*)), this, SLOT(onItem(QTreeWidgetItem*))); connect(list, SIGNAL(clicked(QTreeWidgetItem*)), this, SLOT(itemClicked(QTreeWidgetItem*))); }
void ForkJoinNursery::forwardFromTenured(ForkJoinNurseryCollectionTracer *trc) { JSObject *objs[ArenaCellCount]; for (size_t k=0; k < FINALIZE_LIMIT; k++) { AllocKind kind = (AllocKind)k; if (!IsFJNurseryAllocable(kind)) continue; // When non-JSObject types become nursery-allocable the assumptions in the // loops below will no longer hold; other types than JSObject must be // handled. JS_ASSERT(kind <= FINALIZE_OBJECT_LAST); ArenaIter ai; ai.init(const_cast<Allocator *>(tenured_), kind); for (; !ai.done(); ai.next()) { // Do the walk in two steps to avoid problems resulting from allocating // into the arena that's being walked: ArenaCellIter is not safe for that. // It can happen during evacuation. // // ArenaCellIterUnderFinalize requires any free list to be flushed into // its arena, and since we may allocate within traceObject() we must // purge before each arena scan. This is probably not very expensive, // it's constant work, and inlined. // // Use ArenaCellIterUnderFinalize, not ...UnderGC, because that side-steps // some assertions in the latter that are wrong for PJS collection. size_t numObjs = 0; tenured_->arenas.purge(kind); for (ArenaCellIterUnderFinalize i(ai.get()); !i.done(); i.next()) objs[numObjs++] = i.get<JSObject>(); for (size_t i=0; i < numObjs; i++) traceObject(trc, objs[i]); } } }
void ForkJoinNursery::collectToFixedPoint(ForkJoinNurseryCollectionTracer *trc) { for (RelocationOverlay *p = head_; p; p = p->next()) traceObject(trc, static_cast<JSObject *>(p->forwardingAddress())); }