Changeset 36081 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- Sep 4, 2008, 12:21:43 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r36058 r36081 1196 1196 } 1197 1197 1198 JSCell* baseCell = static_cast<JSCell*>(baseValue); 1199 StructureID* structureID = baseCell->structureID(); 1198 StructureID* structureID = static_cast<JSCell*>(baseValue)->structureID(); 1200 1199 1201 1200 // FIXME: Remove this !structureID check once all JSCells have StructureIDs. … … 1226 1225 // Cache hit: Specialize instruction and ref StructureIDs. 1227 1226 1228 JSValue* slotBase = slot.slotBase(); 1229 if (slotBase == baseCell) { 1227 if (slot.slotBase() == baseValue) { 1230 1228 vPC[0] = getOpcode(op_get_by_id_self); 1231 1229 vPC[5] = slot.cachedOffset(); … … 1235 1233 } 1236 1234 1237 if (slotBase == structureID->prototype()) { 1238 ASSERT(!JSImmediate::isImmediate(slotBase)); 1235 if (slot.slotBase() == structureID->prototype()) { 1236 ASSERT(slot.slotBase()->isObject()); 1237 1238 JSObject* slotBaseObject = static_cast<JSObject*>(slot.slotBase()); 1239 1240 // Heavy access to a prototype is a good indication that it's not being 1241 // used as a dictionary. 1242 if (slotBaseObject->structureID()->isDictionary()) { 1243 RefPtr<StructureID> transition = StructureID::fromDictionaryTransition(slotBaseObject->structureID()); 1244 slotBaseObject->setStructureID(transition.release()); 1245 static_cast<JSObject*>(baseValue)->structureID()->setCachedPrototypeChain(0); 1246 } 1239 1247 1240 1248 vPC[0] = getOpcode(op_get_by_id_proto); 1241 vPC[5] = s tatic_cast<JSCell*>(slotBase)->structureID();1249 vPC[5] = slotBaseObject->structureID(); 1242 1250 vPC[6] = slot.cachedOffset(); 1243 1251 … … 1247 1255 1248 1256 size_t count = 0; 1249 while (baseCell != slotBase) { 1250 baseCell = static_cast<JSCell*>(baseCell->structureID()->prototype()); 1251 // If we didn't find slotBase in baseCell's prototype chain, then baseCell 1257 JSObject* o = static_cast<JSObject*>(baseValue); 1258 while (slot.slotBase() != o) { 1259 JSValue* v = o->structureID()->prototype(); 1260 1261 // If we didn't find slotBase in baseValue's prototype chain, then baseValue 1252 1262 // must be a proxy for another object. 1253 if ( baseCell->isNull()) {1263 if (v->isNull()) { 1254 1264 vPC[0] = getOpcode(op_get_by_id_generic); 1255 1265 return; 1256 1266 } 1267 1268 o = static_cast<JSObject*>(v); 1269 1270 // Heavy access to a prototype is a good indication that it's not being 1271 // used as a dictionary. 1272 if (o->structureID()->isDictionary()) { 1273 RefPtr<StructureID> transition = StructureID::fromDictionaryTransition(o->structureID()); 1274 o->setStructureID(transition.release()); 1275 static_cast<JSObject*>(baseValue)->structureID()->setCachedPrototypeChain(0); 1276 } 1277 1257 1278 ++count; 1258 1279 }
Note:
See TracChangeset
for help on using the changeset viewer.