Changeset 40562 in webkit for trunk/JavaScriptCore/jit/JIT.cpp


Ignore:
Timestamp:
Feb 3, 2009, 6:02:32 PM (16 years ago)
Author:
[email protected]
Message:

2009-02-03 Gavin Barraclough <[email protected]>

Reviewed by Geoff Garen.

https://bugs.webkit.org/show_bug.cgi?id=23715

Simplify MacroAssembler interface, by combining comparison methods.
Seprate operations are combined as follows:

jz32/jnz32/jzPtr/jnzPtr -> branchTest32/branchTestPtr,
j*(Add|Mul|Sub)32/j*(Add|Mul|Sub)Ptr -> branch(Add|Mul|Sub)32/branch(Add|Mul|Sub)Ptr
j*32/j*Ptr (all other two op combparisons) -> branch32/brnachPtr
set*32 -> set32

Also, represent the Scale of BaseIndex addresses as a plain enum (0,1,2,3),
instead of as multiplicands (1,2,4,8).

This patch singificantly reduces replication of code, and increases functionality supported
by the MacroAssembler. No performance impact.

  • assembler/MacroAssembler.h: (JSC::MacroAssembler::): (JSC::MacroAssembler::branchPtr): (JSC::MacroAssembler::branchPtrWithPatch): (JSC::MacroAssembler::branch32): (JSC::MacroAssembler::branch16): (JSC::MacroAssembler::branchTestPtr): (JSC::MacroAssembler::branchTest32): (JSC::MacroAssembler::branchAddPtr): (JSC::MacroAssembler::branchAdd32): (JSC::MacroAssembler::branchMul32): (JSC::MacroAssembler::branchSubPtr): (JSC::MacroAssembler::branchSub32): (JSC::MacroAssembler::set32): (JSC::MacroAssembler::setTest32):
  • assembler/X86Assembler.h: (JSC::X86Assembler::): (JSC::X86Assembler::jccRel32): (JSC::X86Assembler::setccOpcode): (JSC::X86Assembler::cmpq_mr): (JSC::X86Assembler::setcc_r): (JSC::X86Assembler::sete_r): (JSC::X86Assembler::setne_r): (JSC::X86Assembler::jne): (JSC::X86Assembler::je): (JSC::X86Assembler::jl): (JSC::X86Assembler::jb): (JSC::X86Assembler::jle): (JSC::X86Assembler::jbe): (JSC::X86Assembler::jge): (JSC::X86Assembler::jg): (JSC::X86Assembler::ja): (JSC::X86Assembler::jae): (JSC::X86Assembler::jo): (JSC::X86Assembler::jp): (JSC::X86Assembler::js): (JSC::X86Assembler::jcc): (JSC::X86Assembler::X86InstructionFormatter::putModRmSib):
  • jit/JIT.cpp: (JSC::JIT::compileOpStrictEq): (JSC::JIT::emitSlowScriptCheck): (JSC::JIT::privateCompileMainPass): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::privateCompile): (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JITArithmetic.cpp: (JSC::JIT::compileFastArith_op_lshift): (JSC::JIT::compileFastArith_op_mod): (JSC::JIT::compileFastArith_op_post_inc): (JSC::JIT::compileFastArith_op_post_dec): (JSC::JIT::compileFastArith_op_pre_inc): (JSC::JIT::compileFastArith_op_pre_dec): (JSC::JIT::compileBinaryArithOp): (JSC::JIT::compileFastArith_op_add): (JSC::JIT::compileFastArith_op_mul):
  • jit/JITCall.cpp: (JSC::JIT::compileOpCall): (JSC::JIT::compileOpCallSlowCase):
  • jit/JITInlineMethods.h: (JSC::JIT::checkStructure): (JSC::JIT::emitJumpIfJSCell): (JSC::JIT::emitJumpIfNotJSCell): (JSC::JIT::emitJumpIfImmediateNumber): (JSC::JIT::emitJumpIfNotImmediateNumber): (JSC::JIT::emitJumpIfImmediateInteger): (JSC::JIT::emitJumpIfNotImmediateInteger): (JSC::JIT::emitFastArithDeTagImmediateJumpIfZero):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::compileGetByIdHotPath): (JSC::JIT::compilePutByIdHotPath): (JSC::JIT::privateCompilePutByIdTransition): (JSC::JIT::privateCompilePatchGetArrayLength): (JSC::JIT::privateCompileGetByIdProto): (JSC::JIT::privateCompileGetByIdProtoList): (JSC::JIT::privateCompileGetByIdChainList): (JSC::JIT::privateCompileGetByIdChain):
  • runtime/RegExp.cpp: (JSC::RegExp::match):
  • wrec/WRECGenerator.cpp: (JSC::WREC::Generator::generateEnter): (JSC::WREC::Generator::generateIncrementIndex): (JSC::WREC::Generator::generateLoadCharacter): (JSC::WREC::Generator::generateJumpIfNotEndOfInput): (JSC::WREC::Generator::generateBackreferenceQuantifier): (JSC::WREC::Generator::generateNonGreedyQuantifier): (JSC::WREC::Generator::generateGreedyQuantifier): (JSC::WREC::Generator::generatePatternCharacterPair): (JSC::WREC::Generator::generatePatternCharacter): (JSC::WREC::Generator::generateCharacterClassInvertedRange): (JSC::WREC::Generator::generateCharacterClassInverted): (JSC::WREC::Generator::generateAssertionBOL): (JSC::WREC::Generator::generateAssertionEOL): (JSC::WREC::Generator::generateAssertionWordBoundary): (JSC::WREC::Generator::generateBackreference):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JIT.cpp

    r40279 r40562  
    239239
    240240    if (type == OpStrictEq)
    241         sete32(X86::edx, X86::eax);
     241        set32(Equal, X86::edx, X86::eax, X86::eax);
    242242    else
    243         setne32(X86::edx, X86::eax);
     243        set32(NotEqual, X86::edx, X86::eax, X86::eax);
    244244    emitTagAsBoolImmediate(X86::eax);
    245245#else
     
    249249    Jump firstNotImmediate = emitJumpIfJSCell(X86::eax);
    250250    Jump secondNotImmediate = emitJumpIfJSCell(X86::edx);
    251     Jump bothWereImmediatesButNotEqual = jnePtr(X86::edx, X86::eax);
     251    Jump bothWereImmediatesButNotEqual = branchPtr(NotEqual, X86::edx, X86::eax);
    252252
    253253    // They are equal - set the result to true. (Or false, if negated).
     
    260260    firstNotImmediate.link(this);
    261261    emitJumpSlowCaseIfJSCell(X86::edx);
    262     addSlowCase(jePtr(X86::edx, ImmPtr(JSValuePtr::encode(js0()))));
     262    addSlowCase(branchPtr(Equal, X86::edx, ImmPtr(JSValuePtr::encode(js0()))));
    263263    Jump firstWasNotImmediate = jump();
    264264
     
    266266    // If eax is 0 jump to a slow case, otherwise these values are not equal.
    267267    secondNotImmediate.link(this);
    268     addSlowCase(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))));
     268    addSlowCase(branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(js0()))));
    269269
    270270    // We get here if the two values are different immediates, or one is 0 and the other is a JSCell.
     
    282282void JIT::emitSlowScriptCheck()
    283283{
    284     Jump skipTimeout = jnzSub32(Imm32(1), timeoutCheckRegister);
     284    Jump skipTimeout = branchSub32(NonZero, Imm32(1), timeoutCheckRegister);
    285285    emitCTICall(Interpreter::cti_timeout_check);
    286286    move(X86::eax, timeoutCheckRegister);
     
    380380                int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2)));
    381381#endif
    382                 addJump(jl32(X86::eax, Imm32(op2imm)), target + 3);
     382                addJump(branch32(LessThan, X86::eax, Imm32(op2imm)), target + 3);
    383383            } else {
    384384                emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx);
    385385                emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
    386386                emitJumpSlowCaseIfNotImmediateInteger(X86::edx);
    387                 addJump(jl32(X86::eax, X86::edx), target + 3);
     387                addJump(branch32(LessThan, X86::eax, X86::edx), target + 3);
    388388            }
    389389            NEXT_OPCODE(op_loop_if_less);
     
    403403                int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2)));
    404404#endif
    405                 addJump(jle32(X86::eax, Imm32(op2imm)), target + 3);
     405                addJump(branch32(LessThanOrEqual, X86::eax, Imm32(op2imm)), target + 3);
    406406            } else {
    407407                emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx);
    408408                emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
    409409                emitJumpSlowCaseIfNotImmediateInteger(X86::edx);
    410                 addJump(jle32(X86::eax, X86::edx), target + 3);
     410                addJump(branch32(LessThanOrEqual, X86::eax, X86::edx), target + 3);
    411411            }
    412412            NEXT_OPCODE(op_loop_if_less);
     
    445445            sub32(Address(X86::eax, FIELD_OFFSET(Structure, m_typeInfo.m_type)), X86::ebx);
    446446            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));
    448448
    449449            // check that baseVal's flags include ImplementsHasInstance but not OverridesHasInstance
    450450            load32(Address(X86::ecx, FIELD_OFFSET(Structure, m_typeInfo.m_flags)), X86::ecx);
    451451            and32(Imm32(ImplementsHasInstance | OverridesHasInstance), X86::ecx);
    452             addSlowCase(jne32(X86::ecx, Imm32(ImplementsHasInstance)));
     452            addSlowCase(branch32(NotEqual, X86::ecx, Imm32(ImplementsHasInstance)));
    453453
    454454            emitGetVirtualRegister(currentInstruction[2].u.operand, X86::ecx); // reload value
     
    464464            loadPtr(Address(X86::ecx, FIELD_OFFSET(Structure, m_prototype)), X86::ecx);
    465465
    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);
    469469
    470470            move(ImmPtr(JSValuePtr::encode(jsBoolean(false))), X86::eax);
     
    593593            emitJumpSlowCaseIfNotJSCell(X86::eax);
    594594            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)));
    596596
    597597            NEXT_OPCODE(op_construct_verify);
     
    612612#endif
    613613            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)));
    615615
    616616            // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff
    617617            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))));
    619619
    620620            // Get the value from the vector
     
    645645#endif
    646646            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)));
    648648
    649649            // This is an array; get the m_storage pointer into ecx, then check if the index is below the fast cutoff
    650650            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)));
    652652            // 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))));
    654654
    655655            // 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.
    656656            // 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]))));
    658658
    659659            // All good - put the value into the array.
     
    670670            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    671671
    672             Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0())));
     672            Jump isZero = branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(js0())));
    673673            addJump(emitJumpIfImmediateInteger(X86::eax), target + 2);
    674674
    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)))));
    677677
    678678            isZero.link(this);
     
    712712            move(ImmPtr(globalObject), X86::eax);
    713713            loadPtr(structureAddress, X86::edx);
    714             Jump noMatch = jnePtr(X86::edx, Address(X86::eax, FIELD_OFFSET(JSCell, m_structure))); // Structures don't match
     714            Jump noMatch = branchPtr(NotEqual, X86::edx, Address(X86::eax, FIELD_OFFSET(JSCell, m_structure))); // Structures don't match
    715715
    716716            // Load cached property
     
    748748                int32_t op2imm = static_cast<int32_t>(JSImmediate::rawValue(getConstantOperand(op2)));
    749749#endif
    750                 addJump(jge32(X86::eax, Imm32(op2imm)), target + 3);
     750                addJump(branch32(GreaterThanOrEqual, X86::eax, Imm32(op2imm)), target + 3);
    751751            } else {
    752752                emitGetVirtualRegisters(op1, X86::eax, op2, X86::edx);
    753753                emitJumpSlowCaseIfNotImmediateInteger(X86::eax);
    754754                emitJumpSlowCaseIfNotImmediateInteger(X86::edx);
    755                 addJump(jge32(X86::eax, X86::edx), target + 3);
     755                addJump(branch32(GreaterThanOrEqual, X86::eax, X86::edx), target + 3);
    756756            }
    757757            NEXT_OPCODE(op_jnless);
     
    760760            emitGetVirtualRegister(currentInstruction[2].u.operand, X86::eax);
    761761            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))));
    763763            xorPtr(Imm32(static_cast<int32_t>(JSImmediate::FullTagTypeBool | JSImmediate::ExtendedPayloadBitBoolValue)), X86::eax);
    764764            emitPutVirtualRegister(currentInstruction[1].u.operand);
     
    769769            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    770770
    771             addJump(jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0()))), target + 2);
     771            addJump(branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(js0()))), target + 2);
    772772            Jump isNonZero = emitJumpIfImmediateInteger(X86::eax);
    773773
    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)))));
    776776
    777777            isNonZero.link(this);
     
    787787            // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure.
    788788            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);
    790790            Jump wasNotImmediate = jump();
    791791
     
    793793            isImmediate.link(this);
    794794            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);           
    796796
    797797            wasNotImmediate.link(this);
     
    807807            // First, handle JSCell cases - check MasqueradesAsUndefined bit on the structure.
    808808            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);
    810810            Jump wasNotImmediate = jump();
    811811
     
    813813            isImmediate.link(this);
    814814            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);           
    816816
    817817            wasNotImmediate.link(this);
     
    843843            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx);
    844844            emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx);
    845             sete32(X86::edx, X86::eax);
     845            set32(Equal, X86::edx, X86::eax, X86::eax);
    846846            emitTagAsBoolImmediate(X86::eax);
    847847            emitPutVirtualRegister(currentInstruction[1].u.operand);
     
    895895            emitGetVirtualRegister(currentInstruction[1].u.operand, X86::eax);
    896896
    897             Jump isZero = jePtr(X86::eax, ImmPtr(JSValuePtr::encode(js0())));
     897            Jump isZero = branchPtr(Equal, X86::eax, ImmPtr(JSValuePtr::encode(js0())));
    898898            addJump(emitJumpIfImmediateInteger(X86::eax), target + 2);
    899899
    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)))));
    902902
    903903            isZero.link(this);
     
    908908            emitGetVirtualRegisters(currentInstruction[2].u.operand, X86::eax, currentInstruction[3].u.operand, X86::edx);
    909909            emitJumpSlowCaseIfNotImmediateIntegers(X86::eax, X86::edx, X86::ecx);
    910             setne32(X86::edx, X86::eax);
     910            set32(NotEqual, X86::edx, X86::eax, X86::eax);
    911911            emitTagAsBoolImmediate(X86::eax);
    912912
     
    974974            unsigned target = currentInstruction[3].u.operand;
    975975            emitCTICall(Interpreter::cti_op_next_pname);
    976             Jump endOfIter = jzPtr(X86::eax);
     976            Jump endOfIter = branchTestPtr(Zero, X86::eax);
    977977            emitPutVirtualRegister(currentInstruction[1].u.operand);
    978978            addJump(jump(), target + 3);
     
    10131013            emitJumpSlowCaseIfNotJSCell(X86::eax, srcVReg);
    10141014            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)));
    10161016           
    10171017            wasImmediate.link(this);
     
    11431143
    11441144            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
    1145             setnz32(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);
    11461146
    11471147            Jump wasNotImmediate = jump();
     
    11501150
    11511151            andPtr(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax);
    1152             sete32(Imm32(JSImmediate::FullTagTypeNull), X86::eax);
     1152            set32(Equal, X86::eax, Imm32(JSImmediate::FullTagTypeNull), X86::eax);
    11531153
    11541154            wasNotImmediate.link(this);
     
    11671167
    11681168            loadPtr(Address(X86::eax, FIELD_OFFSET(JSCell, m_structure)), X86::ecx);
    1169             setz32(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);
    11701170
    11711171            Jump wasNotImmediate = jump();
     
    11741174
    11751175            andPtr(Imm32(~JSImmediate::ExtendedTagBitUndefined), X86::eax);
    1176             setne32(Imm32(JSImmediate::FullTagTypeNull), X86::eax);
     1176            set32(NotEqual, X86::eax, Imm32(JSImmediate::FullTagTypeNull), X86::eax);
    11771177
    11781178            wasNotImmediate.link(this);
     
    12181218            emitJumpSlowCaseIfNotJSCell(X86::eax);
    12191219            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)));
    12211221
    12221222            NEXT_OPCODE(op_convert_this);
     
    12241224        case op_profile_will_call: {
    12251225            emitGetCTIParam(STUB_ARGS_profilerReference, X86::eax);
    1226             Jump noProfiler = jzPtr(Address(X86::eax));
     1226            Jump noProfiler = branchTestPtr(Zero, Address(X86::eax));
    12271227            emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, X86::eax);
    12281228            emitCTICall(Interpreter::cti_op_profile_will_call);
     
    12331233        case op_profile_did_call: {
    12341234            emitGetCTIParam(STUB_ARGS_profilerReference, X86::eax);
    1235             Jump noProfiler = jzPtr(Address(X86::eax));
     1235            Jump noProfiler = branchTestPtr(Zero, Address(X86::eax));
    12361236            emitPutJITStubArgFromVirtualRegister(currentInstruction[1].u.operand, 1, X86::eax);
    12371237            emitCTICall(Interpreter::cti_op_profile_did_call);
     
    13281328            // First, check if this is an access to the vector
    13291329            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);
    13311331
    13321332            // okay, missed the fast region, but it is still in the vector.  Get the value.
    13331333            loadPtr(BaseIndex(X86::ecx, X86::edx, ScalePtr, FIELD_OFFSET(ArrayStorage, m_vector[0])), X86::ecx);
    13341334            // 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);
    13361336            move(X86::ecx, X86::eax);
    13371337            emitPutVirtualRegister(currentInstruction[1].u.operand, X86::eax);
     
    13591359                emitPutJITStubArgFromVirtualRegister(op2, 2, X86::ecx);
    13601360                emitCTICall(Interpreter::cti_op_loop_if_less);
    1361                 emitJumpSlowToHot(jnz32(X86::eax), target + 3);
     1361                emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 3);
    13621362            } else {
    13631363                linkSlowCase(iter);
     
    13661366                emitPutJITStubArg(X86::edx, 2);
    13671367                emitCTICall(Interpreter::cti_op_loop_if_less);
    1368                 emitJumpSlowToHot(jnz32(X86::eax), target + 3);
     1368                emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 3);
    13691369            }
    13701370            NEXT_OPCODE(op_loop_if_less);
     
    13861386                emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 2, X86::ecx);
    13871387                emitCTICall(Interpreter::cti_op_loop_if_lesseq);
    1388                 emitJumpSlowToHot(jnz32(X86::eax), target + 3);
     1388                emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 3);
    13891389            } else {
    13901390                linkSlowCase(iter);
     
    13931393                emitPutJITStubArg(X86::edx, 2);
    13941394                emitCTICall(Interpreter::cti_op_loop_if_lesseq);
    1395                 emitJumpSlowToHot(jnz32(X86::eax), target + 3);
     1395                emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 3);
    13961396            }
    13971397            NEXT_OPCODE(op_loop_if_lesseq);
     
    14311431            emitCTICall(Interpreter::cti_op_jtrue);
    14321432            unsigned target = currentInstruction[2].u.operand;
    1433             emitJumpSlowToHot(jnz32(X86::eax), target + 2);
     1433            emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 2);
    14341434            NEXT_OPCODE(op_loop_if_true);
    14351435        }
     
    14461446                emitPutJITStubArgFromVirtualRegister(currentInstruction[2].u.operand, 2, X86::ecx);
    14471447                emitCTICall(Interpreter::cti_op_jless);
    1448                 emitJumpSlowToHot(jz32(X86::eax), target + 3);
     1448                emitJumpSlowToHot(branchTest32(Zero, X86::eax), target + 3);
    14491449            } else {
    14501450                linkSlowCase(iter);
     
    14531453                emitPutJITStubArg(X86::edx, 2);
    14541454                emitCTICall(Interpreter::cti_op_jless);
    1455                 emitJumpSlowToHot(jz32(X86::eax), target + 3);
     1455                emitJumpSlowToHot(branchTest32(Zero, X86::eax), target + 3);
    14561456            }
    14571457            NEXT_OPCODE(op_jnless);
     
    14701470            emitCTICall(Interpreter::cti_op_jtrue);
    14711471            unsigned target = currentInstruction[2].u.operand;
    1472             emitJumpSlowToHot(jz32(X86::eax), target + 2); // inverted!
     1472            emitJumpSlowToHot(branchTest32(Zero, X86::eax), target + 2); // inverted!
    14731473            NEXT_OPCODE(op_jfalse);
    14741474        }
     
    14931493            emitCTICall(Interpreter::cti_op_jtrue);
    14941494            unsigned target = currentInstruction[2].u.operand;
    1495             emitJumpSlowToHot(jnz32(X86::eax), target + 2);
     1495            emitJumpSlowToHot(branchTest32(NonZero, X86::eax), target + 2);
    14961496            NEXT_OPCODE(op_jtrue);
    14971497        }
     
    16401640        addPtr(Imm32(m_codeBlock->m_numCalleeRegisters * sizeof(Register)), callFrameRegister, X86::edx);
    16411641       
    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)));
    16431643        afterRegisterFileCheck = label();
    16441644    }
     
    17541754    // Check eax is an array
    17551755    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));
    17571757
    17581758    // Checks out okay! - get the length from the storage
     
    17601760    load32(Address(X86::eax, FIELD_OFFSET(ArrayStorage, m_length)), X86::eax);
    17611761
    1762     Jump array_failureCases3 = ja32(X86::eax, Imm32(JSImmediate::maxImmediateInt));
     1762    Jump array_failureCases3 = branch32(Above, X86::eax, Imm32(JSImmediate::maxImmediateInt));
    17631763
    17641764    // X86::eax contains a 64 bit value (is positive, is zero extended) so we don't need sign extend here.
     
    17721772    // Check eax is a string
    17731773    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));
    17751775
    17761776    // Checks out okay! - get the length from the Ustring.
     
    17781778    load32(Address(X86::eax, FIELD_OFFSET(UString::Rep, len)), X86::eax);
    17791779
    1780     Jump string_failureCases3 = ja32(X86::eax, Imm32(JSImmediate::maxImmediateInt));
     1780    Jump string_failureCases3 = branch32(Above, X86::eax, Imm32(JSImmediate::maxImmediateInt));
    17811781
    17821782    // X86::eax contains a 64 bit value (is positive, is zero extended) so we don't need sign extend here.
     
    17931793    loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_body)), X86::eax);
    17941794    loadPtr(Address(X86::eax, FIELD_OFFSET(FunctionBodyNode, m_code)), X86::eax);
    1795     Jump hasCodeBlock1 = jnzPtr(X86::eax);
     1795    Jump hasCodeBlock1 = branchTestPtr(NonZero, X86::eax);
    17961796    pop(X86::ebx);
    17971797    restoreArgumentReference();
     
    18031803
    18041804    // 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);
    18061806    pop(X86::ebx);
    18071807    emitPutJITStubArg(X86::ebx, 2);
     
    18301830    loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_body)), X86::eax);
    18311831    loadPtr(Address(X86::eax, FIELD_OFFSET(FunctionBodyNode, m_code)), X86::eax);
    1832     Jump hasCodeBlock2 = jnzPtr(X86::eax);
     1832    Jump hasCodeBlock2 = branchTestPtr(NonZero, X86::eax);
    18331833    pop(X86::ebx);
    18341834    restoreArgumentReference();
     
    18401840
    18411841    // 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);
    18431843    pop(X86::ebx);
    18441844    emitPutJITStubArg(X86::ebx, 2);
     
    18671867    loadPtr(Address(X86::ecx, FIELD_OFFSET(JSFunction, m_body)), X86::eax);
    18681868    loadPtr(Address(X86::eax, FIELD_OFFSET(FunctionBodyNode, m_code)), X86::eax);
    1869     Jump hasCodeBlock3 = jnzPtr(X86::eax);
     1869    Jump hasCodeBlock3 = branchTestPtr(NonZero, X86::eax);
    18701870    pop(X86::ebx);
    18711871    restoreArgumentReference();
     
    18771877
    18781878    // 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);
    18801880    pop(X86::ebx);
    18811881    emitPutJITStubArg(X86::ebx, 2);
Note: See TracChangeset for help on using the changeset viewer.