Title: [109863] trunk/Source/_javascript_Core
Revision
109863
Author
[email protected]
Date
2012-03-05 22:54:23 -0800 (Mon, 05 Mar 2012)

Log Message

The LLInt should work even when the JIT is disabled
https://bugs.webkit.org/show_bug.cgi?id=80340
<rdar://problem/10922235>

Reviewed by Gavin Barraclough.

* assembler/MacroAssemblerCodeRef.h:
(JSC::MacroAssemblerCodePtr::createLLIntCodePtr):
(MacroAssemblerCodeRef):
(JSC::MacroAssemblerCodeRef::createLLIntCodeRef):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::initialize):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
* jit/JIT.h:
(JSC::JIT::compileCTINativeCall):
* jit/JITStubs.h:
(JSC::JITThunks::ctiNativeCall):
(JSC::JITThunks::ctiNativeConstruct):
* llint/LLIntEntrypoints.cpp:
(JSC::LLInt::getFunctionEntrypoint):
(JSC::LLInt::getEvalEntrypoint):
(JSC::LLInt::getProgramEntrypoint):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
(LLInt):
* llint/LLIntSlowPaths.h:
(LLInt):
* llint/LowLevelInterpreter.h:
* llint/LowLevelInterpreter32_64.asm:
* runtime/Executable.h:
(NativeExecutable):
(JSC::NativeExecutable::create):
(JSC::NativeExecutable::finishCreation):
* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::JSGlobalData):
* runtime/JSGlobalData.h:
(JSGlobalData):
* runtime/Options.cpp:
(Options):
(JSC::Options::parse):
(JSC::Options::initializeOptions):
* runtime/Options.h:
(Options):
* wtf/Platform.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (109862 => 109863)


--- trunk/Source/_javascript_Core/ChangeLog	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-03-06 06:54:23 UTC (rev 109863)
@@ -1,3 +1,52 @@
+2012-03-05  Filip Pizlo  <[email protected]>
+
+        The LLInt should work even when the JIT is disabled
+        https://bugs.webkit.org/show_bug.cgi?id=80340
+        <rdar://problem/10922235>
+
+        Reviewed by Gavin Barraclough.
+
+        * assembler/MacroAssemblerCodeRef.h:
+        (JSC::MacroAssemblerCodePtr::createLLIntCodePtr):
+        (MacroAssemblerCodeRef):
+        (JSC::MacroAssemblerCodeRef::createLLIntCodeRef):
+        * interpreter/Interpreter.cpp:
+        (JSC::Interpreter::initialize):
+        (JSC::Interpreter::execute):
+        (JSC::Interpreter::executeCall):
+        (JSC::Interpreter::executeConstruct):
+        * jit/JIT.h:
+        (JSC::JIT::compileCTINativeCall):
+        * jit/JITStubs.h:
+        (JSC::JITThunks::ctiNativeCall):
+        (JSC::JITThunks::ctiNativeConstruct):
+        * llint/LLIntEntrypoints.cpp:
+        (JSC::LLInt::getFunctionEntrypoint):
+        (JSC::LLInt::getEvalEntrypoint):
+        (JSC::LLInt::getProgramEntrypoint):
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        (LLInt):
+        * llint/LLIntSlowPaths.h:
+        (LLInt):
+        * llint/LowLevelInterpreter.h:
+        * llint/LowLevelInterpreter32_64.asm:
+        * runtime/Executable.h:
+        (NativeExecutable):
+        (JSC::NativeExecutable::create):
+        (JSC::NativeExecutable::finishCreation):
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::JSGlobalData):
+        * runtime/JSGlobalData.h:
+        (JSGlobalData):
+        * runtime/Options.cpp:
+        (Options):
+        (JSC::Options::parse):
+        (JSC::Options::initializeOptions):
+        * runtime/Options.h:
+        (Options):
+        * wtf/Platform.h:
+
 2012-03-05  Yuqiang Xian  <[email protected]>
 
         Checks for dead variables are not sufficient when fixing the expected

Modified: trunk/Source/_javascript_Core/assembler/MacroAssemblerCodeRef.h (109862 => 109863)


