Ignore:
Timestamp:
Sep 22, 2011, 3:42:54 PM (14 years ago)
Author:
[email protected]
Message:

DFG JIT does not support to_primitive or strcat
https://bugs.webkit.org/show_bug.cgi?id=68582

Reviewed by Darin Adler.

This adds functional support for to_primitive and strcat. It focuses
on minimizing the amount of code emitted on to_primitive (if we know
that it is a primitive or can speculate cheaply, then we omit the
slow path) and on keeping the implementation of strcat simple while
leveraging whatever optimizations we have already. In particular,
unlike the Call and Construct nodes which require extending the size
of the DFG's callee registers, StrCat takes advantage of the fact
that no JS code can run while StrCat is in progress and uses a
scratch buffer, rather than the register file, to store the list of
values to concatenate. This was done mainly to keep the code simple,
but there are probably other benefits to keeping call frame sizes
down. Essentially, this patch ensures that the presence of an
op_strcat does not mess up any other optimizations we might do while
ensuring that if you do execute it, it'll work about as well as you'd
expect.

When combined with the previous patch for integer division, this is a
14% speed-up on Kraken. Without it, it would have been a 2% loss.

  • assembler/AbstractMacroAssembler.h:

(JSC::AbstractMacroAssembler::TrustedImmPtr::TrustedImmPtr):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::parseBlock):

  • dfg/DFGCapabilities.h:

(JSC::DFG::canCompileOpcode):

  • dfg/DFGJITCodeGenerator.h:

(JSC::DFG::JITCodeGenerator::callOperation):

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::exitSpeculativeWithOSR):

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

(JSC::DFG::Propagator::propagateNodePredictions):
(JSC::DFG::Propagator::performNodeCSE):

  • dfg/DFGSpeculativeJIT.cpp:

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

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::~JSGlobalData):

  • runtime/JSGlobalData.h:

(JSC::JSGlobalData::scratchBufferForSize):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSGlobalData.cpp

    r95751 r95758  
    187187    , heap(this, heapSize)
    188188#if ENABLE(DFG_JIT)
    189     , sizeOfLastOSRScratchBuffer(0)
     189    , sizeOfLastScratchBuffer(0)
    190190#endif
    191191    , dynamicGlobalObject(0)
     
    353353
    354354#if ENABLE(DFG_JIT)
    355     for (unsigned i = 0; i < osrScratchBuffers.size(); ++i)
    356         fastFree(osrScratchBuffers[i]);
     355    for (unsigned i = 0; i < scratchBuffers.size(); ++i)
     356        fastFree(scratchBuffers[i]);
    357357#endif
    358358}
Note: See TracChangeset for help on using the changeset viewer.