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

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: 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
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 dd150018917ad795eded1cef51e3d74706bbcd8d..bdd8cda97f15f62f4c98f751f972da51fef6f2dd 100644
--- a/test/mjsunit/wasm/wasm-module-builder.js
+++ b/test/mjsunit/wasm/wasm-module-builder.js
@@ -158,7 +158,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]);
}
@@ -171,7 +171,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, "");
emit_string(bytes, imp.name);
}
@@ -218,7 +218,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);
@@ -247,7 +247,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);
}
}
@@ -257,7 +257,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);
}
}

Powered by Google App Engine
This is Rietveld 408576698