Changeset 37653 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Oct 17, 2008, 4:55:09 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r37651 r37653 2876 2876 extern "C" { 2877 2877 2878 static JSValue* transitionObject(StructureID* newStructureID, size_t cachedOffset, JSObject* baseObject, JSValue* value) 2879 { 2880 baseObject->transitionTo(newStructureID); 2881 baseObject->putDirectOffset(cachedOffset, value); 2882 return baseObject; 2883 } 2878 static JSValue* resizePropertyStorage(JSObject* baseObject, size_t oldSize, size_t newSize) 2879 { 2880 baseObject->allocatePropertyStorageInline(oldSize, newSize); 2881 return baseObject; 2882 } 2884 2883 2885 2884 } … … 2928 2927 2929 2928 X86Assembler::JmpSrc callTarget; 2930 // Fast case, don't need to do any heavy lifting, so don't bother making a call. 2931 if (!transitionWillNeedStorageRealloc(oldStructureID, newStructureID)) { 2932 // Assumes m_refCount can be decremented easily, refcount decrement is safe as 2933 // codeblock should ensure oldStructureID->m_refCount > 0 2934 m_jit.subl_i8m(1, reinterpret_cast<void*>(oldStructureID)); 2935 m_jit.addl_i8m(1, reinterpret_cast<void*>(newStructureID)); 2936 m_jit.movl_i32m(reinterpret_cast<uint32_t>(newStructureID), OBJECT_OFFSET(JSCell, m_structureID), X86::eax); 2937 2938 // write the value 2939 m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax); 2940 m_jit.movl_rm(X86::edx, cachedOffset * sizeof(JSValue*), X86::eax); 2941 } else { 2942 // Slow case transition -- we're going to need to quite a bit of work, 2943 // so just make a call 2929 2930 // emit a call only if storage realloc is needed 2931 if (transitionWillNeedStorageRealloc(oldStructureID, newStructureID)) { 2944 2932 m_jit.pushl_r(X86::edx); 2945 m_jit.pushl_r(X86::eax); 2946 m_jit.movl_i32r(cachedOffset, X86::eax); 2947 m_jit.pushl_r(X86::eax); 2948 m_jit.movl_i32r(reinterpret_cast<uint32_t>(newStructureID), X86::eax); 2933 m_jit.pushl_i32(newStructureID->propertyStorageCapacity()); 2934 m_jit.pushl_i32(oldStructureID->propertyStorageCapacity()); 2949 2935 m_jit.pushl_r(X86::eax); 2950 2936 callTarget = m_jit.emitCall(); 2951 m_jit.addl_i32r(4 * sizeof(void*), X86::esp); 2937 m_jit.addl_i32r(3 * sizeof(void*), X86::esp); 2938 m_jit.popl_r(X86::edx); 2952 2939 } 2940 2941 // Assumes m_refCount can be decremented easily, refcount decrement is safe as 2942 // codeblock should ensure oldStructureID->m_refCount > 0 2943 m_jit.subl_i8m(1, reinterpret_cast<void*>(oldStructureID)); 2944 m_jit.addl_i8m(1, reinterpret_cast<void*>(newStructureID)); 2945 m_jit.movl_i32m(reinterpret_cast<uint32_t>(newStructureID), OBJECT_OFFSET(JSCell, m_structureID), X86::eax); 2946 2947 // write the value 2948 m_jit.movl_mr(OBJECT_OFFSET(JSObject, m_propertyStorage), X86::eax, X86::eax); 2949 m_jit.movl_rm(X86::edx, cachedOffset * sizeof(JSValue*), X86::eax); 2950 2953 2951 m_jit.ret(); 2954 2952 … … 2968 2966 2969 2967 if (transitionWillNeedStorageRealloc(oldStructureID, newStructureID)) 2970 X86Assembler::link(code, callTarget, reinterpret_cast<void*>( transitionObject));2968 X86Assembler::link(code, callTarget, reinterpret_cast<void*>(resizePropertyStorage)); 2971 2969 2972 2970 m_codeBlock->getStubInfo(returnAddress).stubRoutine = code;
Note:
See TracChangeset
for help on using the changeset viewer.