diff options
author | Myles Borins <mylesborins@google.com> | 2019-09-24 11:56:38 -0400 |
---|---|---|
committer | Myles Borins <myles.borins@gmail.com> | 2019-10-07 03:19:23 -0400 |
commit | f7f6c928c1c9c136b7926f892b8a2fda11d8b4b2 (patch) | |
tree | f5edbccb3ffda2573d70a6e291e7157f290e0ae0 /deps/v8/src/compiler/load-elimination.h | |
parent | ffd22e81983056d09c064c59343a0e488236272d (diff) | |
download | node-new-f7f6c928c1c9c136b7926f892b8a2fda11d8b4b2.tar.gz |
deps: update V8 to 7.8.279.9
PR-URL: https://github.com/nodejs/node/pull/29694
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Diffstat (limited to 'deps/v8/src/compiler/load-elimination.h')
-rw-r--r-- | deps/v8/src/compiler/load-elimination.h | 75 |
1 files changed, 58 insertions, 17 deletions
diff --git a/deps/v8/src/compiler/load-elimination.h b/deps/v8/src/compiler/load-elimination.h index 4ad1fa64a2..b97fd7b883 100644 --- a/deps/v8/src/compiler/load-elimination.h +++ b/deps/v8/src/compiler/load-elimination.h @@ -9,6 +9,7 @@ #include "src/codegen/machine-type.h" #include "src/common/globals.h" #include "src/compiler/graph-reducer.h" +#include "src/compiler/simplified-operator.h" #include "src/handles/maybe-handles.h" #include "src/zone/zone-handle-set.h" @@ -100,20 +101,25 @@ class V8_EXPORT_PRIVATE LoadElimination final struct FieldInfo { FieldInfo() = default; - FieldInfo(Node* value, MachineRepresentation representation) - : value(value), name(), representation(representation) {} - FieldInfo(Node* value, MaybeHandle<Name> name, - MachineRepresentation representation) - : value(value), name(name), representation(representation) {} + FieldInfo(Node* value, MachineRepresentation representation, + MaybeHandle<Name> name = {}, + ConstFieldInfo const_field_info = ConstFieldInfo::None()) + : value(value), + representation(representation), + name(name), + const_field_info(const_field_info) {} bool operator==(const FieldInfo& other) const { - return value == other.value && name.address() == other.name.address() && - representation == other.representation; + return value == other.value && representation == other.representation && + name.address() == other.name.address() && + const_field_info == other.const_field_info; } + bool operator!=(const FieldInfo& other) const { return !(*this == other); } Node* value = nullptr; - MaybeHandle<Name> name; MachineRepresentation representation = MachineRepresentation::kNone; + MaybeHandle<Name> name; + ConstFieldInfo const_field_info; }; // Abstract state to approximate the current state of a certain field along @@ -134,6 +140,7 @@ class V8_EXPORT_PRIVATE LoadElimination final return that; } FieldInfo const* Lookup(Node* object) const; + AbstractField const* KillConst(Node* object, Zone* zone) const; AbstractField const* Kill(const AliasStateInfo& alias_info, MaybeHandle<Name> name, Zone* zone) const; bool Equals(AbstractField const* that) const { @@ -186,6 +193,39 @@ class V8_EXPORT_PRIVATE LoadElimination final ZoneMap<Node*, ZoneHandleSet<Map>> info_for_node_; }; + class IndexRange { + public: + IndexRange(int begin, int size) : begin_(begin), end_(begin + size) { + DCHECK_LE(0, begin); + DCHECK_LE(1, size); + if (end_ > static_cast<int>(kMaxTrackedFields)) { + *this = IndexRange::Invalid(); + } + } + static IndexRange Invalid() { return IndexRange(); } + + bool operator==(const IndexRange& other) { + return begin_ == other.begin_ && end_ == other.end_; + } + bool operator!=(const IndexRange& other) { return !(*this == other); } + + struct Iterator { + int i; + int operator*() { return i; } + void operator++() { ++i; } + bool operator!=(Iterator other) { return i != other.i; } + }; + + Iterator begin() { return {begin_}; } + Iterator end() { return {end_}; } + + private: + int begin_; + int end_; + + IndexRange() : begin_(-1), end_(-1) {} + }; + class AbstractState final : public ZoneObject { public: AbstractState() {} @@ -200,19 +240,20 @@ class V8_EXPORT_PRIVATE LoadElimination final Zone* zone) const; bool LookupMaps(Node* object, ZoneHandleSet<Map>* object_maps) const; - AbstractState const* AddField(Node* object, size_t index, FieldInfo info, - PropertyConstness constness, - Zone* zone) const; + AbstractState const* AddField(Node* object, IndexRange index, + FieldInfo info, Zone* zone) const; + AbstractState const* KillConstField(Node* object, IndexRange index_range, + Zone* zone) const; AbstractState const* KillField(const AliasStateInfo& alias_info, - size_t index, MaybeHandle<Name> name, + IndexRange index, MaybeHandle<Name> name, Zone* zone) const; - AbstractState const* KillField(Node* object, size_t index, + AbstractState const* KillField(Node* object, IndexRange index, MaybeHandle<Name> name, Zone* zone) const; AbstractState const* KillFields(Node* object, MaybeHandle<Name> name, Zone* zone) const; AbstractState const* KillAll(Zone* zone) const; - FieldInfo const* LookupField(Node* object, size_t index, - PropertyConstness constness) const; + FieldInfo const* LookupField(Node* object, IndexRange index, + ConstFieldInfo const_field_info) const; AbstractState const* AddElement(Node* object, Node* index, Node* value, MachineRepresentation representation, @@ -280,8 +321,8 @@ class V8_EXPORT_PRIVATE LoadElimination final AbstractState const* UpdateStateForPhi(AbstractState const* state, Node* effect_phi, Node* phi); - static int FieldIndexOf(int offset); - static int FieldIndexOf(FieldAccess const& access); + static IndexRange FieldIndexOf(int offset, int representation_size); + static IndexRange FieldIndexOf(FieldAccess const& access); static AbstractState const* empty_state() { return AbstractState::empty_state(); |