--- trunk/Source/_javascript_Core/assembler/MacroAssemblerCodeRef.h	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/assembler/MacroAssemblerCodeRef.h	2012-03-06 06:54:23 UTC (rev 109863)
@@ -280,6 +280,10 @@
         return result;
     }
 
+    static MacroAssemblerCodePtr createLLIntCodePtr(void (*function)())
+    {
+        return createFromExecutableAddress(bitwise_cast<void*>(function));
+    }
     explicit MacroAssemblerCodePtr(ReturnAddressPtr ra)
         : m_value(ra.value())
     {
@@ -340,6 +344,12 @@
         return MacroAssemblerCodeRef(codePtr);
     }
     
+    // Helper for creating self-managed code refs from LLInt.
+    static MacroAssemblerCodeRef createLLIntCodeRef(void (*function)())
+    {
+        return createSelfManagedCodeRef(MacroAssemblerCodePtr::createFromExecutableAddress(bitwise_cast<void*>(function)));
+    }
+    
     ExecutableMemoryHandle* executableMemory() const
     {
         return m_executableMemory.get();

Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (109862 => 109863)


--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2012-03-06 06:54:23 UTC (rev 109863)
@@ -560,31 +560,27 @@
 {
     UNUSED_PARAM(llintData);
     UNUSED_PARAM(canUseJIT);
-#if ENABLE(COMPUTED_GOTO_CLASSIC_INTERPRETER) || ENABLE(LLINT)
-#if !ENABLE(COMPUTED_GOTO_CLASSIC_INTERPRETER)
-    // Having LLInt enabled, but not being able to use the JIT, and not having
-    // a computed goto interpreter, is not supported. Not because we cannot
-    // support it, but because I decided to draw the line at the number of
-    // permutations of execution engines that I wanted this code to grok.
-    ASSERT(canUseJIT);
+
+    // If we have LLInt, then we shouldn't be building any kind of classic interpreter.
+#if ENABLE(LLINT) && ENABLE(CLASSIC_INTERPRETER)
+#error "Building both LLInt and the Classic Interpreter is not supported because it doesn't make sense."
 #endif
-    if (canUseJIT) {
+
 #if ENABLE(LLINT)
-        m_opcodeTable = llintData->opcodeMap();
-        for (int i = 0; i < numOpcodeIDs; ++i)
-            m_opcodeIDTable.add(m_opcodeTable[i], static_cast<OpcodeID>(i));
-#else
+    m_opcodeTable = llintData->opcodeMap();
+    for (int i = 0; i < numOpcodeIDs; ++i)
+        m_opcodeIDTable.add(m_opcodeTable[i], static_cast<OpcodeID>(i));
+    m_classicEnabled = false;
+#elif ENABLE(COMPUTED_GOTO_CLASSIC_INTERPRETER)
+    if (canUseJIT) {
         // If the JIT is present, don't use jump destinations for opcodes.
         
         for (int i = 0; i < numOpcodeIDs; ++i) {
             Opcode opcode = bitwise_cast<void*>(static_cast<uintptr_t>(i));
             m_opcodeTable[i] = opcode;
         }
-#endif
+        m_classicEnabled = false;
     } else {
-#if ENABLE(LLINT)
-        m_opcodeTable = new Opcode[numOpcodeIDs];
-#endif
         privateExecute(InitializeAndReturn, 0, 0);
         
         for (int i = 0; i < numOpcodeIDs; ++i)
@@ -1198,7 +1194,7 @@
 
         m_reentryDepth++;  
 #if ENABLE(JIT)
-        if (callFrame->globalData().canUseJIT())
+        if (!classicEnabled())
             result = program->generatedJITCode().execute(&m_registerFile, newCallFrame, scopeChain->globalData);
         else
 #endif
@@ -1270,7 +1266,7 @@
 
             m_reentryDepth++;  
 #if ENABLE(JIT)
-            if (callFrame->globalData().canUseJIT())
+            if (!classicEnabled())
                 result = callData.js.functionExecutable->generatedJITCodeForCall().execute(&m_registerFile, newCallFrame, callDataScopeChain->globalData);
             else
 #endif
@@ -1366,7 +1362,7 @@
 
             m_reentryDepth++;  
 #if ENABLE(JIT)
-            if (callFrame->globalData().canUseJIT())
+            if (!classicEnabled())
                 result = constructData.js.functionExecutable->generatedJITCodeForConstruct().execute(&m_registerFile, newCallFrame, constructDataScopeChain->globalData);
             else
 #endif

Modified: trunk/Source/_javascript_Core/jit/JIT.h (109862 => 109863)


--- trunk/Source/_javascript_Core/jit/JIT.h	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/jit/JIT.h	2012-03-06 06:54:23 UTC (rev 109863)
@@ -254,8 +254,13 @@
 
         static CodeRef compileCTINativeCall(JSGlobalData* globalData, NativeFunction func)
         {
-            if (!globalData->canUseJIT())
+            if (!globalData->canUseJIT()) {
+#if ENABLE(LLINT)
+                return CodeRef::createLLIntCodeRef(llint_native_call_trampoline);
+#else
                 return CodeRef();
+#endif
+            }
             JIT jit(globalData, 0);
             return jit.privateCompileCTINativeCall(globalData, func);
         }

Modified: trunk/Source/_javascript_Core/jit/JITStubs.h (109862 => 109863)


--- trunk/Source/_javascript_Core/jit/JITStubs.h	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/jit/JITStubs.h	2012-03-06 06:54:23 UTC (rev 109863)
@@ -32,6 +32,7 @@
 
 #include "CallData.h"
 #include "Intrinsic.h"
+#include "LowLevelInterpreter.h"
 #include "MacroAssemblerCodeRef.h"
 #include "Register.h"
 #include "ThunkGenerators.h"
@@ -306,8 +307,22 @@
         MacroAssemblerCodePtr ctiVirtualConstructLink() { return m_trampolineStructure.ctiVirtualConstructLink; }
         MacroAssemblerCodePtr ctiVirtualCall() { return m_trampolineStructure.ctiVirtualCall; }
         MacroAssemblerCodePtr ctiVirtualConstruct() { return m_trampolineStructure.ctiVirtualConstruct; }
-        MacroAssemblerCodePtr ctiNativeCall() { return m_trampolineStructure.ctiNativeCall; }
-        MacroAssemblerCodePtr ctiNativeConstruct() { return m_trampolineStructure.ctiNativeConstruct; }
+        MacroAssemblerCodePtr ctiNativeCall()
+        {
+#if ENABLE(LLINT)
+            if (!m_executableMemory)
+                return MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_call_trampoline);
+#endif
+            return m_trampolineStructure.ctiNativeCall;
+        }
+        MacroAssemblerCodePtr ctiNativeConstruct()
+        {
+#if ENABLE(LLINT)
+            if (!m_executableMemory)
+                return MacroAssemblerCodePtr::createLLIntCodePtr(llint_native_construct_trampoline);
+#endif
+            return m_trampolineStructure.ctiNativeConstruct;
+        }
         MacroAssemblerCodePtr ctiSoftModulo() { return m_trampolineStructure.ctiSoftModulo; }
 
         MacroAssemblerCodeRef ctiStub(JSGlobalData*, ThunkGenerator);

Modified: trunk/Source/_javascript_Core/llint/LLIntEntrypoints.cpp (109862 => 109863)


--- trunk/Source/_javascript_Core/llint/LLIntEntrypoints.cpp	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/llint/LLIntEntrypoints.cpp	2012-03-06 06:54:23 UTC (rev 109863)
@@ -39,14 +39,14 @@
 {
     if (!globalData.canUseJIT()) {
         if (kind == CodeForCall) {
-            jitCode = JITCode::HostFunction(MacroAssemblerCodeRef::createSelfManagedCodeRef(MacroAssemblerCodePtr(bitwise_cast<void*>(&llint_function_for_call_prologue))));
-            arityCheck = MacroAssemblerCodePtr(bitwise_cast<void*>(&llint_function_for_call_arity_check));
+            jitCode = JITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_call_prologue), JITCode::InterpreterThunk);
+            arityCheck = MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_call_arity_check);
             return;
         }
 
         ASSERT(kind == CodeForConstruct);
-        jitCode = JITCode::HostFunction(MacroAssemblerCodeRef::createSelfManagedCodeRef(MacroAssemblerCodePtr(bitwise_cast<void*>(&llint_function_for_construct_prologue))));
-        arityCheck = MacroAssemblerCodePtr(bitwise_cast<void*>(&llint_function_for_construct_arity_check));
+        jitCode = JITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_function_for_construct_prologue), JITCode::InterpreterThunk);
+        arityCheck = MacroAssemblerCodePtr::createLLIntCodePtr(llint_function_for_construct_arity_check);
         return;
     }
     
