OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef V8_COMPILER_ARM64_UNWINDING_INFO_WRITER_H_ |
| 6 #define V8_COMPILER_ARM64_UNWINDING_INFO_WRITER_H_ |
| 7 |
| 8 #include <unordered_map> |
| 9 #include "src/eh-frame.h" |
| 10 |
| 11 namespace v8 { |
| 12 namespace internal { |
| 13 namespace compiler { |
| 14 |
| 15 class InstructionBlock; |
| 16 |
| 17 class UnwindingInfoWriter { |
| 18 public: |
| 19 UnwindingInfoWriter() : saved_lr_(false), block_will_exit_(false) {} |
| 20 |
| 21 void BeginInstructionBlock(int pc_offset, const InstructionBlock* block); |
| 22 void EndInstructionBlock(const InstructionBlock* block); |
| 23 |
| 24 void MarkLinkRegisterOnTopOfStack(int pc_offset); |
| 25 void MarkPopLinkRegisterFromTopOfStack(int pc_offset); |
| 26 |
| 27 void MarkFrameConstructed(int pc_base); |
| 28 void MarkFrameDeconstructed(int pc_base); |
| 29 |
| 30 void MarkBlockWillExit() { block_will_exit_ = true; } |
| 31 |
| 32 void Finish(int code_size) { eh_frame_writer_.Finish(code_size); } |
| 33 |
| 34 EhFrameWriter* eh_frame_writer() { return &eh_frame_writer_; } |
| 35 |
| 36 private: |
| 37 EhFrameWriter eh_frame_writer_; |
| 38 |
| 39 struct BlockInitialState { |
| 40 bool saved_lr_; |
| 41 }; |
| 42 |
| 43 bool saved_lr_; |
| 44 bool block_will_exit_; |
| 45 |
| 46 std::unordered_map<int, BlockInitialState> block_initial_states_; |
| 47 static_assert(kIntSize >= kInt32Size, "int too small to encode a RpoNumber"); |
| 48 }; |
| 49 |
| 50 } // namespace compiler |
| 51 } // namespace internal |
| 52 } // namespace v8 |
| 53 |
| 54 #endif |
OLD | NEW |