bool ImmixGC::ObjectDescriber::mark_address(Address addr, MarkStack& ms, bool push) { Object* obj = addr.as<Object>(); if(obj->marked_p(memory_->mark())) return false; obj->mark(memory_, memory_->mark()); if(push) ms.push_back(addr); // If this is a young object, let the GC know not to try and mark // the block it's in. return obj->in_immix_p(); }
void markDOMObjectWrapper(MarkStack& markStack, JSGlobalData& globalData, void* object) { // FIXME: This could be changed to only mark wrappers that are "observable" // as markDOMNodesForDocument does, allowing us to collect more wrappers, // but doing this correctly would be challenging. if (!object) return; for (JSGlobalDataWorldIterator worldIter(&globalData); worldIter; ++worldIter) { if (HandleSlot wrapperSlot = worldIter->m_wrappers.getSlot(object)) markStack.deprecatedAppend(wrapperSlot); } }
void markDOMNodesForDocument(MarkStack& markStack, Document* document) { JSWrapperCacheMap& wrapperCacheMap = document->wrapperCacheMap(); for (JSWrapperCacheMap::iterator wrappersIter = wrapperCacheMap.begin(); wrappersIter != wrapperCacheMap.end(); ++wrappersIter) { DOMWrapperWorld* world = wrappersIter->first; JSWrapperCache* nodeDict = wrappersIter->second; JSWrapperCache::iterator nodeEnd = nodeDict->end(); for (JSWrapperCache::iterator nodeIt = nodeDict->begin(); nodeIt != nodeEnd; ++nodeIt) { if (isObservableThroughDOM(nodeIt.get().second, world)) markStack.deprecatedAppend(nodeIt.getSlot().second); } } }
void markDOMNodesForDocument(MarkStack& markStack, Document* document) { JSWrapperCacheMap& wrapperCacheMap = document->wrapperCacheMap(); for (JSWrapperCacheMap::iterator wrappersIter = wrapperCacheMap.begin(); wrappersIter != wrapperCacheMap.end(); ++wrappersIter) { DOMWrapperWorld* world = wrappersIter->first; JSWrapperCache* nodeDict = wrappersIter->second; JSWrapperCache::iterator nodeEnd = nodeDict->uncheckedEnd(); for (JSWrapperCache::iterator nodeIt = nodeDict->uncheckedBegin(); nodeIt != nodeEnd; ++nodeIt) { DeprecatedPtr<JSNode>& jsNode = nodeIt->second; if (isObservableThroughDOM(jsNode.get(), world)) markStack.append(&jsNode); } } }
void JSPropertyNameIterator::markChildren(MarkStack& markStack) { markStack.appendValues(m_jsStrings.get(), m_jsStringsSize, MayContainNullValues); }
void JSGlobalObject::markChildren(MarkStack& markStack) { JSVariableObject::markChildren(markStack); HashSet<GlobalCodeBlock*>::const_iterator end = codeBlocks().end(); for (HashSet<GlobalCodeBlock*>::const_iterator it = codeBlocks().begin(); it != end; ++it) (*it)->markAggregate(markStack); RegisterFile& registerFile = globalData()->interpreter->registerFile(); if (registerFile.globalObject() == this) registerFile.markGlobals(markStack, &globalData()->heap); markIfNeeded(markStack, d()->regExpConstructor); markIfNeeded(markStack, d()->errorConstructor); markIfNeeded(markStack, d()->evalErrorConstructor); markIfNeeded(markStack, d()->rangeErrorConstructor); markIfNeeded(markStack, d()->referenceErrorConstructor); markIfNeeded(markStack, d()->syntaxErrorConstructor); markIfNeeded(markStack, d()->typeErrorConstructor); markIfNeeded(markStack, d()->URIErrorConstructor); markIfNeeded(markStack, d()->evalFunction); markIfNeeded(markStack, d()->callFunction); markIfNeeded(markStack, d()->applyFunction); markIfNeeded(markStack, d()->objectPrototype); markIfNeeded(markStack, d()->functionPrototype); markIfNeeded(markStack, d()->arrayPrototype); markIfNeeded(markStack, d()->booleanPrototype); markIfNeeded(markStack, d()->stringPrototype); markIfNeeded(markStack, d()->numberPrototype); markIfNeeded(markStack, d()->datePrototype); markIfNeeded(markStack, d()->regExpPrototype); markIfNeeded(markStack, d()->methodCallDummy); markIfNeeded(markStack, d()->errorStructure); markIfNeeded(markStack, d()->argumentsStructure); markIfNeeded(markStack, d()->arrayStructure); markIfNeeded(markStack, d()->booleanObjectStructure); markIfNeeded(markStack, d()->callbackConstructorStructure); markIfNeeded(markStack, d()->callbackFunctionStructure); markIfNeeded(markStack, d()->callbackObjectStructure); markIfNeeded(markStack, d()->dateStructure); markIfNeeded(markStack, d()->emptyObjectStructure); markIfNeeded(markStack, d()->errorStructure); markIfNeeded(markStack, d()->functionStructure); markIfNeeded(markStack, d()->numberObjectStructure); markIfNeeded(markStack, d()->prototypeFunctionStructure); markIfNeeded(markStack, d()->regExpMatchesArrayStructure); markIfNeeded(markStack, d()->regExpStructure); markIfNeeded(markStack, d()->stringObjectStructure); // No need to mark the other structures, because their prototypes are all // guaranteed to be referenced elsewhere. Register* registerArray = d()->registerArray.get(); if (!registerArray) return; size_t size = d()->registerArraySize; markStack.appendValues(reinterpret_cast<JSValue*>(registerArray), size); }
static inline void markIfNeeded(MarkStack& markStack, JSValue v) { if (v) markStack.append(v); }
void JSNodeFilterCondition::markAggregate(MarkStack& markStack) { markStack.append(m_filter); }
void JSStaticScopeObject::markChildren(MarkStack& markStack) { JSVariableObject::markChildren(markStack); markStack.deprecatedAppend(&d()->registerStore); }
void JSEventListener::markJSFunction(MarkStack& markStack) { if (m_jsFunction) markStack.append(m_jsFunction); }
void JSStaticScopeObject::markChildren(MarkStack& markStack) { JSVariableObject::markChildren(markStack); markStack.append(d()->registerStore.jsValue()); }
// Marking void JSNotAnObject::markChildren(MarkStack& markStack) { TiObject::markChildren(markStack); markStack.append(m_exception); }
void NativeErrorConstructor::markChildren(MarkStack& markStack) { InternalFunction::markChildren(markStack); if (m_errorStructure) markStack.append(&m_errorStructure); }
void GlobalEvalFunction::markChildren(MarkStack& markStack) { PrototypeFunction::markChildren(markStack); markStack.append(m_cachedGlobalObject); }
void JSDOMWindowShell::markChildren(MarkStack& markStack) { Base::markChildren(markStack); if (m_window) markStack.append(&m_window); }
void AstObject::pushAccessibles(MarkStack &v) { if(obj) v.push(obj); }
void AstSymbol::pushAccessibles(MarkStack &markStack) { //### might have to uncomment this later, but // for now, symbols are not handled by the GC at all markStack.push(symbol); // ### }
void AstForest::pushAccessibles(MarkStack &markStack) { int i; for(i=0 ; i<numTrees ; ++i) markStack.push((Garbage*)trees[i]); }
void AstLambda::pushAccessibles(MarkStack &markStack) { markStack.push(body); }
void AstFreeVariable::pushAccessibles(MarkStack &markStack) { markStack.push(parent); }