Changeset 38377 in webkit


Ignore:
Timestamp:
Nov 13, 2008 2:27:59 PM (15 years ago)
Author:
cwzwarich@webkit.org
Message:

2008-11-13 Cameron Zwarich <zwarich@apple.com>

Reviewed by Darin Adler.

Bug 22238: Avoid unnecessary reads of temporaries when the target machine register is not eax
<https://bugs.webkit.org/show_bug.cgi?id=22238>

Enable the optimization of not reading a value back from memory that we
just wrote when the target machine register is not eax. In order to do
this, the code generation for op_put_global_var must be changed to
read its argument into a register before overwriting eax.

This is a 0.5% speedup on SunSpider and shows no change on the V8
benchmark suite when run in either harness.

  • VM/CTI.cpp: (JSC::CTI::emitGetArg): (JSC::CTI::privateCompileMainPass):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r38375 r38377  
     12008-11-13  Cameron Zwarich  <zwarich@apple.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        Bug 22238: Avoid unnecessary reads of temporaries when the target machine register is not eax
     6        <https://bugs.webkit.org/show_bug.cgi?id=22238>
     7
     8        Enable the optimization of not reading a value back from memory that we
     9        just wrote when the target machine register is not eax. In order to do
     10        this, the code generation for op_put_global_var must be changed to
     11        read its argument into a register before overwriting eax.
     12
     13        This is a 0.5% speedup on SunSpider and shows no change on the V8
     14        benchmark suite when run in either harness.
     15
     16        * VM/CTI.cpp:
     17        (JSC::CTI::emitGetArg):
     18        (JSC::CTI::privateCompileMainPass):
     19
    1202008-11-13  Cameron Zwarich  <zwarich@apple.com>
    221
  • trunk/JavaScriptCore/VM/CTI.cpp

    r38369 r38377  
    190190    }
    191191
    192     if (src == m_lastResultBytecodeRegister && dst == X86::eax && m_codeBlock->isTemporaryRegisterIndex(src)) {
     192    if (src == m_lastResultBytecodeRegister && m_codeBlock->isTemporaryRegisterIndex(src)) {
    193193        bool atJumpTarget = false;
    194194        while (m_jumpTargetsPosition < m_codeBlock->jumpTargets.size() && m_codeBlock->jumpTargets[m_jumpTargetsPosition] <= currentInstructionIndex) {
     
    200200        if (!atJumpTarget) {
    201201            // The argument we want is already stored in eax
     202            if (dst != X86::eax)
     203                m_jit.movl_rr(X86::eax, dst);
    202204            killLastResultRegister();
    203205            return;
     
    13861388        }
    13871389        case op_put_global_var: {
     1390            emitGetArg(instruction[i + 3].u.operand, X86::edx, i);
    13881391            JSVariableObject* globalObject = static_cast<JSVariableObject*>(instruction[i + 1].u.jsCell);
    13891392            m_jit.movl_i32r(asInteger(globalObject), X86::eax);
    1390             emitGetArg(instruction[i + 3].u.operand, X86::edx, i);
    13911393            emitPutVariableObjectRegister(X86::edx, X86::eax, instruction[i + 2].u.operand);
    13921394            i += 4;
Note: See TracChangeset for help on using the changeset viewer.