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

Unified Diff: test/mjsunit/wasm/asm-wasm-stdlib.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 side-by-side diff with in-line comments
Download patch
Index: test/mjsunit/wasm/asm-wasm-stdlib.js
diff --git a/test/mjsunit/wasm/asm-wasm-stdlib.js b/test/mjsunit/wasm/asm-wasm-stdlib.js
index 55a244b58d7f999751b02b2fa9ccd48540be8521..de482579a0f2c1751fbd0be547aa9eff72967d4f 100644
--- a/test/mjsunit/wasm/asm-wasm-stdlib.js
+++ b/test/mjsunit/wasm/asm-wasm-stdlib.js
@@ -2,10 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --expose-wasm
+// Flags: --validate-asm --allow-natives-syntax
var stdlib = this;
+function assertValidAsm(func) {
+ assertTrue(%IsAsmWasmCode(func) ||
+ %GetOptimizationStatus(func) === 3);
+}
+
(function TestStdlibConstants() {
function Module(stdlib) {
"use asm";
@@ -41,7 +46,8 @@ var stdlib = this;
return {caller:caller, nanCheck:nanCheck};
}
- var m = Wasm.instantiateModuleFromAsm(Module.toString(), stdlib);
+ var m = Module(stdlib);
+ assertValidAsm(Module);
assertEquals(1, m.caller());
assertTrue(isNaN(m.nanCheck()));
})();
@@ -54,9 +60,8 @@ var stdlib = this;
function foo() { return +StdlibNaN; }
return {};
}
- assertThrows(function() {
- Wasm.instantiateModuleFromAsm(Module.toString(), { NaN: 0 });
- });
+ Module({ NaN: 0 });
+ assertFalse(%IsAsmWasmCode(Module));
})();
@@ -67,9 +72,8 @@ var stdlib = this;
function foo() { return +StdlibNaN; }
return {};
}
- assertThrows(function() {
- Wasm.instantiateModuleFromAsm(Module.toString(), {});
- });
+ Module({});
+ assertFalse(%IsAsmWasmCode(Module));
})();
@@ -148,7 +152,8 @@ var stdlib = this;
return {caller:caller};
}
- var m = Wasm.instantiateModuleFromAsm(Module.toString(), stdlib);
+ var m = Module(stdlib);
+ assertValidAsm(Module);
assertEquals(1, m.caller());
})();
@@ -292,7 +297,8 @@ var stdlib = this;
max_f64: max_f64,
};
}
- var m = Wasm.instantiateModuleFromAsm(Module.toString(), stdlib);
+ var m = Module(stdlib);
+ assertValidAsm(Module);
var values = {
i32: [
0, 1, -1, 123, 456, -123, -456,

Powered by Google App Engine
This is Rietveld 408576698