OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 2607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2618 public: | 2618 public: |
2619 enum SearchForDuplicates { kAlwaysAdd, kAddIfNotFound }; | 2619 enum SearchForDuplicates { kAlwaysAdd, kAddIfNotFound }; |
2620 | 2620 |
2621 // If |maybe_array| is not a WeakFixedArray, a fresh one will be allocated. | 2621 // If |maybe_array| is not a WeakFixedArray, a fresh one will be allocated. |
2622 static Handle<WeakFixedArray> Add( | 2622 static Handle<WeakFixedArray> Add( |
2623 Handle<Object> maybe_array, Handle<HeapObject> value, | 2623 Handle<Object> maybe_array, Handle<HeapObject> value, |
2624 SearchForDuplicates search_for_duplicates = kAlwaysAdd); | 2624 SearchForDuplicates search_for_duplicates = kAlwaysAdd); |
2625 | 2625 |
2626 void Remove(Handle<HeapObject> value); | 2626 void Remove(Handle<HeapObject> value); |
2627 | 2627 |
| 2628 void Compact(); |
| 2629 |
2628 inline Object* Get(int index) const; | 2630 inline Object* Get(int index) const; |
2629 inline int Length() const; | 2631 inline int Length() const; |
2630 | 2632 |
2631 static Object* Empty() { return Smi::FromInt(0); } | 2633 static Object* Empty() { return Smi::FromInt(0); } |
2632 | 2634 |
2633 DECLARE_CAST(WeakFixedArray) | 2635 DECLARE_CAST(WeakFixedArray) |
2634 | 2636 |
2635 private: | 2637 private: |
2636 static const int kLastUsedIndexIndex = 0; | 2638 static const int kLastUsedIndexIndex = 0; |
2637 static const int kFirstIndex = 1; | 2639 static const int kFirstIndex = 1; |
(...skipping 8451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11089 } else { | 11091 } else { |
11090 value &= ~(1 << bit_position); | 11092 value &= ~(1 << bit_position); |
11091 } | 11093 } |
11092 return value; | 11094 return value; |
11093 } | 11095 } |
11094 }; | 11096 }; |
11095 | 11097 |
11096 } } // namespace v8::internal | 11098 } } // namespace v8::internal |
11097 | 11099 |
11098 #endif // V8_OBJECTS_H_ | 11100 #endif // V8_OBJECTS_H_ |
OLD | NEW |