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

Unified Diff: src/wasm/encoder.cc

Issue 1895013002: [wasm] Introduce Encoder::GetLocal and Encoder::SetLocal utilities. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « src/wasm/encoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/encoder.cc
diff --git a/src/wasm/encoder.cc b/src/wasm/encoder.cc
index 92e6b1145cba4670e204046bb209674a8bca51f5..a95171d0ae54b9ea6a7ac5ee8f70180252815036 100644
--- a/src/wasm/encoder.cc
+++ b/src/wasm/encoder.cc
@@ -150,6 +150,15 @@ void WasmFunctionBuilder::EmitCode(const byte* code, uint32_t code_size) {
EmitCode(code, code_size, nullptr, 0);
}
+void WasmFunctionBuilder::EmitGetLocal(uint32_t local_index) {
+ local_indices_.push_back(static_cast<uint32_t>(body_.size() + 1));
+ EmitWithVarInt(kExprGetLocal, local_index);
+}
+
+void WasmFunctionBuilder::EmitSetLocal(uint32_t local_index) {
+ local_indices_.push_back(static_cast<uint32_t>(body_.size() + 1));
+ EmitWithVarInt(kExprSetLocal, local_index);
+}
void WasmFunctionBuilder::EmitCode(const byte* code, uint32_t code_size,
const uint32_t* local_indices,
« no previous file with comments | « src/wasm/encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698