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

Unified Diff: test/mjsunit/wasm/start-function.js

Issue 1763433002: [wasm] Rework encoding of local declarations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/start-function.js
diff --git a/test/mjsunit/wasm/start-function.js b/test/mjsunit/wasm/start-function.js
index 409857de345f7a307097b76f1417b7d6e5621dcf..5b39a06a74531aa1a6bb283b0cec6eda22a95888 100644
--- a/test/mjsunit/wasm/start-function.js
+++ b/test/mjsunit/wasm/start-function.js
@@ -23,8 +23,9 @@ function instantiate(sig, body) {
kDeclFunctions, 1,
0, // decl flags
0, 0, // signature
- body.length, 0, // body size
+ body.length + 1, 0, // body size
]);
+ module = module.concat([kDeclNoLocals]);
module = module.concat(body);
module = module.concat([
// -- declare start function
@@ -67,7 +68,7 @@ assertFails([2, kAstI32, kAstI32, kAstF32], [kExprGetLocal, 0]);
assertFails([3, kAstI32, kAstI32, kAstF32, kAstF64], [kExprGetLocal, 0]);
(function testInvalidIndex() {
- var kBodySize = 1;
+ var kBodySize = 2;
var data = bytesWithHeader(
// -- signatures
kDeclSignatures, 1,
@@ -76,6 +77,7 @@ assertFails([3, kAstI32, kAstI32, kAstF32, kAstF64], [kExprGetLocal, 0]);
kDeclFunctions, 1,
0, // decl flags
0, 0, // signature
+ kDeclNoLocals,
kBodySize, 0, // body size
kExprNop, // body
// -- declare start function
@@ -88,7 +90,7 @@ assertFails([3, kAstI32, kAstI32, kAstF32, kAstF64], [kExprGetLocal, 0]);
(function testTwoStartFuncs() {
- var kBodySize = 1;
+ var kBodySize = 2;
var data = bytesWithHeader(
// -- signatures
kDeclSignatures, 1,
@@ -98,6 +100,7 @@ assertFails([3, kAstI32, kAstI32, kAstF32, kAstF64], [kExprGetLocal, 0]);
0, // decl flags
0, 0, // signature
kBodySize, 0, // body size
+ kDeclNoLocals,
kExprNop, // body
// -- declare start function
kDeclStartFunction,
@@ -112,7 +115,7 @@ assertFails([3, kAstI32, kAstI32, kAstF32, kAstF64], [kExprGetLocal, 0]);
(function testRun() {
- var kBodySize = 6;
+ var kBodySize = 7;
var data = bytesWithHeader(
kDeclMemory,
@@ -125,6 +128,7 @@ assertFails([3, kAstI32, kAstI32, kAstF32, kAstF64], [kExprGetLocal, 0]);
0, // decl flags
0, 0, // signature
kBodySize, 0, // code size
+ kDeclNoLocals,
// -- start body
kExprI32StoreMem, 0, kExprI8Const, 0, kExprI8Const, 77,
// -- declare start function
@@ -139,8 +143,8 @@ assertFails([3, kAstI32, kAstI32, kAstF32, kAstF64], [kExprGetLocal, 0]);
})();
(function testStartFFI() {
- var kBodySize = 2;
- var kNameOffset = kHeaderSize + 4 + 9 + 7 + 3;
+ var kBodySize = 3;
+ var kNameOffset = kHeaderSize + 4 + 9 + 5 + kBodySize + 3;
var data = bytesWithHeader(
// -- signatures
@@ -155,6 +159,7 @@ assertFails([3, kAstI32, kAstI32, kAstF32, kAstF64], [kExprGetLocal, 0]);
0, // decl flags
0, 0, // signature
kBodySize, 0, // code size
+ kDeclNoLocals,
// -- start body
kExprCallFunction, 0,
// -- declare start function

Powered by Google App Engine
This is Rietveld 408576698