Ignore:
Timestamp:
May 8, 2009, 8:08:41 AM (16 years ago)
Author:
[email protected]
Message:

2009-05-08 Cameron Zwarich <[email protected]>

Reviewed by Maciej Stachowiak.

Add a new opcode jnlesseq, and optimize its compilation in the JIT using
techniques similar to what were used to optimize jnless in r43363.

This gives a 0.7% speedup on SunSpider, particularly on the tests 3d-cube,
control-flow-recursive, date-format-xparb, and string-base64.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): Add support for dumping op_jnlesseq.
  • bytecode/Opcode.h: Add op_jnlesseq to the list of opcodes.
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitJumpIfFalse): Add a peephole optimization for op_jnlesseq when emitting lesseq followed by a jump.
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute): Add case for op_jnlesseq.
  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass): Add case for op_jnlesseq. (JSC::JIT::privateCompileSlowCases): Add case for op_jnlesseq.
  • jit/JIT.h:
  • jit/JITArithmetic.cpp: (JSC::JIT::compileFastArith_op_jnlesseq): Added. (JSC::JIT::compileFastArithSlow_op_jnlesseq): Added.
  • jit/JITStubs.cpp: (JSC::JITStubs::cti_op_jlesseq): Added.
  • jit/JITStubs.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r43331 r43401  
    648648            rewindBinaryOp();
    649649            emitOpcode(op_jnless);
     650            instructions().append(src1Index);
     651            instructions().append(src2Index);
     652            instructions().append(target->offsetFrom(instructions().size()));
     653            return target;
     654        }
     655    } else if (m_lastOpcodeID == op_lesseq) {
     656        int dstIndex;
     657        int src1Index;
     658        int src2Index;
     659
     660        retrieveLastBinaryOp(dstIndex, src1Index, src2Index);
     661
     662        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
     663            rewindBinaryOp();
     664            emitOpcode(op_jnlesseq);
    650665            instructions().append(src1Index);
    651666            instructions().append(src2Index);
Note: See TracChangeset for help on using the changeset viewer.