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

Side by Side Diff: test/mjsunit/wasm/asm-wasm.js

Issue 1530093002: Add do-while and conditional and mark non asm nodes as unreachable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@mywork
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/wasm/asm-wasm-builder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --expose-wasm 5 // Flags: --expose-wasm
6 6
7 function IntTest() { 7 function IntTest() {
8 "use asm"; 8 "use asm";
9 function sum(a, b) { 9 function sum(a, b) {
10 a = a|0; 10 a = a|0;
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 var i = 0; 631 var i = 0;
632 for (i=1; i < 45 ; i = (i+1)|0) { 632 for (i=1; i < 45 ; i = (i+1)|0) {
633 } 633 }
634 return i|0; 634 return i|0;
635 } 635 }
636 636
637 return {caller:caller}; 637 return {caller:caller};
638 } 638 }
639 639
640 assertEquals(45, WASM.asmCompileRun(TestForLoopWithoutBody.toString())); 640 assertEquals(45, WASM.asmCompileRun(TestForLoopWithoutBody.toString()));
641
642 function TestDoWhile() {
643 "use asm"
644
645 function caller() {
646 var i = 0;
647 var ret = 21;
648 do {
649 ret = (ret + ret)|0;
650 i = (i + 1)|0;
651 } while (i < 2);
652 return ret|0;
653 }
654
655 return {caller:caller};
656 }
657
658 assertEquals(84, WASM.asmCompileRun(TestDoWhile.toString()));
659
660 function TestConditional() {
661 "use asm"
662
663 function caller() {
664 var x = 1;
665 return ((x > 0) ? 41 : 71)|0;
666 }
667
668 return {caller:caller};
669 }
670
671 assertEquals(41, WASM.asmCompileRun(TestConditional.toString()));
OLDNEW
« no previous file with comments | « src/wasm/asm-wasm-builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698