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/runtime/JSGlobalData.cpp

    r61623 r62612  
    5959#if PLATFORM(MAC)
    6060#include "ProfilerServer.h"
     61#include <CoreFoundation/CoreFoundation.h>
    6162#endif
    6263
     
    157158    startProfilerServerIfNeeded();
    158159#endif
     160#if ENABLE(JIT) && ENABLE(INTERPRETER)
     161#if PLATFORM(MAC)
     162    CFStringRef canUseJITKey = CFStringCreateWithCString(0 , "JavaScriptCoreUseJIT", kCFStringEncodingMacRoman);
     163    CFBooleanRef canUseJIT = (CFBooleanRef)CFPreferencesCopyAppValue(canUseJITKey, kCFPreferencesCurrentApplication);
     164    m_canUseJIT = kCFBooleanTrue == canUseJIT;
     165    CFRelease(canUseJIT);
     166    CFRelease(canUseJITKey);
     167#elif OS(UNIX)
     168    m_canUseJIT = !getenv("JSC_FORCE_INTERPRETER");
     169#else
     170    m_canUseJIT = true;
     171#endif
     172#endif
    159173}
    160174
Note: See TracChangeset for help on using the changeset viewer.