예제 #1
0
bool VariableAccessData::predict(SpeculatedType prediction)
{
    VariableAccessData* self = find();
    bool result = mergeSpeculation(self->m_prediction, prediction);
    if (result)
        mergeSpeculation(m_argumentAwarePrediction, m_prediction);
    return result;
}
예제 #2
0
bool AbstractValue::mergeOSREntryValue(Graph& graph, JSValue value)
{
    AbstractValue oldMe = *this;
    
    if (isClear()) {
        FrozenValue* frozenValue = graph.freeze(value);
        if (frozenValue->pointsToHeap()) {
            m_structure = frozenValue->structure();
            m_arrayModes = asArrayModes(frozenValue->structure()->indexingType());
        } else {
            m_structure.clear();
            m_arrayModes = 0;
        }
        
        m_type = speculationFromValue(value);
        m_value = value;
    } else {
        mergeSpeculation(m_type, speculationFromValue(value));
        if (!!value && value.isCell()) {
            Structure* structure = value.asCell()->structure();
            graph.registerStructure(structure);
            mergeArrayModes(m_arrayModes, asArrayModes(structure->indexingType()));
            m_structure.merge(StructureSet(structure));
        }
        if (m_value != value)
            m_value = JSValue();
    }
    
    checkConsistency();
    assertIsRegistered(graph);
    
    return oldMe != *this;
}
예제 #3
0
SpeculatedType RegisteredStructureSet::speculationFromStructures() const
{
    SpeculatedType result = SpecNone;
    forEach(
        [&] (RegisteredStructure structure) {
            mergeSpeculation(result, speculationFromStructure(structure.get()));
        });
    return result;
}
예제 #4
0
SpeculatedType StructureSet::speculationFromStructures() const
{
    SpeculatedType result = SpecNone;
    forEach(
        [&] (Structure* structure) {
            mergeSpeculation(result, speculationFromStructure(structure));
        });
    return result;
}
예제 #5
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;
}
예제 #6
0
bool VariableAccessData::mergeArgumentAwarePrediction(SpeculatedType prediction)
{
    return mergeSpeculation(find()->m_argumentAwarePrediction, prediction);
}