[turbofan] Introduce CheckPoint common operator.

This operator will be used to carry eager frame states, and is hooked up
to the effect chain with a control dependency to avoid hosting out of
control structures.

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

Review-Url: https://codereview.chromium.org/1993593002
Cr-Commit-Position: refs/heads/master@{#36301}
This commit is contained in:
bmeurer 2016-05-17 22:27:27 -07:00 committed by Commit bot
parent 9e332635ce
commit 4e0105d876
6 changed files with 20 additions and 0 deletions

View File

@ -179,6 +179,7 @@ std::ostream& operator<<(std::ostream& os,
V(Terminate, Operator::kKontrol, 0, 1, 1, 0, 0, 1) \
V(OsrNormalEntry, Operator::kFoldable, 0, 1, 1, 0, 1, 1) \
V(OsrLoopEntry, Operator::kFoldable, 0, 1, 1, 0, 1, 1) \
V(CheckPoint, Operator::kKontrol, 1, 1, 1, 0, 1, 0) \
V(BeginRegion, Operator::kNoThrow, 0, 1, 0, 0, 1, 0) \
V(FinishRegion, Operator::kNoThrow, 1, 1, 0, 1, 1, 0)

View File

@ -190,6 +190,7 @@ class CommonOperatorBuilder final : public ZoneObject {
const Operator* Phi(MachineRepresentation representation,
int value_input_count);
const Operator* EffectPhi(int effect_input_count);
const Operator* CheckPoint();
const Operator* Guard(Type* type);
const Operator* BeginRegion();
const Operator* FinishRegion();

View File

@ -293,6 +293,15 @@ void EffectControlLinearizer::ProcessNode(Node* node, Node** effect,
return RemoveRegionNode(node);
}
// Special treatment for CheckPoint nodes.
// TODO(epertoso): Pickup the current frame state.
if (node->opcode() == IrOpcode::kCheckPoint) {
// Unlink the check point; effect uses will be updated to the incoming
// effect that is passed.
node->Kill();
return;
}
if (node->opcode() == IrOpcode::kIfSuccess) {
// We always schedule IfSuccess with its call, so skip it here.
DCHECK_EQ(IrOpcode::kCall, node->InputAt(0)->opcode());

View File

@ -47,6 +47,7 @@
V(Select) \
V(Phi) \
V(EffectPhi) \
V(CheckPoint) \
V(Guard) \
V(BeginRegion) \
V(FinishRegion) \

View File

@ -706,6 +706,10 @@ Type* Typer::Visitor::TypeGuard(Node* node) {
return Type::Intersect(input_type, guard_type, zone());
}
Type* Typer::Visitor::TypeCheckPoint(Node* node) {
UNREACHABLE();
return nullptr;
}
Type* Typer::Visitor::TypeBeginRegion(Node* node) {
UNREACHABLE();

View File

@ -420,6 +420,10 @@ void Verifier::Visitor::Check(Node* node) {
case IrOpcode::kGuard:
// TODO(bmeurer): what are the constraints on these?
break;
case IrOpcode::kCheckPoint:
// Type is empty.
CheckNotTyped(node);
break;
case IrOpcode::kBeginRegion:
// TODO(rossberg): what are the constraints on these?
break;