void RegisteredStructureSet::filterArrayModes(ArrayModes arrayModes)
{
    genericFilter(
        [&] (RegisteredStructure structure) -> bool {
            return arrayModes & arrayModeFromStructure(structure.get());
        });
}
Example #2
0
void StructureSet::filterArrayModes(ArrayModes arrayModes)
{
    genericFilter(
        [&] (Structure* structure) -> bool {
            return arrayModes & arrayModeFromStructure(structure);
        });
}
Example #3
0
void ArrayProfile::computeUpdatedPrediction(const ConcurrentJITLocker&, CodeBlock* codeBlock, Structure* lastSeenStructure)
{
    m_observedArrayModes |= arrayModeFromStructure(lastSeenStructure);

    if (!m_didPerformFirstRunPruning
        && hasTwoOrMoreBitsSet(m_observedArrayModes)) {
        m_observedArrayModes = arrayModeFromStructure(lastSeenStructure);
        m_didPerformFirstRunPruning = true;
    }

    m_mayInterceptIndexedAccesses |=
        lastSeenStructure->typeInfo().interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero();
    JSGlobalObject* globalObject = codeBlock->globalObject();
    if (!globalObject->isOriginalArrayStructure(lastSeenStructure)
        && !globalObject->isOriginalTypedArrayStructure(lastSeenStructure))
        m_usesOriginalArrayStructures = false;
}
Example #4
0
void ArrayProfile::computeUpdatedPrediction(CodeBlock* codeBlock, OperationInProgress operation)
{
    const bool verbose = false;
    
    if (m_lastSeenStructure) {
        m_observedArrayModes |= arrayModeFromStructure(m_lastSeenStructure);
        m_mayInterceptIndexedAccesses |=
            m_lastSeenStructure->typeInfo().interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero();
        if (!codeBlock->globalObject()->isOriginalArrayStructure(m_lastSeenStructure))
            m_usesOriginalArrayStructures = false;
        if (!structureIsPolymorphic()) {
            if (!m_expectedStructure)
                m_expectedStructure = m_lastSeenStructure;
            else if (m_expectedStructure != m_lastSeenStructure) {
                if (verbose)
                    dataLog(*codeBlock, " bc#", m_bytecodeOffset, ": making structure polymorphic because ", RawPointer(m_expectedStructure), " (", m_expectedStructure->classInfo()->className, ") != ", RawPointer(m_lastSeenStructure), " (", m_lastSeenStructure->classInfo()->className, ")\n");
                m_expectedStructure = polymorphicStructure();
            }
        }
        m_lastSeenStructure = 0;
    }
    
    if (hasTwoOrMoreBitsSet(m_observedArrayModes)) {
        if (verbose)
            dataLog(*codeBlock, " bc#", m_bytecodeOffset, ": making structure polymorphic because two or more bits are set in m_observedArrayModes\n");
        m_expectedStructure = polymorphicStructure();
    }
    
    if (operation == Collection
        && expectedStructure()
        && !Heap::isMarked(m_expectedStructure)) {
        if (verbose)
            dataLog(*codeBlock, " bc#", m_bytecodeOffset, ": making structure during GC\n");
        m_expectedStructure = polymorphicStructure();
    }
}
bool AbstractValue::contains(Structure* structure) const
{
    return couldBeType(speculationFromStructure(structure))
        && (m_arrayModes & arrayModeFromStructure(structure))
        && m_structure.contains(structure);
}
Example #6
0
ArrayModes ArrayProfile::updatedObservedArrayModes() const
{
    if (m_lastSeenStructure)
        return m_observedArrayModes | arrayModeFromStructure(m_lastSeenStructure);
    return m_observedArrayModes;
}