@@ -64,7 +64,7 @@
 void getEvalEntrypoint(JSGlobalData& globalData, JITCode& jitCode)
 {
     if (!globalData.canUseJIT()) {
-        jitCode = JITCode::HostFunction(MacroAssemblerCodeRef::createSelfManagedCodeRef(MacroAssemblerCodePtr(bitwise_cast<void*>(&llint_eval_prologue))));
+        jitCode = JITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_eval_prologue), JITCode::InterpreterThunk);
         return;
     }
     
@@ -74,7 +74,7 @@
 void getProgramEntrypoint(JSGlobalData& globalData, JITCode& jitCode)
 {
     if (!globalData.canUseJIT()) {
-        jitCode = JITCode::HostFunction(MacroAssemblerCodeRef::createSelfManagedCodeRef(MacroAssemblerCodePtr(bitwise_cast<void*>(&llint_program_prologue))));
+        jitCode = JITCode(MacroAssemblerCodeRef::createLLIntCodeRef(llint_program_prologue), JITCode::InterpreterThunk);
         return;
     }
     

Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp (109862 => 109863)


--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.cpp	2012-03-06 06:54:23 UTC (rev 109863)
@@ -1576,6 +1576,13 @@
     LLINT_END();
 }
 
+LLINT_SLOW_PATH_DECL(throw_from_native_call)
+{
+    LLINT_BEGIN();
+    ASSERT(globalData.exception);
+    LLINT_END();
+}
+
 } } // namespace JSC::LLInt
 
 #endif // ENABLE(LLINT)

