Commit fa1fd5a6 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Remove deprecated FrameStateBeforeAndAfter.

The helper class in question is no longer needed now that frame states
representing the "before" state is not attached to nodes anymore. They
are represented by appropriate {Checkpoint} nodes in the graph now.

R=bmeurer@chromium.org
BUG=v8:5021

Review-Url: https://codereview.chromium.org/2205243002
Cr-Commit-Position: refs/heads/master@{#38288}
parent bdb4e2cb
...@@ -412,48 +412,6 @@ class AstGraphBuilder::ControlScopeForFinally : public ControlScope { ...@@ -412,48 +412,6 @@ class AstGraphBuilder::ControlScopeForFinally : public ControlScope {
}; };
// Helper for generating before and after frame states.
class AstGraphBuilder::FrameStateBeforeAndAfter {
public:
FrameStateBeforeAndAfter(AstGraphBuilder* builder, BailoutId id_before)
: builder_(builder), frame_state_before_(nullptr) {
frame_state_before_ = id_before == BailoutId::None()
? builder_->GetEmptyFrameState()
: builder_->environment()->Checkpoint(id_before);
if (id_before != BailoutId::None()) {
// Create an explicit checkpoint node for before the operation.
Node* node = builder_->NewNode(builder_->common()->Checkpoint());
DCHECK_EQ(IrOpcode::kDead,
NodeProperties::GetFrameStateInput(node)->opcode());
NodeProperties::ReplaceFrameStateInput(node, frame_state_before_);
}
}
void AddToNode(
Node* node, BailoutId id_after,
OutputFrameStateCombine combine = OutputFrameStateCombine::Ignore()) {
if (OperatorProperties::HasFrameStateInput(node->op())) {
// Add the frame state for after the operation.
DCHECK_EQ(IrOpcode::kDead,
NodeProperties::GetFrameStateInput(node)->opcode());
bool node_has_exception = NodeProperties::IsExceptionalCall(node);
Node* frame_state_after =
id_after == BailoutId::None()
? builder_->GetEmptyFrameState()
: builder_->environment()->Checkpoint(id_after, combine,
node_has_exception);
NodeProperties::ReplaceFrameStateInput(node, frame_state_after);
}
}
private:
AstGraphBuilder* builder_;
Node* frame_state_before_;
};
AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info, AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
JSGraph* jsgraph, LoopAssignmentAnalysis* loop, JSGraph* jsgraph, LoopAssignmentAnalysis* loop,
TypeHintAnalysis* type_hint_analysis) TypeHintAnalysis* type_hint_analysis)
...@@ -2184,17 +2142,13 @@ void AstGraphBuilder::VisitAssignment(Assignment* expr) { ...@@ -2184,17 +2142,13 @@ void AstGraphBuilder::VisitAssignment(Assignment* expr) {
} }
environment()->Push(old_value); environment()->Push(old_value);
VisitForValue(expr->value()); VisitForValue(expr->value());
Node* value; Node* right = environment()->Pop();
{ Node* left = environment()->Pop();
FrameStateBeforeAndAfter states(this, expr->value()->id()); Node* value =
Node* right = environment()->Pop(); BuildBinaryOp(left, right, expr->binary_op(),
Node* left = environment()->Pop(); expr->binary_operation()->BinaryOperationFeedbackId());
value = PrepareFrameState(value, expr->binary_operation()->id(),
BuildBinaryOp(left, right, expr->binary_op(), OutputFrameStateCombine::Push());
expr->binary_operation()->BinaryOperationFeedbackId());
states.AddToNode(value, expr->binary_operation()->id(),
OutputFrameStateCombine::Push());
}
environment()->Push(value); environment()->Push(value);
if (needs_frame_state_before) { if (needs_frame_state_before) {
PrepareEagerCheckpoint(expr->binary_operation()->id()); PrepareEagerCheckpoint(expr->binary_operation()->id());
...@@ -2782,12 +2736,11 @@ void AstGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) { ...@@ -2782,12 +2736,11 @@ void AstGraphBuilder::VisitBinaryOperation(BinaryOperation* expr) {
default: { default: {
VisitForValue(expr->left()); VisitForValue(expr->left());
VisitForValue(expr->right()); VisitForValue(expr->right());
FrameStateBeforeAndAfter states(this, expr->right()->id());
Node* right = environment()->Pop(); Node* right = environment()->Pop();
Node* left = environment()->Pop(); Node* left = environment()->Pop();
Node* value = BuildBinaryOp(left, right, expr->op(), Node* value = BuildBinaryOp(left, right, expr->op(),
expr->BinaryOperationFeedbackId()); expr->BinaryOperationFeedbackId());
states.AddToNode(value, expr->id(), ast_context()->GetStateCombine()); PrepareFrameState(value, expr->id(), ast_context()->GetStateCombine());
ast_context()->ProduceValue(expr, value); ast_context()->ProduceValue(expr, value);
} }
} }
......
...@@ -74,7 +74,6 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> { ...@@ -74,7 +74,6 @@ class AstGraphBuilder : public AstVisitor<AstGraphBuilder> {
class ControlScopeForCatch; class ControlScopeForCatch;
class ControlScopeForFinally; class ControlScopeForFinally;
class Environment; class Environment;
class FrameStateBeforeAndAfter;
friend class ControlBuilder; friend class ControlBuilder;
Isolate* isolate_; Isolate* isolate_;
......
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