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 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2581 | 2581 |
2582 // Are two DescriptorArrays equal? | 2582 // Are two DescriptorArrays equal? |
2583 bool IsEqualTo(DescriptorArray* other); | 2583 bool IsEqualTo(DescriptorArray* other); |
2584 #endif | 2584 #endif |
2585 | 2585 |
2586 // The maximum number of descriptors we want in a descriptor array (should | 2586 // The maximum number of descriptors we want in a descriptor array (should |
2587 // fit in a page). | 2587 // fit in a page). |
2588 static const int kMaxNumberOfDescriptors = 1024 + 512; | 2588 static const int kMaxNumberOfDescriptors = 1024 + 512; |
2589 | 2589 |
2590 private: | 2590 private: |
| 2591 friend class IntrusiveMapTransitionIterator; |
| 2592 |
2591 // An entry in a DescriptorArray, represented as an (array, index) pair. | 2593 // An entry in a DescriptorArray, represented as an (array, index) pair. |
2592 class Entry { | 2594 class Entry { |
2593 public: | 2595 public: |
2594 inline explicit Entry(DescriptorArray* descs, int index) : | 2596 inline explicit Entry(DescriptorArray* descs, int index) : |
2595 descs_(descs), index_(index) { } | 2597 descs_(descs), index_(index) { } |
2596 | 2598 |
2597 inline PropertyType type() { return descs_->GetType(index_); } | 2599 inline PropertyType type() { return descs_->GetType(index_); } |
2598 inline Object* GetCallbackObject() { return descs_->GetValue(index_); } | 2600 inline Object* GetCallbackObject() { return descs_->GetValue(index_); } |
2599 | 2601 |
2600 private: | 2602 private: |
(...skipping 18 matching lines...) Expand all Loading... |
2619 static inline void NoIncrementalWriteBarrierSwap( | 2621 static inline void NoIncrementalWriteBarrierSwap( |
2620 FixedArray* array, int first, int second); | 2622 FixedArray* array, int first, int second); |
2621 | 2623 |
2622 // Swap descriptor first and second. | 2624 // Swap descriptor first and second. |
2623 inline void NoIncrementalWriteBarrierSwapDescriptors( | 2625 inline void NoIncrementalWriteBarrierSwapDescriptors( |
2624 int first, int second); | 2626 int first, int second); |
2625 | 2627 |
2626 FixedArray* GetContentArray() { | 2628 FixedArray* GetContentArray() { |
2627 return FixedArray::cast(get(kContentArrayIndex)); | 2629 return FixedArray::cast(get(kContentArrayIndex)); |
2628 } | 2630 } |
| 2631 |
2629 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); | 2632 DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray); |
2630 }; | 2633 }; |
2631 | 2634 |
2632 | 2635 |
2633 // HashTable is a subclass of FixedArray that implements a hash table | 2636 // HashTable is a subclass of FixedArray that implements a hash table |
2634 // that uses open addressing and quadratic probing. | 2637 // that uses open addressing and quadratic probing. |
2635 // | 2638 // |
2636 // In order for the quadratic probing to work, elements that have not | 2639 // In order for the quadratic probing to work, elements that have not |
2637 // yet been used and elements that have been deleted are | 2640 // yet been used and elements that have been deleted are |
2638 // distinguished. Probing continues when deleted elements are | 2641 // distinguished. Probing continues when deleted elements are |
(...skipping 6010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8649 } else { | 8652 } else { |
8650 value &= ~(1 << bit_position); | 8653 value &= ~(1 << bit_position); |
8651 } | 8654 } |
8652 return value; | 8655 return value; |
8653 } | 8656 } |
8654 }; | 8657 }; |
8655 | 8658 |
8656 } } // namespace v8::internal | 8659 } } // namespace v8::internal |
8657 | 8660 |
8658 #endif // V8_OBJECTS_H_ | 8661 #endif // V8_OBJECTS_H_ |
OLD | NEW |