| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_PROPERTY_DETAILS_H_ | 5 #ifndef V8_PROPERTY_DETAILS_H_ |
| 6 #define V8_PROPERTY_DETAILS_H_ | 6 #define V8_PROPERTY_DETAILS_H_ |
| 7 | 7 |
| 8 #include "include/v8.h" | 8 #include "include/v8.h" |
| 9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
| 10 #include "src/utils.h" | 10 #include "src/utils.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 260 } |
| 261 | 261 |
| 262 Representation representation() const { | 262 Representation representation() const { |
| 263 return DecodeRepresentation(RepresentationField::decode(value_)); | 263 return DecodeRepresentation(RepresentationField::decode(value_)); |
| 264 } | 264 } |
| 265 | 265 |
| 266 int field_index() const { return FieldIndexField::decode(value_); } | 266 int field_index() const { return FieldIndexField::decode(value_); } |
| 267 | 267 |
| 268 inline int field_width_in_words() const; | 268 inline int field_width_in_words() const; |
| 269 | 269 |
| 270 inline PropertyDetails AsDeleted() const; | |
| 271 | |
| 272 static bool IsValidIndex(int index) { | 270 static bool IsValidIndex(int index) { |
| 273 return DictionaryStorageField::is_valid(index); | 271 return DictionaryStorageField::is_valid(index); |
| 274 } | 272 } |
| 275 | 273 |
| 276 bool IsReadOnly() const { return (attributes() & READ_ONLY) != 0; } | 274 bool IsReadOnly() const { return (attributes() & READ_ONLY) != 0; } |
| 277 bool IsConfigurable() const { return (attributes() & DONT_DELETE) == 0; } | 275 bool IsConfigurable() const { return (attributes() & DONT_DELETE) == 0; } |
| 278 bool IsDontEnum() const { return (attributes() & DONT_ENUM) != 0; } | 276 bool IsDontEnum() const { return (attributes() & DONT_ENUM) != 0; } |
| 279 bool IsDeleted() const { return DeletedField::decode(value_) != 0; } | |
| 280 | 277 |
| 281 // Bit fields in value_ (type, shift, size). Must be public so the | 278 // Bit fields in value_ (type, shift, size). Must be public so the |
| 282 // constants can be embedded in generated code. | 279 // constants can be embedded in generated code. |
| 283 class KindField : public BitField<PropertyKind, 0, 1> {}; | 280 class KindField : public BitField<PropertyKind, 0, 1> {}; |
| 284 class LocationField : public BitField<PropertyLocation, 1, 1> {}; | 281 class LocationField : public BitField<PropertyLocation, 1, 1> {}; |
| 285 class AttributesField : public BitField<PropertyAttributes, 2, 3> {}; | 282 class AttributesField : public BitField<PropertyAttributes, 2, 3> {}; |
| 286 | 283 |
| 287 // Bit fields for normalized objects. | 284 // Bit fields for normalized objects. |
| 288 class DeletedField : public BitField<uint32_t, 5, 1> {}; | 285 class DictionaryStorageField : public BitField<uint32_t, 5, 24> {}; |
| 289 class DictionaryStorageField : public BitField<uint32_t, 6, 24> {}; | |
| 290 | 286 |
| 291 // Bit fields for fast objects. | 287 // Bit fields for fast objects. |
| 292 class RepresentationField : public BitField<uint32_t, 5, 4> {}; | 288 class RepresentationField : public BitField<uint32_t, 5, 4> {}; |
| 293 class DescriptorPointer | 289 class DescriptorPointer |
| 294 : public BitField<uint32_t, 9, kDescriptorIndexBitCount> {}; // NOLINT | 290 : public BitField<uint32_t, 9, kDescriptorIndexBitCount> {}; // NOLINT |
| 295 class FieldIndexField | 291 class FieldIndexField |
| 296 : public BitField<uint32_t, 9 + kDescriptorIndexBitCount, | 292 : public BitField<uint32_t, 9 + kDescriptorIndexBitCount, |
| 297 kDescriptorIndexBitCount> {}; // NOLINT | 293 kDescriptorIndexBitCount> {}; // NOLINT |
| 298 | 294 |
| 299 // NOTE: TypeField overlaps with KindField and LocationField. | 295 // NOTE: TypeField overlaps with KindField and LocationField. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 328 uint32_t value_; | 324 uint32_t value_; |
| 329 }; | 325 }; |
| 330 | 326 |
| 331 | 327 |
| 332 std::ostream& operator<<(std::ostream& os, | 328 std::ostream& operator<<(std::ostream& os, |
| 333 const PropertyAttributes& attributes); | 329 const PropertyAttributes& attributes); |
| 334 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details); | 330 std::ostream& operator<<(std::ostream& os, const PropertyDetails& details); |
| 335 } } // namespace v8::internal | 331 } } // namespace v8::internal |
| 336 | 332 |
| 337 #endif // V8_PROPERTY_DETAILS_H_ | 333 #endif // V8_PROPERTY_DETAILS_H_ |
| OLD | NEW |