aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/load-elimination.cc
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/load-elimination.cc')
-rw-r--r--deps/v8/src/compiler/load-elimination.cc117
1 files changed, 2 insertions, 115 deletions
diff --git a/deps/v8/src/compiler/load-elimination.cc b/deps/v8/src/compiler/load-elimination.cc
index 6d6cfafdbf..46966b552f 100644
--- a/deps/v8/src/compiler/load-elimination.cc
+++ b/deps/v8/src/compiler/load-elimination.cc
@@ -99,8 +99,6 @@ Reduction LoadElimination::Reduce(Node* node) {
}
}
switch (node->opcode()) {
- case IrOpcode::kArrayBufferWasNeutered:
- return ReduceArrayBufferWasNeutered(node);
case IrOpcode::kMapGuard:
return ReduceMapGuard(node);
case IrOpcode::kCheckMaps:
@@ -139,74 +137,6 @@ Reduction LoadElimination::Reduce(Node* node) {
namespace {
-bool LoadEliminationIsCompatibleCheck(Node const* a, Node const* b) {
- if (a->op() != b->op()) return false;
- for (int i = a->op()->ValueInputCount(); --i >= 0;) {
- if (!MustAlias(a->InputAt(i), b->InputAt(i))) return false;
- }
- return true;
-}
-
-} // namespace
-
-Node* LoadElimination::AbstractChecks::Lookup(Node* node) const {
- for (Node* const check : nodes_) {
- if (check && !check->IsDead() &&
- LoadEliminationIsCompatibleCheck(check, node)) {
- return check;
- }
- }
- return nullptr;
-}
-
-bool LoadElimination::AbstractChecks::Equals(AbstractChecks const* that) const {
- if (this == that) return true;
- for (size_t i = 0; i < arraysize(nodes_); ++i) {
- if (Node* this_node = this->nodes_[i]) {
- for (size_t j = 0;; ++j) {
- if (j == arraysize(nodes_)) return false;
- if (that->nodes_[j] == this_node) break;
- }
- }
- }
- for (size_t i = 0; i < arraysize(nodes_); ++i) {
- if (Node* that_node = that->nodes_[i]) {
- for (size_t j = 0;; ++j) {
- if (j == arraysize(nodes_)) return false;
- if (this->nodes_[j] == that_node) break;
- }
- }
- }
- return true;
-}
-
-LoadElimination::AbstractChecks const* LoadElimination::AbstractChecks::Merge(
- AbstractChecks const* that, Zone* zone) const {
- if (this->Equals(that)) return this;
- AbstractChecks* copy = new (zone) AbstractChecks(zone);
- for (Node* const this_node : this->nodes_) {
- if (this_node == nullptr) continue;
- for (Node* const that_node : that->nodes_) {
- if (this_node == that_node) {
- copy->nodes_[copy->next_index_++] = this_node;
- break;
- }
- }
- }
- copy->next_index_ %= arraysize(nodes_);
- return copy;
-}
-
-void LoadElimination::AbstractChecks::Print() const {
- for (Node* const node : nodes_) {
- if (node != nullptr) {
- PrintF(" #%d:%s\n", node->id(), node->op()->mnemonic());
- }
- }
-}
-
-namespace {
-
bool IsCompatible(MachineRepresentation r1, MachineRepresentation r2) {
if (r1 == r2) return true;
return IsAnyTagged(r1) && IsAnyTagged(r2);
@@ -446,13 +376,6 @@ void LoadElimination::AbstractMaps::Print() const {
}
bool LoadElimination::AbstractState::Equals(AbstractState const* that) const {
- if (this->checks_) {
- if (!that->checks_ || !that->checks_->Equals(this->checks_)) {
- return false;
- }
- } else if (that->checks_) {
- return false;
- }
if (this->elements_) {
if (!that->elements_ || !that->elements_->Equals(this->elements_)) {
return false;
@@ -481,12 +404,6 @@ bool LoadElimination::AbstractState::Equals(AbstractState const* that) const {
void LoadElimination::AbstractState::Merge(AbstractState const* that,
Zone* zone) {
- // Merge the information we have about the checks.
- if (this->checks_) {
- this->checks_ =
- that->checks_ ? that->checks_->Merge(this->checks_, zone) : nullptr;
- }
-
// Merge the information we have about the elements.
if (this->elements_) {
this->elements_ = that->elements_
@@ -511,21 +428,6 @@ void LoadElimination::AbstractState::Merge(AbstractState const* that,
}
}
-Node* LoadElimination::AbstractState::LookupCheck(Node* node) const {
- return this->checks_ ? this->checks_->Lookup(node) : nullptr;
-}
-
-LoadElimination::AbstractState const* LoadElimination::AbstractState::AddCheck(
- Node* node, Zone* zone) const {
- AbstractState* that = new (zone) AbstractState(*this);
- if (that->checks_) {
- that->checks_ = that->checks_->Extend(node, zone);
- } else {
- that->checks_ = new (zone) AbstractChecks(node, zone);
- }
- return that;
-}
-
bool LoadElimination::AbstractState::LookupMaps(
Node* object, ZoneHandleSet<Map>* object_map) const {
return this->maps_ && this->maps_->Lookup(object, object_map);
@@ -689,10 +591,6 @@ bool LoadElimination::AliasStateInfo::MayAlias(Node* other) const {
}
void LoadElimination::AbstractState::Print() const {
- if (checks_) {
- PrintF(" checks:\n");
- checks_->Print();
- }
if (maps_) {
PrintF(" maps:\n");
maps_->Print();
@@ -723,18 +621,6 @@ void LoadElimination::AbstractStateForEffectNodes::Set(
info_for_node_[id] = state;
}
-Reduction LoadElimination::ReduceArrayBufferWasNeutered(Node* node) {
- Node* const effect = NodeProperties::GetEffectInput(node);
- AbstractState const* state = node_states_.Get(effect);
- if (state == nullptr) return NoChange();
- if (Node* const check = state->LookupCheck(node)) {
- ReplaceWithValue(node, check, effect);
- return Replace(check);
- }
- state = state->AddCheck(node, zone());
- return UpdateState(node, state);
-}
-
Reduction LoadElimination::ReduceMapGuard(Node* node) {
ZoneHandleSet<Map> const maps = MapGuardMapsOf(node->op()).maps();
Node* const object = NodeProperties::GetValueInput(node, 0);
@@ -962,8 +848,9 @@ Reduction LoadElimination::ReduceStoreField(Node* node) {
Type const new_value_type = NodeProperties::GetType(new_value);
if (new_value_type.IsHeapConstant()) {
// Record the new {object} map information.
+ AllowHandleDereference handle_dereference;
ZoneHandleSet<Map> object_maps(
- bit_cast<Handle<Map>>(new_value_type.AsHeapConstant()->Value()));
+ Handle<Map>::cast(new_value_type.AsHeapConstant()->Value()));
state = state->SetMaps(object, object_maps, zone());
}
} else {