static void MarkChildren(JSTracer *trc, types::TypeObject *type) { if (!type->singleton) { unsigned count = type->getPropertyCount(); for (unsigned i = 0; i < count; i++) { types::Property *prop = type->getProperty(i); if (prop) MarkId(trc, &prop->id, "type_prop"); } } if (type->proto) MarkObject(trc, &type->proto, "type_proto"); if (type->singleton && !type->lazy()) MarkObject(trc, &type->singleton, "type_singleton"); if (type->newScript) { MarkObject(trc, &type->newScript->fun, "type_new_function"); MarkShape(trc, &type->newScript->shape, "type_new_shape"); } if (type->interpretedFunction) MarkObject(trc, &type->interpretedFunction, "type_function"); }
/* * This function is used by the cycle collector to trace through a * shape. The cycle collector does not care about shapes or base * shapes, so those are not marked. Instead, any shapes or base shapes * that are encountered have their children marked. Stack space is * bounded. If two shapes in a row have the same parent pointer, the * parent pointer will only be marked once. */ void MarkCycleCollectorChildren(JSTracer *trc, Shape *shape) { JSObject *prevParent = NULL; do { MarkCycleCollectorChildren(trc, shape->base(), &prevParent); MarkId(trc, &shape->propidRef(), "propid"); shape = shape->previous(); } while (shape); }
SjDisplayEditDlg::SjDisplayEditDlg() : SjTagEditorDlg(g_mainFrame, (g_mainFrame->m_contextMenuClickedUrls.GetCount()>1)) { g_mainFrame->m_display.m_tagEditorJustOpened = TRUE; g_mainFrame->m_libraryModule->SavePendingData(); m_id = g_mainFrame->m_contextMenuClickedId; if( g_mainFrame->m_contextMenuClickedUrls.GetCount() > 1 ) { m_urls = g_mainFrame->m_contextMenuClickedUrls; } else { m_urls.Add(g_mainFrame->m_player.m_queue.GetUrlById(m_id)); MarkId(0); } }
bool SjDisplayEditDlg::GetUrls(wxArrayString& retUrls, int what) { if( what != 0 ) { m_urls.Clear(); long newId = 0; long currPos = g_mainFrame->m_player.m_queue.GetPosById(m_id); long queueCount = g_mainFrame->m_player.m_queue.GetCount(); if( currPos >= 0 && currPos < queueCount ) { if( what == 1 && currPos < queueCount-1 ) { // get next track newId = g_mainFrame->m_player.m_queue.GetIdByPos(currPos+1); } else if( what == -1 && currPos > 0 ) { // get prev. track newId = g_mainFrame->m_player.m_queue.GetIdByPos(currPos-1); } } if( newId ) { m_id = newId; m_urls.Clear(); m_urls.Add(g_mainFrame->m_player.m_queue.GetUrlById(m_id)); MarkId(what); } } // return the urls in scope retUrls = m_urls; return TRUE; }