Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2413 // [0]: storage for bit_field3 for Map owning this object (Smi) | 2413 // [0]: storage for bit_field3 for Map owning this object (Smi) |
| 2414 // [1]: point to a fixed array with (value, detail) pairs. | 2414 // [1]: point to a fixed array with (value, detail) pairs. |
| 2415 // [2]: next enumeration index (Smi), or pointer to small fixed array: | 2415 // [2]: next enumeration index (Smi), or pointer to small fixed array: |
| 2416 // [0]: next enumeration index (Smi) | 2416 // [0]: next enumeration index (Smi) |
| 2417 // [1]: pointer to fixed array with enum cache | 2417 // [1]: pointer to fixed array with enum cache |
| 2418 // [3]: first key | 2418 // [3]: first key |
| 2419 // [length() - 1]: last key | 2419 // [length() - 1]: last key |
| 2420 // | 2420 // |
| 2421 class DescriptorArray: public FixedArray { | 2421 class DescriptorArray: public FixedArray { |
| 2422 public: | 2422 public: |
| 2423 friend class IntrusiveMapTransitionIterator; | |
|
Michael Starzinger
2012/05/25 12:18:00
Move that to the bottom of the class (or at least
Toon Verwaest
2012/05/25 12:32:09
Done.
| |
| 2424 | |
| 2423 // Returns true for both shared empty_descriptor_array and for smis, which the | 2425 // Returns true for both shared empty_descriptor_array and for smis, which the |
| 2424 // map uses to encode additional bit fields when the descriptor array is not | 2426 // map uses to encode additional bit fields when the descriptor array is not |
| 2425 // yet used. | 2427 // yet used. |
| 2426 inline bool IsEmpty(); | 2428 inline bool IsEmpty(); |
| 2427 | 2429 |
| 2428 // Returns the number of descriptors in the array. | 2430 // Returns the number of descriptors in the array. |
| 2429 int number_of_descriptors() { | 2431 int number_of_descriptors() { |
| 2430 ASSERT(length() > kFirstIndex || IsEmpty()); | 2432 ASSERT(length() > kFirstIndex || IsEmpty()); |
| 2431 int len = length(); | 2433 int len = length(); |
| 2432 return len <= kFirstIndex ? 0 : len - kFirstIndex; | 2434 return len <= kFirstIndex ? 0 : len - kFirstIndex; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2468 // Initialize or change the enum cache, | 2470 // Initialize or change the enum cache, |
| 2469 // using the supplied storage for the small "bridge". | 2471 // using the supplied storage for the small "bridge". |
| 2470 void SetEnumCache(FixedArray* bridge_storage, | 2472 void SetEnumCache(FixedArray* bridge_storage, |
| 2471 FixedArray* new_cache, | 2473 FixedArray* new_cache, |
| 2472 Object* new_index_cache); | 2474 Object* new_index_cache); |
| 2473 | 2475 |
| 2474 // Accessors for fetching instance descriptor at descriptor number. | 2476 // Accessors for fetching instance descriptor at descriptor number. |
| 2475 inline String* GetKey(int descriptor_number); | 2477 inline String* GetKey(int descriptor_number); |
| 2476 inline Object* GetValue(int descriptor_number); | 2478 inline Object* GetValue(int descriptor_number); |
| 2477 inline PropertyDetails GetDetails(int descriptor_number); | 2479 inline PropertyDetails GetDetails(int descriptor_number); |
| 2480 | |
|
Michael Starzinger
2012/05/25 12:18:00
Remove this empty line.
Toon Verwaest
2012/05/25 12:32:09
Done.
| |
| 2478 inline PropertyType GetType(int descriptor_number); | 2481 inline PropertyType GetType(int descriptor_number); |
| 2479 inline int GetFieldIndex(int descriptor_number); | 2482 inline int GetFieldIndex(int descriptor_number); |
| 2480 inline JSFunction* GetConstantFunction(int descriptor_number); | 2483 inline JSFunction* GetConstantFunction(int descriptor_number); |
| 2481 inline Object* GetCallbacksObject(int descriptor_number); | 2484 inline Object* GetCallbacksObject(int descriptor_number); |
| 2482 inline AccessorDescriptor* GetCallbacks(int descriptor_number); | 2485 inline AccessorDescriptor* GetCallbacks(int descriptor_number); |
| 2483 inline bool IsProperty(int descriptor_number); | 2486 inline bool IsProperty(int descriptor_number); |
| 2484 inline bool IsTransitionOnly(int descriptor_number); | 2487 inline bool IsTransitionOnly(int descriptor_number); |
| 2485 inline bool IsNullDescriptor(int descriptor_number); | 2488 inline bool IsNullDescriptor(int descriptor_number); |
| 2486 | 2489 |
| 2487 class WhitenessWitness { | 2490 class WhitenessWitness { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2643 static inline void NoIncrementalWriteBarrierSwap( | 2646 static inline void NoIncrementalWriteBarrierSwap( |
| 2644 FixedArray* array, int first, int second); | 2647 FixedArray* array, int first, int second); |
| 2645 | 2648 |
| 2646 // Swap descriptor first and second. | 2649 // Swap descriptor first and second. |
| 2647 inline void NoIncrementalWriteBarrierSwapDescriptors( | 2650 inline void NoIncrementalWriteBarrierSwapDescriptors( |
| 2648 int first, int second); | 2651 int first, int second); |
| 2649 | 2652 |
| 2650 FixedArray* GetContentArray() { | 2653 FixedArray* GetContentArray() { |
| 2651 return FixedArray::cast(get(kContentArrayIndex)); | 2654 return FixedArray::cast(get(kContentArrayIndex)); |
| 2652 } | 2655 } |
| 2656 | |
| 2653 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); | 2657 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); |
| 2654 }; | 2658 }; |
| 2655 | 2659 |
| 2656 | 2660 |
| 2657 // HashTable is a subclass of FixedArray that implements a hash table | 2661 // HashTable is a subclass of FixedArray that implements a hash table |
| 2658 // that uses open addressing and quadratic probing. | 2662 // that uses open addressing and quadratic probing. |
| 2659 // | 2663 // |
| 2660 // In order for the quadratic probing to work, elements that have not | 2664 // In order for the quadratic probing to work, elements that have not |
| 2661 // yet been used and elements that have been deleted are | 2665 // yet been used and elements that have been deleted are |
| 2662 // distinguished. Probing continues when deleted elements are | 2666 // distinguished. Probing continues when deleted elements are |
| (...skipping 5984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8647 } else { | 8651 } else { |
| 8648 value &= ~(1 << bit_position); | 8652 value &= ~(1 << bit_position); |
| 8649 } | 8653 } |
| 8650 return value; | 8654 return value; |
| 8651 } | 8655 } |
| 8652 }; | 8656 }; |
| 8653 | 8657 |
| 8654 } } // namespace v8::internal | 8658 } } // namespace v8::internal |
| 8655 | 8659 |
| 8656 #endif // V8_OBJECTS_H_ | 8660 #endif // V8_OBJECTS_H_ |
| OLD | NEW |