OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 int index = 0) | 92 int index = 0) |
93 : key_(key), | 93 : key_(key), |
94 value_(value), | 94 value_(value), |
95 details_(attributes, type, index) { } | 95 details_(attributes, type, index) { } |
96 | 96 |
97 friend class DescriptorWriter; | 97 friend class DescriptorWriter; |
98 friend class DescriptorReader; | 98 friend class DescriptorReader; |
99 friend class DescriptorArray; | 99 friend class DescriptorArray; |
100 }; | 100 }; |
101 | 101 |
102 | 102 // A pointer from a map to the new map that is created by adding |
| 103 // a named property. These are key to the speed and functioning of V8. |
| 104 // The two maps should always have the same prototype, since |
| 105 // MapSpace::CreateBackPointers depends on this. |
103 class MapTransitionDescriptor: public Descriptor { | 106 class MapTransitionDescriptor: public Descriptor { |
104 public: | 107 public: |
105 MapTransitionDescriptor(String* key, Map* map, PropertyAttributes attributes) | 108 MapTransitionDescriptor(String* key, Map* map, PropertyAttributes attributes) |
106 : Descriptor(key, map, attributes, MAP_TRANSITION) { } | 109 : Descriptor(key, map, attributes, MAP_TRANSITION) { } |
107 }; | 110 }; |
108 | 111 |
109 // Marks a field name in a map so that adding the field is guaranteed | 112 // Marks a field name in a map so that adding the field is guaranteed |
110 // to create a FIELD descriptor in the new map. Used after adding | 113 // to create a FIELD descriptor in the new map. Used after adding |
111 // a constant function the first time, creating a CONSTANT_FUNCTION | 114 // a constant function the first time, creating a CONSTANT_FUNCTION |
112 // descriptor in the new map. This avoids creating multiple maps with | 115 // descriptor in the new map. This avoids creating multiple maps with |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 | 383 |
381 // Append a descriptor to this stream. | 384 // Append a descriptor to this stream. |
382 void Write(Descriptor* desc); | 385 void Write(Descriptor* desc); |
383 // Read a descriptor from the reader and append it to this stream. | 386 // Read a descriptor from the reader and append it to this stream. |
384 void WriteFrom(DescriptorReader* reader); | 387 void WriteFrom(DescriptorReader* reader); |
385 }; | 388 }; |
386 | 389 |
387 } } // namespace v8::internal | 390 } } // namespace v8::internal |
388 | 391 |
389 #endif // V8_PROPERTY_H_ | 392 #endif // V8_PROPERTY_H_ |
OLD | NEW |