Ignore:
Timestamp:
Sep 21, 2011, 3:17:06 PM (14 years ago)
Author:
[email protected]
Message:

DFG does not support compiling functions as constructors
https://bugs.webkit.org/show_bug.cgi?id=68500

Reviewed by Oliver Hunt.

This adds support for compiling constructors to the DFG. It's a
1% speed-up on V8, mostly due to a 6% speed-up on early-boyer.
It's also a 13% win on access-binary-trees, but it's neutral in
the SunSpider and Kraken averages.

  • dfg/DFGByteCodeParser.cpp:

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

  • dfg/DFGCapabilities.h:

(JSC::DFG::mightCompileFunctionForConstruct):
(JSC::DFG::canCompileOpcode):

  • 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/Executable.cpp:

(JSC::FunctionExecutable::compileOptimizedForConstruct):
(JSC::FunctionExecutable::compileForConstructInternal):

  • runtime/Executable.h:

(JSC::FunctionExecutable::compileForConstruct):
(JSC::FunctionExecutable::compileFor):
(JSC::FunctionExecutable::compileOptimizedFor):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r95666 r95672  
    488488        }
    489489
    490         JSObject* compileForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode)
     490        JSObject* compileForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode, ExecState* calleeArgsExec = 0)
    491491        {
    492492            ASSERT(exec->globalData().dynamicGlobalObject);
    493493            JSObject* error = 0;
    494494            if (!m_codeBlockForConstruct)
    495                 error = compileForConstructInternal(exec, scopeChainNode, JITCode::bottomTierJIT());
     495                error = compileForConstructInternal(exec, scopeChainNode, calleeArgsExec, JITCode::bottomTierJIT());
    496496            ASSERT(!error == !!m_codeBlockForConstruct);
    497497            return error;
    498498        }
    499499
    500         JSObject* compileOptimizedForConstruct(ExecState*, ScopeChainNode*);
     500        JSObject* compileOptimizedForConstruct(ExecState*, ScopeChainNode*, ExecState* calleeArgsExec = 0);
    501501
    502502        bool isGeneratedForConstruct() const
     
    522522                return compileForCall(exec, scopeChainNode, exec);
    523523            ASSERT(kind == CodeForConstruct);
    524             return compileForConstruct(exec, scopeChainNode);
     524            return compileForConstruct(exec, scopeChainNode, exec);
    525525        }
    526526       
     
    536536                return compileOptimizedForCall(exec, scopeChainNode, exec);
    537537            ASSERT(kind == CodeForConstruct);
    538             return compileOptimizedForConstruct(exec, scopeChainNode);
     538            return compileOptimizedForConstruct(exec, scopeChainNode, exec);
    539539        }
    540540       
     
    588588
    589589        JSObject* compileForCallInternal(ExecState*, ScopeChainNode*, ExecState* calleeArgsExec, JITCode::JITType);
    590         JSObject* compileForConstructInternal(ExecState*, ScopeChainNode*, JITCode::JITType);
     590        JSObject* compileForConstructInternal(ExecState*, ScopeChainNode*, ExecState* calleeArgsExec, JITCode::JITType);
    591591       
    592592        static const unsigned StructureFlags = OverridesVisitChildren | ScriptExecutable::StructureFlags;
Note: See TracChangeset for help on using the changeset viewer.