Title: [157932] trunk/Source/_javascript_Core
Revision
157932
Author
[email protected]
Date
2013-10-24 09:10:59 -0700 (Thu, 24 Oct 2013)

Log Message

Fix broken C Loop LLINT build.
https://bugs.webkit.org/show_bug.cgi?id=123271.

Reviewed by Michael Saboff.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::printGetByIdCacheStatus): Added an UNUSED_PARAM().
(JSC::CodeBlock::dumpBytecode): Added #if ENABLE(JIT) to JIT only code.
* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFor): Added an UNUSED_PARAM().
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFor): Added an UNUSED_PARAM().
* bytecode/StructureStubInfo.h:
- Added a stub StubInfoMap for non-JIT builds. StubInfoMap is still used
  in function prototypes even when !ENABLE(JIT). Rather that adding #if's
  in many places, we just provide a stub/placeholder implementation that
  is unused but keeps the compiler happy.
* jit/JITOperations.h: Added #if ENABLE(JIT).
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
- The putByVal() macro reifies a slow path which is never taken in one case.
  This translates into a label that is never used in the C Loop LLINT. The
  C++ compiler doesn't like unused labels. So, we fix this by adding a
  cloopUnusedLabel offline asm instruction that synthesizes the following:

      if (false) goto unusedLabel;

  This keeps the C++ compiler happy without changing code behavior.
* offlineasm/cloop.rb: Implementing cloopUnusedLabel.
* offlineasm/instructions.rb: Declaring cloopUnusedLabel.
* runtime/Executable.cpp:
(JSC::setupJIT): Added UNUSED_PARAM()s.
(JSC::ScriptExecutable::prepareForExecutionImpl):
- run-_javascript_core-tests have phases that forces the LLINT to be off
  which in turn asserts that the JIT is enabled. With the C Loop LLINT,
  this combination is illegal. So, we override the setup code here to
  always use the LLINT if !ENABLE(JIT) regardless of what options are
  passed in.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (157931 => 157932)


--- trunk/Source/_javascript_Core/ChangeLog	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-10-24 16:10:59 UTC (rev 157932)
@@ -1,3 +1,44 @@
+2013-10-24  Mark Lam  <[email protected]>
+
+        Fix broken C Loop LLINT build.
+        https://bugs.webkit.org/show_bug.cgi?id=123271.
+
+        Reviewed by Michael Saboff.
+
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::printGetByIdCacheStatus): Added an UNUSED_PARAM().
+        (JSC::CodeBlock::dumpBytecode): Added #if ENABLE(JIT) to JIT only code.
+        * bytecode/GetByIdStatus.cpp:
+        (JSC::GetByIdStatus::computeFor): Added an UNUSED_PARAM().
+        * bytecode/PutByIdStatus.cpp:
+        (JSC::PutByIdStatus::computeFor): Added an UNUSED_PARAM().
+        * bytecode/StructureStubInfo.h:
+        - Added a stub StubInfoMap for non-JIT builds. StubInfoMap is still used
+          in function prototypes even when !ENABLE(JIT). Rather that adding #if's
+          in many places, we just provide a stub/placeholder implementation that
+          is unused but keeps the compiler happy.
+        * jit/JITOperations.h: Added #if ENABLE(JIT).
+        * llint/LowLevelInterpreter32_64.asm:
+        * llint/LowLevelInterpreter64.asm:
+        - The putByVal() macro reifies a slow path which is never taken in one case.
+          This translates into a label that is never used in the C Loop LLINT. The
+          C++ compiler doesn't like unused labels. So, we fix this by adding a
+          cloopUnusedLabel offline asm instruction that synthesizes the following:
+
+              if (false) goto unusedLabel;
+
+          This keeps the C++ compiler happy without changing code behavior.
+        * offlineasm/cloop.rb: Implementing cloopUnusedLabel.
+        * offlineasm/instructions.rb: Declaring cloopUnusedLabel.
+        * runtime/Executable.cpp:
+        (JSC::setupJIT): Added UNUSED_PARAM()s.
+        (JSC::ScriptExecutable::prepareForExecutionImpl):
+        - run-_javascript_core-tests have phases that forces the LLINT to be off
+          which in turn asserts that the JIT is enabled. With the C Loop LLINT,
+          this combination is illegal. So, we override the setup code here to
+          always use the LLINT if !ENABLE(JIT) regardless of what options are
+          passed in.
+
 2013-10-24  [email protected]  <[email protected]>
 
         Uninitialized member causes crash when DFG JIT is not enabled.

Modified: trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp (157931 => 157932)


--- trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/bytecode/CodeBlock.cpp	2013-10-24 16:10:59 UTC (rev 157932)
@@ -444,6 +444,8 @@
             out.printf(")");
         }
     }
+#else
+    UNUSED_PARAM(map);
 #endif
 }
 
@@ -522,10 +524,12 @@
     out.printf("\n");
     
     StubInfoMap stubInfos;
+#if ENABLE(JIT)
     {
         ConcurrentJITLocker locker(m_lock);
         getStubInfoMap(locker, stubInfos);
     }
+#endif
     
     const Instruction* begin = instructions().begin();
     const Instruction* end = instructions().end();

Modified: trunk/Source/_javascript_Core/bytecode/GetByIdStatus.cpp (157931 => 157932)


--- trunk/Source/_javascript_Core/bytecode/GetByIdStatus.cpp	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/bytecode/GetByIdStatus.cpp	2013-10-24 16:10:59 UTC (rev 157932)
@@ -246,6 +246,7 @@
     
     return result;
 #else // ENABLE(JIT)
