Ignore:
Timestamp:
Jun 29, 2008, 11:17:01 PM (17 years ago)
Author:
[email protected]
Message:

2008-06-29 Cameron Zwarich <[email protected]>

Reviewed by Oliver.

Bug 19821: Merge the instruction pair (less, jfalse)
<https://bugs.webkit.org/show_bug.cgi?id=19821>

This is a 2.4% win on SunSpider. I needed to add an ALWAYS_INLINE
intrinisc to CodeGenerator::rewindBinaryOp() to avoid a massive
regression in regexp-dna.

  • VM/CodeBlock.cpp: (KJS::CodeBlock::dump):
  • VM/CodeGenerator.cpp: (KJS::CodeGenerator::rewindBinaryOp): (KJS::CodeGenerator::emitJumpIfFalse):
  • VM/Machine.cpp: (KJS::Machine::privateExecute):
  • VM/Opcode.cpp: (KJS::):
  • VM/Opcode.h:
File:
1 edited

Legend:

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

    r34851 r34883  
    430430}
    431431
    432 void CodeGenerator::rewindBinaryOp()
     432void ALWAYS_INLINE CodeGenerator::rewindBinaryOp()
    433433{
    434434    ASSERT(instructions().size() >= 4);
     
    471471{
    472472    ASSERT(target->isForwardLabel());
     473   
     474    if (m_lastOpcodeID == op_less) {
     475        int dstIndex;
     476        int src1Index;
     477        int src2Index;
     478       
     479        retrieveLastBinaryOp(dstIndex, src1Index, src2Index);
     480       
     481        if (cond->index() == dstIndex && !cond->refCount()) {
     482            rewindBinaryOp();
     483            emitOpcode(op_jnless);
     484            instructions().append(src1Index);
     485            instructions().append(src2Index);
     486            instructions().append(target->offsetFrom(instructions().size()));
     487            return target;
     488        }
     489    }
     490   
    473491    emitOpcode(op_jfalse);
    474492    instructions().append(cond->index());
Note: See TracChangeset for help on using the changeset viewer.