Changeset 44412 in webkit for trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
- Timestamp:
- Jun 4, 2009, 4:00:58 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITPropertyAccess.cpp
r44341 r44412 424 424 } 425 425 426 static JSObject* resizePropertyStorage(JSObject* baseObject, int32_t oldSize, int32_t newSize)427 {428 baseObject->allocatePropertyStorage(oldSize, newSize);429 return baseObject;430 }431 432 static inline bool transitionWillNeedStorageRealloc(Structure* oldStructure, Structure* newStructure)433 {434 return oldStructure->propertyStorageCapacity() != newStructure->propertyStorageCapacity();435 }436 437 426 void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure* oldStructure, Structure* newStructure, size_t cachedOffset, StructureChain* chain, ProcessorReturnAddress returnAddress) 438 427 { … … 443 432 JumpList successCases; 444 433 445 // 434 // ecx = baseObject 446 435 loadPtr(Address(regT0, FIELD_OFFSET(JSCell, m_structure)), regT2); 447 436 // proto(ecx) = baseObject->structure()->prototype() … … 468 457 469 458 // emit a call only if storage realloc is needed 470 bool willNeedStorageRealloc = transitionWillNeedStorageRealloc(oldStructure, newStructure);459 bool willNeedStorageRealloc = oldStructure->propertyStorageCapacity() != newStructure->propertyStorageCapacity(); 471 460 if (willNeedStorageRealloc) { 472 pop(X86::ebx); 473 #if PLATFORM(X86_64) 474 // Setup arguments in edi, esi, edx. Since baseObject is in regT0, 475 // regT0 had better not be any of these registers. 476 ASSERT(regT0 != X86::edx); 477 ASSERT(regT0 != X86::esi); 478 ASSERT(regT0 != X86::edi); 479 move(Imm32(newStructure->propertyStorageCapacity()), X86::edx); 480 move(Imm32(oldStructure->propertyStorageCapacity()), X86::esi); 481 move(regT0, X86::edi); 482 callTarget = call(); 483 #else 484 push(Imm32(newStructure->propertyStorageCapacity())); 485 push(Imm32(oldStructure->propertyStorageCapacity())); 486 push(regT0); 487 callTarget = call(); 488 addPtr(Imm32(3 * sizeof(void*)), X86::esp); 489 #endif 490 emitGetJITStubArg(3, regT1); 491 push(X86::ebx); 461 // This trampoline was called to like a JIT stub; before we can can call again we need to 462 // remove the return address from the stack, to prevent the stack from becoming misaligned. 463 preverveReturnAddressAfterCall(regT3); 464 465 JITStubCall stubCall(this, JITStubs::cti_op_put_by_id_transition_realloc); 466 stubCall.addArgument(regT0); 467 stubCall.addArgument(Imm32(oldStructure->propertyStorageCapacity())); 468 stubCall.addArgument(Imm32(newStructure->propertyStorageCapacity())); 469 stubCall.addArgument(regT1); // This argument is not used in the stub; we set it up on the stack so that it can be restored, below. 470 stubCall.call(regT0); 471 emitGetJITStubArg(4, regT1); 472 473 restoreReturnAddressBeforeReturn(regT3); 492 474 } 493 475 … … 512 494 patchBuffer.link(failureCall, JITStubs::cti_op_put_by_id_fail); 513 495 514 if (willNeedStorageRealloc) 515 patchBuffer.link(callTarget, resizePropertyStorage); 496 if (willNeedStorageRealloc) { 497 ASSERT(m_calls.size() == 1); 498 patchBuffer.link(m_calls[0].from, JITStubs::cti_op_put_by_id_transition_realloc); 499 } 516 500 517 501 CodeLocationLabel entryLabel = patchBuffer.finalizeCodeAddendum();
Note:
See TracChangeset
for help on using the changeset viewer.