Changeset 41232 in webkit for trunk/JavaScriptCore/jit/JITStubs.cpp
- Timestamp:
- Feb 25, 2009, 3:44:07 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITStubs.cpp
r41168 r41232 114 114 // Structure transition, cache transition info 115 115 if (slot.type() == PutPropertySlot::NewProperty) { 116 StructureChain* chain = structure->cachedPrototypeChain(); 117 if (!chain) { 118 chain = cachePrototypeChain(callFrame, structure); 119 if (!chain) { 120 // This happens if someone has manually inserted null into the prototype chain 121 stubInfo->opcodeID = op_put_by_id_generic; 122 return; 123 } 124 } 125 stubInfo->initPutByIdTransition(structure->previousID(), structure, chain); 126 JIT::compilePutByIdTransition(callFrame->scopeChain()->globalData, codeBlock, stubInfo, structure->previousID(), structure, slot.cachedOffset(), chain, returnAddress); 116 StructureChain* prototypeChain = structure->prototypeChain(callFrame); 117 stubInfo->initPutByIdTransition(structure->previousID(), structure, prototypeChain); 118 JIT::compilePutByIdTransition(callFrame->scopeChain()->globalData, codeBlock, stubInfo, structure->previousID(), structure, slot.cachedOffset(), prototypeChain, returnAddress); 127 119 return; 128 120 } … … 206 198 // Since we're accessing a prototype in a loop, it's a good bet that it 207 199 // should not be treated as a dictionary. 208 if (slotBaseObject->structure()->isDictionary()) { 209 RefPtr<Structure> transition = Structure::fromDictionaryTransition(slotBaseObject->structure()); 210 slotBaseObject->setStructure(transition.release()); 211 asCell(baseValue)->structure()->setCachedPrototypeChain(0); 212 } 200 if (slotBaseObject->structure()->isDictionary()) 201 slotBaseObject->setStructure(Structure::fromDictionaryTransition(slotBaseObject->structure())); 213 202 214 203 stubInfo->initGetByIdProto(structure, slotBaseObject->structure()); … … 224 213 } 225 214 226 StructureChain* chain = structure->cachedPrototypeChain(); 227 if (!chain) 228 chain = cachePrototypeChain(callFrame, structure); 229 ASSERT(chain); 230 231 stubInfo->initGetByIdChain(structure, chain); 232 233 JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, chain, count, slot.cachedOffset(), returnAddress); 215 StructureChain* prototypeChain = structure->prototypeChain(callFrame); 216 stubInfo->initGetByIdChain(structure, prototypeChain); 217 JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, slot.cachedOffset(), returnAddress); 234 218 } 235 219 … … 673 657 // Since we're accessing a prototype in a loop, it's a good bet that it 674 658 // should not be treated as a dictionary. 675 if (slotBaseObject->structure()->isDictionary()) { 676 RefPtr<Structure> transition = Structure::fromDictionaryTransition(slotBaseObject->structure()); 677 slotBaseObject->setStructure(transition.release()); 678 asCell(baseValue)->structure()->setCachedPrototypeChain(0); 679 } 659 if (slotBaseObject->structure()->isDictionary()) 660 slotBaseObject->setStructure(Structure::fromDictionaryTransition(slotBaseObject->structure())); 680 661 681 662 int listIndex; … … 687 668 ctiPatchCallByReturnAddress(STUB_RETURN_ADDRESS, reinterpret_cast<void*>(cti_op_get_by_id_proto_list_full)); 688 669 } else if (size_t count = countPrototypeChainEntriesAndCheckForProxies(callFrame, baseValue, slot)) { 689 StructureChain* chain = structure->cachedPrototypeChain();690 if (!chain)691 chain = cachePrototypeChain(callFrame, structure);692 ASSERT(chain);693 694 670 int listIndex; 695 671 PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex); 696 697 JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, chain, count, slot.cachedOffset()); 672 JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, structure->prototypeChain(callFrame), count, slot.cachedOffset()); 698 673 699 674 if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1))
Note:
See TracChangeset
for help on using the changeset viewer.