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

Unified Diff: test/mjsunit/wasm/wasm-module-builder.js

Issue 1775873002: [Wasm] Convert many of the fixed-size values to LEB128. (Closed) Base URL: http://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows Created 4 years, 9 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 | « test/cctest/wasm/test-run-wasm.cc ('k') | test/unittests/wasm/encoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/wasm/wasm-module-builder.js
diff --git a/test/mjsunit/wasm/wasm-module-builder.js b/test/mjsunit/wasm/wasm-module-builder.js
index f529e53e2a6556fa3b7e89856c2813b10dd7269a..7ccd2a42c151acb01f7ee9348dc7d2cd205ee141 100644
--- a/test/mjsunit/wasm/wasm-module-builder.js
+++ b/test/mjsunit/wasm/wasm-module-builder.js
@@ -164,7 +164,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) {
emit_varint(bytes, this.signatures.length);
for (sig of this.signatures) {
var params = sig.length - 1;
- emit_u8(bytes, params);
+ emit_varint(bytes, params);
for (var j = 0; j < sig.length; j++) {
emit_u8(bytes, sig[j]);
}
@@ -177,7 +177,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) {
emit_u8(bytes, kDeclImportTable);
emit_varint(bytes, this.imports.length);
for (imp of this.imports) {
- emit_u16(bytes, imp.sig_index);
+ emit_varint(bytes, imp.sig_index);
emit_string(bytes, imp.module);
if (imp.name == undefined) {
emit_u32(bytes, 0);
@@ -228,7 +228,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) {
local_decls.push({count: l.f64_count, type: kAstF64});
}
}
- emit_u8(bytes, local_decls.length);
+ emit_varint(bytes, local_decls.length);
for (decl of local_decls) {
emit_varint(bytes, decl.count);
emit_u8(bytes, decl.type);
@@ -257,7 +257,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) {
emit_u8(bytes, kDeclFunctionTable);
emit_varint(bytes, this.function_table.length);
for (index of this.function_table) {
- emit_u16(bytes, index);
+ emit_varint(bytes, index);
}
}
@@ -267,7 +267,7 @@ WasmModuleBuilder.prototype.toArray = function(debug) {
emit_varint(bytes, exports);
for (func of this.functions) {
for (exp of func.exports) {
- emit_u16(bytes, func.index);
+ emit_varint(bytes, func.index);
emit_string(bytes, exp);
}
}
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | test/unittests/wasm/encoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698