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

Unified Diff: src/wasm/ast-decoder.cc

Issue 1937083002: [wasm] Remove the module environment and signature as arguments to OpcodeArity. (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/ast-decoder.h ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/ast-decoder.cc
diff --git a/src/wasm/ast-decoder.cc b/src/wasm/ast-decoder.cc
index 17c84c6ac24121e7d7e43c451c64f80fd3472970..46e78a69f26285a157d1671a52b78c578597abe6 100644
--- a/src/wasm/ast-decoder.cc
+++ b/src/wasm/ast-decoder.cc
@@ -287,21 +287,19 @@ class WasmDecoder : public Decoder {
case kExprCallFunction: {
CallFunctionOperand operand(this, pc);
- return static_cast<int>(
- module_->GetFunctionSignature(operand.index)->parameter_count());
+ return operand.arity;
ahaas 2016/05/02 14:48:28 Could the arity be calculated in a static function
titzer 2016/05/02 14:57:31 Not sure what value that would add, since this fun
}
case kExprCallIndirect: {
CallIndirectOperand operand(this, pc);
- return 1 + static_cast<int>(
- module_->GetSignature(operand.index)->parameter_count());
+ return 1 + operand.arity;
}
case kExprCallImport: {
CallImportOperand operand(this, pc);
- return static_cast<int>(
- module_->GetImportSignature(operand.index)->parameter_count());
+ return operand.arity;
}
case kExprReturn: {
- return static_cast<int>(sig_->return_count());
+ ReturnArityOperand operand(this, pc);
+ return operand.arity;
}
#define DECLARE_OPCODE_CASE(name, opcode, sig) \
@@ -1523,9 +1521,8 @@ int OpcodeLength(const byte* pc, const byte* end) {
return decoder.OpcodeLength(pc);
}
-int OpcodeArity(ModuleEnv* module, FunctionSig* sig, const byte* pc,
- const byte* end) {
- WasmDecoder decoder(module, sig, pc, end);
+int OpcodeArity(const byte* pc, const byte* end) {
+ WasmDecoder decoder(nullptr, nullptr, pc, end);
ahaas 2016/05/02 14:48:28 Could you make OpcodeArity a static function?
titzer 2016/05/02 14:57:31 The decoder classes are not exposed through the he
ahaas 2016/05/02 15:12:41 What I mean is, I don't see a point why you have t
return decoder.OpcodeArity(pc);
}
« no previous file with comments | « src/wasm/ast-decoder.h ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698