[turbofan] Do not use the state value cache when building the tree
Since the liveness analysis's non-live value clearing rebuilds the state value trees, we don't need to be smart when creating state values in the initial graph building. This simplifies both the building and the iteration over the state values by the liveness analyzer. Review-Url: https://codereview.chromium.org/2495413003 Cr-Commit-Position: refs/heads/master@{#40996}
This commit is contained in:
parent
f71260b298
commit
4a660091ee
@ -841,13 +841,6 @@ void AstGraphBuilder::Environment::UpdateStateValues(Node** state_values,
|
||||
}
|
||||
|
||||
|
||||
void AstGraphBuilder::Environment::UpdateStateValuesWithCache(
|
||||
Node** state_values, int offset, int count) {
|
||||
Node** env_values = (count == 0) ? nullptr : &values()->at(offset);
|
||||
*state_values = builder_->state_values_cache_.GetNodeForValues(
|
||||
env_values, static_cast<size_t>(count));
|
||||
}
|
||||
|
||||
Node* AstGraphBuilder::Environment::Checkpoint(BailoutId ast_id,
|
||||
OutputFrameStateCombine combine,
|
||||
bool owner_has_exception) {
|
||||
@ -856,7 +849,7 @@ Node* AstGraphBuilder::Environment::Checkpoint(BailoutId ast_id,
|
||||
}
|
||||
|
||||
UpdateStateValues(¶meters_node_, 0, parameters_count());
|
||||
UpdateStateValuesWithCache(&locals_node_, parameters_count(), locals_count());
|
||||
UpdateStateValues(&locals_node_, parameters_count(), locals_count());
|
||||
UpdateStateValues(&stack_node_, parameters_count() + locals_count(),
|
||||
stack_height());
|
||||
|
||||
|
@ -602,7 +602,6 @@ class AstGraphBuilder::Environment : public ZoneObject {
|
||||
LivenessAnalyzerBlock* liveness_block);
|
||||
Environment* CopyAndShareLiveness();
|
||||
void UpdateStateValues(Node** state_values, int offset, int count);
|
||||
void UpdateStateValuesWithCache(Node** state_values, int offset, int count);
|
||||
Zone* zone() const { return builder_->local_zone(); }
|
||||
Graph* graph() const { return builder_->graph(); }
|
||||
AstGraphBuilder* builder() const { return builder_; }
|
||||
|
@ -82,7 +82,6 @@ class BytecodeGraphBuilder::Environment : public ZoneObject {
|
||||
|
||||
bool StateValuesRequireUpdate(Node** state_values, int offset, int count);
|
||||
void UpdateStateValues(Node** state_values, int offset, int count);
|
||||
void UpdateStateValuesWithCache(Node** state_values, int offset, int count);
|
||||
|
||||
int RegisterToValuesIndex(interpreter::Register the_register) const;
|
||||
|
||||
@ -453,19 +452,12 @@ void BytecodeGraphBuilder::Environment::UpdateStateValues(Node** state_values,
|
||||
}
|
||||
}
|
||||
|
||||
void BytecodeGraphBuilder::Environment::UpdateStateValuesWithCache(
|
||||
Node** state_values, int offset, int count) {
|
||||
Node** env_values = (count == 0) ? nullptr : &values()->at(offset);
|
||||
*state_values = builder_->state_values_cache_.GetNodeForValues(
|
||||
env_values, static_cast<size_t>(count));
|
||||
}
|
||||
|
||||
Node* BytecodeGraphBuilder::Environment::Checkpoint(
|
||||
BailoutId bailout_id, OutputFrameStateCombine combine,
|
||||
bool owner_has_exception) {
|
||||
UpdateStateValues(¶meters_state_values_, 0, parameter_count());
|
||||
UpdateStateValuesWithCache(®isters_state_values_, register_base(),
|
||||
register_count());
|
||||
UpdateStateValues(®isters_state_values_, register_base(),
|
||||
register_count());
|
||||
UpdateStateValues(&accumulator_state_values_, accumulator_base(), 1);
|
||||
|
||||
const Operator* op = common()->FrameState(
|
||||
|
@ -160,13 +160,20 @@ void NonLiveFrameStateSlotReplacer::ClearNonLiveFrameStateSlots(
|
||||
Node* NonLiveFrameStateSlotReplacer::ClearNonLiveStateValues(
|
||||
Node* values, BitVector* liveness) {
|
||||
DCHECK(inputs_buffer_.empty());
|
||||
for (StateValuesAccess::TypedNode node : StateValuesAccess(values)) {
|
||||
|
||||
int var = 0;
|
||||
for (Node* value_node : values->inputs()) {
|
||||
// Make sure this isn't a state value tree
|
||||
DCHECK(value_node->opcode() != IrOpcode::kStateValues);
|
||||
|
||||
// Index of the next variable is its furure index in the inputs buffer,
|
||||
// i.e., the buffer's size.
|
||||
int var = static_cast<int>(inputs_buffer_.size());
|
||||
bool live = liveness->Contains(var) || permanently_live_.Contains(var);
|
||||
inputs_buffer_.push_back(live ? node.node : replacement_node_);
|
||||
inputs_buffer_.push_back(live ? value_node : replacement_node_);
|
||||
|
||||
var++;
|
||||
}
|
||||
|
||||
Node* result = state_values_cache()->GetNodeForValues(
|
||||
inputs_buffer_.empty() ? nullptr : &(inputs_buffer_.front()),
|
||||
inputs_buffer_.size());
|
||||
|
Loading…
Reference in New Issue
Block a user