| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_COMPILER_ACCESS_INFO_H_ | 5 #ifndef V8_COMPILER_ACCESS_INFO_H_ |
| 6 #define V8_COMPILER_ACCESS_INFO_H_ | 6 #define V8_COMPILER_ACCESS_INFO_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/field-index.h" | 10 #include "src/field-index.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 | 22 |
| 23 namespace compiler { | 23 namespace compiler { |
| 24 | 24 |
| 25 // Whether we are loading a property or storing to a property. | 25 // Whether we are loading a property or storing to a property. |
| 26 enum class AccessMode { kLoad, kStore }; | 26 enum class AccessMode { kLoad, kStore }; |
| 27 | 27 |
| 28 std::ostream& operator<<(std::ostream&, AccessMode); | 28 std::ostream& operator<<(std::ostream&, AccessMode); |
| 29 | 29 |
| 30 | 30 |
| 31 // Mapping of transition source to transition target. |
| 32 typedef std::vector<std::pair<Handle<Map>, Handle<Map>>> MapTransitionList; |
| 33 |
| 34 |
| 31 // This class encapsulates all information required to access a certain element. | 35 // This class encapsulates all information required to access a certain element. |
| 32 class ElementAccessInfo final { | 36 class ElementAccessInfo final { |
| 33 public: | 37 public: |
| 34 ElementAccessInfo(); | 38 ElementAccessInfo(); |
| 35 ElementAccessInfo(Type* receiver_type, ElementsKind elements_kind, | 39 ElementAccessInfo(Type* receiver_type, ElementsKind elements_kind, |
| 36 MaybeHandle<JSObject> holder) | 40 MaybeHandle<JSObject> holder); |
| 37 : elements_kind_(elements_kind), | |
| 38 holder_(holder), | |
| 39 receiver_type_(receiver_type) {} | |
| 40 | 41 |
| 41 MaybeHandle<JSObject> holder() const { return holder_; } | 42 MaybeHandle<JSObject> holder() const { return holder_; } |
| 42 ElementsKind elements_kind() const { return elements_kind_; } | 43 ElementsKind elements_kind() const { return elements_kind_; } |
| 43 Type* receiver_type() const { return receiver_type_; } | 44 Type* receiver_type() const { return receiver_type_; } |
| 45 MapTransitionList& transitions() { return transitions_; } |
| 46 MapTransitionList const& transitions() const { return transitions_; } |
| 44 | 47 |
| 45 private: | 48 private: |
| 46 ElementsKind elements_kind_; | 49 ElementsKind elements_kind_; |
| 47 MaybeHandle<JSObject> holder_; | 50 MaybeHandle<JSObject> holder_; |
| 48 Type* receiver_type_; | 51 Type* receiver_type_; |
| 52 MapTransitionList transitions_; |
| 49 }; | 53 }; |
| 50 | 54 |
| 51 | 55 |
| 52 // This class encapsulates all information required to access a certain | 56 // This class encapsulates all information required to access a certain |
| 53 // object property, either on the object itself or on the prototype chain. | 57 // object property, either on the object itself or on the prototype chain. |
| 54 class PropertyAccessInfo final { | 58 class PropertyAccessInfo final { |
| 55 public: | 59 public: |
| 56 enum Kind { kInvalid, kNotFound, kDataConstant, kDataField }; | 60 enum Kind { kInvalid, kNotFound, kDataConstant, kDataField }; |
| 57 | 61 |
| 58 static PropertyAccessInfo NotFound(Type* receiver_type, | 62 static PropertyAccessInfo NotFound(Type* receiver_type, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 Zone* const zone_; | 141 Zone* const zone_; |
| 138 | 142 |
| 139 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory); | 143 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory); |
| 140 }; | 144 }; |
| 141 | 145 |
| 142 } // namespace compiler | 146 } // namespace compiler |
| 143 } // namespace internal | 147 } // namespace internal |
| 144 } // namespace v8 | 148 } // namespace v8 |
| 145 | 149 |
| 146 #endif // V8_COMPILER_ACCESS_INFO_H_ | 150 #endif // V8_COMPILER_ACCESS_INFO_H_ |
| OLD | NEW |