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

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

Issue 2264913002: [wasm] asm.js - Remove Wasm.instantiateModuleFromAsm, use asm.js directly. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 4 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 | « test/mjsunit/wasm/asm-wasm.js ('k') | test/mjsunit/wasm/asm-wasm-deopt.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 TestCopyBug() { 7 (function TestCopyBug() {
8 // This was tickling a register allocation issue with 8 // This was tickling a register allocation issue with
9 // idiv in embenchen/copy. 9 // idiv in embenchen/copy.
10 function asmModule(){ 10 function asmModule(){
11 'use asm'; 11 'use asm';
12 function func() { 12 function func() {
13 var ret = 0; 13 var ret = 0;
14 var x = 1, y = 0, z = 0; 14 var x = 1, y = 0, z = 0;
15 var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0; 15 var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0;
16 do { 16 do {
17 y = (x + 0) | 0; 17 y = (x + 0) | 0;
18 z = (y | 0) % 2 | 0; 18 z = (y | 0) % 2 | 0;
19 ret = (y + z + a + b + c + d + e + f + g) | 0; 19 ret = (y + z + a + b + c + d + e + f + g) | 0;
20 } while(0); 20 } while(0);
21 return ret | 0; 21 return ret | 0;
22 } 22 }
23 return { func: func }; 23 return { func: func };
24 } 24 }
25 var wasm = Wasm.instantiateModuleFromAsm(asmModule.toString()); 25 var wasm = asmModule();
26 assertEquals(asmModule().func(), wasm.func()); 26 var js = eval('(' + asmModule.toString().replace('use asm', '') + ')')();
27 assertEquals(js.func(), wasm.func());
27 })(); 28 })();
OLDNEW
« no previous file with comments | « test/mjsunit/wasm/asm-wasm.js ('k') | test/mjsunit/wasm/asm-wasm-deopt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698