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; }
ArrayModes RegisteredStructureSet::arrayModesFromStructures() const { ArrayModes result = 0; forEach( [&] (RegisteredStructure structure) { mergeArrayModes(result, asArrayModes(structure->indexingType())); }); return result; }
ArrayModes StructureSet::arrayModesFromStructures() const { if (isThin()) { if (!singleStructure()) return 0; return asArrayModes(singleStructure()->indexingType()); } ArrayModes result = 0; OutOfLineList* list = structureList(); for (unsigned i = 0; i < list->m_length; ++i) mergeArrayModes(result, asArrayModes(list->list()[i]->indexingType())); return result; }