Ignore:
Timestamp:
Sep 14, 2008, 4:01:03 PM (17 years ago)
Author:
[email protected]
Message:

2008-09-14 Cameron Zwarich <[email protected]>

Reviewed by Oliver Hunt.

Bug 20816: op_lesseq should be optimized
<https://bugs.webkit.org/show_bug.cgi?id=20816>

Add a loop_if_lesseq opcode that is similar to the loop_if_less opcode.

This is a 9.4% speedup on the V8 Crypto benchmark.

  • VM/CTI.cpp: (JSC::CTI::privateCompileMainPass): (JSC::CTI::privateCompileSlowCases):
  • VM/CodeBlock.cpp: (JSC::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (JSC::CodeGenerator::emitJumpIfTrue):
  • VM/Machine.cpp: (JSC::Machine::privateExecute): (JSC::Machine::cti_op_loop_if_lesseq):
  • VM/Machine.h:
  • VM/Opcode.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CodeGenerator.cpp

    r36401 r36408  
    487487            return target;
    488488        }
     489    } else if (m_lastOpcodeID == op_lesseq && !target->isForwardLabel()) {
     490        int dstIndex;
     491        int src1Index;
     492        int src2Index;
     493
     494        retrieveLastBinaryOp(dstIndex, src1Index, src2Index);
     495
     496        if (cond->index() == dstIndex && cond->isTemporary() && !cond->refCount()) {
     497            rewindBinaryOp();
     498            emitOpcode(op_loop_if_lesseq);
     499            instructions().append(src1Index);
     500            instructions().append(src2Index);
     501            instructions().append(target->offsetFrom(instructions().size()));
     502            return target;
     503        }
    489504    }
    490505
Note: See TracChangeset for help on using the changeset viewer.