Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Unified Diff: test/mjsunit/regress/regress-2416.js

Issue 11413087: Fix corner case in x64 compare stubs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added copyright header to test case Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-2416.js
diff --git a/test/mjsunit/compare-known-objects-slow.js b/test/mjsunit/regress/regress-2416.js
similarity index 51%
copy from test/mjsunit/compare-known-objects-slow.js
copy to test/mjsunit/regress/regress-2416.js
index afa198fcb352ea7f186a285146a61fd1ab70d51b..02afeb9a596338d0c783dbf743fdd67e749d7a8d 100644
--- a/test/mjsunit/compare-known-objects-slow.js
+++ b/test/mjsunit/regress/regress-2416.js
@@ -25,45 +25,51 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax
+assertFalse(2147483647 < -2147483648)
+assertFalse(2147483647 <= -2147483648)
+assertFalse(2147483647 == -2147483648)
+assertTrue(2147483647 >= -2147483648)
+assertTrue(2147483647 > -2147483648)
-// Test CompareIC stubs for normal and strict equality comparison of known
-// objects in slow mode. These objects share the same map even though they
-// might have completely different properties.
+assertTrue(-2147483648 < 2147483647)
+assertTrue(-2147483648 <= 2147483647)
+assertFalse(-2147483648 == 2147483647)
+assertFalse(-2147483648 >= 2147483647)
+assertFalse(-2147483648 > 2147483647)
-function eq(a, b) {
- return a == b;
-}
+assertFalse(2147483647 < 2147483647)
+assertTrue(2147483647 <= 2147483647)
+assertTrue(2147483647 == 2147483647)
+assertTrue(2147483647 >= 2147483647)
+assertFalse(2147483647 > 2147483647)
-function eq_strict(a, b) {
- return a === b;
-}
+assertFalse(-2147483648 < -2147483648)
+assertTrue(-2147483648 <= -2147483648)
+assertTrue(-2147483648 == -2147483648)
+assertTrue(-2147483648 >= -2147483648)
+assertFalse(-2147483648 > -2147483648)
-function test(a, b) {
- // Check CompareIC for equality of known objects.
- assertTrue(eq(a, a));
- assertTrue(eq(b, b));
- assertFalse(eq(a, b));
- // Check CompareIC for strict equality of known objects.
- assertTrue(eq_strict(a, a));
- assertTrue(eq_strict(b, b));
- assertFalse(eq_strict(a, b));
-}
-// Prepare two objects in slow mode that have the same map.
-var obj1 = %OptimizeObjectForAddingMultipleProperties({}, 1);
-var obj2 = %OptimizeObjectForAddingMultipleProperties({}, 1);
+assertFalse(1073741823 < -1073741824)
+assertFalse(1073741823 <= -1073741824)
+assertFalse(1073741823 == -1073741824)
+assertTrue(1073741823 >= -1073741824)
+assertTrue(1073741823 > -1073741824)
-// Test original objects.
-assertTrue(%HaveSameMap(obj1, obj2));
-test(obj1, obj2);
+assertTrue(-1073741824 < 1073741823)
+assertTrue(-1073741824 <= 1073741823)
+assertFalse(-1073741824 == 1073741823)
+assertFalse(-1073741824 >= 1073741823)
+assertFalse(-1073741824 > 1073741823)
-// Test after adding property to first object.
-obj1.x = 1;
-assertTrue(%HaveSameMap(obj1, obj2));
-test(obj1, obj2);
+assertFalse(1073741823 < 1073741823)
+assertTrue(1073741823 <= 1073741823)
+assertTrue(1073741823 == 1073741823)
+assertTrue(1073741823 >= 1073741823)
+assertFalse(1073741823 > 1073741823)
-// Test after adding property to second object.
-obj2.y = 2;
-assertTrue(%HaveSameMap(obj1, obj2));
-test(obj1, obj2);
+assertFalse(-1073741824 < -1073741824)
+assertTrue(-1073741824 <= -1073741824)
+assertTrue(-1073741824 == -1073741824)
+assertTrue(-1073741824 >= -1073741824)
+assertFalse(-1073741824 > -1073741824)
« no previous file with comments | « src/x64/code-stubs-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698