| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 std::ostream& operator<<(std::ostream& os, const Descriptor& d); | 73 std::ostream& operator<<(std::ostream& os, const Descriptor& d); |
| 74 | 74 |
| 75 | 75 |
| 76 class DataDescriptor FINAL : public Descriptor { | 76 class DataDescriptor FINAL : public Descriptor { |
| 77 public: | 77 public: |
| 78 DataDescriptor(Handle<Name> key, int field_index, | 78 DataDescriptor(Handle<Name> key, int field_index, |
| 79 PropertyAttributes attributes, Representation representation) | 79 PropertyAttributes attributes, Representation representation) |
| 80 : Descriptor(key, HeapType::Any(key->GetIsolate()), attributes, DATA, | 80 : Descriptor(key, HeapType::Any(key->GetIsolate()), attributes, DATA, |
| 81 representation, field_index) {} | 81 representation, field_index) {} |
| 82 // The field type is either a simple type or a map wrapped in a weak cell. | 82 DataDescriptor(Handle<Name> key, int field_index, Handle<HeapType> field_type, |
| 83 DataDescriptor(Handle<Name> key, int field_index, | |
| 84 Handle<Object> wrapped_field_type, | |
| 85 PropertyAttributes attributes, Representation representation) | 83 PropertyAttributes attributes, Representation representation) |
| 86 : Descriptor(key, wrapped_field_type, attributes, DATA, representation, | 84 : Descriptor(key, field_type, attributes, DATA, representation, |
| 87 field_index) { | 85 field_index) {} |
| 88 DCHECK(wrapped_field_type->IsSmi() || wrapped_field_type->IsWeakCell()); | |
| 89 } | |
| 90 }; | 86 }; |
| 91 | 87 |
| 92 | 88 |
| 93 class DataConstantDescriptor FINAL : public Descriptor { | 89 class DataConstantDescriptor FINAL : public Descriptor { |
| 94 public: | 90 public: |
| 95 DataConstantDescriptor(Handle<Name> key, Handle<Object> value, | 91 DataConstantDescriptor(Handle<Name> key, Handle<Object> value, |
| 96 PropertyAttributes attributes) | 92 PropertyAttributes attributes) |
| 97 : Descriptor(key, value, attributes, DATA_CONSTANT, | 93 : Descriptor(key, value, attributes, DATA_CONSTANT, |
| 98 value->OptimalRepresentation()) {} | 94 value->OptimalRepresentation()) {} |
| 99 }; | 95 }; |
| 100 | 96 |
| 101 | 97 |
| 102 class AccessorConstantDescriptor FINAL : public Descriptor { | 98 class AccessorConstantDescriptor FINAL : public Descriptor { |
| 103 public: | 99 public: |
| 104 AccessorConstantDescriptor(Handle<Name> key, Handle<Object> foreign, | 100 AccessorConstantDescriptor(Handle<Name> key, Handle<Object> foreign, |
| 105 PropertyAttributes attributes) | 101 PropertyAttributes attributes) |
| 106 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, | 102 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, |
| 107 Representation::Tagged()) {} | 103 Representation::Tagged()) {} |
| 108 }; | 104 }; |
| 109 | 105 |
| 110 | 106 |
| 111 } } // namespace v8::internal | 107 } } // namespace v8::internal |
| 112 | 108 |
| 113 #endif // V8_PROPERTY_H_ | 109 #endif // V8_PROPERTY_H_ |
| OLD | NEW |