| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_H_ | 5 #ifndef V8_PROPERTY_H_ |
| 6 #define V8_PROPERTY_H_ | 6 #define V8_PROPERTY_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/factory.h" | 10 #include "src/factory.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 private: | 29 private: |
| 30 Handle<Name> key_; | 30 Handle<Name> key_; |
| 31 Handle<Object> value_; | 31 Handle<Object> value_; |
| 32 PropertyDetails details_; | 32 PropertyDetails details_; |
| 33 | 33 |
| 34 protected: | 34 protected: |
| 35 Descriptor() : details_(Smi::FromInt(0)) {} | 35 Descriptor() : details_(Smi::FromInt(0)) {} |
| 36 | 36 |
| 37 void Init(Handle<Name> key, Handle<Object> value, PropertyDetails details) { | 37 void Init(Handle<Name> key, Handle<Object> value, PropertyDetails details) { |
| 38 DCHECK(key->IsUniqueName()); | 38 DCHECK(key->IsUniqueName()); |
| 39 DCHECK_IMPLIES(key->IsPrivate(), !details.IsEnumerable()); |
| 39 key_ = key; | 40 key_ = key; |
| 40 value_ = value; | 41 value_ = value; |
| 41 details_ = details; | 42 details_ = details; |
| 42 } | 43 } |
| 43 | 44 |
| 44 Descriptor(Handle<Name> key, Handle<Object> value, PropertyDetails details) | 45 Descriptor(Handle<Name> key, Handle<Object> value, PropertyDetails details) |
| 45 : key_(key), value_(value), details_(details) { | 46 : key_(key), value_(value), details_(details) { |
| 46 DCHECK(key->IsUniqueName()); | 47 DCHECK(key->IsUniqueName()); |
| 48 DCHECK_IMPLIES(key->IsPrivate(), !details_.IsEnumerable()); |
| 47 } | 49 } |
| 48 | 50 |
| 49 Descriptor(Handle<Name> key, Handle<Object> value, | 51 Descriptor(Handle<Name> key, Handle<Object> value, |
| 50 PropertyAttributes attributes, PropertyType type, | 52 PropertyAttributes attributes, PropertyType type, |
| 51 Representation representation, int field_index = 0) | 53 Representation representation, int field_index = 0) |
| 52 : key_(key), | 54 : key_(key), |
| 53 value_(value), | 55 value_(value), |
| 54 details_(attributes, type, representation, field_index) { | 56 details_(attributes, type, representation, field_index) { |
| 55 DCHECK(key->IsUniqueName()); | 57 DCHECK(key->IsUniqueName()); |
| 58 DCHECK_IMPLIES(key->IsPrivate(), !details_.IsEnumerable()); |
| 56 } | 59 } |
| 57 | 60 |
| 58 friend class DescriptorArray; | 61 friend class DescriptorArray; |
| 59 friend class Map; | 62 friend class Map; |
| 60 }; | 63 }; |
| 61 | 64 |
| 62 | 65 |
| 63 std::ostream& operator<<(std::ostream& os, const Descriptor& d); | 66 std::ostream& operator<<(std::ostream& os, const Descriptor& d); |
| 64 | 67 |
| 65 | 68 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 93 PropertyAttributes attributes) | 96 PropertyAttributes attributes) |
| 94 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, | 97 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, |
| 95 Representation::Tagged()) {} | 98 Representation::Tagged()) {} |
| 96 }; | 99 }; |
| 97 | 100 |
| 98 | 101 |
| 99 } // namespace internal | 102 } // namespace internal |
| 100 } // namespace v8 | 103 } // namespace v8 |
| 101 | 104 |
| 102 #endif // V8_PROPERTY_H_ | 105 #endif // V8_PROPERTY_H_ |
| OLD | NEW |