Modified: trunk/Source/_javascript_Core/llint/LLIntSlowPaths.h (109862 => 109863)


--- trunk/Source/_javascript_Core/llint/LLIntSlowPaths.h	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/llint/LLIntSlowPaths.h	2012-03-06 06:54:23 UTC (rev 109863)
@@ -161,6 +161,7 @@
 LLINT_SLOW_PATH_DECL(slow_path_debug);
 LLINT_SLOW_PATH_DECL(slow_path_profile_will_call);
 LLINT_SLOW_PATH_DECL(slow_path_profile_did_call);
+LLINT_SLOW_PATH_DECL(throw_from_native_call);
 
 } } // namespace JSC::LLInt
 

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter.h (109862 => 109863)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter.h	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter.h	2012-03-06 06:54:23 UTC (rev 109863)
@@ -48,6 +48,10 @@
 extern "C" void llint_throw_from_slow_path_trampoline();
 extern "C" void llint_throw_during_call_trampoline();
 
+// Native call trampolines
+extern "C" void llint_native_call_trampoline();
+extern "C" void llint_native_construct_trampoline();
+
 #endif // ENABLE(LLINT)
 
 #endif // LowLevelInterpreter_h

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (109862 => 109863)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2012-03-06 06:54:23 UTC (rev 109863)
@@ -2302,6 +2302,53 @@
     jmp JSGlobalData::targetMachinePCForThrow[t1]
 
 
