StatementReader.h 1.2 KB

1234567891011121314151617181920212223242526272829
  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. namespace Js
  7. {
  8. struct StatementReader
  9. {
  10. private:
  11. const byte* m_startLocation;
  12. SmallSpanSequence* m_statementMap;
  13. SmallSpanSequenceIter m_statementMapIter;
  14. FunctionBody::StatementMapList* m_fullstatementMap;
  15. const byte* m_nextStatementBoundary;
  16. int m_statementIndex;
  17. bool m_startOfStatement;
  18. public:
  19. void Create(FunctionBody* functionRead, uint startOffset = 0);
  20. void Create(FunctionBody* functionRead, uint startOffset, bool useOriginalByteCode);
  21. inline bool AtStatementBoundary(ByteCodeReader * reader) { return m_nextStatementBoundary == reader->GetIP(); }
  22. inline uint32 MoveNextStatementBoundary();
  23. inline uint32 GetStatementIndex() const { return m_statementIndex; }
  24. };
  25. } // namespace Js