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.cpp

    r62551 r62612  
    13741374CodeBlock::~CodeBlock()
    13751375{
    1376 #if !ENABLE(JIT)
     1376#if ENABLE(INTERPRETER)
    13771377    for (size_t size = m_globalResolveInstructions.size(), i = 0; i < size; ++i)
    13781378        derefStructures(&m_instructions[m_globalResolveInstructions[i]]);
     
    13801380    for (size_t size = m_propertyAccessInstructions.size(), i = 0; i < size; ++i)
    13811381        derefStructures(&m_instructions[m_propertyAccessInstructions[i]]);
    1382 #else
     1382#endif
     1383#if ENABLE(JIT)
    13831384    for (size_t size = m_globalResolveInfos.size(), i = 0; i < size; ++i) {
    13841385        if (m_globalResolveInfos[i].structure)
     
    14081409#endif
    14091410
    1410 #endif // !ENABLE(JIT)
     1411#endif // ENABLE(JIT)
    14111412
    14121413#if DUMP_CODE_BLOCK_STATISTICS
     
    16701671#endif
    16711672
    1672 #if !ENABLE(JIT)
     1673#if ENABLE(INTERPRETER)
    16731674bool CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset)
    16741675{
     
    16901691    return true;
    16911692}
    1692 #else
     1693#endif
     1694#if ENABLE(JIT)
    16931695bool CodeBlock::hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset)
    16941696{
     
    17161718    m_instructions.shrinkToFit();
    17171719
    1718 #if !ENABLE(JIT)
     1720#if ENABLE(INTERPRETER)
    17191721    m_propertyAccessInstructions.shrinkToFit();
    17201722    m_globalResolveInstructions.shrinkToFit();
    1721 #else
     1723#endif
     1724#if ENABLE(JIT)
    17221725    m_structureStubInfos.shrinkToFit();
    17231726    m_globalResolveInfos.shrinkToFit();
Note: See TracChangeset for help on using the changeset viewer.