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

Unified Diff: src/wasm/encoder.cc

Issue 1609893002: Add function tables to asm to wasm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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') | test/cctest/test-asm-validator.cc » ('j') | 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 d8d36338b127fba815904d994b2de07f17192b5a..2b93301ae7877a42d0b8530ca08507fb1d556a6a 100644
--- a/src/wasm/encoder.cc
+++ b/src/wasm/encoder.cc
@@ -121,12 +121,6 @@ void WasmFunctionBuilder::EmitWithU8(WasmOpcode opcode, const byte immediate) {
}
-void WasmFunctionBuilder::EmitWithLocal(WasmOpcode opcode) {
- body_.push_back(static_cast<byte>(opcode));
- local_indices_.push_back(static_cast<uint32_t>(body_.size()) - 1);
-}
-
-
uint32_t WasmFunctionBuilder::EmitEditableImmediate(const byte immediate) {
body_.push_back(immediate);
return static_cast<uint32_t>(body_.size()) - 1;
@@ -370,21 +364,21 @@ void WasmModuleBuilder::AddDataSegment(WasmDataSegmentEncoder* data) {
}
-int WasmModuleBuilder::CompareFunctionSigs::operator()(FunctionSig* a,
- FunctionSig* b) const {
- if (a->return_count() < b->return_count()) return -1;
- if (a->return_count() > b->return_count()) return 1;
- if (a->parameter_count() < b->parameter_count()) return -1;
- if (a->parameter_count() > b->parameter_count()) return 1;
+bool WasmModuleBuilder::CompareFunctionSigs::operator()(FunctionSig* a,
+ FunctionSig* b) const {
+ if (a->return_count() < b->return_count()) return true;
+ if (a->return_count() > b->return_count()) return false;
+ if (a->parameter_count() < b->parameter_count()) return true;
+ if (a->parameter_count() > b->parameter_count()) return false;
for (size_t r = 0; r < a->return_count(); r++) {
- if (a->GetReturn(r) < b->GetReturn(r)) return -1;
- if (a->GetReturn(r) > b->GetReturn(r)) return 1;
+ if (a->GetReturn(r) < b->GetReturn(r)) return true;
+ if (a->GetReturn(r) > b->GetReturn(r)) return false;
}
for (size_t p = 0; p < a->parameter_count(); p++) {
- if (a->GetParam(p) < b->GetParam(p)) return -1;
- if (a->GetParam(p) > b->GetParam(p)) return 1;
+ if (a->GetParam(p) < b->GetParam(p)) return true;
+ if (a->GetParam(p) > b->GetParam(p)) return false;
}
- return 0;
+ return false;
}
« no previous file with comments | « src/wasm/encoder.h ('k') | test/cctest/test-asm-validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698