+macro nativeCallTrampoline(executableOffsetToFunction)
+    storep 0, CodeBlock[cfr]
+    loadp CallerFrame[cfr], t0
+    loadi ScopeChain + PayloadOffset[t0], t1
+    storei CellTag, ScopeChain + TagOffset[cfr]
+    storei t1, ScopeChain + PayloadOffset[cfr]
+    if X86
+        peek 0, t1
+        storep t1, ReturnPC[cfr]
+        move cfr, t2  # t2 = ecx
+        subp 16 - 4, sp
+        loadi Callee + PayloadOffset[cfr], t1
+        loadp JSFunction::m_executable[t1], t1
+        move t0, cfr
+        call executableOffsetToFunction[t1]
+        addp 16 - 4, sp
+        loadp JITStackFrame::globalData + 4[sp], t3
+    elsif ARMv7
+        move t0, t2
+        preserveReturnAddressAfterCall(t3)
+        storep t3, ReturnPC[cfr]
+        move cfr, t0
+        loadi Callee + PayloadOffset[cfr], t1
+        loadp JSFunction::m_executable[t1], t1
+        move t2, cfr
+        call executableOffsetToFunction[t1]
+        restoreReturnAddressBeforeReturn(t3)
+        loadp JITStackFrame::globalData[sp], t3
+    else  
+        error
+    end
+    bineq JSGlobalData::exception + TagOffset[t3], EmptyValueTag, .exception
+    ret
+.exception:
+    preserveReturnAddressAfterCall(t1) # This is really only needed on X86
+    callSlowPath(_llint_throw_from_native_call)
+    jmp _llint_throw_from_slow_path_trampoline
+end
+
+_llint_native_call_trampoline:
+    nativeCallTrampoline(NativeExecutable::m_function)
+
+
+_llint_native_construct_trampoline:
+    nativeCallTrampoline(NativeExecutable::m_constructor)
+
+
 # Lastly, make sure that we can link even though we don't support all opcodes.
 # These opcodes should never arise when using LLInt or either JIT. We assert
 # as much.

Modified: trunk/Source/_javascript_Core/runtime/Executable.h (109862 => 109863)


