Index: src/wasm/encoder.h |
diff --git a/src/wasm/encoder.h b/src/wasm/encoder.h |
index 1afedcb9d6dd4a8174f165a92d461e21da3e56f5..cf6a2b667b38e889dba125eebe59938525f331ba 100644 |
--- a/src/wasm/encoder.h |
+++ b/src/wasm/encoder.h |
@@ -10,6 +10,7 @@ |
#include "src/base/smart-pointers.h" |
+#include "src/wasm/wasm-macro-gen.h" |
#include "src/wasm/wasm-module.h" |
#include "src/wasm/wasm-opcodes.h" |
#include "src/wasm/wasm-result.h" |
@@ -23,6 +24,9 @@ class WasmModuleBuilder; |
class WasmFunctionEncoder : public ZoneObject { |
public: |
uint32_t HeaderSize() const; |
+ uint32_t LocalDeclSize() const { |
+ return static_cast<uint32_t>(local_decls_.Size()); |
+ } |
uint32_t BodySize() const; |
uint32_t NameSize() const; |
void Serialize(byte* buffer, byte** header, byte** body) const; |
@@ -33,20 +37,12 @@ class WasmFunctionEncoder : public ZoneObject { |
friend class WasmFunctionBuilder; |
uint16_t signature_index_; |
ZoneVector<LocalType> params_; |
- uint16_t local_i32_count_; |
- uint16_t local_i64_count_; |
- uint16_t local_f32_count_; |
- uint16_t local_f64_count_; |
+ LocalDeclEncoder local_decls_; |
bool exported_; |
bool external_; |
ZoneVector<uint8_t> body_; |
ZoneVector<char> name_; |
- bool HasLocals() const { |
- return (local_i32_count_ + local_i64_count_ + local_f32_count_ + |
- local_f64_count_) > 0; |
- } |
- |
bool HasName() const { return (exported_ || external_) && name_.size() > 0; } |
}; |