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


Ignore:
Timestamp:
Mar 5, 2009, 11:02:10 PM (16 years ago)
Author:
[email protected]
Message:

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

Reviewed by Oliver Hunt.

Writes of constant values to SF registers should be made with direct memory
writes where possible, rather than moving the value via a hardware register.

~3% win on SunSpider tests on x86, ~1.5% win on v8 tests on x86-64.

  • assembler/MacroAssemblerX86_64.h: (JSC::MacroAssemblerX86_64::storePtr):
  • assembler/X86Assembler.h: (JSC::X86Assembler::movq_i32m):
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass):
File:
1 edited

Legend:

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

    r41275 r41474  
    305305        switch (opcodeID) {
    306306        case op_mov: {
    307             emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
    308             emitPutVirtualRegister(currentInstruction[1].u.operand);
     307            int src = currentInstruction[2].u.operand;
     308            int dst = currentInstruction[1].u.operand;
     309
     310            if (m_codeBlock->isConstantRegisterIndex(src)) {
     311                storePtr(ImmPtr(JSValuePtr::encode(getConstantOperand(src))), Address(callFrameRegister, dst * sizeof(Register)));
     312                if (dst == m_lastResultBytecodeRegister)
     313                    killLastResultRegister();
     314            } else {
     315                emitGetVirtualRegister(src, regT0);
     316                emitPutVirtualRegister(dst);
     317            }
    309318            NEXT_OPCODE(op_mov);
    310319        }
Note: See TracChangeset for help on using the changeset viewer.