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