Changeset 121925 in webkit for trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
- Timestamp:
- Jul 5, 2012, 3:55:51 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r121798 r121925 100 100 void handleGetByOffset( 101 101 int destinationOperand, SpeculatedType, NodeIndex base, unsigned identifierNumber, 102 bool useInlineStorage, size_t offset);102 PropertyOffset); 103 103 void handleGetById( 104 104 int destinationOperand, SpeculatedType, NodeIndex base, unsigned identifierNumber, … … 1631 1631 void ByteCodeParser::handleGetByOffset( 1632 1632 int destinationOperand, SpeculatedType prediction, NodeIndex base, unsigned identifierNumber, 1633 bool useInlineStorage, size_t offset)1633 PropertyOffset offset) 1634 1634 { 1635 1635 NodeIndex propertyStorage; 1636 size_t offsetOffset; 1637 if (useInlineStorage) { 1636 if (isInlineOffset(offset)) 1638 1637 propertyStorage = base; 1639 ASSERT(!(sizeof(JSObject) % sizeof(EncodedJSValue))); 1640 offsetOffset = sizeof(JSObject) / sizeof(EncodedJSValue); 1641 } else { 1638 else 1642 1639 propertyStorage = addToGraph(GetPropertyStorage, base); 1643 offsetOffset = 0;1644 }1645 1640 set(destinationOperand, 1646 1641 addToGraph( … … 1649 1644 1650 1645 StorageAccessData storageAccessData; 1651 storageAccessData.offset = offset + offsetOffset;1646 storageAccessData.offset = indexRelativeToBase(offset); 1652 1647 storageAccessData.identifierNumber = identifierNumber; 1653 1648 m_graph.m_storageAccessData.append(storageAccessData); … … 1678 1673 addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(getByIdStatus.structureSet())), base); 1679 1674 1680 bool useInlineStorage;1681 1675 if (!getByIdStatus.chain().isEmpty()) { 1682 1676 Structure* currentStructure = getByIdStatus.structureSet().singletonStructure(); … … 1687 1681 base = addStructureTransitionCheck(currentObject, currentStructure); 1688 1682 } 1689 useInlineStorage = currentStructure->isUsingInlineStorage(); 1690 } else 1691 useInlineStorage = getByIdStatus.structureSet().allAreUsingInlinePropertyStorage(); 1683 } 1692 1684 1693 1685 // Unless we want bugs like https://bugs.webkit.org/show_bug.cgi?id=88783, we need to … … 1708 1700 1709 1701 handleGetByOffset( 1710 destinationOperand, prediction, base, identifierNumber, useInlineStorage, 1711 getByIdStatus.offset()); 1702 destinationOperand, prediction, base, identifierNumber, getByIdStatus.offset()); 1712 1703 } 1713 1704 … … 2173 2164 SpeculatedType prediction = getPrediction(); 2174 2165 2175 ASSERT(interpreter->getOpcodeID(getInstruction->u.opcode) == op_get_by_id); 2166 ASSERT(interpreter->getOpcodeID(getInstruction->u.opcode) == op_get_by_id 2167 || interpreter->getOpcodeID(getInstruction->u.opcode) == op_get_by_id_out_of_line); 2176 2168 2177 2169 NodeIndex base = get(getInstruction[2].u.operand); … … 2226 2218 NEXT_OPCODE(op_put_scoped_var); 2227 2219 } 2228 case op_get_by_id: { 2220 case op_get_by_id: 2221 case op_get_by_id_out_of_line: { 2229 2222 SpeculatedType prediction = getPredictionWithoutOSRExit(); 2230 2223 … … 2242 2235 } 2243 2236 case op_put_by_id: 2237 case op_put_by_id_out_of_line: 2244 2238 case op_put_by_id_transition_direct: 2245 case op_put_by_id_transition_normal: { 2239 case op_put_by_id_transition_normal: 2240 case op_put_by_id_transition_direct_out_of_line: 2241 case op_put_by_id_transition_normal_out_of_line: { 2246 2242 NodeIndex value = get(currentInstruction[3].u.operand); 2247 2243 NodeIndex base = get(currentInstruction[1].u.operand); … … 2260 2256 if (!hasExitSite && putByIdStatus.isSimpleReplace()) { 2261 2257 addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(putByIdStatus.oldStructure())), base); 2262 size_t offsetOffset;2263 2258 NodeIndex propertyStorage; 2264 if ( putByIdStatus.oldStructure()->isUsingInlineStorage()) {2259 if (isInlineOffset(putByIdStatus.offset())) 2265 2260 propertyStorage = base; 2266 ASSERT(!(sizeof(JSObject) % sizeof(EncodedJSValue))); 2267 offsetOffset = sizeof(JSObject) / sizeof(EncodedJSValue); 2268 } else { 2261 else 2269 2262 propertyStorage = addToGraph(GetPropertyStorage, base); 2270 offsetOffset = 0;2271 }2272 2263 addToGraph(PutByOffset, OpInfo(m_graph.m_storageAccessData.size()), propertyStorage, base, value); 2273 2264 2274 2265 StorageAccessData storageAccessData; 2275 storageAccessData.offset = putByIdStatus.offset() + offsetOffset;2266 storageAccessData.offset = indexRelativeToBase(putByIdStatus.offset()); 2276 2267 storageAccessData.identifierNumber = identifierNumber; 2277 2268 m_graph.m_storageAccessData.append(storageAccessData); 2278 2269 } else if (!hasExitSite 2279 2270 && putByIdStatus.isSimpleTransition() 2280 && putByIdStatus.oldStructure()-> propertyStorageCapacity() == putByIdStatus.newStructure()->propertyStorageCapacity()2271 && putByIdStatus.oldStructure()->outOfLineCapacity() == putByIdStatus.newStructure()->outOfLineCapacity() 2281 2272 && structureChainIsStillValid( 2282 2273 direct, … … 2309 2300 base); 2310 2301 2311 size_t offsetOffset;2312 2302 NodeIndex propertyStorage; 2313 if ( putByIdStatus.newStructure()->isUsingInlineStorage()) {2303 if (isInlineOffset(putByIdStatus.offset())) 2314 2304 propertyStorage = base; 2315 ASSERT(!(sizeof(JSObject) % sizeof(EncodedJSValue))); 2316 offsetOffset = sizeof(JSObject) / sizeof(EncodedJSValue); 2317 } else { 2305 else 2318 2306 propertyStorage = addToGraph(GetPropertyStorage, base); 2319 offsetOffset = 0;2320 }2321 2307 addToGraph( 2322 2308 PutByOffset, … … 2327 2313 2328 2314 StorageAccessData storageAccessData; 2329 storageAccessData.offset = putByIdStatus.offset() + offsetOffset;2315 storageAccessData.offset = indexRelativeToBase(putByIdStatus.offset()); 2330 2316 storageAccessData.identifierNumber = identifierNumber; 2331 2317 m_graph.m_storageAccessData.append(storageAccessData); … … 2739 2725 handleGetByOffset( 2740 2726 currentInstruction[1].u.operand, prediction, globalObject, 2741 identifierNumber, status.structure()->isUsingInlineStorage(), 2742 status.offset()); 2727 identifierNumber, status.offset()); 2743 2728 } 2744 2729
Note:
See TracChangeset
for help on using the changeset viewer.