Chromium Code Reviews| 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_ARM_UNWINDING_INFO_WRITER_H_ | |
| 6 #define V8_COMPILER_ARM_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 at_pc); | |
| 28 void MarkFrameDeconstructed(int at_pc); | |
| 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_; | |
|
Jarin
2016/07/06 07:09:42
Nit: Could not you use a zone vector here? It seem
| |
| 47 static_assert(kIntSize >= kInt32Size, "int too small to encode a RpoNumber"); | |
|
Jarin
2016/07/06 07:09:42
Normally, we use STATIC_ASSERT.
Stefano Sanfilippo
2016/07/06 13:25:10
I followed the comment at line 216 of src/base/mac
Jarin
2016/07/07 07:31:40
Ah, good to know. Thanks.
| |
| 48 }; | |
| 49 | |
| 50 } // namespace compiler | |
| 51 } // namespace internal | |
| 52 } // namespace v8 | |
| 53 | |
| 54 #endif | |
| OLD | NEW |