Changeset 45039 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jun 23, 2009, 7:47:48 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r45011 r45039 1 2009-06-23 Oliver Hunt <[email protected]> 2 3 Reviewed by Gavin Barraclough. 4 5 <rdar://problem/6992806> REGRESSION: Enumeration can skip new properties in cases of prototypes that have more than 64 (26593) 6 <https://bugs.webkit.org/show_bug.cgi?id=26593> 7 8 Do not attempt to cache structure chains if they contain a dictionary at any level. 9 10 * interpreter/Interpreter.cpp: 11 (JSC::Interpreter::tryCachePutByID): 12 (JSC::Interpreter::tryCacheGetByID): 13 * jit/JITStubs.cpp: 14 (JSC::JITThunks::tryCachePutByID): 15 * runtime/Structure.cpp: 16 (JSC::Structure::getEnumerablePropertyNames): 17 (JSC::Structure::addPropertyTransition): 18 * runtime/StructureChain.cpp: 19 (JSC::StructureChain::isCacheable): 20 * runtime/StructureChain.h: 21 1 22 2009-06-23 Yong Li <[email protected]> 2 23 -
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r44923 r45039 971 971 } 972 972 973 StructureChain* protoChain = structure->prototypeChain(callFrame); 974 if (!protoChain->isCacheable()) { 975 vPC[0] = getOpcode(op_put_by_id_generic); 976 return; 977 } 978 973 979 // Structure transition, cache transition info 974 980 if (slot.type() == PutPropertySlot::NewProperty) { … … 976 982 vPC[4] = structure->previousID(); 977 983 vPC[5] = structure; 978 vPC[6] = structure->prototypeChain(callFrame);984 vPC[6] = protoChain; 979 985 vPC[7] = slot.cachedOffset(); 980 986 codeBlock->refStructures(vPC); … … 1078 1084 } 1079 1085 1086 StructureChain* protoChain = structure->prototypeChain(callFrame); 1087 if (!protoChain->isCacheable()) { 1088 vPC[0] = getOpcode(op_put_by_id_generic); 1089 return; 1090 } 1091 1080 1092 vPC[0] = getOpcode(op_get_by_id_chain); 1081 1093 vPC[4] = structure; 1082 vPC[5] = structure->prototypeChain(callFrame);1094 vPC[5] = protoChain; 1083 1095 vPC[6] = count; 1084 1096 vPC[7] = slot.cachedOffset(); -
trunk/JavaScriptCore/jit/JITStubs.cpp
r44889 r45039 384 384 if (slot.type() == PutPropertySlot::NewProperty) { 385 385 StructureChain* prototypeChain = structure->prototypeChain(callFrame); 386 if (!prototypeChain->isCacheable()) { 387 ctiPatchCallByReturnAddress(returnAddress, FunctionPtr(JITStubs::cti_op_put_by_id_generic)); 388 return; 389 } 386 390 stubInfo->initPutByIdTransition(structure->previousID(), structure, prototypeChain); 387 391 JIT::compilePutByIdTransition(callFrame->scopeChain()->globalData, codeBlock, stubInfo, structure->previousID(), structure, slot.cachedOffset(), prototypeChain, returnAddress); … … 471 475 472 476 StructureChain* prototypeChain = structure->prototypeChain(callFrame); 477 if (!prototypeChain->isCacheable()) { 478 ctiPatchCallByReturnAddress(returnAddress, FunctionPtr(JITStubs::cti_op_get_by_id_generic)); 479 return; 480 } 473 481 stubInfo->initGetByIdChain(structure, prototypeChain); 474 482 JIT::compileGetByIdChain(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, prototypeChain, count, slot.cachedOffset(), returnAddress); … … 1044 1052 ctiPatchCallByReturnAddress(STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full)); 1045 1053 } else if (size_t count = countPrototypeChainEntriesAndCheckForProxies(callFrame, baseValue, slot)) { 1054 StructureChain* protoChain = structure->prototypeChain(callFrame); 1055 if (!protoChain->isCacheable()) { 1056 ctiPatchCallByReturnAddress(STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail)); 1057 return JSValue::encode(result); 1058 } 1059 1046 1060 int listIndex; 1047 1061 PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex); 1048 JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, structure->prototypeChain(callFrame), count, slot.cachedOffset());1062 JIT::compileGetByIdChainList(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, prototypeStructureList, listIndex, structure, protoChain, count, slot.cachedOffset()); 1049 1063 1050 1064 if (listIndex == (POLYMORPHIC_LIST_CACHE_SIZE - 1)) -
trunk/JavaScriptCore/runtime/Structure.cpp
r44171 r45039 307 307 308 308 if (shouldCache) { 309 StructureChain* protoChain = prototypeChain(exec); 309 310 m_cachedPropertyNameArrayData = propertyNames.data(); 310 m_cachedPropertyNameArrayData->setCachedPrototypeChain(prototypeChain(exec)); 311 if (!protoChain->isCacheable()) 312 return; 313 m_cachedPropertyNameArrayData->setCachedPrototypeChain(protoChain); 311 314 m_cachedPropertyNameArrayData->setCachedStructure(this); 312 315 } … … 408 411 if (structure->transitionCount() > s_maxTransitionLength) { 409 412 RefPtr<Structure> transition = toDictionaryTransition(structure); 413 ASSERT(structure != transition); 410 414 offset = transition->put(propertyName, attributes, specificValue); 411 415 if (transition->propertyStorageSize() > transition->propertyStorageCapacity()) -
trunk/JavaScriptCore/runtime/StructureChain.cpp
r44224 r45039 47 47 } 48 48 49 bool StructureChain::isCacheable() const 50 { 51 uint32_t i = 0; 52 53 while (m_vector[i]) { 54 if (m_vector[i++]->isDictionary()) 55 return false; 56 } 57 return true; 58 } 59 49 60 } // namespace JSC -
trunk/JavaScriptCore/runtime/StructureChain.h
r44224 r45039 40 40 static PassRefPtr<StructureChain> create(Structure* head) { return adoptRef(new StructureChain(head)); } 41 41 RefPtr<Structure>* head() { return m_vector.get(); } 42 bool isCacheable() const; 42 43 43 44 private:
Note:
See TracChangeset
for help on using the changeset viewer.