Changeset 51976 in webkit
- Timestamp:
- Dec 10, 2009 6:22:07 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r51975 r51976 1 2009-12-10 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Incorrect caching of prototype lookup with dictionary base 6 https://bugs.webkit.org/show_bug.cgi?id=32402 7 8 Make sure we don't add cached prototype lookup to the proto_list 9 lookup chain if the top level object is a dictionary. 10 11 * jit/JITStubs.cpp: 12 (JSC::JITThunks::tryCacheGetByID): 13 1 14 2009-12-10 Gavin Barraclough <barraclough@apple.com> 2 15 -
trunk/JavaScriptCore/jit/JITStubs.cpp
r51975 r51976 848 848 stubInfo->initGetByIdProto(structure, slotBaseObject->structure()); 849 849 850 ASSERT(!structure->isDictionary()); 851 ASSERT(!slotBaseObject->structure()->isDictionary()); 850 852 JIT::compileGetByIdProto(callFrame->scopeChain()->globalData, callFrame, codeBlock, stubInfo, structure, slotBaseObject->structure(), slot.cachedOffset(), returnAddress); 851 853 return; … … 1366 1368 CHECK_FOR_EXCEPTION(); 1367 1369 1368 if (!baseValue.isCell() || !slot.isCacheable() || asCell(baseValue)->structure()->is UncacheableDictionary()) {1370 if (!baseValue.isCell() || !slot.isCacheable() || asCell(baseValue)->structure()->isDictionary()) { 1369 1371 ctiPatchCallByReturnAddress(callFrame->codeBlock(), STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail)); 1370 1372 return JSValue::encode(result); … … 1381 1383 ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_fail)); 1382 1384 else if (slot.slotBase() == asCell(baseValue)->structure()->prototypeForLookup(callFrame)) { 1385 ASSERT(!asCell(baseValue)->structure()->isDictionary()); 1383 1386 // Since we're accessing a prototype in a loop, it's a good bet that it 1384 1387 // should not be treated as a dictionary. … … 1394 1397 ctiPatchCallByReturnAddress(codeBlock, STUB_RETURN_ADDRESS, FunctionPtr(cti_op_get_by_id_proto_list_full)); 1395 1398 } else if (size_t count = normalizePrototypeChain(callFrame, baseValue, slot.slotBase())) { 1399 ASSERT(!asCell(baseValue)->structure()->isDictionary()); 1396 1400 int listIndex; 1397 1401 PolymorphicAccessStructureList* prototypeStructureList = getPolymorphicAccessStructureListSlot(stubInfo, listIndex); -
trunk/LayoutTests/ChangeLog
r51973 r51976 1 2009-12-10 Oliver Hunt <oliver@apple.com> 2 3 Reviewed by Gavin Barraclough. 4 5 Incorrect caching of prototype lookup with dictionary base 6 https://bugs.webkit.org/show_bug.cgi?id=32402 7 8 Adding test for prototype caching through a dictionary 9 10 * fast/js/dictionary-prototype-caching-expected.txt: 11 * fast/js/script-tests/dictionary-prototype-caching.js: 12 (testFunction): 13 1 14 2009-12-10 Alexey Proskuryakov <ap@apple.com> 2 15 -
trunk/LayoutTests/fast/js/dictionary-prototype-caching-expected.txt
r50707 r51976 8 8 PASS protoKeys is [1,2,3] 9 9 PASS protoKeys is [1,2,3] 10 PASS testFunction(subclass1) is true 11 PASS testFunction(subclass2) is true 12 PASS testFunction(subclass2) is true 10 13 PASS successfullyParsed is true 11 14 -
trunk/LayoutTests/fast/js/script-tests/dictionary-prototype-caching.js
r50704 r51976 55 55 shouldBe("protoKeys", "[1,2,3]"); 56 56 57 function testFunction(o) { 58 return o.test; 59 } 60 61 var proto = { test: true }; 62 var subclass1 = { __proto__: proto }; 63 var subclass2 = { __proto__: proto }; 64 for (var i = 0; i < 500; i++) 65 subclass2["a"+i]="a"+i; 66 67 testFunction(subclass1); 68 shouldBeTrue("testFunction(subclass1)"); 69 shouldBeTrue("testFunction(subclass2)"); 70 proto.test = false 71 subclass2.test = true; 72 shouldBeTrue("testFunction(subclass2)"); 73 57 74 successfullyParsed = true;
Note: See TracChangeset
for help on using the changeset viewer.