--- trunk/Source/_javascript_Core/runtime/Executable.h	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/runtime/Executable.h	2012-03-06 06:54:23 UTC (rev 109863)
@@ -180,13 +180,14 @@
 
     class NativeExecutable : public ExecutableBase {
         friend class JIT;
+        friend class LLIntOffsetsExtractor;
     public:
         typedef ExecutableBase Base;
 
 #if ENABLE(JIT)
         static NativeExecutable* create(JSGlobalData& globalData, MacroAssemblerCodeRef callThunk, NativeFunction function, MacroAssemblerCodeRef constructThunk, NativeFunction constructor, Intrinsic intrinsic)
         {
-            ASSERT(globalData.canUseJIT());
+            ASSERT(!globalData.interpreter->classicEnabled());
             NativeExecutable* executable;
             if (!callThunk) {
                 executable = new (NotNull, allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
@@ -228,7 +229,7 @@
 #if ENABLE(JIT)
         void finishCreation(JSGlobalData& globalData, JITCode callThunk, JITCode constructThunk, Intrinsic intrinsic)
         {
-            ASSERT(globalData.canUseJIT());
+            ASSERT(!globalData.interpreter->classicEnabled());
             Base::finishCreation(globalData);
             m_jitCodeForCall = callThunk;
             m_jitCodeForConstruct = constructThunk;

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp (109862 => 109863)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2012-03-06 06:54:23 UTC (rev 109863)
@@ -193,7 +193,7 @@
 
     wtfThreadData().setCurrentIdentifierTable(existingEntryIdentifierTable);
 
-#if ENABLE(JIT) && ENABLE(CLASSIC_INTERPRETER)
+#if ENABLE(JIT) && (ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT))
 #if USE(CF)
     CFStringRef canUseJITKey = CFStringCreateWithCString(0 , "_javascript_CoreUseJIT", kCFStringEncodingMacRoman);
     CFBooleanRef canUseJIT = (CFBooleanRef)CFPreferencesCopyAppValue(canUseJITKey, kCFPreferencesCurrentApplication);
@@ -213,13 +213,16 @@
 #endif
 #endif
 #if ENABLE(JIT)
-#if ENABLE(CLASSIC_INTERPRETER)
+#if ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT)
     if (m_canUseJIT)
         m_canUseJIT = executableAllocator.isValid();
+    
+    if (!Options::useJIT)
+        m_canUseJIT = false;
 #endif
     jitStubs = adoptPtr(new JITThunks(this));
 #endif
-
+    
     interpreter->initialize(&llintData, this->canUseJIT());
     
     initializeHostCallReturnValue(); // This is needed to convince the linker not to drop host call return support.

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.h (109862 => 109863)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.h	2012-03-06 06:54:23 UTC (rev 109863)
@@ -231,7 +231,7 @@
 
 #if !ENABLE(JIT)
         bool canUseJIT() { return false; } // interpreter only
-#elif !ENABLE(CLASSIC_INTERPRETER)
+#elif !ENABLE(CLASSIC_INTERPRETER) && !ENABLE(LLINT)
         bool canUseJIT() { return true; } // jit only
 #else
         bool canUseJIT() { return m_canUseJIT; }
@@ -369,7 +369,7 @@
         JSGlobalData(GlobalDataType, ThreadStackType, HeapSize);
         static JSGlobalData*& sharedInstanceInternal();
         void createNativeThunk();
-#if ENABLE(JIT) && ENABLE(CLASSIC_INTERPRETER)
+#if ENABLE(JIT) && (ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT))
         bool m_canUseJIT;
 #endif
 #if ENABLE(GC_VALIDATION)

Modified: trunk/Source/_javascript_Core/runtime/Options.cpp (109862 => 109863)


--- trunk/Source/_javascript_Core/runtime/Options.cpp	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/runtime/Options.cpp	2012-03-06 06:54:23 UTC (rev 109863)
@@ -45,6 +45,8 @@
 
 namespace JSC { namespace Options {
 
+bool useJIT;
+
 unsigned maximumOptimizationCandidateInstructionCount;
 
 unsigned maximumFunctionForCallInlineCandidateInstructionCount;
@@ -93,6 +95,19 @@
 unsigned opaqueRootMergeThreshold;
 
 #if ENABLE(RUN_TIME_HEURISTICS)
+static bool parse(const char* string, bool& value)
+{
+    if (!strcasecmp(string, "true") || !strcasecmp(string, "yes") || !strcmp(string, "1")) {
+        value = true;
+        return true;
+    }
+    if (!strcasecmp(string, "false") || !strcasecmp(string, "no") || !strcmp(string, "0")) {
+        value = false;
+        return true;
+    }
+    return false;
+}
+
 static bool parse(const char* string, int32_t& value)
 {
     return sscanf(string, "%d", &value) == 1;
@@ -131,6 +146,8 @@
 
 void initializeOptions()
 {
+    SET(useJIT, true);
+    
     SET(maximumOptimizationCandidateInstructionCount, 1100);
     
     SET(maximumFunctionForCallInlineCandidateInstructionCount, 180);

Modified: trunk/Source/_javascript_Core/runtime/Options.h (109862 => 109863)


--- trunk/Source/_javascript_Core/runtime/Options.h	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/runtime/Options.h	2012-03-06 06:54:23 UTC (rev 109863)
@@ -30,6 +30,8 @@
 
 namespace JSC { namespace Options {
 
+extern bool useJIT;
+
 extern unsigned maximumOptimizationCandidateInstructionCount;
 
 extern unsigned maximumFunctionForCallInlineCandidateInstructionCount;

Modified: trunk/Source/_javascript_Core/wtf/Platform.h (109862 => 109863)


--- trunk/Source/_javascript_Core/wtf/Platform.h	2012-03-06 06:31:34 UTC (rev 109862)
+++ trunk/Source/_javascript_Core/wtf/Platform.h	2012-03-06 06:54:23 UTC (rev 109863)
@@ -610,8 +610,9 @@
     #define ENABLE_JIT 0
     #define ENABLE_YARR_JIT 0
 #else
-    #define ENABLE_CLASSIC_INTERPRETER 1
+    #define ENABLE_CLASSIC_INTERPRETER 0
     #define ENABLE_JIT 1
+    #define ENABLE_LLINT 1
     #define ENABLE_YARR_JIT 1
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to