Changeset 36316 in webkit for trunk/JavaScriptCore/VM/Machine.cpp
- Timestamp:
- Sep 10, 2008, 1:42:43 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/Machine.cpp
r36267 r36316 545 545 static_cast<JSCell*>(jsArray)->~JSCell(); 546 546 547 JSString* jsString = new (storage) JSString( "");547 JSString* jsString = new (storage) JSString(JSString::VPtrStealingHack); 548 548 m_jsStringVptr = jsString->vptr(); 549 549 static_cast<JSCell*>(jsString)->~JSCell(); … … 1106 1106 } 1107 1107 1108 StructureIDChain* cachePrototypeChain(StructureID* structureID)1109 { 1110 RefPtr<StructureIDChain> chain = StructureIDChain::create(static_cast<JSObject*>(structureID->prototype ())->structureID());1108 static StructureIDChain* cachePrototypeChain(ExecState* exec, StructureID* structureID) 1109 { 1110 RefPtr<StructureIDChain> chain = StructureIDChain::create(static_cast<JSObject*>(structureID->prototypeForLookup(exec))->structureID()); 1111 1111 structureID->setCachedPrototypeChain(chain.release()); 1112 1112 return structureID->cachedPrototypeChain(); … … 1136 1136 JSCell* baseCell = static_cast<JSCell*>(baseValue); 1137 1137 StructureID* structureID = baseCell->structureID(); 1138 1139 // FIXME: Remove this !structureID check once all objects have StructureIDs.1140 if (!structureID) {1141 vPC[0] = getOpcode(op_put_by_id_generic);1142 return;1143 }1144 1138 1145 1139 if (structureID->isDictionary()) { … … 1211 1205 StructureID* structureID = static_cast<JSCell*>(baseValue)->structureID(); 1212 1206 1213 // FIXME: Remove this !structureID check once all JSCells have StructureIDs.1214 if (!structureID) {1215 vPC[0] = getOpcode(op_get_by_id_generic);1216 return;1217 }1218 1219 1207 if (structureID->isDictionary()) { 1220 1208 vPC[0] = getOpcode(op_get_by_id_generic); … … 1246 1234 } 1247 1235 1248 if (slot.slotBase() == structureID->prototype ()) {1236 if (slot.slotBase() == structureID->prototypeForLookup(exec)) { 1249 1237 ASSERT(slot.slotBase()->isObject()); 1250 1238 … … 1270 1258 JSObject* o = static_cast<JSObject*>(baseValue); 1271 1259 while (slot.slotBase() != o) { 1272 JSValue* v = o->structureID()->prototype ();1260 JSValue* v = o->structureID()->prototypeForLookup(exec); 1273 1261 1274 1262 // If we didn't find base in baseValue's prototype chain, then baseValue … … 1294 1282 StructureIDChain* chain = structureID->cachedPrototypeChain(); 1295 1283 if (!chain) 1296 chain = cachePrototypeChain( structureID);1284 chain = cachePrototypeChain(exec, structureID); 1297 1285 1298 1286 vPC[0] = getOpcode(op_get_by_id_chain); … … 2265 2253 2266 2254 if (LIKELY(baseCell->structureID() == structureID)) { 2267 ASSERT(structureID->prototype ()->isObject());2268 JSObject* protoObject = static_cast<JSObject*>(structureID->prototype ());2255 ASSERT(structureID->prototypeForLookup(exec)->isObject()); 2256 JSObject* protoObject = static_cast<JSObject*>(structureID->prototypeForLookup(exec)); 2269 2257 StructureID* protoStructureID = vPC[5].u.structureID; 2270 2258 … … 2306 2294 while (1) { 2307 2295 ASSERT(baseCell->isObject()); 2308 JSObject* baseObject = static_cast<JSObject*>(baseCell->structureID()->prototype ());2296 JSObject* baseObject = static_cast<JSObject*>(baseCell->structureID()->prototypeForLookup(exec)); 2309 2297 if (UNLIKELY(baseObject->structureID() != (*it).get())) 2310 2298 break; … … 2338 2326 2339 2327 Identifier& ident = codeBlock->identifiers[property]; 2328 2340 2329 JSValue* baseValue = r[base].jsValue(exec); 2341 2330 PropertySlot slot(baseValue); … … 3550 3539 StructureID* structureID = baseCell->structureID(); 3551 3540 3552 // FIXME: Remove this !structureID check once all objects have StructureIDs.3553 if (!structureID) {3554 ctiRepatchCallByReturnAddress(returnAddress, (void*)cti_op_put_by_id_generic);3555 return;3556 }3557 3558 3541 if (structureID->isDictionary()) { 3559 3542 ctiRepatchCallByReturnAddress(returnAddress, (void*)cti_op_put_by_id_generic); … … 3625 3608 JSCell* baseCell = static_cast<JSCell*>(baseValue); 3626 3609 StructureID* structureID = baseCell->structureID(); 3627 3628 // FIXME: Remove this !structureID check once all JSCells have StructureIDs.3629 if (!structureID) {3630 ctiRepatchCallByReturnAddress(returnAddress, (void*)cti_op_get_by_id_generic);3631 return;3632 }3633 3610 3634 3611 if (structureID->isDictionary()) { … … 3656 3633 } 3657 3634 3658 if (slot.slotBase() == structureID->prototype ()) {3635 if (slot.slotBase() == structureID->prototypeForLookup(exec)) { 3659 3636 ASSERT(slot.slotBase()->isObject()); 3660 3637 … … 3682 3659 JSObject* o = static_cast<JSObject*>(baseValue); 3683 3660 while (slot.slotBase() != o) { 3684 JSValue* v = o->structureID()->prototype ();3661 JSValue* v = o->structureID()->prototypeForLookup(exec); 3685 3662 3686 3663 // If we didn't find slotBase in baseValue's prototype chain, then baseValue … … 3707 3684 StructureIDChain* chain = structureID->cachedPrototypeChain(); 3708 3685 if (!chain) 3709 chain = cachePrototypeChain( structureID);3686 chain = cachePrototypeChain(exec, structureID); 3710 3687 3711 3688 vPC[0] = getOpcode(op_get_by_id_chain);
Note:
See TracChangeset
for help on using the changeset viewer.