Title: [127938] trunk/Source
Revision
127938
Author
commit-qu...@webkit.org
Date
2012-09-07 16:58:47 -0700 (Fri, 07 Sep 2012)

Log Message

Source/_javascript_Core: Fix a llint C++ interpreter bugs.
https://bugs.webkit.org/show_bug.cgi?id=96127.

Patch by Mark Lam <mark....@apple.com> on 2012-09-07
Reviewed by Filip Pizlo.

* llint/LowLevelInterpreter.cpp:
(JSC):
(JSC::CLoop::execute):
* offlineasm/cloop.rb:

Source/WTF: Fixed ASSERT() and ASSERT_AT() macros so that they can be used in
comma expressions.
https://bugs.webkit.org/show_bug.cgi?id=96127.

Patch by Mark Lam <mark....@apple.com> on 2012-09-07
Reviewed by Filip Pizlo.

* wtf/Assertions.h:
(wtfAssert):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (127937 => 127938)


--- trunk/Source/_javascript_Core/ChangeLog	2012-09-07 23:54:30 UTC (rev 127937)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-09-07 23:58:47 UTC (rev 127938)
@@ -1,3 +1,15 @@
+2012-09-07  Mark Lam  <mark....@apple.com>
+
+        Fix a llint C++ interpreter bugs.
+        https://bugs.webkit.org/show_bug.cgi?id=96127.
+
+        Reviewed by Filip Pizlo.
+
+        * llint/LowLevelInterpreter.cpp:
+        (JSC):
+        (JSC::CLoop::execute):
+        * offlineasm/cloop.rb:
+
 2012-09-07  Gavin Barraclough  <barraclo...@apple.com>
 
         Object.prototype.__define{G,S}etter__ with non-callable second parameter should throw TypeError instead of SyntaxError

Modified: trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp (127937 => 127938)


--- trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp	2012-09-07 23:54:30 UTC (rev 127937)
+++ trunk/Source/_javascript_Core/llint/LowLevelInterpreter.cpp	2012-09-07 23:58:47 UTC (rev 127938)
@@ -36,6 +36,7 @@
 #include "LLintCLoop.h"
 #include "LLintSlowPaths.h"
 #include "VMInspector.h"
+#include <wtf/Assertions.h>
 #include <wtf/MathExtras.h>
 
 using namespace JSC::LLInt;
@@ -98,6 +99,10 @@
 #define OFFLINE_ASM_LOCAL_LABEL(label)   label:
 
 
+//============================================================================
+// Some utilities:
+//
+
 namespace JSC {
 namespace LLInt {
 
@@ -116,11 +121,15 @@
 } // namespace LLint
 
 
+//============================================================================
+// The llint C++ interpreter loop:
+//
+
 JSValue CLoop::execute(CallFrame* callFrame, OpcodeID bootstrapOpcodeId,
                        bool isInitializationPass)
 {
     #define CAST reinterpret_cast
-    #define SIGN_BIT32(x) (x & 0x80000000)
+    #define SIGN_BIT32(x) ((x) & 0x80000000)
 
     // One-time initialization of our address tables. We have to put this code
     // here because our labels are only in scope inside this function. The

Modified: trunk/Source/_javascript_Core/offlineasm/cloop.rb (127937 => 127938)


--- trunk/Source/_javascript_Core/offlineasm/cloop.rb	2012-09-07 23:54:30 UTC (rev 127937)
+++ trunk/Source/_javascript_Core/offlineasm/cloop.rb	2012-09-07 23:58:47 UTC (rev 127938)
@@ -172,7 +172,7 @@
     def pointerExpr
         if base.is_a? RegisterID and base.name == "sp" 
             offsetValue = "#{offset.value}"
-            "(assert(#{offsetValue} == offsetof(JITStackFrame, globalData)), &sp->globalData)"
+            "(ASSERT(#{offsetValue} == offsetof(JITStackFrame, globalData)), &sp->globalData)"
         elsif offset.value == 0
             "#{base.clValue(:int8Ptr)}"
         elsif offset.value > 0
@@ -236,7 +236,7 @@
     def pointerExpr
         if base.is_a? RegisterID and base.name == "sp"
             offsetValue = "(#{index.clValue(:int32)} << #{scaleShift}) + #{offset.clValue})"
-            "(assert(#{offsetValue} == offsetof(JITStackFrame, globalData)), &sp->globalData)"
+            "(ASSERT(#{offsetValue} == offsetof(JITStackFrame, globalData)), &sp->globalData)"
         else
             "#{base.clValue(:int8Ptr)} + (#{index.clValue(:int32)} << #{scaleShift}) + #{offset.clValue}"
         end

Modified: trunk/Source/WTF/ChangeLog (127937 => 127938)


--- trunk/Source/WTF/ChangeLog	2012-09-07 23:54:30 UTC (rev 127937)
+++ trunk/Source/WTF/ChangeLog	2012-09-07 23:58:47 UTC (rev 127938)
@@ -1,3 +1,14 @@
+2012-09-07  Mark Lam  <mark....@apple.com>
+
+        Fixed ASSERT() and ASSERT_AT() macros so that they can be used in
+        comma expressions.
+        https://bugs.webkit.org/show_bug.cgi?id=96127.
+
+        Reviewed by Filip Pizlo.
+
+        * wtf/Assertions.h:
+        (wtfAssert):
+
 2012-09-07  Michael Saboff  <msab...@apple.com>
 
         StringImpl::find(StringImpl*) doesn't handle cases where search and match strings are different bitness

Modified: trunk/Source/WTF/wtf/Assertions.h (127937 => 127938)


--- trunk/Source/WTF/wtf/Assertions.h	2012-09-07 23:54:30 UTC (rev 127937)
+++ trunk/Source/WTF/wtf/Assertions.h	2012-09-07 23:58:47 UTC (rev 127938)
@@ -244,20 +244,21 @@
 
 #else
 
-#define ASSERT(assertion) do \
-    if (!(assertion)) { \
-        WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion); \
-        CRASH(); \
-    } \
-while (0)
+static inline void wtfAssert(bool assertion, const char* file, int line,
+    const char* function, const char* assertionString)
+{
+    if (!assertion) {
+        WTFReportAssertionFailure(file, line, function, assertionString);
+        CRASH();
+    }
+}
 
-#define ASSERT_AT(assertion, file, line, function) do  \
-    if (!(assertion)) { \
-        WTFReportAssertionFailure(file, line, function, #assertion); \
-        CRASH(); \
-    } \
-while (0)
+#define ASSERT(assertion) \
+    wtfAssert(!!(assertion), __FILE__, __LINE__, WTF_PRETTY_FUNCTION, #assertion)
 
+#define ASSERT_AT(assertion, file, line, function) \
+    wtfAssert(!!(assertion), file, line, function, #assertion)
+
 #define ASSERT_NOT_REACHED() do { \
     WTFReportAssertionFailure(__FILE__, __LINE__, WTF_PRETTY_FUNCTION, 0); \
     CRASH(); \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to