Пример #1
0
SpeculatedType StructureSet::speculationFromStructures() const
{
    if (isThin()) {
        if (!singleStructure())
            return SpecNone;
        return speculationFromStructure(singleStructure());
    }

    SpeculatedType result = SpecNone;
    OutOfLineList* list = structureList();
    for (unsigned i = 0; i < list->m_length; ++i)
        mergeSpeculation(result, speculationFromStructure(list->list()[i]));
    return result;
}
Пример #2
0
void RegisteredStructureSet::filter(SpeculatedType type)
{
    genericFilter(
        [&] (RegisteredStructure structure) -> bool {
            return type & speculationFromStructure(structure.get());
        });
}
Пример #3
0
void StructureSet::filter(SpeculatedType type)
{
    genericFilter(
        [&] (Structure* structure) -> bool {
            return type & speculationFromStructure(structure);
        });
}
Пример #4
0
SpeculatedType RegisteredStructureSet::speculationFromStructures() const
{
    SpeculatedType result = SpecNone;
    forEach(
        [&] (RegisteredStructure structure) {
            mergeSpeculation(result, speculationFromStructure(structure.get()));
        });
    return result;
}
Пример #5
0
SpeculatedType StructureSet::speculationFromStructures() const
{
    SpeculatedType result = SpecNone;
    forEach(
        [&] (Structure* structure) {
            mergeSpeculation(result, speculationFromStructure(structure));
        });
    return result;
}
Пример #6
0
void AbstractValue::set(Graph& graph, Structure* structure)
{
    m_currentKnownStructure = structure;
    setFuturePossibleStructure(graph, structure);
    m_arrayModes = asArrayModes(structure->indexingType());
    m_type = speculationFromStructure(structure);
    m_value = JSValue();
    
    checkConsistency();
}
Пример #7
0
void AbstractValue::set(Graph& graph, Structure* structure)
{
    m_structure = structure;
    m_arrayModes = asArrayModes(structure->indexingType());
    m_type = speculationFromStructure(structure);
    m_value = JSValue();
    
    checkConsistency();
    assertIsRegistered(graph);
}
Пример #8
0
SpeculatedType speculationFromCell(JSCell* cell)
{
    if (JSString* string = jsDynamicCast<JSString*>(cell)) {
        if (const StringImpl* impl = string->tryGetValueImpl()) {
            if (impl->isIdentifier())
                return SpecStringIdent;
        }
        return SpecStringVar;
    }
    return speculationFromStructure(cell->structure());
}
void StructureAbstractValue::filterSlow(SpeculatedType type)
{
    SAMPLE("StructureAbstractValue filter type slow");

    if (!(type & SpecCell)) {
        clear();
        return;
    }
    
    ASSERT(!isTop());
    
    m_set.genericFilter(
        [&] (Structure* structure) {
            return !!(speculationFromStructure(structure) & type);
        });
}
Пример #10
0
bool AbstractValue::contains(Structure* structure) const
{
    return couldBeType(speculationFromStructure(structure))
        && (m_arrayModes & arrayModeFromStructure(structure))
        && m_structure.contains(structure);
}