WasmCustomReader.h 958 B

12345678910111213141516171819202122232425
  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. void AddNode(WasmNode node);
  18. private:
  19. JsUtil::List<WasmNode, ArenaAllocator> m_nodes;
  20. uint32 m_state = 0;
  21. };
  22. } // namespace Wasm
  23. #endif // ENABLE_WASM