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/JITCall.cpp

    r40232 r40562  
    134134
    135135        emitCTICall(Interpreter::cti_op_call_eval);
    136         wasEval = jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsImpossibleValue())));
     136        wasEval = branchPtr(NotEqual, X86::eax, ImmPtr(JSValuePtr::encode(jsImpossibleValue())));
    137137    }
    138138
     
    146146    // Check for JSFunctions.
    147147    emitJumpSlowCaseIfNotJSCell(X86::ecx);
    148     addSlowCase(jnePtr(Address(X86::ecx), ImmPtr(m_interpreter->m_jsFunctionVptr)));
     148    addSlowCase(branchPtr(NotEqual, Address(X86::ecx), ImmPtr(m_interpreter->m_jsFunctionVptr)));
    149149
    150150    // First, in the case of a construct, allocate the new object.
     
    208208
    209209        emitCTICall(Interpreter::cti_op_call_eval);
    210         wasEval = jnePtr(X86::eax, ImmPtr(JSValuePtr::encode(jsImpossibleValue())));
     210        wasEval = branchPtr(NotEqual, X86::eax, ImmPtr(JSValuePtr::encode(jsImpossibleValue())));
    211211    }
    212212
     
    215215    emitGetVirtualRegister(callee, X86::ecx);
    216216    DataLabelPtr addressOfLinkedFunctionCheck;
    217     Jump jumpToSlow = jnePtrWithPatch(X86::ecx, addressOfLinkedFunctionCheck, ImmPtr(JSValuePtr::encode(jsImpossibleValue())));
     217    Jump jumpToSlow = branchPtrWithPatch(NotEqual, X86::ecx, addressOfLinkedFunctionCheck, ImmPtr(JSValuePtr::encode(jsImpossibleValue())));
    218218    addSlowCase(jumpToSlow);
    219219    ASSERT(differenceBetween(addressOfLinkedFunctionCheck, jumpToSlow) == patchOffsetOpCallCompareToJump);
     
    273273    // Fast check for JS function.
    274274    Jump callLinkFailNotObject = emitJumpIfNotJSCell(X86::ecx);
    275     Jump callLinkFailNotJSFunction = jnePtr(Address(X86::ecx), ImmPtr(m_interpreter->m_jsFunctionVptr));
     275    Jump callLinkFailNotJSFunction = branchPtr(NotEqual, Address(X86::ecx), ImmPtr(m_interpreter->m_jsFunctionVptr));
    276276
    277277    // First, in the case of a construct, allocate the new object.
     
    305305    // Check for JSFunctions.
    306306    Jump isNotObject = emitJumpIfNotJSCell(X86::ecx);
    307     Jump isJSFunction = jePtr(Address(X86::ecx), ImmPtr(m_interpreter->m_jsFunctionVptr));
     307    Jump isJSFunction = branchPtr(Equal, Address(X86::ecx), ImmPtr(m_interpreter->m_jsFunctionVptr));
    308308
    309309    // This handles host functions
Note: See TracChangeset for help on using the changeset viewer.