Changeset 39374 in webkit for trunk/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Dec 18, 2008, 9:45:44 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r39370 r39374 1315 1315 static size_t countPrototypeChainEntriesAndCheckForProxies(CallFrame* callFrame, JSValue* baseValue, const PropertySlot& slot) 1316 1316 { 1317 JS Object* o = asObject(baseValue);1317 JSCell* cell = asCell(baseValue); 1318 1318 size_t count = 0; 1319 1319 1320 while (slot.slotBase() != o) {1321 JSValue* v = o->structure()->prototypeForLookup(callFrame);1320 while (slot.slotBase() != cell) { 1321 JSValue* v = cell->structure()->prototypeForLookup(callFrame); 1322 1322 1323 1323 // If we didn't find slotBase in baseValue's prototype chain, then baseValue … … 1327 1327 return 0; 1328 1328 1329 o = asObject(v);1330 1331 // Heavy access to a prototype is a good indication that it's not being1332 // used as a dictionary.1333 if ( o->structure()->isDictionary()) {1334 RefPtr<Structure> transition = Structure::fromDictionaryTransition( o->structure());1335 o->setStructure(transition.release());1336 asObject(baseValue)->structure()->setCachedPrototypeChain(0);1329 cell = asCell(v); 1330 1331 // Since we're accessing a prototype in a loop, it's a good bet that it 1332 // should not be treated as a dictionary. 1333 if (cell->structure()->isDictionary()) { 1334 RefPtr<Structure> transition = Structure::fromDictionaryTransition(cell->structure()); 1335 asObject(cell)->setStructure(transition.release()); 1336 cell->structure()->setCachedPrototypeChain(0); 1337 1337 } 1338 1338 … … 1408 1408 JSObject* baseObject = asObject(slot.slotBase()); 1409 1409 1410 // Heavy access to a prototype is a good indication that it's not being1411 // used as a dictionary.1410 // Since we're accessing a prototype in a loop, it's a good bet that it 1411 // should not be treated as a dictionary. 1412 1412 if (baseObject->structure()->isDictionary()) { 1413 1413 RefPtr<Structure> transition = Structure::fromDictionaryTransition(baseObject->structure()); … … 4179 4179 JSObject* slotBaseObject = asObject(slot.slotBase()); 4180 4180 4181 // Heavy access to a prototype is a good indication that it's not being4182 // used as a dictionary.4181 // Since we're accessing a prototype in a loop, it's a good bet that it 4182 // should not be treated as a dictionary. 4183 4183 if (slotBaseObject->structure()->isDictionary()) { 4184 4184 RefPtr<Structure> transition = Structure::fromDictionaryTransition(slotBaseObject->structure()); 4185 4185 slotBaseObject->setStructure(transition.release()); 4186 as Object(baseValue)->structure()->setCachedPrototypeChain(0);4186 asCell(baseValue)->structure()->setCachedPrototypeChain(0); 4187 4187 } 4188 4188 … … 4555 4555 CHECK_FOR_EXCEPTION(); 4556 4556 4557 if ( baseValue->isObject()4557 if (!JSImmediate::isImmediate(baseValue) 4558 4558 && slot.isCacheable() 4559 4559 && !asCell(baseValue)->structure()->isDictionary() … … 4629 4629 CHECK_FOR_EXCEPTION(); 4630 4630 4631 if ( !baseValue->isObject() || !slot.isCacheable() || asCell(baseValue)->structure()->isDictionary()) {4631 if (JSImmediate::isImmediate(baseValue) || !slot.isCacheable() || asCell(baseValue)->structure()->isDictionary()) { 4632 4632 ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, reinterpret_cast<void*>(cti_op_get_by_id_proto_fail)); 4633 4633 return result; … … 4644 4644 ctiRepatchCallByReturnAddress(CTI_RETURN_ADDRESS, reinterpret_cast<void*>(cti_op_get_by_id_proto_fail)); 4645 4645 else if (slot.slotBase() == asCell(baseValue)->structure()->prototypeForLookup(callFrame)) { 4646 // Heavy access to a prototype is a good indication that it's not being4647 // used as a dictionary.4646 // Since we're accessing a prototype in a loop, it's a good bet that it 4647 // should not be treated as a dictionary. 4648 4648 if (slotBaseObject->structure()->isDictionary()) { 4649 4649 RefPtr<Structure> transition = Structure::fromDictionaryTransition(slotBaseObject->structure()); 4650 4650 slotBaseObject->setStructure(transition.release()); 4651 as Object(baseValue)->structure()->setCachedPrototypeChain(0);4651 asCell(baseValue)->structure()->setCachedPrototypeChain(0); 4652 4652 } 4653 4653
Note:
See TracChangeset
for help on using the changeset viewer.