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

Unified Diff: src/wasm/asm-wasm-builder.cc

Issue 1909513002: [wasm] Extra LEB utilities to leb-helper.h (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add unittests for signed encodings. Created 4 years, 8 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 | « BUILD.gn ('k') | src/wasm/ast-decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/asm-wasm-builder.cc
diff --git a/src/wasm/asm-wasm-builder.cc b/src/wasm/asm-wasm-builder.cc
index 7d166f0f3e40521220ad60f4b6ac98bcdbf0514b..f1ccf3db6c8bba7d46631eaa4f10106930fa768d 100644
--- a/src/wasm/asm-wasm-builder.cc
+++ b/src/wasm/asm-wasm-builder.cc
@@ -273,10 +273,7 @@ class AsmWasmBuilderImpl : public AstVisitor {
current_function_builder_->Emit(kExprNop);
} else {
current_function_builder_->Emit(kExprBrTable);
- std::vector<uint8_t> count =
- UnsignedLEB128From(node->end - node->begin + 1);
- current_function_builder_->EmitCode(&count[0],
- static_cast<uint32_t>(count.size()));
+ current_function_builder_->EmitVarInt(node->end - node->begin + 1);
for (int v = node->begin; v <= node->end; v++) {
if (case_to_block.find(v) != case_to_block.end()) {
byte break_code[] = {BR_TARGET(case_to_block.at(v))};
@@ -1137,9 +1134,7 @@ class AsmWasmBuilderImpl : public AstVisitor {
index = LookupOrInsertFunction(vp->var());
}
current_function_builder_->Emit(kExprCallFunction);
- std::vector<uint8_t> index_arr = UnsignedLEB128From(index);
- current_function_builder_->EmitCode(
- &index_arr[0], static_cast<uint32_t>(index_arr.size()));
+ current_function_builder_->EmitVarInt(index);
break;
}
case Call::KEYED_PROPERTY_CALL: {
« no previous file with comments | « BUILD.gn ('k') | src/wasm/ast-decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698