Title: [102011] trunk/Source/_javascript_Core
Revision
102011
Author
[email protected]
Date
2011-12-05 10:25:45 -0800 (Mon, 05 Dec 2011)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=73624
JIT + INTERPRETER builds are broken

Reviewed by Geoff Garen, Sam Weinig.

These don't fallback to the interpreter correctly.
Thunk creation assumes that is the JIT is compiled in, then it is enabled.

* jit/JITStubs.cpp:
(JSC::JITThunks::JITThunks):
* runtime/Executable.h:
(JSC::NativeExecutable::create):
(JSC::NativeExecutable::finishCreation):
* runtime/JSGlobalData.cpp:
(JSC::JSGlobalData::getHostFunction):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (102010 => 102011)


--- trunk/Source/_javascript_Core/ChangeLog	2011-12-05 18:13:13 UTC (rev 102010)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-12-05 18:25:45 UTC (rev 102011)
@@ -1,3 +1,21 @@
+2011-12-01  Gavin Barraclough  <[email protected]>
+
+        https://bugs.webkit.org/show_bug.cgi?id=73624
+        JIT + INTERPRETER builds are broken
+
+        Reviewed by Geoff Garen, Sam Weinig.
+
+        These don't fallback to the interpreter correctly.
+        Thunk creation assumes that is the JIT is compiled in, then it is enabled.
+
+        * jit/JITStubs.cpp:
+        (JSC::JITThunks::JITThunks):
+        * runtime/Executable.h:
+        (JSC::NativeExecutable::create):
+        (JSC::NativeExecutable::finishCreation):
+        * runtime/JSGlobalData.cpp:
+        (JSC::JSGlobalData::getHostFunction):
+
 2011-12-05  Zoltan Herczeg  <[email protected]>
 
         MacroAssemblerSH4 does not implement readCallTarget

Modified: trunk/Source/_javascript_Core/interpreter/Interpreter.cpp (102010 => 102011)


--- trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2011-12-05 18:13:13 UTC (rev 102010)
+++ trunk/Source/_javascript_Core/interpreter/Interpreter.cpp	2011-12-05 18:25:45 UTC (rev 102011)
@@ -3704,6 +3704,7 @@
     }
     DEFINE_OPCODE(op_loop_hint) {
         // This is a no-op unless we intend on doing OSR from the interpreter.
+        vPC += OPCODE_LENGTH(op_loop_hint);
         NEXT_INSTRUCTION();
     }
     DEFINE_OPCODE(op_loop_if_true) {

Modified: trunk/Source/_javascript_Core/jit/JITStubs.cpp (102010 => 102011)


--- trunk/Source/_javascript_Core/jit/JITStubs.cpp	2011-12-05 18:13:13 UTC (rev 102010)
+++ trunk/Source/_javascript_Core/jit/JITStubs.cpp	2011-12-05 18:25:45 UTC (rev 102011)
@@ -760,7 +760,7 @@
 JITThunks::JITThunks(JSGlobalData* globalData)
     : m_hostFunctionStubMap(adoptPtr(new HostFunctionStubMap))
 {
-    if (!globalData->executableAllocator.isValid())
+    if (!globalData->canUseJIT())
         return;
 
     m_executableMemory = JIT::compileCTIMachineTrampolines(globalData, &m_trampolineStructure);

Modified: trunk/Source/_javascript_Core/runtime/Executable.h (102010 => 102011)


--- trunk/Source/_javascript_Core/runtime/Executable.h	2011-12-05 18:13:13 UTC (rev 102010)
+++ trunk/Source/_javascript_Core/runtime/Executable.h	2011-12-05 18:25:45 UTC (rev 102011)
@@ -183,6 +183,7 @@
 #if ENABLE(JIT)
         static NativeExecutable* create(JSGlobalData& globalData, MacroAssemblerCodeRef callThunk, NativeFunction function, MacroAssemblerCodeRef constructThunk, NativeFunction constructor, DFG::Intrinsic intrinsic)
         {
+            ASSERT(globalData.canUseJIT());
             NativeExecutable* executable;
             if (!callThunk) {
                 executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
@@ -194,9 +195,12 @@
             globalData.heap.addFinalizer(executable, &finalize);
             return executable;
         }
-#else
+#endif
+
+#if ENABLE(INTERPRETER)
         static NativeExecutable* create(JSGlobalData& globalData, NativeFunction function, NativeFunction constructor)
         {
+            ASSERT(!globalData.canUseJIT());
             NativeExecutable* executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
             executable->finishCreation(globalData);
             globalData.heap.addFinalizer(executable, &finalize);
@@ -221,6 +225,7 @@
 #if ENABLE(JIT)
         void finishCreation(JSGlobalData& globalData, JITCode callThunk, JITCode constructThunk, DFG::Intrinsic intrinsic)
         {
+            ASSERT(globalData.canUseJIT());
             Base::finishCreation(globalData);
             m_jitCodeForCall = callThunk;
             m_jitCodeForConstruct = constructThunk;
@@ -233,7 +238,15 @@
 #endif
         }
 #endif
-        
+
+#if ENABLE(INTERPRETER)
+        void finishCreation(JSGlobalData& globalData)
+        {
+            ASSERT(!globalData.canUseJIT());
+            Base::finishCreation(globalData);
+        }
+#endif
+
         static void finalize(JSCell*);
  
     private:

Modified: trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp (102010 => 102011)


--- trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2011-12-05 18:13:13 UTC (rev 102010)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalData.cpp	2011-12-05 18:25:45 UTC (rev 102011)
@@ -414,10 +414,15 @@
 #if ENABLE(JIT)
 NativeExecutable* JSGlobalData::getHostFunction(NativeFunction function, NativeFunction constructor)
 {
+#if ENABLE(INTERPRETER)
+    if (!canUseJIT())
+        return NativeExecutable::create(*this, function, constructor);
+#endif
     return jitStubs->hostFunctionStub(this, function, constructor);
 }
 NativeExecutable* JSGlobalData::getHostFunction(NativeFunction function, ThunkGenerator generator, DFG::Intrinsic intrinsic)
 {
+    ASSERT(canUseJIT());
     return jitStubs->hostFunctionStub(this, function, generator, intrinsic);
 }
 #else

Modified: trunk/Source/_javascript_Core/runtime/Lookup.cpp (102010 => 102011)


--- trunk/Source/_javascript_Core/runtime/Lookup.cpp	2011-12-05 18:13:13 UTC (rev 102010)
+++ trunk/Source/_javascript_Core/runtime/Lookup.cpp	2011-12-05 18:25:45 UTC (rev 102011)
@@ -86,7 +86,7 @@
         JSFunction* function;
         JSGlobalObject* globalObject = thisObj->globalObject();
 #if ENABLE(JIT)
-        if (entry->generator() || entry->intrinsic() != DFG::NoIntrinsic)
+        if (exec->globalData().canUseJIT() && (entry->generator() || entry->intrinsic() != DFG::NoIntrinsic))
             function = JSFunction::create(exec, globalObject, entry->functionLength(), propertyName, exec->globalData().getHostFunction(entry->function(), entry->generator(), entry->intrinsic()));
         else
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to