Ignore:
Timestamp:
Jul 6, 2010, 6:35:56 PM (15 years ago)
Author:
[email protected]
Message:

2010-07-06 Oliver Hunt <[email protected]>

Reviewed by Maciej Stachowiak.

Make it possible to have both the JIT and Interpreter available in a single build
https://bugs.webkit.org/show_bug.cgi?id=41722

Separate the concept of !ENABLE(JIT) and ENABLE(INTERPRETER) and make it possible
to have both JIT and INTERPRETER enabled at the same time. This doesn't add
support for mix mode execution, but it does allow a single build to contain all
the code needed to use either the interpreter or the jit.

If both ENABLE(INTERPRETER) and ENABLE(JIT) are true then setting the environment
variable JSC_FORCE_INTERPRETER will force JSC to use the interpreter.

This patch basically consists of replacing !ENABLE(JIT) with ENABLE(INTERPRETER),
or converting #if ENABLE(JIT) ... #else ... into #if ENABLE(JIT) ... #endif
#if ENABLE(INTERPRETER), etc. There are also a few functions that need to be
renamed to resolve return type ambiguity.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::shrinkToFit):
  • bytecode/CodeBlock.h:
  • interpreter/CallFrame.h: (JSC::ExecState::returnVPC):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::unwindCallFrame): (JSC::Interpreter::throwException): (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC::Interpreter::prepareForRepeatCall): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller):
  • interpreter/Interpreter.h:
  • runtime/ArrayPrototype.cpp: (JSC::isNumericCompareFunction):
  • runtime/Executable.cpp: (JSC::EvalExecutable::generateJITCode): (JSC::ProgramExecutable::generateJITCode): (JSC::FunctionExecutable::generateJITCodeForCall): (JSC::FunctionExecutable::generateJITCodeForConstruct): (JSC::FunctionExecutable::reparseExceptionInfo): (JSC::EvalExecutable::reparseExceptionInfo):
  • runtime/JSFunction.cpp:
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::JSGlobalData):
  • runtime/JSGlobalData.h: (JSC::JSGlobalData::canUseJIT):
  • wtf/Platform.h:
File:
1 edited

Legend:

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

    r62551 r62612  
    359359       
    360360        bool functionRegisterForBytecodeOffset(unsigned bytecodeOffset, int& functionRegisterIndex);
    361 #else
     361#endif
     362#if ENABLE(INTERPRETER)
    362363        unsigned bytecodeOffset(CallFrame*, Instruction* returnAddress)
    363364        {
     
    417418        unsigned lastJumpTarget() const { return m_jumpTargets.last(); }
    418419
    419 #if !ENABLE(JIT)
     420#if ENABLE(INTERPRETER)
    420421        void addPropertyAccessInstruction(unsigned propertyAccessInstruction) { m_propertyAccessInstructions.append(propertyAccessInstruction); }
    421422        void addGlobalResolveInstruction(unsigned globalResolveInstruction) { m_globalResolveInstructions.append(globalResolveInstruction); }
    422423        bool hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset);
    423 #else
     424#endif
     425#if ENABLE(JIT)
    424426        size_t numberOfStructureStubInfos() const { return m_structureStubInfos.size(); }
    425427        void addStructureStubInfo(const StructureStubInfo& stubInfo) { m_structureStubInfos.append(stubInfo); }
     
    552554        unsigned m_sourceOffset;
    553555
    554 #if !ENABLE(JIT)
     556#if ENABLE(INTERPRETER)
    555557        Vector<unsigned> m_propertyAccessInstructions;
    556558        Vector<unsigned> m_globalResolveInstructions;
    557 #else
     559#endif
     560#if ENABLE(JIT)
    558561        Vector<StructureStubInfo> m_structureStubInfos;
    559562        Vector<GlobalResolveInfo> m_globalResolveInfos;
Note: See TracChangeset for help on using the changeset viewer.