Commit 98585402 authored by Michael Hablich's avatar Michael Hablich Committed by Commit Bot

Revert "[turbofan] Instance type tracking in load elimination."

This reverts commit ddd15cda.

Reason for revert: Blocks roll: https://chromium-review.googlesource.com/c/chromium/src/+/732565

Original change's description:
> [turbofan] Instance type tracking in load elimination.
> 
> This tracks instance type in load elimination, so that it can be used
> to prune control flow with unreachable states.
> 
> (This is a cut down version of https://chromium-review.googlesource.com/c/v8/v8/+/727761),
> the regression should be addressed by the map invalidation fix from
> https://chromium-review.googlesource.com/c/v8/v8/+/730705.)
> 
> Bug: v8:6396
> Change-Id: I3acab16ebbc0f1f16c7900a8d307deb84e1cb618
> Reviewed-on: https://chromium-review.googlesource.com/732307
> Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#48812}

TBR=jarin@chromium.org,bmeurer@chromium.org

Change-Id: I1a3fe1d62c05889ea83e2f6cfb31a6ccbe65241d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:6396
Reviewed-on: https://chromium-review.googlesource.com/732898Reviewed-by: 's avatarMichael Hablich <hablich@chromium.org>
Commit-Queue: Michael Hablich <hablich@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48833}
parent 266e803e
This diff is collapsed.
......@@ -24,7 +24,6 @@ class CommonOperatorBuilder;
struct FieldAccess;
class Graph;
class JSGraph;
class MapsParameterInfo;
class V8_EXPORT_PRIVATE LoadElimination final
: public NON_EXPORTED_BASE(AdvancedReducer) {
......@@ -197,64 +196,27 @@ class V8_EXPORT_PRIVATE LoadElimination final
static MapSetComparisonResult CompareMapSets(ZoneHandleSet<Map> const& lhs,
ZoneHandleSet<Map> const& rhs);
class AbstractMapInfo {
public:
enum InfoValid { kMapsValid = 1 << 0, kInstanceTypeValid = 1 << 1 };
typedef base::Flags<InfoValid, uint8_t> Validity;
AbstractMapInfo();
explicit AbstractMapInfo(ZoneHandleSet<Map> const& maps);
explicit AbstractMapInfo(InstanceType instance_type);
explicit AbstractMapInfo(MapsParameterInfo const& info);
bool operator==(AbstractMapInfo const& other) const;
bool operator!=(AbstractMapInfo const& other) const;
ZoneHandleSet<Map> const& maps() const;
InstanceType instance_type() const;
bool maps_valid() const { return info_validity_ & kMapsValid; }
bool instance_type_valid() const {
return info_validity_ & kInstanceTypeValid;
}
bool empty() const { return info_validity_ == 0; }
AbstractMapInfo Merge(AbstractMapInfo const& other) const;
MapSetComparisonResult Compare(AbstractMapInfo const& other) const;
private:
AbstractMapInfo(ZoneHandleSet<Map> const& maps, InstanceType instance_type,
Validity validity);
ZoneHandleSet<Map> maps_;
InstanceType instance_type_;
Validity info_validity_;
};
// Abstract state to approximate the current map of an object along the
// effect paths through the graph.
class AbstractMaps final : public ZoneObject {
public:
explicit AbstractMaps(Zone* zone);
AbstractMaps(Node* object, AbstractMapInfo const& map_info, Zone* zone);
AbstractMaps(Node* object, ZoneHandleSet<Map> maps, Zone* zone);
AbstractMaps const* Extend(Node* object, AbstractMapInfo const& maps,
AbstractMaps const* Extend(Node* object, ZoneHandleSet<Map> maps,
Zone* zone) const;
bool Lookup(Node* object, ZoneHandleSet<Map>* object_maps) const;
bool Lookup(Node* object, AbstractMapInfo* maps_info) const;
AbstractMaps const* Kill(const AliasStateInfo& alias_info,
Zone* zone) const;
bool Equals(AbstractMaps const* that) const {
return this == that || this->info_for_node_ == that->info_for_node_;
}
AbstractMaps const* Merge(AbstractMaps const* that, Zone* zone) const;
AbstractMaps const* KillMutableState(Zone* zone) const;
void Print() const;
private:
ZoneMap<Node*, AbstractMapInfo> info_for_node_;
ZoneMap<Node*, ZoneHandleSet<Map>> info_for_node_;
};
class AbstractState final : public ZoneObject {
......@@ -264,13 +226,10 @@ class V8_EXPORT_PRIVATE LoadElimination final
AbstractState const* SetMaps(Node* object, ZoneHandleSet<Map> maps,
Zone* zone) const;
AbstractState const* SetMaps(Node* object, AbstractMapInfo const& map_info,
Zone* zone) const;
AbstractState const* KillMaps(Node* object, Zone* zone) const;
AbstractState const* KillMaps(const AliasStateInfo& alias_info,
Zone* zone) const;
bool LookupMaps(Node* object, ZoneHandleSet<Map>* object_maps) const;
bool LookupMaps(Node* object, AbstractMapInfo* map_info) const;
AbstractState const* AddField(Node* object, size_t index, Node* value,
MaybeHandle<Name> name, Zone* zone) const;
......@@ -294,8 +253,6 @@ class V8_EXPORT_PRIVATE LoadElimination final
AbstractState const* AddCheck(Node* node, Zone* zone) const;
Node* LookupCheck(Node* node) const;
AbstractState const* KillMutableState(Zone* zone) const;
bool is_unreachable() const { return is_unreachable_; }
void Print() const;
......
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