Changeset 96436 in webkit


Ignore:
Timestamp:
Sep 30, 2011 4:05:59 PM (13 years ago)
Author:
barraclough@apple.com
Message:

DFG JIT, Branch on integer can always be a 32-bit compare.
https://bugs.webkit.org/show_bug.cgi?id=69174

Reviewed by Sam Weinig.

if (shouldSpeculateInteger(node.child1()) && !isStrictInt32(node.child1())),
the JSVALUE64 JIT will currently compare all 64bits in the register, but in
these cases the DataFormat is always a JS boxed integer. In these cases we
can just compare the low 32bits anyway - no need to check the tag.
This allows the code to be unified with the JSVALUE32_64 JIT.

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r96432 r96436  
     12011-09-30  Gavin Barraclough  <barraclough@apple.com>
     2
     3        DFG JIT, Branch on integer can always be a 32-bit compare.
     4        https://bugs.webkit.org/show_bug.cgi?id=69174
     5
     6        Reviewed by Sam Weinig.
     7
     8        if (shouldSpeculateInteger(node.child1()) && !isStrictInt32(node.child1())),
     9        the JSVALUE64 JIT will currently compare all 64bits in the register, but in
     10        these cases the DataFormat is always a JS boxed integer. In these cases we
     11        can just compare the low 32bits anyway - no need to check the tag.
     12        This allows the code to be unified with the JSVALUE32_64 JIT.
     13
     14        * dfg/DFGSpeculativeJIT32_64.cpp:
     15        (JSC::DFG::SpeculativeJIT::compile):
     16        * dfg/DFGSpeculativeJIT64.cpp:
     17        (JSC::DFG::SpeculativeJIT::compile):
     18
    1192011-09-30  Oliver Hunt  <oliver@apple.com>
    220
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r96415 r96436  
    12711271    case Branch:
    12721272        if (isStrictInt32(node.child1()) || shouldSpeculateInteger(node.child1())) {
    1273             SpeculateStrictInt32Operand op(this, node.child1());
     1273            SpeculateIntegerOperand op(this, node.child1());
    12741274           
    12751275            BlockIndex taken = m_jit.graph().blockIndexForBytecodeOffset(node.takenBytecodeOffset());
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r96415 r96436  
    13641364
    13651365    case Branch:
    1366         if (isStrictInt32(node.child1())) {
    1367             SpeculateStrictInt32Operand op(this, node.child1());
     1366        if (isStrictInt32(node.child1()) || shouldSpeculateInteger(node.child1())) {
     1367            SpeculateIntegerOperand op(this, node.child1());
    13681368           
    13691369            BlockIndex taken = m_jit.graph().blockIndexForBytecodeOffset(node.takenBytecodeOffset());
     
    13801380           
    13811381            addBranch(m_jit.branchTest32(condition, op.gpr()), taken);
    1382             if (notTaken != (m_block + 1))
    1383                 addBranch(m_jit.jump(), notTaken);
    1384            
    1385             noResult(m_compileIndex);
    1386             break;
    1387         }
    1388         if (shouldSpeculateInteger(node.child1())) {
    1389             SpeculateIntegerOperand op(this, node.child1());
    1390 
    1391             BlockIndex taken = m_jit.graph().blockIndexForBytecodeOffset(node.takenBytecodeOffset());
    1392             BlockIndex notTaken = m_jit.graph().blockIndexForBytecodeOffset(node.notTakenBytecodeOffset());
    1393            
    1394             MacroAssembler::RelationalCondition condition = MacroAssembler::NotEqual;
    1395 
    1396             if (taken == (m_block + 1)) {
    1397                 condition = MacroAssembler::Equal;
    1398                 BlockIndex tmp = taken;
    1399                 taken = notTaken;
    1400                 notTaken = tmp;
    1401             }
    1402            
    1403             addBranch(m_jit.branchPtr(condition, op.gpr(), GPRInfo::tagTypeNumberRegister), taken);
    1404 
    14051382            if (notTaken != (m_block + 1))
    14061383                addBranch(m_jit.jump(), notTaken);
Note: See TracChangeset for help on using the changeset viewer.