| 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_LAYOUT_DESCRIPTOR_H_ | 5 #ifndef V8_LAYOUT_DESCRIPTOR_H_ |
| 6 #define V8_LAYOUT_DESCRIPTOR_H_ | 6 #define V8_LAYOUT_DESCRIPTOR_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 V8_INLINE static LayoutDescriptor* cast_gc_safe(Object* object); | 47 V8_INLINE static LayoutDescriptor* cast_gc_safe(Object* object); |
| 48 | 48 |
| 49 // Builds layout descriptor optimized for given |map| by |num_descriptors| | 49 // Builds layout descriptor optimized for given |map| by |num_descriptors| |
| 50 // elements of given descriptors array. The |map|'s descriptors could be | 50 // elements of given descriptors array. The |map|'s descriptors could be |
| 51 // different. | 51 // different. |
| 52 static Handle<LayoutDescriptor> New(Handle<Map> map, | 52 static Handle<LayoutDescriptor> New(Handle<Map> map, |
| 53 Handle<DescriptorArray> descriptors, | 53 Handle<DescriptorArray> descriptors, |
| 54 int num_descriptors); | 54 int num_descriptors); |
| 55 | 55 |
| 56 // Creates new layout descriptor by appending property with |details| to | 56 // Modifies |map|'s layout descriptor or creates a new one if necessary by |
| 57 // |map|'s layout descriptor. | 57 // appending property with |details| to it. |
| 58 static Handle<LayoutDescriptor> Append(Handle<Map> map, | 58 static Handle<LayoutDescriptor> ShareAppend(Handle<Map> map, |
| 59 PropertyDetails details); | 59 PropertyDetails details); |
| 60 | 60 |
| 61 // Creates new layout descriptor by appending property with |details| to | 61 // Creates new layout descriptor by appending property with |details| to |
| 62 // |map|'s layout descriptor and if it is still fast then returns it. | 62 // |map|'s layout descriptor and if it is still fast then returns it. |
| 63 // Otherwise the |full_layout_descriptor| is returned. | 63 // Otherwise the |full_layout_descriptor| is returned. |
| 64 static Handle<LayoutDescriptor> AppendIfFastOrUseFull( | 64 static Handle<LayoutDescriptor> AppendIfFastOrUseFull( |
| 65 Handle<Map> map, PropertyDetails details, | 65 Handle<Map> map, PropertyDetails details, |
| 66 Handle<LayoutDescriptor> full_layout_descriptor); | 66 Handle<LayoutDescriptor> full_layout_descriptor); |
| 67 | 67 |
| 68 // Layout descriptor that corresponds to an object all fields of which are | 68 // Layout descriptor that corresponds to an object all fields of which are |
| 69 // tagged (FastPointerLayout). | 69 // tagged (FastPointerLayout). |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 bool all_fields_tagged_; | 134 bool all_fields_tagged_; |
| 135 int header_size_; | 135 int header_size_; |
| 136 LayoutDescriptor* layout_descriptor_; | 136 LayoutDescriptor* layout_descriptor_; |
| 137 }; | 137 }; |
| 138 } | 138 } |
| 139 } // namespace v8::internal | 139 } // namespace v8::internal |
| 140 | 140 |
| 141 #endif // V8_LAYOUT_DESCRIPTOR_H_ | 141 #endif // V8_LAYOUT_DESCRIPTOR_H_ |
| OLD | NEW |