WasmCustomReader.h 1.0 KB

1234567891011121314151617181920212223242526
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. #ifdef ENABLE_WASM
  7. namespace Wasm
  8. {
  9. class WasmCustomReader : public WasmReaderBase
  10. {
  11. public:
  12. WasmCustomReader(ArenaAllocator* alloc);
  13. virtual void SeekToFunctionBody(class WasmFunctionInfo* funcInfo) override;
  14. virtual bool IsCurrentFunctionCompleted() const override;
  15. virtual WasmOp ReadExpr() override;
  16. virtual void FunctionEnd() override;
  17. virtual const uint32 EstimateCurrentFunctionBytecodeSize() const override;
  18. void AddNode(WasmNode node);
  19. private:
  20. JsUtil::List<WasmNode, ArenaAllocator> m_nodes;
  21. uint32 m_state = 0;
  22. };
  23. } // namespace Wasm
  24. #endif // ENABLE_WASM