+    UNUSED_PARAM(map);
     return GetByIdStatus(NoInformation, false);
 #endif // ENABLE(JIT)
 }

Modified: trunk/Source/_javascript_Core/bytecode/PutByIdStatus.cpp (157931 => 157932)


--- trunk/Source/_javascript_Core/bytecode/PutByIdStatus.cpp	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/bytecode/PutByIdStatus.cpp	2013-10-24 16:10:59 UTC (rev 157932)
@@ -143,6 +143,7 @@
         return PutByIdStatus(TakesSlowPath, 0, 0, 0, invalidOffset);
     }
 #else // ENABLE(JIT)
+    UNUSED_PARAM(map);
     return PutByIdStatus(NoInformation, 0, 0, 0, invalidOffset);
 #endif // ENABLE(JIT)
 }

Modified: trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h (157931 => 157932)


--- trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/bytecode/StructureStubInfo.h	2013-10-24 16:10:59 UTC (rev 157932)
@@ -28,8 +28,6 @@
 
 #include <wtf/Platform.h>
 
-#if ENABLE(JIT)
-
 #include "CodeOrigin.h"
 #include "Instruction.h"
 #include "JITStubRoutine.h"
@@ -43,6 +41,8 @@
 
 namespace JSC {
 
+#if ENABLE(JIT)
+
 class PolymorphicPutByIdList;
 
 enum AccessType {
@@ -301,8 +301,12 @@
 
 typedef HashMap<CodeOrigin, StructureStubInfo*> StubInfoMap;
 
-} // namespace JSC
+#else
 
+typedef HashMap<int, void*> StubInfoMap;
+
 #endif // ENABLE(JIT)
 
+} // namespace JSC
+
 #endif // StructureStubInfo_h

Modified: trunk/Source/_javascript_Core/jit/JITOperations.h (157931 => 157932)


--- trunk/Source/_javascript_Core/jit/JITOperations.h	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/jit/JITOperations.h	2013-10-24 16:10:59 UTC (rev 157932)
@@ -26,6 +26,8 @@
 #ifndef JITOperations_h
 #define JITOperations_h
 
+#if ENABLE(JIT)
+
 #include "CallFrame.h"
 #include "JITExceptions.h"
 #include "JSArray.h"
@@ -275,5 +277,7 @@
 
 } // namespace JSC
 
+#endif // ENABLE(JIT)
+
 #endif // JITOperations_h
 

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (157931 => 157932)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2013-10-24 16:10:59 UTC (rev 157932)
@@ -1389,6 +1389,9 @@
 
 _llint_op_put_by_val_direct:
     putByVal(macro(addr, slowPath)
+        if C_LOOP
+            cloopUnusedLabel slowPath
+        end
     end, _llint_slow_path_put_by_val_direct)
 
 _llint_op_jmp:

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (157931 => 157932)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2013-10-24 16:10:59 UTC (rev 157932)
@@ -1248,6 +1248,9 @@
 
 _llint_op_put_by_val_direct:
     putByVal(macro(slot, slowPath)
+        if C_LOOP
+            cloopUnusedLabel slowPath
+        end
     end, _llint_slow_path_put_by_val_direct)
 
 

Modified: trunk/Source/_javascript_Core/offlineasm/cloop.rb (157931 => 157932)


--- trunk/Source/_javascript_Core/offlineasm/cloop.rb	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/offlineasm/cloop.rb	2013-10-24 16:10:59 UTC (rev 157932)
@@ -1110,6 +1110,9 @@
         when "cloopCallSlowPath"
             cloopEmitCallSlowPath(operands)
 
+        when "cloopUnusedLabel"
+            $asm.putc "if (false) goto #{operands[0].cLabel};"
+
         # For debugging only. This is used to insert instrumentation into the
         # generated LLIntAssembly.h during llint development only. Do not use
         # for production code.

Modified: trunk/Source/_javascript_Core/offlineasm/instructions.rb (157931 => 157932)


--- trunk/Source/_javascript_Core/offlineasm/instructions.rb	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/offlineasm/instructions.rb	2013-10-24 16:10:59 UTC (rev 157932)
@@ -295,6 +295,7 @@
      "cloopCallJSFunction",  # operands: callee
      "cloopCallNative",      # operands: callee
      "cloopCallSlowPath",    # operands: callTarget, currentFrame, currentPC
+     "cloopUnusedLabel",     # operands: label
 
      # For debugging only:
      # Takes no operands but simply emits whatever follows in // comments as

Modified: trunk/Source/_javascript_Core/runtime/Executable.cpp (157931 => 157932)


--- trunk/Source/_javascript_Core/runtime/Executable.cpp	2013-10-24 16:09:48 UTC (rev 157931)
+++ trunk/Source/_javascript_Core/runtime/Executable.cpp	2013-10-24 16:10:59 UTC (rev 157932)
@@ -277,6 +277,8 @@
     CompilationResult result = JIT::compile(&vm, codeBlock, JITCompilationMustSucceed);
     RELEASE_ASSERT(result == CompilationSuccessful);
 #else
+    UNUSED_PARAM(vm);
+    UNUSED_PARAM(codeBlock);
     UNREACHABLE_FOR_PLATFORM();
 #endif
 }
@@ -295,7 +297,11 @@
     }
     
     bool shouldUseLLInt;
-#if ENABLE(LLINT)
+#if !ENABLE(JIT)
+    // No JIT implies use of the C Loop LLINT. Override the options to reflect this. 
+    Options::useLLInt() = true;
+    shouldUseLLInt = true;
+#elif ENABLE(LLINT)
     shouldUseLLInt = Options::useLLInt();
 #else
     shouldUseLLInt = false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to