Commit 3c8edd31 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[interpreter] Workaround for unused frame states.

This is a temporary workaround for bytecodes which are not guaranteed
to actually use the frame states being created for them. One example
for this are runtime calls to intrinsics, or to runtime functions for
which the frame state count is zero in Linkage::FrameStateInputCount.

This will eventually be reworked into a more generic mechanism that
attaches frame states in the BytecodeGraphBuilder::VisitBytecodes
iteration method itself, instead of in the individual visitors.

R=jarin@chromium.org

Review URL: https://codereview.chromium.org/1676293002

Cr-Commit-Position: refs/heads/master@{#33836}
parent dca275ba
...@@ -101,6 +101,7 @@ class BytecodeGraphBuilder::FrameStateBeforeAndAfter { ...@@ -101,6 +101,7 @@ class BytecodeGraphBuilder::FrameStateBeforeAndAfter {
: builder_(builder), : builder_(builder),
id_after_(BailoutId::None()), id_after_(BailoutId::None()),
added_to_node_(false), added_to_node_(false),
frame_states_unused_(false),
output_poke_offset_(0), output_poke_offset_(0),
output_poke_count_(0) { output_poke_count_(0) {
BailoutId id_before(builder->bytecode_iterator().current_offset()); BailoutId id_before(builder->bytecode_iterator().current_offset());
...@@ -112,7 +113,8 @@ class BytecodeGraphBuilder::FrameStateBeforeAndAfter { ...@@ -112,7 +113,8 @@ class BytecodeGraphBuilder::FrameStateBeforeAndAfter {
~FrameStateBeforeAndAfter() { ~FrameStateBeforeAndAfter() {
DCHECK(added_to_node_); DCHECK(added_to_node_);
DCHECK(builder_->environment()->StateValuesAreUpToDate(output_poke_offset_, DCHECK(frame_states_unused_ ||
builder_->environment()->StateValuesAreUpToDate(output_poke_offset_,
output_poke_count_)); output_poke_count_));
} }
...@@ -143,6 +145,7 @@ class BytecodeGraphBuilder::FrameStateBeforeAndAfter { ...@@ -143,6 +145,7 @@ class BytecodeGraphBuilder::FrameStateBeforeAndAfter {
output_poke_offset_ = static_cast<int>(combine.GetOffsetToPokeAt()); output_poke_offset_ = static_cast<int>(combine.GetOffsetToPokeAt());
output_poke_count_ = node->op()->ValueOutputCount(); output_poke_count_ = node->op()->ValueOutputCount();
} }
frame_states_unused_ = count == 0;
added_to_node_ = true; added_to_node_ = true;
} }
...@@ -151,6 +154,7 @@ class BytecodeGraphBuilder::FrameStateBeforeAndAfter { ...@@ -151,6 +154,7 @@ class BytecodeGraphBuilder::FrameStateBeforeAndAfter {
BailoutId id_after_; BailoutId id_after_;
bool added_to_node_; bool added_to_node_;
bool frame_states_unused_;
int output_poke_offset_; int output_poke_offset_;
int output_poke_count_; int output_poke_count_;
}; };
......
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