| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/compiler/ast-graph-builder.h" | 5 #include "src/compiler/ast-graph-builder.h" |
| 6 | 6 |
| 7 #include "src/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/compiler/ast-loop-assignment-analyzer.h" | 9 #include "src/compiler/ast-loop-assignment-analyzer.h" |
| 10 #include "src/compiler/control-builders.h" | 10 #include "src/compiler/control-builders.h" |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 411 |
| 412 | 412 |
| 413 // Helper for generating before and after frame states. | 413 // Helper for generating before and after frame states. |
| 414 class AstGraphBuilder::FrameStateBeforeAndAfter { | 414 class AstGraphBuilder::FrameStateBeforeAndAfter { |
| 415 public: | 415 public: |
| 416 FrameStateBeforeAndAfter(AstGraphBuilder* builder, BailoutId id_before) | 416 FrameStateBeforeAndAfter(AstGraphBuilder* builder, BailoutId id_before) |
| 417 : builder_(builder), frame_state_before_(nullptr) { | 417 : builder_(builder), frame_state_before_(nullptr) { |
| 418 frame_state_before_ = id_before == BailoutId::None() | 418 frame_state_before_ = id_before == BailoutId::None() |
| 419 ? builder_->GetEmptyFrameState() | 419 ? builder_->GetEmptyFrameState() |
| 420 : builder_->environment()->Checkpoint(id_before); | 420 : builder_->environment()->Checkpoint(id_before); |
| 421 // Create an explicit checkpoint node for before the operation. | 421 if (id_before != BailoutId::None()) { |
| 422 Node* node = builder_->NewNode(builder_->common()->Checkpoint()); | 422 // Create an explicit checkpoint node for before the operation. |
| 423 DCHECK_EQ(IrOpcode::kDead, | 423 Node* node = builder_->NewNode(builder_->common()->Checkpoint()); |
| 424 NodeProperties::GetFrameStateInput(node, 0)->opcode()); | 424 DCHECK_EQ(IrOpcode::kDead, |
| 425 NodeProperties::ReplaceFrameStateInput(node, 0, frame_state_before_); | 425 NodeProperties::GetFrameStateInput(node, 0)->opcode()); |
| 426 NodeProperties::ReplaceFrameStateInput(node, 0, frame_state_before_); |
| 427 } |
| 426 } | 428 } |
| 427 | 429 |
| 428 void AddToNode( | 430 void AddToNode( |
| 429 Node* node, BailoutId id_after, | 431 Node* node, BailoutId id_after, |
| 430 OutputFrameStateCombine combine = OutputFrameStateCombine::Ignore()) { | 432 OutputFrameStateCombine combine = OutputFrameStateCombine::Ignore()) { |
| 431 int count = OperatorProperties::GetFrameStateInputCount(node->op()); | 433 int count = OperatorProperties::GetFrameStateInputCount(node->op()); |
| 432 DCHECK_LE(count, 2); | 434 DCHECK_LE(count, 2); |
| 433 | 435 |
| 434 if (count >= 1) { | 436 if (count >= 1) { |
| 435 // Add the frame state for after the operation. | 437 // Add the frame state for after the operation. |
| (...skipping 3937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4373 // Phi does not exist yet, introduce one. | 4375 // Phi does not exist yet, introduce one. |
| 4374 value = NewPhi(inputs, value, control); | 4376 value = NewPhi(inputs, value, control); |
| 4375 value->ReplaceInput(inputs - 1, other); | 4377 value->ReplaceInput(inputs - 1, other); |
| 4376 } | 4378 } |
| 4377 return value; | 4379 return value; |
| 4378 } | 4380 } |
| 4379 | 4381 |
| 4380 } // namespace compiler | 4382 } // namespace compiler |
| 4381 } // namespace internal | 4383 } // namespace internal |
| 4382 } // namespace v8 | 4384 } // namespace v8 |
| OLD | NEW |