5 #ifndef V8_COMPILER_BACKEND_ARM64_UNWINDING_INFO_WRITER_ARM64_H_ 6 #define V8_COMPILER_BACKEND_ARM64_UNWINDING_INFO_WRITER_ARM64_H_ 8 #include "src/eh-frame.h" 14 class InstructionBlock;
16 class UnwindingInfoWriter {
18 explicit UnwindingInfoWriter(Zone* zone)
20 eh_frame_writer_(zone),
22 block_will_exit_(false),
23 block_initial_states_(zone) {
24 if (enabled()) eh_frame_writer_.Initialize();
27 void SetNumberOfInstructionBlocks(
int number) {
28 if (enabled()) block_initial_states_.resize(number);
31 void BeginInstructionBlock(
int pc_offset,
const InstructionBlock* block);
32 void EndInstructionBlock(
const InstructionBlock* block);
34 void MarkLinkRegisterOnTopOfStack(
int pc_offset,
const Register& sp);
35 void MarkPopLinkRegisterFromTopOfStack(
int pc_offset);
37 void MarkFrameConstructed(
int at_pc);
38 void MarkFrameDeconstructed(
int at_pc);
40 void MarkBlockWillExit() { block_will_exit_ =
true; }
42 void Finish(
int code_size) {
43 if (enabled()) eh_frame_writer_.Finish(code_size);
46 EhFrameWriter* eh_frame_writer() {
47 return enabled() ? &eh_frame_writer_ :
nullptr;
51 bool enabled()
const {
return FLAG_perf_prof_unwinding_info; }
53 class BlockInitialState :
public ZoneObject {
55 explicit BlockInitialState(
bool saved_lr) : saved_lr_(saved_lr) {}
61 EhFrameWriter eh_frame_writer_;
63 bool block_will_exit_;
65 ZoneVector<const BlockInitialState*> block_initial_states_;
72 #endif // V8_COMPILER_BACKEND_ARM64_UNWINDING_INFO_WRITER_ARM64_H_