Chromium Code Reviews| 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); |
| } |