5#ifndef V8_MAGLEV_MAGLEV_BASIC_BLOCK_H_
6#define V8_MAGLEV_MAGLEV_BASIC_BLOCK_H_
43 if (node ==
nullptr)
continue;
44 if (!node->Is<
Identity>())
return node->id();
52 if (node ==
nullptr)
continue;
80 if (
nodes_[split] == node)
break;
83 size_t after_split = split + 1;
185 template <
typename Func>
189 if (predecessor_block) {
190 functor(predecessor_block);
199 template <
typename Func>
201 if (
auto unconditional_control =
203 functor(unconditional_control->target());
205 functor(branch->if_true());
206 functor(branch->if_false());
208 for (
int i = 0;
i < switch_node->
size();
i++) {
209 functor(switch_node->targets()[
i].block_ptr());
211 if (switch_node->has_fallthrough()) {
212 functor(switch_node->fallthrough());
217 template <
typename Func>
244 if (!current->nodes_.empty() || current->is_loop() ||
245 current->is_exception_handler_block() ||
246 current->HasPhisOrRegisterMerges()) {
286 bool has_register_merge =
false;
287#ifdef V8_ENABLE_MAGLEV
288 if (!
state()->register_state().is_initialized()) {
299 has_register_merge =
true;
307 has_register_merge =
true;
311 return has_register_merge;
343 if (
auto unconditional_control =
345 return {unconditional_control->target()};
347 return {branch->if_true(), branch->if_false()};
350 for (
int i = 0;
i < switch_node->
size();
i++) {
351 succs.
push_back(switch_node->targets()[
i].block_ptr());
353 if (switch_node->has_fallthrough()) {
354 succs.
push_back(switch_node->fallthrough());
void resize(size_t new_size)
void set_control_node(ControlNode *control_node)
void set_deferred(bool deferred)
BasicBlock(MergePointInterpreterFrameState *state, Zone *zone)
BasicBlock * backedge_predecessor() const
int predecessor_id() const
void AddPhi(Phi *phi) const
bool contains_node_id(NodeIdT id) const
MergePointRegisterState & edge_split_block_register_state()
base::SmallVector< BasicBlock *, 2 > successors() const
ZoneVector< Node * > nodes_
MergePointRegisterState * edge_split_block_register_state_
ExceptionHandlerInfo::List exception_handlers_
static void ForEachSuccessorFollowing(ControlNode *control, Func &&functor)
void ForEachPredecessor(Func &&functor) const
bool is_merge_block() const
ControlNode * control_node_
BasicBlock * predecessor_
bool is_edge_split_block() const
MergePointInterpreterFrameState * state_
void ForEachSuccessor(Func &&functor) const
void set_predecessor_id(int id)
void AddExceptionHandler(ExceptionHandlerInfo *handler)
void set_edge_split_block(BasicBlock *predecessor)
BasicBlock * ComputeRealJumpTarget()
BasicBlock * predecessor_at(int i) const
enum v8::internal::maglev::BasicBlock::@85 type_
ControlNode * control_node() const
ExceptionHandlerInfo::List & exception_handlers()
ControlNode * reset_control_node()
void set_predecessor(BasicBlock *predecessor)
NodeIdT FirstNonGapMoveId() const
static constexpr Id kInvalidBlockId
bool is_start_block_of_switch_case_
BasicBlock * predecessor() const
NodeIdT first_non_phi_id() const
void set_edge_split_block_register_state(MergePointRegisterState *register_state)
int predecessor_count() const
bool is_exception_handler_block() const
ZoneVector< Node * > & nodes()
bool is_start_block_of_switch_case() const
bool HasPhisOrRegisterMerges() const
void set_start_block_of_switch_case(bool value)
MergePointInterpreterFrameState * state() const
ZoneVector< Node * > Split(Node *node, Zone *zone)
BasicBlock * predecessor_at(int i) const
bool is_exception_handler() const
MergePointRegisterState & register_state()
uint32_t predecessor_count() const
constexpr NodeIdT id() const
BasicBlock * target() const
ZoneVector< RpoNumber > & result
ZoneVector< Node * >::iterator NodeIterator
bool LoadMergeState(RegisterState state, RegisterMerge **merge)
constexpr bool IsGapMoveNode(Opcode opcode)
bool Is(IndirectHandle< U > value)
#define DCHECK_NOT_NULL(val)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)