Ignore:
Timestamp:
May 12, 2010, 9:01:56 PM (15 years ago)
Author:
[email protected]
Message:

https://bugs.webkit.org/show_bug.cgi?id=39039
Provide support for separate bytecode/JIT code translations for call/construct usage
This will allow us to produce code generated specifically for use as a constructor, not for general function use.

Reviewed by Oliver Hunt.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::unlinkCallers):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::getBytecodeIndex):
(JSC::CodeBlock::getJITCode):
(JSC::CodeBlock::executablePool):
(JSC::GlobalCodeBlock::GlobalCodeBlock):
(JSC::FunctionCodeBlock::FunctionCodeBlock):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
(JSC::Interpreter::execute):
(JSC::Interpreter::privateExecute):

  • interpreter/Interpreter.h:
  • jit/JIT.cpp:

(JSC::JIT::unlinkCallOrConstruct):
(JSC::JIT::linkConstruct):

  • jit/JIT.h:
  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitSlow_op_get_by_val):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emitSlow_op_get_by_val):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • jit/JITStubs.h:

(JSC::JITThunks::ctiVirtualConstructLink):
(JSC::JITThunks::ctiVirtualConstruct):
(JSC::):

  • jit/SpecializedThunkJIT.h:

(JSC::SpecializedThunkJIT::finalize):

  • runtime/Arguments.h:

(JSC::JSActivation::copyRegisters):

  • runtime/ArrayPrototype.cpp:

(JSC::isNumericCompareFunction):

  • runtime/Executable.cpp:

(JSC::FunctionExecutable::~FunctionExecutable):
(JSC::FunctionExecutable::compileForCall):
(JSC::FunctionExecutable::compileForConstruct):
(JSC::EvalExecutable::generateJITCode):
(JSC::ProgramExecutable::generateJITCode):
(JSC::FunctionExecutable::generateJITCodeForCall):
(JSC::FunctionExecutable::generateJITCodeForConstruct):
(JSC::FunctionExecutable::markAggregate):
(JSC::FunctionExecutable::reparseExceptionInfo):
(JSC::EvalExecutable::reparseExceptionInfo):
(JSC::FunctionExecutable::recompile):

  • runtime/Executable.h:

(JSC::ExecutableBase::ExecutableBase):
(JSC::ExecutableBase::isHostFunction):
(JSC::ExecutableBase::generatedJITCodeForCall):
(JSC::ExecutableBase::generatedJITCodeForConstruct):
(JSC::NativeExecutable::NativeExecutable):
(JSC::EvalExecutable::jitCode):
(JSC::ProgramExecutable::jitCode):
(JSC::FunctionExecutable::bytecodeForCall):
(JSC::FunctionExecutable::isGeneratedForCall):
(JSC::FunctionExecutable::generatedBytecodeForCall):
(JSC::FunctionExecutable::bytecodeForConstruct):
(JSC::FunctionExecutable::isGeneratedForConstruct):
(JSC::FunctionExecutable::generatedBytecodeForConstruct):
(JSC::FunctionExecutable::symbolTable):
(JSC::FunctionExecutable::FunctionExecutable):
(JSC::FunctionExecutable::jitCodeForCall):
(JSC::FunctionExecutable::jitCodeForConstruct):

  • runtime/JSActivation.h:

(JSC::JSActivation::JSActivationData::JSActivationData):

  • runtime/JSFunction.cpp:

(JSC::JSFunction::~JSFunction):
(JSC::JSFunction::call):
(JSC::JSFunction::construct):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::numericCompareFunction):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/CodeBlock.h

    r59064 r59339  
    273273        friend class JIT;
    274274    protected:
    275         CodeBlock(ScriptExecutable* ownerExecutable, CodeType, PassRefPtr<SourceProvider>, unsigned sourceOffset, SymbolTable* symbolTable);
     275        CodeBlock(ScriptExecutable* ownerExecutable, CodeType, PassRefPtr<SourceProvider>, unsigned sourceOffset, SymbolTable* symbolTable, bool isConstructor);
    276276    public:
    277277        virtual ~CodeBlock();
     
    351351        {
    352352            reparseForExceptionInfoIfNecessary(callFrame);
    353             return binaryChop<CallReturnOffsetToBytecodeIndex, unsigned, getCallReturnOffset>(callReturnIndexVector().begin(), callReturnIndexVector().size(), ownerExecutable()->generatedJITCode().offsetOf(returnAddress.value()))->bytecodeIndex;
     353            return binaryChop<CallReturnOffsetToBytecodeIndex, unsigned, getCallReturnOffset>(callReturnIndexVector().begin(), callReturnIndexVector().size(), getJITCode().offsetOf(returnAddress.value()))->bytecodeIndex;
    354354        }
    355355       
     
    369369
    370370#if ENABLE(JIT)
    371         JITCode& getJITCode() { return ownerExecutable()->generatedJITCode(); }
    372         ExecutablePool* executablePool() { return ownerExecutable()->getExecutablePool(); }
     371        JITCode& getJITCode() { return m_isConstructor ? ownerExecutable()->generatedJITCodeForConstruct() : ownerExecutable()->generatedJITCodeForCall(); }
     372        ExecutablePool* executablePool() { return getJITCode().getExecutablePool(); }
    373373#endif
    374374
     
    490490        int m_numVars;
    491491        int m_numParameters;
     492        bool m_isConstructor;
    492493
    493494    private:
     
    580581    public:
    581582        GlobalCodeBlock(ScriptExecutable* ownerExecutable, CodeType codeType, PassRefPtr<SourceProvider> sourceProvider, unsigned sourceOffset, JSGlobalObject* globalObject)
    582             : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset, &m_unsharedSymbolTable)
     583            : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset, &m_unsharedSymbolTable, false)
    583584            , m_globalObject(globalObject)
    584585        {
     
    636637        // symbol table, so we just pass as a raw pointer with a ref count of 1.  We then manually deref
    637638        // in the destructor.
    638         FunctionCodeBlock(FunctionExecutable* ownerExecutable, CodeType codeType, PassRefPtr<SourceProvider> sourceProvider, unsigned sourceOffset)
    639             : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset, new SharedSymbolTable)
     639        FunctionCodeBlock(FunctionExecutable* ownerExecutable, CodeType codeType, PassRefPtr<SourceProvider> sourceProvider, unsigned sourceOffset, bool isConstructor)
     640            : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset, new SharedSymbolTable, isConstructor)
    640641        {
    641642        }
Note: See TracChangeset for help on using the changeset viewer.