Skip to content
  • fpizlo@apple.com's avatar
    DFG JIT should inline Math.abs · 3c3e9651
    fpizlo@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=68227
    
    Source/JavaScriptCore: 
    
    Reviewed by Oliver Hunt.
            
    This adds the ability to track intrinsic functions throughout the
    host function infrastructure, so that the DFG can easily query
    whether or not a call's target is intrinsic, and if so, which
    intrinsic it is.
            
    On top of this, it adds Math.abs intrinsics to DFG. Call(Math.abs)
    is transformed into ValueToNumber<-ArithAbs nodes. These nodes
    then get optimized using the usual tricks.
            
    Also had to make a completely unrelated change to
    DateInstanceCache.h in order to fix a preexisting alphabetical
    sorting problem in JSGlobalData.h
            
    This results in a big win in imaging-gaussian-blur: 61% faster
    than before. The net win on Kraken is around 13%.
    
    * JavaScriptCore.xcodeproj/project.pbxproj:
    * create_hash_table:
    * dfg/DFGByteCodeParser.cpp:
    (JSC::DFG::ByteCodeParser::parseBlock):
    * dfg/DFGGraph.h:
    (JSC::DFG::Graph::isFunctionConstant):
    (JSC::DFG::Graph::valueOfFunctionConstant):
    * dfg/DFGIntrinsic.h: Added.
    * dfg/DFGJITCodeGenerator.h:
    (JSC::DFG::JITCodeGenerator::isFunctionConstant):
    (JSC::DFG::JITCodeGenerator::valueOfFunctionConstant):
    * dfg/DFGJITCompiler.h:
    (JSC::DFG::JITCompiler::isFunctionConstant):
    (JSC::DFG::JITCompiler::valueOfFunctionConstant):
    * dfg/DFGNode.h:
    * dfg/DFGPropagator.cpp:
    (JSC::DFG::Propagator::propagateNode):
    * dfg/DFGSpeculativeJIT.cpp:
    (JSC::DFG::SpeculativeJIT::compile):
    * jit/JITStubs.cpp:
    (JSC::JITThunks::hostFunctionStub):
    * jit/JITStubs.h:
    * runtime/DateInstanceCache.h:
    * runtime/Executable.cpp:
    (JSC::ExecutableBase::intrinsic):
    (JSC::NativeExecutable::intrinsic):
    * runtime/Executable.h:
    (JSC::NativeExecutable::create):
    (JSC::NativeExecutable::finishCreation):
    * runtime/JSGlobalData.cpp:
    (JSC::JSGlobalData::getHostFunction):
    * runtime/JSGlobalData.h:
    * runtime/Lookup.cpp:
    (JSC::HashTable::createTable):
    (JSC::setUpStaticFunctionSlot):
    * runtime/Lookup.h:
    (JSC::HashEntry::initialize):
    (JSC::HashEntry::intrinsic):
    
    Source/WebCore: 
    
    Reviewed by Oliver Hunt.
    
    Added JavaScriptCore/dfg to include path path. Changed the bindings
    scripts to handle the presence of intrinsics.
    
    * CMakeLists.txt:
    * bindings/scripts/CodeGeneratorJS.pm:
    (GenerateHashTable):
    
    Source/WebKit: 
    
    Reviewed by Oliver Hunt.
    
    Added JavaScriptCore/dfg to include path path.
    
    * CMakeLists.txt:
    
    Source/WebKit2: 
    
    Reviewed by Oliver Hunt.
    
    Added JavaScriptCore/dfg to include path path.
    
    * CMakeLists.txt:
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@95310 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    3c3e9651