Ignore:
Timestamp:
Sep 19, 2011, 3:27:38 PM (14 years ago)
Author:
[email protected]
Message:

DFG speculation failures should act as additional value profiles
https://bugs.webkit.org/show_bug.cgi?id=68335

Reviewed by Oliver Hunt.

This adds slow-case counters to the old JIT. It also ensures that
negative zero in multiply is handled carefully. The old JIT
previously took slow path if the result of a multiply was zero,
which, without any changes, would cause the DFG to think that
every such multiply produced a double result.

This also fixes a bug in the old JIT's handling of decrements. It
would take the slow path if the result was zero, but not if it
underflowed.

By itself, this would be a 1% slow-down on V8 and Kraken. But then
I wrote optimizations in the DFG that take advantage of this new
information. It's no longer the case that every multiply needs to
do a check for negative zero; it only happens if the negative
zero is ignored.

This results in a 12% speed-up on v8-crypto, for a 1.4% geomean
speed-up in V8. It's mostly neutral on Kraken. I can see an
0.5% slow-down and it appears to be significant.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::resetRareCaseProfiles):
(JSC::CodeBlock::dumpValueProfiles):

  • bytecode/CodeBlock.h:
  • bytecode/ValueProfile.h:

(JSC::RareCaseProfile::RareCaseProfile):
(JSC::getRareCaseProfileBytecodeOffset):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::toInt32):
(JSC::DFG::ByteCodeParser::makeSafe):
(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGJITCodeGenerator.cpp:

(JSC::DFG::GPRTemporary::GPRTemporary):

  • dfg/DFGJITCodeGenerator.h:
  • dfg/DFGNode.h:
  • dfg/DFGPropagator.cpp:

(JSC::DFG::Propagator::propagateNode):
(JSC::DFG::Propagator::fixupNode):
(JSC::DFG::Propagator::clobbersWorld):
(JSC::DFG::Propagator::performNodeCSE):

  • dfg/DFGSpeculativeJIT.cpp:

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

  • jit/JIT.cpp:

(JSC::JIT::privateCompileSlowCases):

  • jit/JIT.h:

(JSC::JIT::linkDummySlowCase):

  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_post_dec):
(JSC::JIT::emit_op_pre_dec):
(JSC::JIT::compileBinaryArithOp):
(JSC::JIT::emit_op_add):
(JSC::JIT::emitSlow_op_add):

  • jit/JITInlineMethods.h:

(JSC::JIT::addSlowCase):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r95480 r95484  
     12011-09-19  Filip Pizlo  <[email protected]>
     2
     3        DFG speculation failures should act as additional value profiles
     4        https://bugs.webkit.org/show_bug.cgi?id=68335
     5
     6        Reviewed by Oliver Hunt.
     7       
     8        This adds slow-case counters to the old JIT. It also ensures that
     9        negative zero in multiply is handled carefully. The old JIT
     10        previously took slow path if the result of a multiply was zero,
     11        which, without any changes, would cause the DFG to think that
     12        every such multiply produced a double result.
     13       
     14        This also fixes a bug in the old JIT's handling of decrements. It
     15        would take the slow path if the result was zero, but not if it
     16        underflowed.
     17       
     18        By itself, this would be a 1% slow-down on V8 and Kraken. But then
     19        I wrote optimizations in the DFG that take advantage of this new
     20        information. It's no longer the case that every multiply needs to
     21        do a check for negative zero; it only happens if the negative
     22        zero is ignored.
     23       
     24        This results in a 12% speed-up on v8-crypto, for a 1.4% geomean
     25        speed-up in V8. It's mostly neutral on Kraken. I can see an
     26        0.5% slow-down and it appears to be significant.
     27
     28        * bytecode/CodeBlock.cpp:
     29        (JSC::CodeBlock::resetRareCaseProfiles):
     30        (JSC::CodeBlock::dumpValueProfiles):
     31        * bytecode/CodeBlock.h:
     32        * bytecode/ValueProfile.h:
     33        (JSC::RareCaseProfile::RareCaseProfile):
     34        (JSC::getRareCaseProfileBytecodeOffset):
     35        * dfg/DFGByteCodeParser.cpp:
     36        (JSC::DFG::ByteCodeParser::toInt32):
     37        (JSC::DFG::ByteCodeParser::makeSafe):
     38        (JSC::DFG::ByteCodeParser::parseBlock):
     39        * dfg/DFGJITCodeGenerator.cpp:
     40        (JSC::DFG::GPRTemporary::GPRTemporary):
     41        * dfg/DFGJITCodeGenerator.h:
     42        * dfg/DFGNode.h:
     43        * dfg/DFGPropagator.cpp:
     44        (JSC::DFG::Propagator::propagateNode):
     45        (JSC::DFG::Propagator::fixupNode):
     46        (JSC::DFG::Propagator::clobbersWorld):
     47        (JSC::DFG::Propagator::performNodeCSE):
     48        * dfg/DFGSpeculativeJIT.cpp:
     49        (JSC::DFG::SpeculativeJIT::compile):
     50        (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
     51        * jit/JIT.cpp:
     52        (JSC::JIT::privateCompileSlowCases):
     53        * jit/JIT.h:
     54        (JSC::JIT::linkDummySlowCase):
     55        * jit/JITArithmetic.cpp:
     56        (JSC::JIT::emit_op_post_dec):
     57        (JSC::JIT::emit_op_pre_dec):
     58        (JSC::JIT::compileBinaryArithOp):
     59        (JSC::JIT::emit_op_add):
     60        (JSC::JIT::emitSlow_op_add):
     61        * jit/JITInlineMethods.h:
     62        (JSC::JIT::addSlowCase):
     63
    1642011-09-19  Adam Roben  <[email protected]>
    265
Note: See TracChangeset for help on using the changeset viewer.