Commit a56a581b authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by V8 LUCI CQ

[compiler] Remove most instances of DisallowHeapAccessIf scope

We would be allowing or disallowing using the local heap rather than
that scope. There's one case that remains in common-operator-reducer.cc.

Bug: v8:7790
Change-Id: Ice0b407aa37b3aa349fc68f4a7c2644156097e3e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2983206Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75379}
parent dad15364
...@@ -56,8 +56,7 @@ CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph, ...@@ -56,8 +56,7 @@ CommonOperatorReducer::CommonOperatorReducer(Editor* editor, Graph* graph,
} }
Reduction CommonOperatorReducer::Reduce(Node* node) { Reduction CommonOperatorReducer::Reduce(Node* node) {
DisallowHeapAccessIf no_heap_access(broker() == nullptr || DisallowHeapAccessIf no_heap_access(broker() == nullptr);
!broker()->is_concurrent_inlining());
switch (node->opcode()) { switch (node->opcode()) {
case IrOpcode::kBranch: case IrOpcode::kBranch:
return ReduceBranch(node); return ReduceBranch(node);
......
...@@ -64,7 +64,6 @@ ConstantFoldingReducer::ConstantFoldingReducer(Editor* editor, JSGraph* jsgraph, ...@@ -64,7 +64,6 @@ ConstantFoldingReducer::ConstantFoldingReducer(Editor* editor, JSGraph* jsgraph,
ConstantFoldingReducer::~ConstantFoldingReducer() = default; ConstantFoldingReducer::~ConstantFoldingReducer() = default;
Reduction ConstantFoldingReducer::Reduce(Node* node) { Reduction ConstantFoldingReducer::Reduce(Node* node) {
DisallowHeapAccessIf no_heap_access(!broker()->is_concurrent_inlining());
if (!NodeProperties::IsConstant(node) && NodeProperties::IsTyped(node) && if (!NodeProperties::IsConstant(node) && NodeProperties::IsTyped(node) &&
node->op()->HasProperty(Operator::kEliminatable) && node->op()->HasProperty(Operator::kEliminatable) &&
node->opcode() != IrOpcode::kFinishRegion) { node->opcode() != IrOpcode::kFinishRegion) {
......
...@@ -16,14 +16,12 @@ namespace compiler { ...@@ -16,14 +16,12 @@ namespace compiler {
DeadCodeElimination::DeadCodeElimination(Editor* editor, Graph* graph, DeadCodeElimination::DeadCodeElimination(Editor* editor, Graph* graph,
CommonOperatorBuilder* common, CommonOperatorBuilder* common,
Zone* temp_zone, Zone* temp_zone)
bool is_concurrent_inlining)
: AdvancedReducer(editor), : AdvancedReducer(editor),
graph_(graph), graph_(graph),
common_(common), common_(common),
dead_(graph->NewNode(common->Dead())), dead_(graph->NewNode(common->Dead())),
zone_(temp_zone), zone_(temp_zone) {
is_concurrent_inlining_(is_concurrent_inlining) {
NodeProperties::SetType(dead_, Type::None()); NodeProperties::SetType(dead_, Type::None());
} }
...@@ -48,7 +46,6 @@ Node* FindDeadInput(Node* node) { ...@@ -48,7 +46,6 @@ Node* FindDeadInput(Node* node) {
} // namespace } // namespace
Reduction DeadCodeElimination::Reduce(Node* node) { Reduction DeadCodeElimination::Reduce(Node* node) {
DisallowHeapAccessIf no_heap_access(!is_concurrent_inlining_);
switch (node->opcode()) { switch (node->opcode()) {
case IrOpcode::kEnd: case IrOpcode::kEnd:
return ReduceEnd(node); return ReduceEnd(node);
......
...@@ -40,8 +40,7 @@ class V8_EXPORT_PRIVATE DeadCodeElimination final ...@@ -40,8 +40,7 @@ class V8_EXPORT_PRIVATE DeadCodeElimination final
: public NON_EXPORTED_BASE(AdvancedReducer) { : public NON_EXPORTED_BASE(AdvancedReducer) {
public: public:
DeadCodeElimination(Editor* editor, Graph* graph, DeadCodeElimination(Editor* editor, Graph* graph,
CommonOperatorBuilder* common, Zone* temp_zone, CommonOperatorBuilder* common, Zone* temp_zone);
bool is_concurrent_inlining);
~DeadCodeElimination() final = default; ~DeadCodeElimination() final = default;
DeadCodeElimination(const DeadCodeElimination&) = delete; DeadCodeElimination(const DeadCodeElimination&) = delete;
DeadCodeElimination& operator=(const DeadCodeElimination&) = delete; DeadCodeElimination& operator=(const DeadCodeElimination&) = delete;
...@@ -79,8 +78,6 @@ class V8_EXPORT_PRIVATE DeadCodeElimination final ...@@ -79,8 +78,6 @@ class V8_EXPORT_PRIVATE DeadCodeElimination final
CommonOperatorBuilder* const common_; CommonOperatorBuilder* const common_;
Node* const dead_; Node* const dead_;
Zone* zone_; Zone* zone_;
const bool is_concurrent_inlining_;
}; };
} // namespace compiler } // namespace compiler
......
...@@ -1368,8 +1368,7 @@ struct InliningPhase { ...@@ -1368,8 +1368,7 @@ struct InliningPhase {
data->broker(), data->jsgraph()->Dead(), data->broker(), data->jsgraph()->Dead(),
data->observe_node_manager()); data->observe_node_manager());
DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
data->common(), temp_zone, data->common(), temp_zone);
info->concurrent_inlining());
CheckpointElimination checkpoint_elimination(&graph_reducer); CheckpointElimination checkpoint_elimination(&graph_reducer);
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->broker(), data->common(), data->broker(), data->common(),
...@@ -1439,8 +1438,7 @@ struct WasmInliningPhase { ...@@ -1439,8 +1438,7 @@ struct WasmInliningPhase {
GraphReducer graph_reducer(temp_zone, data->graph(), &info->tick_counter(), GraphReducer graph_reducer(temp_zone, data->graph(), &info->tick_counter(),
data->broker(), data->jsgraph()->Dead()); data->broker(), data->jsgraph()->Dead());
DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
data->common(), temp_zone, data->common(), temp_zone);
info->concurrent_inlining());
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->broker(), data->common(), data->broker(), data->common(),
data->machine(), temp_zone); data->machine(), temp_zone);
...@@ -1589,9 +1587,8 @@ struct TypedLoweringPhase { ...@@ -1589,9 +1587,8 @@ struct TypedLoweringPhase {
GraphReducer graph_reducer( GraphReducer graph_reducer(
temp_zone, data->graph(), &data->info()->tick_counter(), data->broker(), temp_zone, data->graph(), &data->info()->tick_counter(), data->broker(),
data->jsgraph()->Dead(), data->observe_node_manager()); data->jsgraph()->Dead(), data->observe_node_manager());
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
JSCreateLowering create_lowering(&graph_reducer, data->dependencies(), JSCreateLowering create_lowering(&graph_reducer, data->dependencies(),
data->jsgraph(), data->broker(), data->jsgraph(), data->broker(),
temp_zone); temp_zone);
...@@ -1777,9 +1774,8 @@ struct EarlyOptimizationPhase { ...@@ -1777,9 +1774,8 @@ struct EarlyOptimizationPhase {
GraphReducer graph_reducer( GraphReducer graph_reducer(
temp_zone, data->graph(), &data->info()->tick_counter(), data->broker(), temp_zone, data->graph(), &data->info()->tick_counter(), data->broker(),
data->jsgraph()->Dead(), data->observe_node_manager()); data->jsgraph()->Dead(), data->observe_node_manager());
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
SimplifiedOperatorReducer simple_reducer(&graph_reducer, data->jsgraph(), SimplifiedOperatorReducer simple_reducer(&graph_reducer, data->jsgraph(),
data->broker()); data->broker());
RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone); RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone);
...@@ -1854,9 +1850,8 @@ struct EffectControlLinearizationPhase { ...@@ -1854,9 +1850,8 @@ struct EffectControlLinearizationPhase {
&data->info()->tick_counter(), data->broker(), &data->info()->tick_counter(), data->broker(),
data->jsgraph()->Dead(), data->jsgraph()->Dead(),
data->observe_node_manager()); data->observe_node_manager());
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->broker(), data->common(), data->broker(), data->common(),
data->machine(), temp_zone); data->machine(), temp_zone);
...@@ -1894,9 +1889,8 @@ struct LoadEliminationPhase { ...@@ -1894,9 +1889,8 @@ struct LoadEliminationPhase {
BranchElimination branch_condition_elimination(&graph_reducer, BranchElimination branch_condition_elimination(&graph_reducer,
data->jsgraph(), temp_zone, data->jsgraph(), temp_zone,
BranchElimination::kEARLY); BranchElimination::kEARLY);
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone); RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone);
LoadElimination load_elimination(&graph_reducer, data->jsgraph(), LoadElimination load_elimination(&graph_reducer, data->jsgraph(),
temp_zone); temp_zone);
...@@ -1963,9 +1957,8 @@ struct LateOptimizationPhase { ...@@ -1963,9 +1957,8 @@ struct LateOptimizationPhase {
data->jsgraph()->Dead(), data->observe_node_manager()); data->jsgraph()->Dead(), data->observe_node_manager());
BranchElimination branch_condition_elimination(&graph_reducer, BranchElimination branch_condition_elimination(&graph_reducer,
data->jsgraph(), temp_zone); data->jsgraph(), temp_zone);
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone()); ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone());
MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph()); MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph());
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
...@@ -2063,9 +2056,8 @@ struct WasmOptimizationPhase { ...@@ -2063,9 +2056,8 @@ struct WasmOptimizationPhase {
data->observe_node_manager()); data->observe_node_manager());
MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(), MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(),
allow_signalling_nan); allow_signalling_nan);
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->broker(), data->common(), data->broker(), data->common(),
data->machine(), temp_zone); data->machine(), temp_zone);
...@@ -2086,9 +2078,8 @@ struct WasmOptimizationPhase { ...@@ -2086,9 +2078,8 @@ struct WasmOptimizationPhase {
data->observe_node_manager()); data->observe_node_manager());
MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(), MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(),
allow_signalling_nan); allow_signalling_nan);
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->broker(), data->common(), data->broker(), data->common(),
data->machine(), temp_zone); data->machine(), temp_zone);
...@@ -2120,9 +2111,8 @@ struct CsaEarlyOptimizationPhase { ...@@ -2120,9 +2111,8 @@ struct CsaEarlyOptimizationPhase {
data->observe_node_manager()); data->observe_node_manager());
MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(), MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(),
true); true);
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->broker(), data->common(), data->broker(), data->common(),
data->machine(), temp_zone); data->machine(), temp_zone);
...@@ -2143,9 +2133,8 @@ struct CsaEarlyOptimizationPhase { ...@@ -2143,9 +2133,8 @@ struct CsaEarlyOptimizationPhase {
data->observe_node_manager()); data->observe_node_manager());
MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(), MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(),
true); true);
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
data->broker(), data->common(), data->broker(), data->common(),
data->machine(), temp_zone); data->machine(), temp_zone);
...@@ -2171,9 +2160,8 @@ struct CsaOptimizationPhase { ...@@ -2171,9 +2160,8 @@ struct CsaOptimizationPhase {
data->jsgraph()->Dead(), data->observe_node_manager()); data->jsgraph()->Dead(), data->observe_node_manager());
BranchElimination branch_condition_elimination(&graph_reducer, BranchElimination branch_condition_elimination(&graph_reducer,
data->jsgraph(), temp_zone); data->jsgraph(), temp_zone);
DeadCodeElimination dead_code_elimination( DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(),
&graph_reducer, data->graph(), data->common(), temp_zone, data->common(), temp_zone);
data->info()->concurrent_inlining());
MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(), MachineOperatorReducer machine_reducer(&graph_reducer, data->jsgraph(),
allow_signalling_nan); allow_signalling_nan);
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), CommonOperatorReducer common_reducer(&graph_reducer, data->graph(),
......
...@@ -42,7 +42,6 @@ SimplifiedOperatorReducer::~SimplifiedOperatorReducer() = default; ...@@ -42,7 +42,6 @@ SimplifiedOperatorReducer::~SimplifiedOperatorReducer() = default;
Reduction SimplifiedOperatorReducer::Reduce(Node* node) { Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
DisallowHeapAccessIf no_heap_access(!broker()->is_concurrent_inlining());
switch (node->opcode()) { switch (node->opcode()) {
case IrOpcode::kBooleanNot: { case IrOpcode::kBooleanNot: {
HeapObjectMatcher m(node->InputAt(0)); HeapObjectMatcher m(node->InputAt(0));
......
...@@ -15,14 +15,11 @@ TypeNarrowingReducer::TypeNarrowingReducer(Editor* editor, JSGraph* jsgraph, ...@@ -15,14 +15,11 @@ TypeNarrowingReducer::TypeNarrowingReducer(Editor* editor, JSGraph* jsgraph,
JSHeapBroker* broker) JSHeapBroker* broker)
: AdvancedReducer(editor), : AdvancedReducer(editor),
jsgraph_(jsgraph), jsgraph_(jsgraph),
broker_(broker),
op_typer_(broker, zone()) {} op_typer_(broker, zone()) {}
TypeNarrowingReducer::~TypeNarrowingReducer() = default; TypeNarrowingReducer::~TypeNarrowingReducer() = default;
Reduction TypeNarrowingReducer::Reduce(Node* node) { Reduction TypeNarrowingReducer::Reduce(Node* node) {
DisallowHeapAccessIf no_heap_access(!broker_->is_concurrent_inlining());
Type new_type = Type::Any(); Type new_type = Type::Any();
switch (node->opcode()) { switch (node->opcode()) {
......
...@@ -34,7 +34,6 @@ class V8_EXPORT_PRIVATE TypeNarrowingReducer final ...@@ -34,7 +34,6 @@ class V8_EXPORT_PRIVATE TypeNarrowingReducer final
Zone* zone() const; Zone* zone() const;
JSGraph* const jsgraph_; JSGraph* const jsgraph_;
const JSHeapBroker* const broker_;
OperationTyper op_typer_; OperationTyper op_typer_;
}; };
......
...@@ -34,7 +34,6 @@ TypedOptimization::TypedOptimization(Editor* editor, ...@@ -34,7 +34,6 @@ TypedOptimization::TypedOptimization(Editor* editor,
TypedOptimization::~TypedOptimization() = default; TypedOptimization::~TypedOptimization() = default;
Reduction TypedOptimization::Reduce(Node* node) { Reduction TypedOptimization::Reduce(Node* node) {
DisallowHeapAccessIf no_heap_access(!broker()->is_concurrent_inlining());
switch (node->opcode()) { switch (node->opcode()) {
case IrOpcode::kConvertReceiver: case IrOpcode::kConvertReceiver:
return ReduceConvertReceiver(node); return ReduceConvertReceiver(node);
......
...@@ -24,8 +24,7 @@ class DeadCodeEliminationTest : public GraphTest { ...@@ -24,8 +24,7 @@ class DeadCodeEliminationTest : public GraphTest {
protected: protected:
Reduction Reduce(AdvancedReducer::Editor* editor, Node* node) { Reduction Reduce(AdvancedReducer::Editor* editor, Node* node) {
DeadCodeElimination reducer(editor, graph(), common(), zone(), DeadCodeElimination reducer(editor, graph(), common(), zone());
FLAG_concurrent_inlining);
return reducer.Reduce(node); return reducer.Reduce(node);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment