v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
unwinding-info-writer-arm.cc
Go to the documentation of this file.
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
7
8namespace v8 {
9namespace internal {
10namespace compiler {
11
13 const InstructionBlock* block) {
14 if (!enabled()) return;
15
16 block_will_exit_ = false;
17
18 DCHECK_LT(block->rpo_number().ToInt(),
19 static_cast<int>(block_initial_states_.size()));
20 const BlockInitialState* initial_state =
21 block_initial_states_[block->rpo_number().ToInt()];
22 if (!initial_state) return;
23 if (initial_state->saved_lr_ != saved_lr_) {
25 if (initial_state->saved_lr_) {
27 } else {
29 }
30 saved_lr_ = initial_state->saved_lr_;
31 }
32}
33
35 if (!enabled() || block_will_exit_) return;
36
37 for (const RpoNumber& successor : block->successors()) {
38 int successor_index = successor.ToInt();
39 DCHECK_LT(successor_index, static_cast<int>(block_initial_states_.size()));
40 const BlockInitialState* existing_state =
41 block_initial_states_[successor_index];
42
43 // If we already had an entry for this BB, check that the values are the
44 // same we are trying to insert.
45 if (existing_state) {
46 DCHECK_EQ(existing_state->saved_lr_, saved_lr_);
47 } else {
48 block_initial_states_[successor_index] =
50 }
51 }
52}
53
55 if (!enabled()) return;
56
57 // Regardless of the type of frame constructed, the relevant part of the
58 // layout is always the one in the diagram:
59 //
60 // | .... | higher addresses
61 // +----------+ ^
62 // | LR | | |
63 // +----------+ | |
64 // | saved FP | | |
65 // +----------+ <-- FP v
66 // | .... | stack growth
67 //
68 // The LR is pushed on the stack, and we can record this fact at the end of
69 // the construction, since the LR itself is not modified in the process.
72 saved_lr_ = true;
73}
74
76 if (!enabled()) return;
77
78 // The lr is restored by the last operation in LeaveFrame().
81 saved_lr_ = false;
82}
83
91
99
100} // namespace compiler
101} // namespace internal
102} // namespace v8
void SetBaseAddressRegisterAndOffset(Register base_register, int base_offset)
Definition eh-frame.cc:293
void AdvanceLocation(int pc_offset)
Definition eh-frame.cc:251
void RecordRegisterSavedToStack(Register name, int offset)
Definition eh-frame.h:104
void RecordRegisterFollowsInitialRule(Register name)
Definition eh-frame.cc:333
T * New(Args &&... args)
Definition zone.h:114
ZoneVector< const BlockInitialState * > block_initial_states_
void BeginInstructionBlock(int pc_offset, const InstructionBlock *block)
void EndInstructionBlock(const InstructionBlock *block)
int pc_offset
constexpr int kSystemPointerSize
Definition globals.h:410
#define DCHECK_LT(v1, v2)
Definition logging.h:489
#define DCHECK_EQ(v1, v2)
Definition logging.h:485