Changeset 44889 in webkit for trunk/JavaScriptCore/jit/JITOpcodes.cpp
- Timestamp:
- Jun 19, 2009, 6:29:36 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITOpcodes.cpp
r44884 r44889 160 160 161 161 // Check that baseVal is an object, that it 'ImplementsHasInstance' but that it does not 'OverridesHasInstance'. 162 loadPtr(Address(regT0, FIELD_OFFSET(JSCell, m_structure)), regT0);163 addSlowCase(branch32(NotEqual, Address(regT0, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(ObjectType)));164 addSlowCase(branchTest32(Zero, Address(regT0, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(ImplementsDefaultHasInstance)));162 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT0); 163 addSlowCase(branch32(NotEqual, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType))); 164 addSlowCase(branchTest32(Zero, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(ImplementsDefaultHasInstance))); 165 165 166 166 // If value is not an Object, return false. 167 167 Jump valueIsImmediate = emitJumpIfNotJSCell(regT2); 168 loadPtr(Address(regT2, FIELD_OFFSET(JSCell, m_structure)), regT0);169 Jump valueIsNotObject = branch32(NotEqual, Address(regT0, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(ObjectType));168 loadPtr(Address(regT2, OBJECT_OFFSETOF(JSCell, m_structure)), regT0); 169 Jump valueIsNotObject = branch32(NotEqual, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType)); 170 170 171 171 // Check proto is object. 172 loadPtr(Address(regT1, FIELD_OFFSET(JSCell, m_structure)), regT0);173 addSlowCase(branch32(NotEqual, Address(regT0, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(ObjectType)));172 loadPtr(Address(regT1, OBJECT_OFFSETOF(JSCell, m_structure)), regT0); 173 addSlowCase(branch32(NotEqual, Address(regT0, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(ObjectType))); 174 174 175 175 // Optimistically load the result true, and start looping. … … 181 181 // Load the prototype of the object in regT2. If this is equal to regT1 - WIN! 182 182 // Otherwise, check if we've hit null - if we have then drop out of the loop, if not go again. 183 loadPtr(Address(regT2, FIELD_OFFSET(JSCell, m_structure)), regT2);184 loadPtr(Address(regT2, FIELD_OFFSET(Structure, m_prototype)), regT2);183 loadPtr(Address(regT2, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 184 loadPtr(Address(regT2, OBJECT_OFFSETOF(Structure, m_prototype)), regT2); 185 185 Jump isInstance = branchPtr(Equal, regT2, regT1); 186 186 branchPtr(NotEqual, regT2, ImmPtr(JSValue::encode(jsNull())), loop); … … 252 252 emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT0); 253 253 while (skip--) 254 loadPtr(Address(regT0, FIELD_OFFSET(ScopeChainNode, next)), regT0);255 256 loadPtr(Address(regT0, FIELD_OFFSET(ScopeChainNode, object)), regT0);254 loadPtr(Address(regT0, OBJECT_OFFSETOF(ScopeChainNode, next)), regT0); 255 256 loadPtr(Address(regT0, OBJECT_OFFSETOF(ScopeChainNode, object)), regT0); 257 257 emitGetVariableObjectRegister(regT0, currentInstruction[2].u.operand, regT0); 258 258 emitPutVirtualRegister(currentInstruction[1].u.operand); … … 266 266 emitGetVirtualRegister(currentInstruction[3].u.operand, regT0); 267 267 while (skip--) 268 loadPtr(Address(regT1, FIELD_OFFSET(ScopeChainNode, next)), regT1);269 270 loadPtr(Address(regT1, FIELD_OFFSET(ScopeChainNode, object)), regT1);268 loadPtr(Address(regT1, OBJECT_OFFSETOF(ScopeChainNode, next)), regT1); 269 270 loadPtr(Address(regT1, OBJECT_OFFSETOF(ScopeChainNode, object)), regT1); 271 271 emitPutVariableObjectRegister(regT0, regT1, currentInstruction[1].u.operand); 272 272 } … … 328 328 329 329 emitJumpSlowCaseIfNotJSCell(regT0); 330 loadPtr(Address(regT0, FIELD_OFFSET(JSCell, m_structure)), regT2);331 addSlowCase(branch32(NotEqual, Address(regT2, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type)), Imm32(ObjectType)));330 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 331 addSlowCase(branch32(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo) + OBJECT_OFFSETOF(TypeInfo, m_type)), Imm32(ObjectType))); 332 332 333 333 } … … 408 408 move(ImmPtr(globalObject), regT0); 409 409 loadPtr(structureAddress, regT1); 410 Jump noMatch = branchPtr(NotEqual, regT1, Address(regT0, FIELD_OFFSET(JSCell, m_structure))); // Structures don't match410 Jump noMatch = branchPtr(NotEqual, regT1, Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure))); // Structures don't match 411 411 412 412 // Load cached property 413 413 // Assume that the global object always uses external storage. 414 loadPtr(Address(regT0, FIELD_OFFSET(JSGlobalObject, m_externalStorage)), regT0);414 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSGlobalObject, m_externalStorage)), regT0); 415 415 load32(offsetAddr, regT1); 416 416 loadPtr(BaseIndex(regT0, regT1, ScalePtr), regT0); … … 460 460 461 461 // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure. 462 loadPtr(Address(regT0, FIELD_OFFSET(JSCell, m_structure)), regT2);463 addJump(branchTest32(NonZero, Address(regT2, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2);462 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 463 addJump(branchTest32(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2); 464 464 Jump wasNotImmediate = jump(); 465 465 … … 481 481 482 482 // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure. 483 loadPtr(Address(regT0, FIELD_OFFSET(JSCell, m_structure)), regT2);484 addJump(branchTest32(Zero, Address(regT2, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2);483 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 484 addJump(branchTest32(Zero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2); 485 485 Jump wasNotImmediate = jump(); 486 486 … … 671 671 672 672 emitJumpSlowCaseIfNotJSCell(regT0, srcVReg); 673 loadPtr(Address(regT0, FIELD_OFFSET(JSCell, m_structure)), regT2);674 addSlowCase(branch32(NotEqual, Address(regT2, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(NumberType)));673 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 674 addSlowCase(branch32(NotEqual, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_type)), Imm32(NumberType))); 675 675 676 676 wasImmediate.link(this); … … 690 690 { 691 691 killLastResultRegister(); // FIXME: Implicitly treat op_catch as a labeled statement, and remove this line of code. 692 peek(callFrameRegister, FIELD_OFFSET(struct JITStackFrame, callFrame) / sizeof (void*));692 peek(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof (void*)); 693 693 emitPutVirtualRegister(currentInstruction[1].u.operand); 694 694 } … … 782 782 Jump isImmediate = emitJumpIfNotJSCell(regT0); 783 783 784 loadPtr(Address(regT0, FIELD_OFFSET(JSCell, m_structure)), regT2);785 setTest32(NonZero, Address(regT2, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), regT0);784 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 785 setTest32(NonZero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), regT0); 786 786 787 787 Jump wasNotImmediate = jump(); … … 807 807 Jump isImmediate = emitJumpIfNotJSCell(regT0); 808 808 809 loadPtr(Address(regT0, FIELD_OFFSET(JSCell, m_structure)), regT2);810 setTest32(Zero, Address(regT2, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), regT0);809 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT2); 810 setTest32(Zero, Address(regT2, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), regT0); 811 811 812 812 Jump wasNotImmediate = jump(); … … 867 867 868 868 emitJumpSlowCaseIfNotJSCell(regT0); 869 loadPtr(Address(regT0, FIELD_OFFSET(JSCell, m_structure)), regT1);870 addSlowCase(branchTest32(NonZero, Address(regT1, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)));869 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)), regT1); 870 addSlowCase(branchTest32(NonZero, Address(regT1, OBJECT_OFFSETOF(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion))); 871 871 872 872 } … … 874 874 void JIT::emit_op_profile_will_call(Instruction* currentInstruction) 875 875 { 876 peek(regT1, FIELD_OFFSET(JITStackFrame, enabledProfilerReference) / sizeof (void*));876 peek(regT1, OBJECT_OFFSETOF(JITStackFrame, enabledProfilerReference) / sizeof (void*)); 877 877 Jump noProfiler = branchTestPtr(Zero, Address(regT1)); 878 878 … … 886 886 void JIT::emit_op_profile_did_call(Instruction* currentInstruction) 887 887 { 888 peek(regT1, FIELD_OFFSET(JITStackFrame, enabledProfilerReference) / sizeof (void*));888 peek(regT1, OBJECT_OFFSETOF(JITStackFrame, enabledProfilerReference) / sizeof (void*)); 889 889 Jump noProfiler = branchTestPtr(Zero, Address(regT1)); 890 890 … … 944 944 // First, check if this is an access to the vector 945 945 linkSlowCase(iter); 946 branch32(AboveOrEqual, regT1, Address(regT2, FIELD_OFFSET(ArrayStorage, m_vectorLength)), beginGetByValSlow);946 branch32(AboveOrEqual, regT1, Address(regT2, OBJECT_OFFSETOF(ArrayStorage, m_vectorLength)), beginGetByValSlow); 947 947 948 948 // okay, missed the fast region, but it is still in the vector. Get the value. 949 loadPtr(BaseIndex(regT2, regT1, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])), regT2);949 loadPtr(BaseIndex(regT2, regT1, ScalePtr, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), regT2); 950 950 // Check whether the value loaded is zero; if so we need to return undefined. 951 951 branchTestPtr(Zero, regT2, beginGetByValSlow);
Note:
See TracChangeset
for help on using the changeset viewer.