Commit 2cc10477 authored by fpizlo@apple.com's avatar fpizlo@apple.com

We broke !(0/0)

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

Reviewed by Gavin Barraclough.

Source/JavaScriptCore: 

* parser/ASTBuilder.h:
(JSC::ASTBuilder::createLogicalNot):
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::pureToBoolean):

Source/WTF: 

* wtf/MathExtras.h:
(isNotZeroAndOrdered):
(isZeroOrUnordered):

LayoutTests: 

* fast/js/constant-fold-not-nan.html: Added.
* fast/js/constant-fold-not-nan-expected.txt: Added.
* fast/js/jsc-test-list:
* fast/js/script-tests/constant-fold-not-nan.js: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7dc7f065
2013-05-24 Filip Pizlo <fpizlo@apple.com>
We broke !(0/0)
https://bugs.webkit.org/show_bug.cgi?id=116736
Reviewed by Gavin Barraclough.
* fast/js/constant-fold-not-nan.html: Added.
* fast/js/constant-fold-not-nan-expected.txt: Added.
* fast/js/jsc-test-list:
* fast/js/script-tests/constant-fold-not-nan.js: Added.
2013-05-24 Sergio Villar Senin <svillar@igalia.com>
REGRESSION (r150215): broke a test case in inspector/console/console-css-warnings.html
......
Tests that our parse-time constant folding treats !(0/0) correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS !(0/0) is true
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="script-tests/constant-fold-not-nan.js"></script>
<script src="resources/js-test-post.js"></script>
</body>
</html>
......@@ -54,6 +54,7 @@ fast/js/const-without-initializer
fast/js/constant-count
fast/js/constant-encoding
fast/js/constant-folding
fast/js/constant-fold-not-nan
fast/js/continue-break-multiple-labels
fast/js/convert-nan-to-bool
fast/js/cyclic-prototypes
......
description(
"Tests that our parse-time constant folding treats !(0/0) correctly."
);
shouldBe("!(0/0)", "true");
2013-05-24 Filip Pizlo <fpizlo@apple.com>
We broke !(0/0)
https://bugs.webkit.org/show_bug.cgi?id=116736
Reviewed by Gavin Barraclough.
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createLogicalNot):
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::pureToBoolean):
2013-05-24 Julien Brianceau <jbrianceau@nds.com>
[sh4] Optimize LLINT generated code and fix few bugs in baseline JIT.
......
......@@ -148,7 +148,7 @@ public:
ExpressionNode* createLogicalNot(const JSTokenLocation& location, ExpressionNode* expr)
{
if (expr->isNumber())
return createBoolean(location, !static_cast<NumberNode*>(expr)->value());
return createBoolean(location, isZeroOrUnordered(static_cast<NumberNode*>(expr)->value()));
return new (m_vm) LogicalNotNode(location, expr);
}
......
......@@ -798,7 +798,7 @@ inline TriState JSValue::pureToBoolean() const
if (isInt32())
return asInt32() ? TrueTriState : FalseTriState;
if (isDouble())
return (asDouble() > 0.0 || asDouble() < 0.0) ? TrueTriState : FalseTriState; // false for NaN
return isNotZeroAndOrdered(asDouble()) ? TrueTriState : FalseTriState; // false for NaN
if (isCell())
return asCell()->pureToBoolean();
return isTrue() ? TrueTriState : FalseTriState;
......
2013-05-24 Filip Pizlo <fpizlo@apple.com>
We broke !(0/0)
https://bugs.webkit.org/show_bug.cgi?id=116736
Reviewed by Gavin Barraclough.
* wtf/MathExtras.h:
(isNotZeroAndOrdered):
(isZeroOrUnordered):
2013-05-24 Anders Carlsson <andersca@apple.com>
Remove PagePopup code
......
/*
* Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -346,6 +346,16 @@ template<typename T> inline T timesThreePlusOneDividedByTwo(T value)
return value + (value >> 1) + (value & 1);
}
template<typename T> inline bool isNotZeroAndOrdered(T value)
{
return value > 0.0 || value < 0.0;
}
template<typename T> inline bool isZeroOrUnordered(T value)
{
return !isNotZeroAndOrdered(value);
}
#ifndef UINT64_C
#if COMPILER(MSVC)
#define UINT64_C(c) c ## ui64
......
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