本文整理汇总了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;
}
}
示例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;
}
}
示例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());
//.........这里部分代码省略.........