当前位置: 首页>>代码示例>>C++>>正文


C++ JSGlobalObject::originalArrayStructureForIndexingType方法代码示例

本文整理汇总了C++中JSGlobalObject::originalArrayStructureForIndexingType方法的典型用法代码示例。如果您正苦于以下问题:C++ JSGlobalObject::originalArrayStructureForIndexingType方法的具体用法?C++ JSGlobalObject::originalArrayStructureForIndexingType怎么用?C++ JSGlobalObject::originalArrayStructureForIndexingType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JSGlobalObject的用法示例。


在下文中一共展示了JSGlobalObject::originalArrayStructureForIndexingType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: originalArrayStructure

Structure* ArrayMode::originalArrayStructure(Graph& graph, const CodeOrigin& codeOrigin) const
{
    JSGlobalObject* globalObject = graph.globalObjectFor(codeOrigin);
    
    switch (arrayClass()) {
    case Array::OriginalArray: {
        switch (type()) {
        case Array::Int32:
            return globalObject->originalArrayStructureForIndexingType(ArrayWithInt32);
        case Array::Double:
            return globalObject->originalArrayStructureForIndexingType(ArrayWithDouble);
        case Array::Contiguous:
            return globalObject->originalArrayStructureForIndexingType(ArrayWithContiguous);
        case Array::ArrayStorage:
            return globalObject->originalArrayStructureForIndexingType(ArrayWithArrayStorage);
        default:
            CRASH();
            return 0;
        }
    }
        
    case Array::OriginalNonArray: {
        TypedArrayType type = typedArrayType();
        if (type == NotTypedArray)
            return 0;
        
        return globalObject->typedArrayStructure(type);
    }
        
    default:
        return 0;
    }
}
开发者ID:boska,项目名称:webkit,代码行数:33,代码来源:DFGArrayMode.cpp

示例2: originalArrayStructure

Structure* ArrayMode::originalArrayStructure(Graph& graph, const CodeOrigin& codeOrigin) const
{
    if (!isJSArrayWithOriginalStructure())
        return 0;
    
    JSGlobalObject* globalObject = graph.globalObjectFor(codeOrigin);
    
    switch (type()) {
    case Array::Int32:
        return globalObject->originalArrayStructureForIndexingType(ArrayWithInt32);
    case Array::Double:
        return globalObject->originalArrayStructureForIndexingType(ArrayWithDouble);
    case Array::Contiguous:
        return globalObject->originalArrayStructureForIndexingType(ArrayWithContiguous);
    case Array::ArrayStorage:
        return globalObject->originalArrayStructureForIndexingType(ArrayWithArrayStorage);
    default:
        CRASH();
        return 0;
    }
}
开发者ID:jiezh,项目名称:h5vcc,代码行数:21,代码来源:DFGArrayMode.cpp

示例3: run

    bool run()
    {
        // FIXME: This phase shouldn't exist. We should have registered all structures by now, since
        // we may already have done optimizations that rely on structures having been registered.
        // Currently, we still have places where we don't register structures prior to this phase,
        // but structures don't end up being used for optimization prior to this phase. That's a
        // pretty fragile situation and we should fix it eventually.
        // https://bugs.webkit.org/show_bug.cgi?id=147889
        
        // We need to set this before this phase finishes. This phase doesn't do anything
        // conditioned on this field, except for assertIsRegistered() below. We intend for that
        // method to behave as if the phase was already finished. So, we set this up here.
        m_graph.m_structureRegistrationState = AllStructuresAreRegistered;
        
        // These are pretty dumb, but needed to placate subsequent assertions. We don't actually
        // have to watch these because there is no way to transition away from it, but they are
        // watchable and so we will assert if they aren't watched.
        registerStructure(m_graph.m_vm.structureStructure.get());
        registerStructure(m_graph.m_vm.stringStructure.get());
        registerStructure(m_graph.m_vm.symbolStructure.get());
        
        for (FrozenValue* value : m_graph.m_frozenValues)
            assertIsRegistered(value->structure());
        
        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
            BasicBlock* block = m_graph.block(blockIndex);
            if (!block)
                continue;
        
            for (unsigned nodeIndex = 0; nodeIndex < block->size(); ++nodeIndex) {
                Node* node = block->at(nodeIndex);
            
                switch (node->op()) {
                case CheckStructure:
                    assertAreRegistered(node->structureSet());
                    break;
                
                case NewObject:
                case ArrayifyToStructure:
                case NewStringObject:
                    registerStructure(node->structure());
                    break;
                
                case PutStructure:
                case AllocatePropertyStorage:
                case ReallocatePropertyStorage:
                    registerStructure(node->transition()->previous);
                    registerStructure(node->transition()->next);
                    break;

                case GetGetterSetterByOffset:
                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->getterSetterStructure());
                    break;

                case MultiGetByOffset:
                    for (const MultiGetByOffsetCase& getCase : node->multiGetByOffsetData().cases)
                        registerStructures(getCase.set());
                    break;
                    
                case MultiPutByOffset:
                    for (unsigned i = node->multiPutByOffsetData().variants.size(); i--;) {
                        PutByIdVariant& variant = node->multiPutByOffsetData().variants[i];
                        registerStructures(variant.oldStructure());
                        if (variant.kind() == PutByIdVariant::Transition)
                            registerStructure(variant.newStructure());
                    }
                    break;
                    
                case NewArray:
                case NewArrayBuffer:
                case NewArrayWithSize: {
                    JSGlobalObject* globalObject = m_graph.globalObjectFor(node->origin.semantic);
                    registerStructure(globalObject->arrayStructureForIndexingTypeDuringAllocation(node->indexingType()));
                    registerStructure(globalObject->originalArrayStructureForIndexingType(ArrayWithSlowPutArrayStorage));
                    break;
                }
                    
                case NewTypedArray:
                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->typedArrayStructureConcurrently(node->typedArrayType()));
                    break;
                    
                case ToString:
                case CallStringConstructor:
                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->stringObjectStructure());
                    break;
                    
                case CreateActivation:
                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->activationStructure());
                    break;
                    
                case CreateDirectArguments:
                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->directArgumentsStructure());
                    break;
                    
                case CreateScopedArguments:
                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->scopedArgumentsStructure());
                    break;

                case CreateClonedArguments:
                    registerStructure(m_graph.globalObjectFor(node->origin.semantic)->clonedArgumentsStructure());
//.........这里部分代码省略.........
开发者ID:LuXiong,项目名称:webkit,代码行数:101,代码来源:DFGStructureRegistrationPhase.cpp


注:本文中的JSGlobalObject::originalArrayStructureForIndexingType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。