OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 bool Equals(const Representation& other) const { | 104 bool Equals(const Representation& other) const { |
105 return kind_ == other.kind_; | 105 return kind_ == other.kind_; |
106 } | 106 } |
107 | 107 |
108 bool IsCompatibleForLoad(const Representation& other) const { | 108 bool IsCompatibleForLoad(const Representation& other) const { |
109 return (IsDouble() && other.IsDouble()) || | 109 return (IsDouble() && other.IsDouble()) || |
110 (!IsDouble() && !other.IsDouble()); | 110 (!IsDouble() && !other.IsDouble()); |
111 } | 111 } |
112 | 112 |
| 113 bool IsCompatibleForStore(const Representation& other) const { |
| 114 return Equals(other); |
| 115 } |
| 116 |
113 bool is_more_general_than(const Representation& other) const { | 117 bool is_more_general_than(const Representation& other) const { |
114 ASSERT(kind_ != kExternal); | 118 ASSERT(kind_ != kExternal); |
115 ASSERT(other.kind_ != kExternal); | 119 ASSERT(other.kind_ != kExternal); |
116 if (IsHeapObject()) return other.IsDouble() || other.IsNone(); | 120 if (IsHeapObject()) return other.IsDouble() || other.IsNone(); |
117 return kind_ > other.kind_; | 121 return kind_ > other.kind_; |
118 } | 122 } |
119 | 123 |
120 bool fits_into(const Representation& other) const { | 124 bool fits_into(const Representation& other) const { |
121 return other.is_more_general_than(*this) || other.Equals(*this); | 125 return other.is_more_general_than(*this) || other.Equals(*this); |
122 } | 126 } |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 PropertyDetails(int value, PropertyAttributes attributes) { | 263 PropertyDetails(int value, PropertyAttributes attributes) { |
260 value_ = AttributesField::update(value, attributes); | 264 value_ = AttributesField::update(value, attributes); |
261 } | 265 } |
262 | 266 |
263 uint32_t value_; | 267 uint32_t value_; |
264 }; | 268 }; |
265 | 269 |
266 } } // namespace v8::internal | 270 } } // namespace v8::internal |
267 | 271 |
268 #endif // V8_PROPERTY_DETAILS_H_ | 272 #endif // V8_PROPERTY_DETAILS_H_ |
OLD | NEW |