5#ifndef V8_COMPILER_CSA_LOAD_ELIMINATION_H_
6#define V8_COMPILER_CSA_LOAD_ELIMINATION_H_
21class CommonOperatorBuilder;
32 node_states_(
jsgraph->graph()->NodeCount(), zone),
39 const
char* reducer_name()
const override {
return "CsaLoadElimination"; }
47 : value(value), representation(representation) {}
50 return value == other.value && representation == other.representation;
55 bool IsEmpty()
const {
return value ==
nullptr; }
66 fresh_entries_(zone,
InnerMap(zone)),
67 constant_entries_(zone,
InnerMap(zone)),
68 arbitrary_entries_(zone,
InnerMap(zone)),
69 fresh_unknown_entries_(zone,
InnerMap(zone)),
70 constant_unknown_entries_(zone,
InnerMap(zone)),
71 arbitrary_unknown_entries_(zone,
InnerMap(zone)) {}
74 return fresh_entries_ == that->fresh_entries_ &&
75 constant_entries_ == that->constant_entries_ &&
76 arbitrary_entries_ == that->arbitrary_entries_ &&
77 fresh_unknown_entries_ == that->fresh_unknown_entries_ &&
78 constant_unknown_entries_ == that->constant_unknown_entries_ &&
79 arbitrary_unknown_entries_ == that->arbitrary_unknown_entries_;
81 void IntersectWith(
HalfState const* that);
91 template <
typename OuterKey>
99 template <
typename OuterKey>
102 InnerMap map_copy(map.Get(outer_key));
103 map_copy.
Set(inner_key, info);
104 map.Set(outer_key, map_copy);
108 static void KillOffset(ConstantOffsetInfos& infos, uint32_t
offset,
110 void KillOffsetInFresh(
Node*
object, uint32_t
offset,
112 template <
typename OuterKey>
113 static void IntersectWith(OuterMap<OuterKey>& to,
114 const OuterMap<OuterKey>& from);
115 static void Print(
const ConstantOffsetInfos& infos);
116 static void Print(
const UnknownOffsetInfos& infos);
134 : mutable_state(zone), immutable_state(zone) {}
136 : mutable_state(mutable_state), immutable_state(immutable_state) {}
139 return this->immutable_state.Equals(&that->immutable_state) &&
140 this->mutable_state.Equals(&that->mutable_state);
143 mutable_state.IntersectWith(&that->mutable_state);
144 immutable_state.IntersectWith(&that->immutable_state);
ConstantOffsetInfos arbitrary_entries_
UnknownOffsetInfos fresh_unknown_entries_
ConstantOffsetInfos fresh_entries_
ConstantOffsetInfos constant_entries_
static void Update(OuterMap< OuterKey > &map, OuterKey outer_key, Node *inner_key, FieldInfo info)
UnknownOffsetInfos arbitrary_unknown_entries_
bool Equals(HalfState const *that) const
UnknownOffsetInfos constant_unknown_entries_
AbstractState const * empty_state() const
~CsaLoadElimination() final=default
JSGraph * jsgraph() const
NodeAuxData< AbstractState const * > node_states_
AbstractState const empty_state_
CsaLoadElimination(Editor *editor, JSGraph *jsgraph, Zone *zone)
void Set(Key key, Value value)
#define NON_EXPORTED_BASE(code)
#define V8_EXPORT_PRIVATE
AbstractState(Zone *zone)
AbstractState(HalfState mutable_state, HalfState immutable_state)
bool Equals(AbstractState const *that) const
HalfState immutable_state
void IntersectWith(AbstractState const *that)
bool operator==(const FieldInfo &other) const
bool operator!=(const FieldInfo &other) const
FieldInfo(Node *value, MachineRepresentation representation)