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 95 matching lines...) Loading... |
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 is_more_general_than(const Representation& other) const { | 113 bool is_more_general_than(const Representation& other) const { |
114 ASSERT(kind_ != kExternal); | 114 ASSERT(kind_ != kExternal); |
115 ASSERT(other.kind_ != kExternal); | 115 ASSERT(other.kind_ != kExternal); |
116 if (IsHeapObject()) return other.IsDouble(); | 116 if (IsHeapObject()) return other.IsDouble() || other.IsNone(); |
117 return kind_ > other.kind_; | 117 return kind_ > other.kind_; |
118 } | 118 } |
119 | 119 |
120 bool fits_into(const Representation& other) const { | 120 bool fits_into(const Representation& other) const { |
121 return other.is_more_general_than(*this) || other.Equals(*this); | 121 return other.is_more_general_than(*this) || other.Equals(*this); |
122 } | 122 } |
123 | 123 |
124 Representation generalize(Representation other) { | 124 Representation generalize(Representation other) { |
125 if (other.fits_into(*this)) return *this; | 125 if (other.fits_into(*this)) return *this; |
126 if (other.is_more_general_than(*this)) return other; | 126 if (other.is_more_general_than(*this)) return other; |
(...skipping 79 matching lines...) Loading... |
206 | 206 |
207 PropertyAttributes attributes() const { | 207 PropertyAttributes attributes() const { |
208 return AttributesField::decode(value_); | 208 return AttributesField::decode(value_); |
209 } | 209 } |
210 | 210 |
211 int dictionary_index() { | 211 int dictionary_index() { |
212 return DictionaryStorageField::decode(value_); | 212 return DictionaryStorageField::decode(value_); |
213 } | 213 } |
214 | 214 |
215 Representation representation() { | 215 Representation representation() { |
| 216 ASSERT(type() != NORMAL); |
216 return DecodeRepresentation(RepresentationField::decode(value_)); | 217 return DecodeRepresentation(RepresentationField::decode(value_)); |
217 } | 218 } |
218 | 219 |
219 int field_index() { | 220 int field_index() { |
220 return FieldIndexField::decode(value_); | 221 return FieldIndexField::decode(value_); |
221 } | 222 } |
222 | 223 |
223 inline PropertyDetails AsDeleted(); | 224 inline PropertyDetails AsDeleted(); |
224 | 225 |
225 static bool IsValidIndex(int index) { | 226 static bool IsValidIndex(int index) { |
(...skipping 32 matching lines...) Loading... |
258 PropertyDetails(int value, PropertyAttributes attributes) { | 259 PropertyDetails(int value, PropertyAttributes attributes) { |
259 value_ = AttributesField::update(value, attributes); | 260 value_ = AttributesField::update(value, attributes); |
260 } | 261 } |
261 | 262 |
262 uint32_t value_; | 263 uint32_t value_; |
263 }; | 264 }; |
264 | 265 |
265 } } // namespace v8::internal | 266 } } // namespace v8::internal |
266 | 267 |
267 #endif // V8_PROPERTY_DETAILS_H_ | 268 #endif // V8_PROPERTY_DETAILS_H_ |
OLD | NEW |