Changeset 40562 in webkit for trunk/JavaScriptCore/jit/JIT.cpp
- Timestamp:
- Feb 3, 2009, 6:02:32 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JIT.cpp
r40279 r40562 239 239 240 240 if (type == OpStrictEq) 241 set e32(X86::edx, X86::eax);241 set32(Equal, X86::edx, X86::eax, X86::eax); 242 242 else 243 set ne32(X86::edx, X86::eax);243 set32(NotEqual, X86::edx, X86::eax, X86::eax); 244 244 emitTagAsBoolImmediate(X86::eax); 245 245 #else … … 249 249 Jump firstNotImmediate = emitJumpIfJSCell(X86::eax); 250 250 Jump secondNotImmediate = emitJumpIfJSCell(X86::edx); 251 Jump bothWereImmediatesButNotEqual = jnePtr(X86::edx, X86::eax);251 Jump bothWereImmediatesButNotEqual = branchPtr(NotEqual, X86::edx, X86::eax); 252 252 253 253 // They are equal - set the result to true. (Or false, if negated). … … 260 260 firstNotImmediate.link(this); 261 261 emitJumpSlowCaseIfJSCell(X86::edx); 262 addSlowCase( jePtr(X86::edx, ImmPtr(JSValuePtr::encode(js0()))));262 addSlowCase(branchPtr(Equal, X86::edx, ImmPtr(JSValuePtr::encode(js0())))); 263 263 Jump firstWasNotImmediate = jump(); 264 264 … … 266 266 // If eax is 0 jump to a slow case, otherwise these values are not equal. 267 267 secondNotImmediate.link(this); 268 addSlowCase( jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))));268 addSlowCase(branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(js0())))); 269 269 270 270 // We get here if the two values are different immediates, or one is 0 and the other is a JSCell. … … 282 282 void JIT::emitSlowScriptCheck() 283 283 { 284 Jump skipTimeout = jnzSub32(Imm32(1), timeoutCheckRegister);284 Jump skipTimeout = branchSub32(NonZero, Imm32(1), timeoutCheckRegister); 285 285 emitCTICall(Interpreter::cti_timeout_check); 286 286 move(X86::eax, timeoutCheckRegister); … … 380 380 int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2))); 381 381 #endif 382 addJump( jl32(X86::eax, Imm32(op2imm)), target + 3);382 addJump(branch32(LessThan, X86::eax, Imm32(op2imm)), target + 3); 383 383 } else { 384 384 emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx); 385 385 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 386 386 emitJumpSlowCaseIfNotImmediateInteger(X86::edx); 387 addJump( jl32(X86::eax, X86::edx), target + 3);387 addJump(branch32(LessThan, X86::eax, X86::edx), target + 3); 388 388 } 389 389 NEXT_OPCODE(op_loop_if_less); … … 403 403 int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2))); 404 404 #endif 405 addJump( jle32(X86::eax, Imm32(op2imm)), target + 3);405 addJump(branch32(LessThanOrEqual, X86::eax, Imm32(op2imm)), target + 3); 406 406 } else { 407 407 emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx); 408 408 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 409 409 emitJumpSlowCaseIfNotImmediateInteger(X86::edx); 410 addJump( jle32(X86::eax, X86::edx), target + 3);410 addJump(branch32(LessThanOrEqual, X86::eax, X86::edx), target + 3); 411 411 } 412 412 NEXT_OPCODE(op_loop_if_less); … … 445 445 sub32(Address(X86::eax, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx); 446 446 sub32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx); 447 addSlowCase( jne32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx));447 addSlowCase(branch32(NotEqual, Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx)); 448 448 449 449 // check that baseVal's flags include ImplementsHasInstance but not OverridesHasInstance 450 450 load32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), X86::ecx); 451 451 and32(Imm32(ImplementsHasInstance | OverridesHasInstance), X86::ecx); 452 addSlowCase( jne32(X86::ecx, Imm32(ImplementsHasInstance)));452 addSlowCase(branch32(NotEqual, X86::ecx, Imm32(ImplementsHasInstance))); 453 453 454 454 emitGetVirtualRegister(currentInstruction[2].u.operand, X86::ecx); // reload value … … 464 464 loadPtr(Address(X86::ecx, FIELD_OFFSET(Structure, m_prototype)), X86::ecx); 465 465 466 Jump exit = jePtr(X86::ecx, X86::edx);467 468 jnePtr(X86::ecx, ImmPtr(JSValuePtr::encode(jsNull())), loop);466 Jump exit = branchPtr(Equal, X86::ecx, X86::edx); 467 468 branchPtr(NotEqual, X86::ecx, ImmPtr(JSValuePtr::encode(jsNull())), loop); 469 469 470 470 move(ImmPtr(JSValuePtr::encode(jsBoolean(false))), X86::eax); … … 593 593 emitJumpSlowCaseIfNotJSCell(X86::eax); 594 594 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 595 addSlowCase( jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type)), Imm32(ObjectType)));595 addSlowCase(branch32(NotEqual, Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo) + FIELD_OFFSET(TypeInfo, m_type)), Imm32(ObjectType))); 596 596 597 597 NEXT_OPCODE(op_construct_verify); … … 612 612 #endif 613 613 emitJumpSlowCaseIfNotJSCell(X86::eax); 614 addSlowCase( jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)));614 addSlowCase(branchPtr(NotEqual, Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr))); 615 615 616 616 // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff 617 617 loadPtr(Address(X86::eax, FIELD_OFFSET(JSArray, m_storage)), X86::ecx); 618 addSlowCase( jae32(X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff))));618 addSlowCase(branch32(AboveOrEqual, X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff)))); 619 619 620 620 // Get the value from the vector … … 645 645 #endif 646 646 emitJumpSlowCaseIfNotJSCell(X86::eax); 647 addSlowCase( jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)));647 addSlowCase(branchPtr(NotEqual, Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr))); 648 648 649 649 // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff 650 650 loadPtr(Address(X86::eax, FIELD_OFFSET(JSArray, m_storage)), X86::ecx); 651 Jump inFastVector = jb32(X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff)));651 Jump inFastVector = branch32(Below, X86::edx, Address(X86::eax, FIELD_OFFSET(JSArray, m_fastAccessCutoff))); 652 652 // No; oh well, check if the access if within the vector - if so, we may still be okay. 653 addSlowCase( jae32(X86::edx, Address(X86::ecx, FIELD_OFFSET(ArrayStorage, m_vectorLength))));653 addSlowCase(branch32(AboveOrEqual, X86::edx, Address(X86::ecx, FIELD_OFFSET(ArrayStorage, m_vectorLength)))); 654 654 655 655 // This is a write to the slow part of the vector; first, we have to check if this would be the first write to this location. 656 656 // FIXME: should be able to handle initial write to array; increment the the number of items in the array, and potentially update fast access cutoff. 657 addSlowCase( jzPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0]))));657 addSlowCase(branchTestPtr(Zero, BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])))); 658 658 659 659 // All good - put the value into the array. … … 670 670 emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax); 671 671 672 Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0())));672 Jump isZero = branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(js0()))); 673 673 addJump(emitJumpIfImmediateInteger(X86::eax), target + 2); 674 674 675 addJump( jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))), target + 2);676 addSlowCase( jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false)))));675 addJump(branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))), target + 2); 676 addSlowCase(branchPtr(NotEqual, X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false))))); 677 677 678 678 isZero.link(this); … … 712 712 move(ImmPtr(globalObject), X86::eax); 713 713 loadPtr(structureAddress, X86::edx); 714 Jump noMatch = jnePtr(X86::edx, Address(X86::eax, FIELD_OFFSET(JSCell, m_structure))); // Structures don't match714 Jump noMatch = branchPtr(NotEqual, X86::edx, Address(X86::eax, FIELD_OFFSET(JSCell, m_structure))); // Structures don't match 715 715 716 716 // Load cached property … … 748 748 int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2))); 749 749 #endif 750 addJump( jge32(X86::eax, Imm32(op2imm)), target + 3);750 addJump(branch32(GreaterThanOrEqual, X86::eax, Imm32(op2imm)), target + 3); 751 751 } else { 752 752 emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx); 753 753 emitJumpSlowCaseIfNotImmediateInteger(X86::eax); 754 754 emitJumpSlowCaseIfNotImmediateInteger(X86::edx); 755 addJump( jge32(X86::eax, X86::edx), target + 3);755 addJump(branch32(GreaterThanOrEqual, X86::eax, X86::edx), target + 3); 756 756 } 757 757 NEXT_OPCODE(op_jnless); … … 760 760 emitGetVirtualRegister(currentInstruction[2].u.operand, X86::eax); 761 761 xorPtr(Imm32(static_cast<int32_t>(JSImmediate::FullTagTypeBool)), X86::eax); 762 addSlowCase( jnzPtr(X86::eax, Imm32(static_cast<int32_t>(~JSImmediate::ExtendedPayloadBitBoolValue))));762 addSlowCase(branchTestPtr(NonZero, X86::eax, Imm32(static_cast<int32_t>(~JSImmediate::ExtendedPayloadBitBoolValue)))); 763 763 xorPtr(Imm32(static_cast<int32_t>(JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue)), X86::eax); 764 764 emitPutVirtualRegister(currentInstruction[1].u.operand); … … 769 769 emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax); 770 770 771 addJump( jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))), target + 2);771 addJump(branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(js0()))), target + 2); 772 772 Jump isNonZero = emitJumpIfImmediateInteger(X86::eax); 773 773 774 addJump( jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false)))), target + 2);775 addSlowCase( jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))));774 addJump(branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false)))), target + 2); 775 addSlowCase(branchPtr(NotEqual, X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true))))); 776 776 777 777 isNonZero.link(this); … … 787 787 // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure. 788 788 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 789 addJump( jnz32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2);789 addJump(branchTest32(NonZero, Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2); 790 790 Jump wasNotImmediate = jump(); 791 791 … … 793 793 isImmediate.link(this); 794 794 andPtr(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax); 795 addJump( jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsNull()))), target + 2);795 addJump(branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(jsNull()))), target + 2); 796 796 797 797 wasNotImmediate.link(this); … … 807 807 // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure. 808 808 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 809 addJump( jz32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2);809 addJump(branchTest32(Zero, Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined)), target + 2); 810 810 Jump wasNotImmediate = jump(); 811 811 … … 813 813 isImmediate.link(this); 814 814 andPtr(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax); 815 addJump( jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsNull()))), target + 2);815 addJump(branchPtr(NotEqual, X86::eax, ImmPtr(JSValuePtr::encode(jsNull()))), target + 2); 816 816 817 817 wasNotImmediate.link(this); … … 843 843 emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx); 844 844 emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx); 845 set e32(X86::edx, X86::eax);845 set32(Equal, X86::edx, X86::eax, X86::eax); 846 846 emitTagAsBoolImmediate(X86::eax); 847 847 emitPutVirtualRegister(currentInstruction[1].u.operand); … … 895 895 emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax); 896 896 897 Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0())));897 Jump isZero = branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(js0()))); 898 898 addJump(emitJumpIfImmediateInteger(X86::eax), target + 2); 899 899 900 addJump( jePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))), target + 2);901 addSlowCase( jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false)))));900 addJump(branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(true)))), target + 2); 901 addSlowCase(branchPtr(NotEqual, X86::eax, ImmPtr(JSValuePtr::encode(jsBoolean(false))))); 902 902 903 903 isZero.link(this); … … 908 908 emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx); 909 909 emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx); 910 set ne32(X86::edx, X86::eax);910 set32(NotEqual, X86::edx, X86::eax, X86::eax); 911 911 emitTagAsBoolImmediate(X86::eax); 912 912 … … 974 974 unsigned target = currentInstruction[3].u.operand; 975 975 emitCTICall(Interpreter::cti_op_next_pname); 976 Jump endOfIter = jzPtr(X86::eax);976 Jump endOfIter = branchTestPtr(Zero, X86::eax); 977 977 emitPutVirtualRegister(currentInstruction[1].u.operand); 978 978 addJump(jump(), target + 3); … … 1013 1013 emitJumpSlowCaseIfNotJSCell(X86::eax, srcVReg); 1014 1014 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 1015 addSlowCase( jne32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(NumberType)));1015 addSlowCase(branch32(NotEqual, Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_type)), Imm32(NumberType))); 1016 1016 1017 1017 wasImmediate.link(this); … … 1143 1143 1144 1144 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 1145 set nz32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), X86::eax);1145 setTest32(NonZero, Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), X86::eax); 1146 1146 1147 1147 Jump wasNotImmediate = jump(); … … 1150 1150 1151 1151 andPtr(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax); 1152 set e32(Imm32(JSImmediate::FullTagTypeNull), X86::eax);1152 set32(Equal, X86::eax, Imm32(JSImmediate::FullTagTypeNull), X86::eax); 1153 1153 1154 1154 wasNotImmediate.link(this); … … 1167 1167 1168 1168 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx); 1169 set z32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), X86::eax);1169 setTest32(Zero, Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(MasqueradesAsUndefined), X86::eax); 1170 1170 1171 1171 Jump wasNotImmediate = jump(); … … 1174 1174 1175 1175 andPtr(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax); 1176 set ne32(Imm32(JSImmediate::FullTagTypeNull), X86::eax);1176 set32(NotEqual, X86::eax, Imm32(JSImmediate::FullTagTypeNull), X86::eax); 1177 1177 1178 1178 wasNotImmediate.link(this); … … 1218 1218 emitJumpSlowCaseIfNotJSCell(X86::eax); 1219 1219 loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::edx); 1220 addSlowCase( jnz32(Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion)));1220 addSlowCase(branchTest32(NonZero, Address(X86::edx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), Imm32(NeedsThisConversion))); 1221 1221 1222 1222 NEXT_OPCODE(op_convert_this); … … 1224 1224 case op_profile_will_call: { 1225 1225 emitGetCTIParam(STUB_ARGS_profilerReference, X86::eax); 1226 Jump noProfiler = jzPtr(Address(X86::eax));1226 Jump noProfiler = branchTestPtr(Zero, Address(X86::eax)); 1227 1227 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, X86::eax); 1228 1228 emitCTICall(Interpreter::cti_op_profile_will_call); … … 1233 1233 case op_profile_did_call: { 1234 1234 emitGetCTIParam(STUB_ARGS_profilerReference, X86::eax); 1235 Jump noProfiler = jzPtr(Address(X86::eax));1235 Jump noProfiler = branchTestPtr(Zero, Address(X86::eax)); 1236 1236 emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, X86::eax); 1237 1237 emitCTICall(Interpreter::cti_op_profile_did_call); … … 1328 1328 // First, check if this is an access to the vector 1329 1329 linkSlowCase(iter); 1330 jae32(X86::edx, Address(X86::ecx, FIELD_OFFSET(ArrayStorage, m_vectorLength)), beginGetByValSlow);1330 branch32(AboveOrEqual, X86::edx, Address(X86::ecx, FIELD_OFFSET(ArrayStorage, m_vectorLength)), beginGetByValSlow); 1331 1331 1332 1332 // okay, missed the fast region, but it is still in the vector. Get the value. 1333 1333 loadPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])), X86::ecx); 1334 1334 // Check whether the value loaded is zero; if so we need to return undefined. 1335 jzPtr(X86::ecx, beginGetByValSlow);1335 branchTestPtr(Zero, X86::ecx, beginGetByValSlow); 1336 1336 move(X86::ecx, X86::eax); 1337 1337 emitPutVirtualRegister(currentInstruction[1].u.operand, X86::eax); … … 1359 1359 emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx); 1360 1360 emitCTICall(Interpreter::cti_op_loop_if_less); 1361 emitJumpSlowToHot( jnz32(X86::eax), target + 3);1361 emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 3); 1362 1362 } else { 1363 1363 linkSlowCase(iter); … … 1366 1366 emitPutJITStubArg(X86::edx, 2); 1367 1367 emitCTICall(Interpreter::cti_op_loop_if_less); 1368 emitJumpSlowToHot( jnz32(X86::eax), target + 3);1368 emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 3); 1369 1369 } 1370 1370 NEXT_OPCODE(op_loop_if_less); … … 1386 1386 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 2, X86::ecx); 1387 1387 emitCTICall(Interpreter::cti_op_loop_if_lesseq); 1388 emitJumpSlowToHot( jnz32(X86::eax), target + 3);1388 emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 3); 1389 1389 } else { 1390 1390 linkSlowCase(iter); … … 1393 1393 emitPutJITStubArg(X86::edx, 2); 1394 1394 emitCTICall(Interpreter::cti_op_loop_if_lesseq); 1395 emitJumpSlowToHot( jnz32(X86::eax), target + 3);1395 emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 3); 1396 1396 } 1397 1397 NEXT_OPCODE(op_loop_if_lesseq); … … 1431 1431 emitCTICall(Interpreter::cti_op_jtrue); 1432 1432 unsigned target = currentInstruction[2].u.operand; 1433 emitJumpSlowToHot( jnz32(X86::eax), target + 2);1433 emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 2); 1434 1434 NEXT_OPCODE(op_loop_if_true); 1435 1435 } … … 1446 1446 emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 2, X86::ecx); 1447 1447 emitCTICall(Interpreter::cti_op_jless); 1448 emitJumpSlowToHot( jz32(X86::eax), target + 3);1448 emitJumpSlowToHot(branchTest32(Zero, X86::eax), target + 3); 1449 1449 } else { 1450 1450 linkSlowCase(iter); … … 1453 1453 emitPutJITStubArg(X86::edx, 2); 1454 1454 emitCTICall(Interpreter::cti_op_jless); 1455 emitJumpSlowToHot( jz32(X86::eax), target + 3);1455 emitJumpSlowToHot(branchTest32(Zero, X86::eax), target + 3); 1456 1456 } 1457 1457 NEXT_OPCODE(op_jnless); … … 1470 1470 emitCTICall(Interpreter::cti_op_jtrue); 1471 1471 unsigned target = currentInstruction[2].u.operand; 1472 emitJumpSlowToHot( jz32(X86::eax), target + 2); // inverted!1472 emitJumpSlowToHot(branchTest32(Zero, X86::eax), target + 2); // inverted! 1473 1473 NEXT_OPCODE(op_jfalse); 1474 1474 } … … 1493 1493 emitCTICall(Interpreter::cti_op_jtrue); 1494 1494 unsigned target = currentInstruction[2].u.operand; 1495 emitJumpSlowToHot( jnz32(X86::eax), target + 2);1495 emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 2); 1496 1496 NEXT_OPCODE(op_jtrue); 1497 1497 } … … 1640 1640 addPtr(Imm32(m_codeBlock->m_numCalleeRegisters * sizeof(Register)), callFrameRegister, X86::edx); 1641 1641 1642 slowRegisterFileCheck = jg32(X86::edx, Address(X86::eax, FIELD_OFFSET(RegisterFile, m_end)));1642 slowRegisterFileCheck = branch32(GreaterThan, X86::edx, Address(X86::eax, FIELD_OFFSET(RegisterFile, m_end))); 1643 1643 afterRegisterFileCheck = label(); 1644 1644 } … … 1754 1754 // Check eax is an array 1755 1755 Jump array_failureCases1 = emitJumpIfNotJSCell(X86::eax); 1756 Jump array_failureCases2 = jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr));1756 Jump array_failureCases2 = branchPtr(NotEqual, Address(X86::eax), ImmPtr(m_interpreter->m_jsArrayVptr)); 1757 1757 1758 1758 // Checks out okay! - get the length from the storage … … 1760 1760 load32(Address(X86::eax, FIELD_OFFSET(ArrayStorage, m_length)), X86::eax); 1761 1761 1762 Jump array_failureCases3 = ja32(X86::eax, Imm32(JSImmediate::maxImmediateInt));1762 Jump array_failureCases3 = branch32(Above, X86::eax, Imm32(JSImmediate::maxImmediateInt)); 1763 1763 1764 1764 // X86::eax contains a 64 bit value (is positive, is zero extended) so we don't need sign extend here. … … 1772 1772 // Check eax is a string 1773 1773 Jump string_failureCases1 = emitJumpIfNotJSCell(X86::eax); 1774 Jump string_failureCases2 = jnePtr(Address(X86::eax), ImmPtr(m_interpreter->m_jsStringVptr));1774 Jump string_failureCases2 = branchPtr(NotEqual, Address(X86::eax), ImmPtr(m_interpreter->m_jsStringVptr)); 1775 1775 1776 1776 // Checks out okay! - get the length from the Ustring. … … 1778 1778 load32(Address(X86::eax, FIELD_OFFSET(UString::Rep, len)), X86::eax); 1779 1779 1780 Jump string_failureCases3 = ja32(X86::eax, Imm32(JSImmediate::maxImmediateInt));1780 Jump string_failureCases3 = branch32(Above, X86::eax, Imm32(JSImmediate::maxImmediateInt)); 1781 1781 1782 1782 // X86::eax contains a 64 bit value (is positive, is zero extended) so we don't need sign extend here. … … 1793 1793 loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_body)), X86::eax); 1794 1794 loadPtr(Address(X86::eax, FIELD_OFFSET(FunctionBodyNode, m_code)), X86::eax); 1795 Jump hasCodeBlock1 = jnzPtr(X86::eax);1795 Jump hasCodeBlock1 = branchTestPtr(NonZero, X86::eax); 1796 1796 pop(X86::ebx); 1797 1797 restoreArgumentReference(); … … 1803 1803 1804 1804 // Check argCount matches callee arity. 1805 Jump arityCheckOkay1 = je32(Address(X86::eax, FIELD_OFFSET(CodeBlock, m_numParameters)), X86::edx);1805 Jump arityCheckOkay1 = branch32(Equal, Address(X86::eax, FIELD_OFFSET(CodeBlock, m_numParameters)), X86::edx); 1806 1806 pop(X86::ebx); 1807 1807 emitPutJITStubArg(X86::ebx, 2); … … 1830 1830 loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_body)), X86::eax); 1831 1831 loadPtr(Address(X86::eax, FIELD_OFFSET(FunctionBodyNode, m_code)), X86::eax); 1832 Jump hasCodeBlock2 = jnzPtr(X86::eax);1832 Jump hasCodeBlock2 = branchTestPtr(NonZero, X86::eax); 1833 1833 pop(X86::ebx); 1834 1834 restoreArgumentReference(); … … 1840 1840 1841 1841 // Check argCount matches callee arity. 1842 Jump arityCheckOkay2 = je32(Address(X86::eax, FIELD_OFFSET(CodeBlock, m_numParameters)), X86::edx);1842 Jump arityCheckOkay2 = branch32(Equal, Address(X86::eax, FIELD_OFFSET(CodeBlock, m_numParameters)), X86::edx); 1843 1843 pop(X86::ebx); 1844 1844 emitPutJITStubArg(X86::ebx, 2); … … 1867 1867 loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_body)), X86::eax); 1868 1868 loadPtr(Address(X86::eax, FIELD_OFFSET(FunctionBodyNode, m_code)), X86::eax); 1869 Jump hasCodeBlock3 = jnzPtr(X86::eax);1869 Jump hasCodeBlock3 = branchTestPtr(NonZero, X86::eax); 1870 1870 pop(X86::ebx); 1871 1871 restoreArgumentReference(); … … 1877 1877 1878 1878 // Check argCount matches callee arity. 1879 Jump arityCheckOkay3 = je32(Address(X86::eax, FIELD_OFFSET(CodeBlock, m_numParameters)), X86::edx);1879 Jump arityCheckOkay3 = branch32(Equal, Address(X86::eax, FIELD_OFFSET(CodeBlock, m_numParameters)), X86::edx); 1880 1880 pop(X86::ebx); 1881 1881 emitPutJITStubArg(X86::ebx, 2);
Note:
See TracChangeset
for help on using the changeset viewer.