OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 4252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4263 // it had exactly zero inobject properties. | 4263 // it had exactly zero inobject properties. |
4264 // The "shared" flags of both this map and |other| are ignored. | 4264 // The "shared" flags of both this map and |other| are ignored. |
4265 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); | 4265 bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode mode); |
4266 | 4266 |
4267 // Returns true if this map and |other| describe equivalent objects. | 4267 // Returns true if this map and |other| describe equivalent objects. |
4268 // The "shared" flags of both this map and |other| are ignored. | 4268 // The "shared" flags of both this map and |other| are ignored. |
4269 bool EquivalentTo(Map* other) { | 4269 bool EquivalentTo(Map* other) { |
4270 return EquivalentToForNormalization(other, KEEP_INOBJECT_PROPERTIES); | 4270 return EquivalentToForNormalization(other, KEEP_INOBJECT_PROPERTIES); |
4271 } | 4271 } |
4272 | 4272 |
| 4273 // Returns the contents of this map's descriptor array for the given string. |
| 4274 // May return NULL. |safe_to_add_transition| is set to false and NULL |
| 4275 // is returned if adding transitions is not allowed. |
| 4276 Object* GetDescriptorContents(String* sentinel_name, |
| 4277 bool* safe_to_add_transitions); |
| 4278 |
| 4279 // Returns the map that this map transitions to if its elements_kind |
| 4280 // is changed to |elements_kind|, or NULL if no such map is cached yet. |
| 4281 // |safe_to_add_transitions| is set to false if adding transitions is not |
| 4282 // allowed. |
| 4283 Map* LookupElementsTransitionMap(ElementsKind elements_kind, |
| 4284 bool* safe_to_add_transition); |
| 4285 |
| 4286 // Adds an entry to this map's descriptor array for a transition to |
| 4287 // |transitioned_map| when its elements_kind is changed to |elements_kind|. |
| 4288 MaybeObject* AddElementsTransition(ElementsKind elements_kind, |
| 4289 Map* transitioned_map); |
| 4290 |
4273 // Dispatched behavior. | 4291 // Dispatched behavior. |
4274 #ifdef OBJECT_PRINT | 4292 #ifdef OBJECT_PRINT |
4275 inline void MapPrint() { | 4293 inline void MapPrint() { |
4276 MapPrint(stdout); | 4294 MapPrint(stdout); |
4277 } | 4295 } |
4278 void MapPrint(FILE* out); | 4296 void MapPrint(FILE* out); |
4279 #endif | 4297 #endif |
4280 #ifdef DEBUG | 4298 #ifdef DEBUG |
4281 void MapVerify(); | 4299 void MapVerify(); |
4282 void SharedMapVerify(); | 4300 void SharedMapVerify(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4380 // Layout of the default cache. It holds alternating name and code objects. | 4398 // Layout of the default cache. It holds alternating name and code objects. |
4381 static const int kCodeCacheEntrySize = 2; | 4399 static const int kCodeCacheEntrySize = 2; |
4382 static const int kCodeCacheEntryNameOffset = 0; | 4400 static const int kCodeCacheEntryNameOffset = 0; |
4383 static const int kCodeCacheEntryCodeOffset = 1; | 4401 static const int kCodeCacheEntryCodeOffset = 1; |
4384 | 4402 |
4385 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, | 4403 typedef FixedBodyDescriptor<kPointerFieldsBeginOffset, |
4386 kPointerFieldsEndOffset, | 4404 kPointerFieldsEndOffset, |
4387 kSize> BodyDescriptor; | 4405 kSize> BodyDescriptor; |
4388 | 4406 |
4389 private: | 4407 private: |
| 4408 String* elements_transition_sentinel_name(); |
4390 DISALLOW_IMPLICIT_CONSTRUCTORS(Map); | 4409 DISALLOW_IMPLICIT_CONSTRUCTORS(Map); |
4391 }; | 4410 }; |
4392 | 4411 |
4393 | 4412 |
4394 // An abstract superclass, a marker class really, for simple structure classes. | 4413 // An abstract superclass, a marker class really, for simple structure classes. |
4395 // It doesn't carry much functionality but allows struct classes to be | 4414 // It doesn't carry much functionality but allows struct classes to be |
4396 // identified in the type system. | 4415 // identified in the type system. |
4397 class Struct: public HeapObject { | 4416 class Struct: public HeapObject { |
4398 public: | 4417 public: |
4399 inline void InitializeBody(int object_size); | 4418 inline void InitializeBody(int object_size); |
(...skipping 3174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7574 } else { | 7593 } else { |
7575 value &= ~(1 << bit_position); | 7594 value &= ~(1 << bit_position); |
7576 } | 7595 } |
7577 return value; | 7596 return value; |
7578 } | 7597 } |
7579 }; | 7598 }; |
7580 | 7599 |
7581 } } // namespace v8::internal | 7600 } } // namespace v8::internal |
7582 | 7601 |
7583 #endif // V8_OBJECTS_H_ | 7602 #endif // V8_OBJECTS_H_ |
OLD | NEW |