Title: [160257] trunk
Revision
160257
Author
[email protected]
Date
2013-12-06 15:20:09 -0800 (Fri, 06 Dec 2013)

Log Message

FTL should support all of Branch/LogicalNot
https://bugs.webkit.org/show_bug.cgi?id=125370

Reviewed by Mark Hahnenberg.

Source/_javascript_Core: 

* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::boolify):

LayoutTests: 

* js/regress/logical-not-expected.txt: Added.
* js/regress/logical-not.html: Added.
* js/regress/script-tests/logical-not.js: Added.
(foo):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (160256 => 160257)


--- trunk/LayoutTests/ChangeLog	2013-12-06 23:14:03 UTC (rev 160256)
+++ trunk/LayoutTests/ChangeLog	2013-12-06 23:20:09 UTC (rev 160257)
@@ -1,5 +1,17 @@
 2013-12-06  Filip Pizlo  <[email protected]>
 
+        FTL should support all of Branch/LogicalNot
+        https://bugs.webkit.org/show_bug.cgi?id=125370
+
+        Reviewed by Mark Hahnenberg.
+
+        * js/regress/logical-not-expected.txt: Added.
+        * js/regress/logical-not.html: Added.
+        * js/regress/script-tests/logical-not.js: Added.
+        (foo):
+
+2013-12-06  Filip Pizlo  <[email protected]>
+
         FTL should support generic ByVal accesses
         https://bugs.webkit.org/show_bug.cgi?id=125368
 

Added: trunk/LayoutTests/js/regress/logical-not-expected.txt (0 => 160257)


--- trunk/LayoutTests/js/regress/logical-not-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/js/regress/logical-not-expected.txt	2013-12-06 23:20:09 UTC (rev 160257)
@@ -0,0 +1,10 @@
+JSRegress/logical-not
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS no exception thrown
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/js/regress/logical-not.html (0 => 160257)


--- trunk/LayoutTests/js/regress/logical-not.html	                        (rev 0)
+++ trunk/LayoutTests/js/regress/logical-not.html	2013-12-06 23:20:09 UTC (rev 160257)
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/js/regress/script-tests/logical-not.js (0 => 160257)


--- trunk/LayoutTests/js/regress/script-tests/logical-not.js	                        (rev 0)
+++ trunk/LayoutTests/js/regress/script-tests/logical-not.js	2013-12-06 23:20:09 UTC (rev 160257)
@@ -0,0 +1,14 @@
+function foo(v) {
+    return !v;
+}
+
+noInline(foo);
+
+var array = ["foo", 42, null, {}, true, false];
+var expected = [false, false, true, false, false, true];
+
+for (var i = 0; i < 200000; ++i) {
+    var result = foo(array[i % array.length]);
+    if (result !== expected[i % array.length])
+        throw "Error: bad result at " + i + ": " + result;
+}

Modified: trunk/Source/_javascript_Core/ChangeLog (160256 => 160257)


--- trunk/Source/_javascript_Core/ChangeLog	2013-12-06 23:14:03 UTC (rev 160256)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-12-06 23:20:09 UTC (rev 160257)
@@ -1,3 +1,16 @@
+2013-12-06  Filip Pizlo  <[email protected]>
+
+        FTL should support all of Branch/LogicalNot
+        https://bugs.webkit.org/show_bug.cgi?id=125370
+
+        Reviewed by Mark Hahnenberg.
+
+        * ftl/FTLCapabilities.cpp:
+        (JSC::FTL::canCompile):
+        * ftl/FTLIntrinsicRepository.h:
+        * ftl/FTLLowerDFGToLLVM.cpp:
+        (JSC::FTL::LowerDFGToLLVM::boolify):
+
 2013-12-06  Roger Fong <[email protected]> and Brent Fulgham  <[email protected]>
 
         [Win] Support compiling with VS2013

Modified: trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp (160256 => 160257)


--- trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2013-12-06 23:14:03 UTC (rev 160256)
+++ trunk/Source/_javascript_Core/ftl/FTLCapabilities.cpp	2013-12-06 23:20:09 UTC (rev 160257)
@@ -106,6 +106,8 @@
     case VariableWatchpoint:
     case NotifyWrite:
     case ValueToInt32:
+    case Branch:
+    case LogicalNot:
         // These are OK.
         break;
     case GetById:
@@ -197,19 +199,6 @@
         if (node->isBinaryUseKind(NumberUse))
             break;
         return CannotCompile;
-    case Branch:
-    case LogicalNot:
-        switch (node->child1().useKind()) {
-        case BooleanUse:
-        case Int32Use:
-        case NumberUse:
-        case StringUse:
-        case ObjectOrOtherUse:
-            break;
-        default:
-            return CannotCompile;
-        }
-        break;
     case Switch:
         switch (node->switchData()->kind) {
         case SwitchImm:

Modified: trunk/Source/_javascript_Core/ftl/FTLIntrinsicRepository.h (160256 => 160257)


--- trunk/Source/_javascript_Core/ftl/FTLIntrinsicRepository.h	2013-12-06 23:14:03 UTC (rev 160256)
+++ trunk/Source/_javascript_Core/ftl/FTLIntrinsicRepository.h	2013-12-06 23:20:09 UTC (rev 160257)
@@ -66,6 +66,7 @@
     macro(P_JITOperation_EStPS, functionType(intPtr, intPtr, intPtr, intPtr, intPtr)) \
     macro(P_JITOperation_EStSS, functionType(intPtr, intPtr, intPtr, intPtr, intPtr)) \
     macro(P_JITOperation_EStZ, functionType(intPtr, intPtr, intPtr, int32)) \
+    macro(S_JITOperation_EJ, functionType(intPtr, intPtr, int64)) \
     macro(V_JITOperation_EJJJ, functionType(voidType, intPtr, int64, int64, int64)) \
     macro(V_JITOperation_EOZD, functionType(voidType, intPtr, intPtr, int32, doubleType)) \
     macro(V_JITOperation_EOZJ, functionType(voidType, intPtr, intPtr, int32, int64)) \

Modified: trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp (160256 => 160257)


--- trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2013-12-06 23:14:03 UTC (rev 160256)
+++ trunk/Source/_javascript_Core/ftl/FTLLowerDFGToLLVM.cpp	2013-12-06 23:20:09 UTC (rev 160257)
@@ -2974,6 +2974,27 @@
             LValue length = m_out.load32(stringValue, m_heaps.JSString_length);
             return m_out.notEqual(length, m_out.int32Zero);
         }
+        case UntypedUse: {
+            LValue value = lowJSValue(m_node->child1());
+            
+            LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped slow case"));
+            LBasicBlock fastCase = FTL_NEW_BLOCK(m_out, ("Boolify untyped fast case"));
+            LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("Boolify untyped continuation"));
+            
+            m_out.branch(isNotBoolean(value), slowCase, fastCase);
+            
+            LBasicBlock lastNext = m_out.appendTo(fastCase, slowCase);
+            ValueFromBlock fastResult = m_out.anchor(unboxBoolean(value));
+            m_out.jump(continuation);
+            
+            m_out.appendTo(slowCase, continuation);
+            ValueFromBlock slowResult = m_out.anchor(m_out.notNull(vmCall(
+                m_out.operation(operationConvertJSValueToBoolean), m_callFrame, value)));
+            m_out.jump(continuation);
+            
+            m_out.appendTo(continuation, lastNext);
+            return m_out.phi(m_out.boolean, fastResult, slowResult);
+        }
         default:
             RELEASE_ASSERT_NOT_REACHED();
             return 0;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to