Index: src/compiler/access-info.h |
diff --git a/src/compiler/access-info.h b/src/compiler/access-info.h |
index 1556e0ee3838482ddcca8f07d4deaeefa3df7a9f..bca7d5d83757432296d7f0b6562a7dd180fae125 100644 |
--- a/src/compiler/access-info.h |
+++ b/src/compiler/access-info.h |
@@ -19,7 +19,6 @@ class CompilationDependencies; |
class Factory; |
class TypeCache; |
- |
namespace compiler { |
// Whether we are loading a property or storing to a property. |
@@ -27,50 +26,51 @@ enum class AccessMode { kLoad, kStore }; |
std::ostream& operator<<(std::ostream&, AccessMode); |
+typedef std::vector<Handle<Map>> MapList; |
// Mapping of transition source to transition target. |
typedef std::vector<std::pair<Handle<Map>, Handle<Map>>> MapTransitionList; |
- |
// This class encapsulates all information required to access a certain element. |
class ElementAccessInfo final { |
public: |
ElementAccessInfo(); |
- ElementAccessInfo(Type* receiver_type, ElementsKind elements_kind, |
+ ElementAccessInfo(MapList const& receiver_maps, ElementsKind elements_kind, |
MaybeHandle<JSObject> holder); |
MaybeHandle<JSObject> holder() const { return holder_; } |
ElementsKind elements_kind() const { return elements_kind_; } |
- Type* receiver_type() const { return receiver_type_; } |
+ MapList const& receiver_maps() const { return receiver_maps_; } |
MapTransitionList& transitions() { return transitions_; } |
MapTransitionList const& transitions() const { return transitions_; } |
private: |
ElementsKind elements_kind_; |
MaybeHandle<JSObject> holder_; |
- Type* receiver_type_; |
+ MapList receiver_maps_; |
MapTransitionList transitions_; |
}; |
- |
// This class encapsulates all information required to access a certain |
// object property, either on the object itself or on the prototype chain. |
class PropertyAccessInfo final { |
public: |
enum Kind { kInvalid, kNotFound, kDataConstant, kDataField }; |
- static PropertyAccessInfo NotFound(Type* receiver_type, |
+ static PropertyAccessInfo NotFound(MapList const& receiver_maps, |
MaybeHandle<JSObject> holder); |
- static PropertyAccessInfo DataConstant(Type* receiver_type, |
+ static PropertyAccessInfo DataConstant(MapList const& receiver_maps, |
Handle<Object> constant, |
MaybeHandle<JSObject> holder); |
static PropertyAccessInfo DataField( |
- Type* receiver_type, FieldIndex field_index, Type* field_type, |
+ MapList const& receiver_maps, FieldIndex field_index, Type* field_type, |
MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(), |
MaybeHandle<Map> transition_map = MaybeHandle<Map>()); |
PropertyAccessInfo(); |
+ bool Merge(PropertyAccessInfo const* that) WARN_UNUSED_RESULT; |
+ |
bool IsNotFound() const { return kind() == kNotFound; } |
bool IsDataConstant() const { return kind() == kDataConstant; } |
bool IsDataField() const { return kind() == kDataField; } |
@@ -83,18 +83,19 @@ class PropertyAccessInfo final { |
Handle<Object> constant() const { return constant_; } |
FieldIndex field_index() const { return field_index_; } |
Type* field_type() const { return field_type_; } |
- Type* receiver_type() const { return receiver_type_; } |
+ MapList const& receiver_maps() const { return receiver_maps_; } |
private: |
- PropertyAccessInfo(MaybeHandle<JSObject> holder, Type* receiver_type); |
+ PropertyAccessInfo(MaybeHandle<JSObject> holder, |
+ MapList const& receiver_maps); |
PropertyAccessInfo(MaybeHandle<JSObject> holder, Handle<Object> constant, |
- Type* receiver_type); |
+ MapList const& receiver_maps); |
PropertyAccessInfo(MaybeHandle<JSObject> holder, |
MaybeHandle<Map> transition_map, FieldIndex field_index, |
- Type* field_type, Type* receiver_type); |
+ Type* field_type, MapList const& receiver_maps); |
Kind kind_; |
- Type* receiver_type_; |
+ MapList receiver_maps_; |
Handle<Object> constant_; |
MaybeHandle<Map> transition_map_; |
MaybeHandle<JSObject> holder_; |