Merge V8 at branches/3.2 r8200: Initial merge by Git
Change-Id: I5c434306e98132997e9c5f6024b6ce200b255edf
diff --git a/test/mjsunit/compiler/logical-and.js b/test/mjsunit/compiler/logical-and.js
index 783edb6..1d31a0a 100644
--- a/test/mjsunit/compiler/logical-and.js
+++ b/test/mjsunit/compiler/logical-and.js
@@ -46,8 +46,8 @@
assertFalse(AndBB(0, 1));
assertFalse(AndBB(1, 1));
-assertEquals(0, AndBN(0, 0));
-assertEquals(1, AndBN(0, 1));
+assertFalse(AndBN(0, 0));
+assertTrue(AndBN(0, 1));
assertFalse(AndBN(1, 0));
assertEquals(1, AndBN(0, 1));
assertEquals(2, AndBN(0, 2));
diff --git a/test/mjsunit/compiler/inline-throw.js b/test/mjsunit/compiler/regress-1394.js
similarity index 71%
rename from test/mjsunit/compiler/inline-throw.js
rename to test/mjsunit/compiler/regress-1394.js
index e3aab39..b1ce192 100644
--- a/test/mjsunit/compiler/inline-throw.js
+++ b/test/mjsunit/compiler/regress-1394.js
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -27,43 +27,33 @@
// Flags: --allow-natives-syntax
-// Test inlined functions contain throw.
-function doThrow() {
- throw "uha";
-}
-
function f(x) {
- if (x == 42) throw doThrow();
- if (x == 43) throw "wow";
- return x == 0;
-}
+ var ret = -1;
+ switch(x){
+ default:
+ case 0:
+ ret = 0;
+ break;
+ case 1:
+ ret = 1;
+ break;
+ case 2:
+ ret = 2;
+ break;
+ case 3:
+ ret = 3;
+ break;
+ case 4:
+ ret = 4;
+ break;
+ }
+ return ret;
+};
-function g(x) {
- return f(x);
-}
+for (var i = 0; i < 3; i++) assertEquals(i, f(i));
-for (var i = 0; i < 5; i++) g(0);
-%OptimizeFunctionOnNextCall(g);
-assertEquals(true, g(0));
+%OptimizeFunctionOnNextCall(f);
-try {
- g(42);
-} catch(e) {
- assertEquals("uha", e);
-}
-
-// Test inlining in a test context.
-function h(x) {
- return f(x) ? "yes" : "no";
-}
-
-for (var i = 0; i < 5; i++) h(0);
-%OptimizeFunctionOnNextCall(h);
-assertEquals("yes", h(0));
-
-try {
- h(43);
-} catch(e) {
- assertEquals("wow", e);
-}
+assertEquals(0, f(0));
+assertEquals(1, f(1));