Commit 438f72f4 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Don't expect framestate input to be a Framestate

It could also be a DeadValue.

A regression test will take a while but the fix is straightforward.

Bug: chromium:1027045
Change-Id: I49a66668b7189b7ea7d6d79d514b9e0de3edc966
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1928853
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65094}
parent 5cf61684
......@@ -19,7 +19,9 @@ namespace {
FrameStateFunctionInfo const* GetFunctionInfo(Node* checkpoint) {
DCHECK_EQ(IrOpcode::kCheckpoint, checkpoint->opcode());
Node* frame_state = NodeProperties::GetFrameStateInput(checkpoint);
return FrameStateInfoOf(frame_state->op()).function_info();
return frame_state->opcode() == IrOpcode::kFrameState
? FrameStateInfoOf(frame_state->op()).function_info()
: nullptr;
}
// The given checkpoint is redundant if it is effect-wise dominated by another
......@@ -35,6 +37,7 @@ FrameStateFunctionInfo const* GetFunctionInfo(Node* checkpoint) {
// exists. See regress-9945-*.js and v8:9945.
bool IsRedundantCheckpoint(Node* node) {
FrameStateFunctionInfo const* function_info = GetFunctionInfo(node);
if (function_info == nullptr) return false;
Node* effect = NodeProperties::GetEffectInput(node);
while (effect->op()->HasProperty(Operator::kNoWrite) &&
effect->op()->EffectInputCount() == 1) {
......
......@@ -90,9 +90,13 @@ Node* GraphTest::UndefinedConstant() {
Node* GraphTest::EmptyFrameState() {
Node* state_values =
graph()->NewNode(common()->StateValues(0, SparseInputMask::Dense()));
FrameStateFunctionInfo const* function_info =
common()->CreateFrameStateFunctionInfo(
FrameStateType::kInterpretedFunction, 0, 0,
Handle<SharedFunctionInfo>());
return graph()->NewNode(
common()->FrameState(BailoutId::None(), OutputFrameStateCombine::Ignore(),
nullptr),
function_info),
state_values, state_values, state_values, NumberConstant(0),
UndefinedConstant(), graph()->start());
}
......
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