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

Unified Diff: test/mjsunit/binary-op-newspace.js

Issue 3338007: Handle argument conversion in StringAddStub. (Closed)
Patch Set: Test added Created 10 years, 3 months 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/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/binary-op-newspace.js
diff --git a/test/mjsunit/binary-op-newspace.js b/test/mjsunit/binary-op-newspace.js
index 8034209806d6f1a976bcde3a31a9edda7df2ff9e..40d53b942c9d3dcef25fff00eaf774c2b823ce01 100644
--- a/test/mjsunit/binary-op-newspace.js
+++ b/test/mjsunit/binary-op-newspace.js
@@ -25,21 +25,38 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-/**
- * @fileoverview Check that a mod where the stub code hits a failure
- * in heap number allocation still works.
- */
-
// Flags: --max-new-space-size=262144
+
+// Check that a mod where the stub code hits a failure in heap number
+// allocation still works.
+
function f(x) {
return x % 3;
}
-function test() {
+function testMod() {
for (var i = 0; i < 40000; i++) {
assertEquals(-1 / 0, 1 / f(-3));
}
}
-test();
+testMod();
+
+
+// Check that an add where the stub code hits a failure in heap number
+// allocation still works.
+
+function g(x, y) {
+ return x + y;
+}
+
+function testAdd() {
+ var lhs = 17.42;
+ var rhs = 42.17;
+ for (var i = 0; i < 40000; i++) {
+ assertEquals(59.59, g(lhs, rhs));
+ }
+}
+
+testAdd();
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698