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


Ignore:
Timestamp:
Jan 16, 2009, 8:57:56 PM (16 years ago)
Author:
[email protected]
Message:

2009-01-16 Gavin Barraclough <[email protected]>

Reviewed by Oliver Hunt.

On x86-64 jit, cache JSImmedate::TagMask & JSImmedate::TagTypeNumber in
registers, save reloading them every time they're used.

Draws x86-64 jit performance close to that of i386 jit.

  • assembler/MacroAssembler.h: (JSC::MacroAssembler::subPtr): (JSC::MacroAssembler::jnzPtr): (JSC::MacroAssembler::jzPtr):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass):
  • jit/JIT.h:
  • jit/JITArithmetic.cpp: (JSC::JIT::compileBinaryArithOpSlowCase):
  • jit/JITInlineMethods.h: (JSC::JIT::emitJumpIfJSCell): (JSC::JIT::emitJumpIfNotJSCell): (JSC::JIT::emitJumpIfImmediateNumber): (JSC::JIT::emitJumpIfNotImmediateNumber): (JSC::JIT::emitJumpIfImmediateInteger): (JSC::JIT::emitJumpIfNotImmediateInteger): (JSC::JIT::emitFastArithIntToImmNoCheck):
File:
1 edited

Legend:

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

    r39993 r40004  
    4545namespace JSC {
    4646
    47 COMPILE_ASSERT(STUB_ARGS_code == 0xC, STUB_ARGS_code_is_C);
    48 COMPILE_ASSERT(STUB_ARGS_callFrame == 0xE, STUB_ARGS_callFrame_is_E);
    49 
    5047#if COMPILER(GCC) && PLATFORM(X86)
     48
     49COMPILE_ASSERT(STUB_ARGS_code == 0x0C, STUB_ARGS_code_is_0x0C);
     50COMPILE_ASSERT(STUB_ARGS_callFrame == 0x0E, STUB_ARGS_callFrame_is_0x0E);
    5151
    5252#if PLATFORM(DARWIN)
     
    9999#elif COMPILER(GCC) && PLATFORM(X86_64)
    100100
     101COMPILE_ASSERT(STUB_ARGS_code == 0x10, STUB_ARGS_code_is_0x10);
     102COMPILE_ASSERT(STUB_ARGS_callFrame == 0x12, STUB_ARGS_callFrame_is_0x12);
     103
    101104#if PLATFORM(DARWIN)
    102105#define SYMBOL_STRING(name) "_" #name
     
    112115    "pushq %r12" "\n"
    113116    "pushq %r13" "\n"
     117    "pushq %r14" "\n"
     118    "pushq %r15" "\n"
    114119    "pushq %rbx" "\n"
    115     "subq $0x38, %rsp" "\n"
     120    "subq $0x48, %rsp" "\n"
    116121    "movq $512, %r12" "\n"
    117     "movq 0x70(%rsp), %r13" "\n" // Ox70 = 0x0E * 8, 0x0E = STUB_ARGS_callFrame (see assertion above)
    118     "call *0x60(%rsp)" "\n" // Ox60 = 0x0C * 8, 0x0C = STUB_ARGS_code (see assertion above)
    119     "addq $0x38, %rsp" "\n"
     122    "movq $0xFFFF000000000000, %r14" "\n"
     123    "movq $0xFFFF000000000002, %r15" "\n"
     124    "movq 0x90(%rsp), %r13" "\n" // Ox90 = 0x12 * 8, 0x12 = STUB_ARGS_callFrame (see assertion above)
     125    "call *0x80(%rsp)" "\n" // Ox80 = 0x10 * 8, 0x10 = STUB_ARGS_code (see assertion above)
     126    "addq $0x48, %rsp" "\n"
    120127    "popq %rbx" "\n"
     128    "popq %r15" "\n"
     129    "popq %r14" "\n"
    121130    "popq %r13" "\n"
    122131    "popq %r12" "\n"
     
    134143#error "JIT_STUB_ARGUMENT configuration not supported."
    135144#endif
    136     "addq $0x38, %rsp" "\n"
     145    "addq $0x48, %rsp" "\n"
    137146    "popq %rbx" "\n"
     147    "popq %r15" "\n"
     148    "popq %r14" "\n"
    138149    "popq %r13" "\n"
    139150    "popq %r12" "\n"
     
    935946            emitCTICall(Interpreter::cti_op_throw);
    936947#if PLATFORM(X86_64)
    937             addPtr(Imm32(0x38), X86::esp);
     948            addPtr(Imm32(0x48), X86::esp);
    938949            pop(X86::ebx);
     950            pop(X86::r15);
     951            pop(X86::r14);
    939952            pop(X86::r13);
    940953            pop(X86::r12);
Note: See TracChangeset for help on using the changeset viewer.