Commit 10648ef3 authored by fpizlo@apple.com's avatar fpizlo@apple.com

FTL should support all of Branch/LogicalNot

https://bugs.webkit.org/show_bug.cgi?id=125370

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore: 

* 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):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6c32f4f1
2013-12-06 Filip Pizlo <fpizlo@apple.com>
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 <fpizlo@apple.com>
FTL should support generic ByVal accesses
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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script src="resources/regress-pre.js"></script>
<script src="script-tests/logical-not.js"></script>
<script src="resources/regress-post.js"></script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
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;
}
2013-12-06 Filip Pizlo <fpizlo@apple.com>
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 <roger_fong@apple.com> and Brent Fulgham <bfulgham@apple.com>
[Win] Support compiling with VS2013
......
......@@ -106,6 +106,8 @@ inline CapabilityLevel canCompile(Node* node)
case VariableWatchpoint:
case NotifyWrite:
case ValueToInt32:
case Branch:
case LogicalNot:
// These are OK.
break;
case GetById:
......@@ -197,19 +199,6 @@ inline CapabilityLevel canCompile(Node* node)
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:
......
......@@ -66,6 +66,7 @@ namespace JSC { namespace FTL {
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)) \
......
......@@ -2974,6 +2974,27 @@ private:
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment