Changeset 49820 in webkit for trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
- Timestamp:
- Oct 19, 2009, 3:59:41 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r49065 r49820 522 522 } 523 523 524 void JIT::testPrototype(Structure* structure, JumpList& failureCases) 525 { 526 if (structure->m_prototype.isNull()) 527 return; 528 529 failureCases.append(branchPtr(NotEqual, AbsoluteAddress(&asCell(structure->m_prototype)->m_structure), ImmPtr(asCell(structure->m_prototype)->m_structure))); 530 } 531 524 532 void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress) 525 533 { … … 528 536 JumpList failureCases; 529 537 failureCases.append(branch32(NotEqual, regT1, Imm32(JSValue::CellTag))); 530 531 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 532 failureCases.append(branchPtr(NotEqual, regT2, ImmPtr(oldStructure))); 538 failureCases.append(branchPtr(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), ImmPtr(oldStructure))); 539 testPrototype(oldStructure, failureCases); 533 540 534 541 // Verify that nothing in the prototype chain has a setter for this property. 535 for (RefPtr<Structure>* it = chain->head(); *it; ++it) { 536 loadPtr(Address(regT2, OBJECT_OFFSETOF(Structure, m_prototype)), regT2); 537 loadPtr(Address(regT2, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 538 failureCases.append(branchPtr(NotEqual, regT2, ImmPtr(it->get()))); 539 } 542 for (RefPtr<Structure>* it = chain->head(); *it; ++it) 543 testPrototype(it->get(), failureCases); 540 544 541 545 // Reallocate property storage if needed. … … 1348 1352 } 1349 1353 1354 void JIT::testPrototype(Structure* structure, JumpList& failureCases) 1355 { 1356 if (structure->m_prototype.isNull()) 1357 return; 1358 1359 move(ImmPtr(&asCell(structure->m_prototype)->m_structure), regT2); 1360 move(ImmPtr(asCell(structure->m_prototype)->m_structure), regT3); 1361 failureCases.append(branchPtr(NotEqual, Address(regT2), regT3)); 1362 } 1363 1350 1364 void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ReturnAddressPtr returnAddress) 1351 1365 { … … 1354 1368 failureCases.append(emitJumpIfNotJSCell(regT0)); 1355 1369 failureCases.append(branchPtr(NotEqual, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), ImmPtr(oldStructure))); 1356 JumpList successCases; 1357 1358 // ecx = baseObject 1359 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 1360 // proto(ecx) = baseObject->structure()->prototype() 1361 failureCases.append(branch32(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo) + OBJECT_OFFSETOF(TypeInfo, m_type)), Imm32(ObjectType))); 1362 1363 loadPtr(Address(regT2, OBJECT_OFFSETOF(Structure, m_prototype)), regT2); 1364 1370 testPrototype(oldStructure, failureCases); 1371 1365 1372 // ecx = baseObject->m_structure 1366 for (RefPtr<Structure>* it = chain->head(); *it; ++it) { 1367 // null check the prototype 1368 successCases.append(branchPtr(Equal, regT2, ImmPtr(JSValue::encode(jsNull())))); 1369 1370 // Check the structure id 1371 failureCases.append(branchPtr(NotEqual, Address(regT2, OBJECT_OFFSETOF(JSCell, m_structure)), ImmPtr(it->get()))); 1372 1373 loadPtr(Address(regT2, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 1374 failureCases.append(branch32(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo) + OBJECT_OFFSETOF(TypeInfo, m_type)), Imm32(ObjectType))); 1375 loadPtr(Address(regT2, OBJECT_OFFSETOF(Structure, m_prototype)), regT2); 1376 } 1377 1378 successCases.link(this); 1373 for (RefPtr<Structure>* it = chain->head(); *it; ++it) 1374 testPrototype(it->get(), failureCases); 1379 1375 1380 1376 Call callTarget;
Note:
See TracChangeset
for help on using the changeset viewer.