예제 #1
0
void PropertyMap::mark() const
{
    if (!_table) {
#if USE_SINGLE_ENTRY
        if (_singleEntry.key) {
            JSValue *v = _singleEntry.value;
            if (!v->marked())
                v->mark();
        }
#endif
        return;
    }

    int minimumKeysToProcess = _table->keyCount;
    Entry *entries = _table->entries;
    for (int i = 0; i < minimumKeysToProcess; i++) {
        JSValue *v = entries[i].value;
        if (v) {
            if (!v->marked())
                v->mark();
        } else {
            ++minimumKeysToProcess;
        }
    }
}
예제 #2
0
EXPORT
void JSObject::mark()
{
  if(checkStackDepthTooDeep())
    {
	return;
	}

  JSCell::mark();

#if JAVASCRIPT_MARK_TRACING
  static int markStackDepth = 0;
  markStackDepth++;
  for (int i = 0; i < markStackDepth; i++)
    putchar('-');
  
  printf("%s (%p)\n", className().UTF8String().c_str(), this);
#endif
  
  JSValue *proto = _proto;
  if (!proto->marked())
    proto->mark();

  _prop.mark();
  
#if JAVASCRIPT_MARK_TRACING
  markStackDepth--;
#endif
}
void ArrayInstance::mark()
{
  JSObject::mark();
  unsigned l = storageLength;
  for (unsigned i = 0; i < l; ++i) {
    JSValue *imp = storage[i];
    if (imp && !imp->marked())
      imp->mark();
  }
}
예제 #4
0
void JSArray::mark()
{
    JSObject::mark();

    ArrayStorage* storage = m_storage;

    unsigned usedVectorLength = min(storage->m_length, storage->m_vectorLength);
    for (unsigned i = 0; i < usedVectorLength; ++i) {
        JSValue* value = storage->m_vector[i];
        if (value && !value->marked())
            value->mark();
    }

    if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
        SparseArrayValueMap::iterator end = map->end();
        for (SparseArrayValueMap::iterator it = map->begin(); it != end; ++it) {
            JSValue* value = it->second;
            if (!value->marked())
                value->mark();
        }
    }
}
예제 #5
0
파일: list.cpp 프로젝트: Chingliu/EAWebkit
void ArgList::markLists(ListSet& markSet)
{
    ListSet::iterator end = markSet.end();
    for (ListSet::iterator it = markSet.begin(); it != end; ++it) {
        ArgList* list = *it;

        iterator end2 = list->end();
        for (iterator it2 = list->begin(); it2 != end2; ++it2) {
            JSValue* v = *it2;
            if (!v->marked())
                v->mark();
        }
    }
}
void JSObject::mark()
{
    JSOBJECT_MARK_BEGIN();

    JSCell::mark();
    m_structureID->mark();

    size_t storageSize = m_structureID->propertyStorageSize();
    for (size_t i = 0; i < storageSize; ++i) {
        JSValue* v = m_propertyStorage[i];
        if (!v->marked())
            v->mark();
    }

    JSOBJECT_MARK_END();
}
예제 #7
0
void JSObject::mark()
{
    JSOBJECT_MARK_BEGIN();

    JSCell::mark();
    m_structureID->mark();

    unsigned storageSize = m_structureID->propertyMap().markingCount();
    if (storageSize) {
        for (unsigned i = 0; i < storageSize; ++i) {
            JSValue* v = m_propertyStorage[i];
            if (!v->marked())
                v->mark();
        }
    }

    JSOBJECT_MARK_END();
}
예제 #8
0
static inline void markIfNeeded(JSValue v)
{
    if (v && !v.marked())
        v.mark();
}