Chromium Code Reviews

Side by Side Diff: src/compiler/x64/unwinding-info-writer-x64.h

Issue 2026313002: Emit unwinding information for TurboFan code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@eh-frame
Patch Set: Clarify assumptions on frame ction/dtion routines in arm/arm64. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
(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_X64_UNWINDING_INFO_WRITER_H_
6 #define V8_COMPILER_X64_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() : tracking_fp_(false), block_will_exit_(false) {}
20
21 void MaybeIncreaseFrameBaseOffsetAt(int pc_offset, int base_delta) {
22 if (!tracking_fp_) {
23 eh_frame_writer_.AdvanceLocation(pc_offset);
24 eh_frame_writer_.IncreaseBaseAddressOffset(base_delta);
25 }
26 }
27
28 void BeginInstructionBlock(int pc_offset, const InstructionBlock* block);
29 void EndInstructionBlock(const InstructionBlock* block);
30
31 void MarkFrameConstructed(int pc_base);
32 void MarkFrameDeconstructed(int pc_base);
33
34 void MarkBlockWillExit() { block_will_exit_ = true; }
35
36 void Finish(int code_size) { eh_frame_writer_.Finish(code_size); }
37
38 EhFrameWriter* eh_frame_writer() { return &eh_frame_writer_; }
39
40 private:
41 EhFrameWriter eh_frame_writer_;
42
43 struct BlockInitialState {
44 Register register_;
45 int offset_;
46 bool tracking_fp_;
47 };
48
49 bool tracking_fp_;
50 bool block_will_exit_;
51
52 std::unordered_map<int, BlockInitialState> block_initial_states_;
53 static_assert(kIntSize >= kInt32Size, "int too small to encode a RpoNumber");
54 };
55
56 } // namespace compiler
57 } // namespace internal
58 } // namespace v8
59
60 #endif
OLDNEW

Powered by Google App Engine