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 2614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2625 Handle<Object> maybe_array, Handle<HeapObject> value, | 2625 Handle<Object> maybe_array, Handle<HeapObject> value, |
2626 SearchForDuplicates search_for_duplicates = kAlwaysAdd, | 2626 SearchForDuplicates search_for_duplicates = kAlwaysAdd, |
2627 bool* was_present = NULL); | 2627 bool* was_present = NULL); |
2628 | 2628 |
2629 // Returns true if an entry was found and removed. | 2629 // Returns true if an entry was found and removed. |
2630 bool Remove(Handle<HeapObject> value); | 2630 bool Remove(Handle<HeapObject> value); |
2631 | 2631 |
2632 void Compact(); | 2632 void Compact(); |
2633 | 2633 |
2634 inline Object* Get(int index) const; | 2634 inline Object* Get(int index) const; |
2635 inline void Clear(int index); | |
2636 inline int Length() const; | 2635 inline int Length() const; |
2637 | 2636 |
2638 inline bool IsEmptySlot(int index) const; | |
2639 static Object* Empty() { return Smi::FromInt(0); } | 2637 static Object* Empty() { return Smi::FromInt(0); } |
2640 | 2638 |
2641 DECLARE_CAST(WeakFixedArray) | 2639 DECLARE_CAST(WeakFixedArray) |
2642 | 2640 |
2643 private: | 2641 private: |
2644 static const int kLastUsedIndexIndex = 0; | 2642 static const int kLastUsedIndexIndex = 0; |
2645 static const int kFirstIndex = 1; | 2643 static const int kFirstIndex = 1; |
2646 | 2644 |
2647 static Handle<WeakFixedArray> Allocate( | 2645 static Handle<WeakFixedArray> Allocate( |
2648 Isolate* isolate, int size, Handle<WeakFixedArray> initialize_from); | 2646 Isolate* isolate, int size, Handle<WeakFixedArray> initialize_from); |
2649 | 2647 |
2650 static void Set(Handle<WeakFixedArray> array, int index, | 2648 static void Set(Handle<WeakFixedArray> array, int index, |
2651 Handle<HeapObject> value); | 2649 Handle<HeapObject> value); |
2652 inline void clear(int index); | 2650 inline void clear(int index); |
| 2651 inline bool IsEmptySlot(int index) const; |
2653 | 2652 |
2654 inline int last_used_index() const; | 2653 inline int last_used_index() const; |
2655 inline void set_last_used_index(int index); | 2654 inline void set_last_used_index(int index); |
2656 | 2655 |
2657 // Disallow inherited setters. | 2656 // Disallow inherited setters. |
2658 void set(int index, Smi* value); | 2657 void set(int index, Smi* value); |
2659 void set(int index, Object* value); | 2658 void set(int index, Object* value); |
2660 void set(int index, Object* value, WriteBarrierMode mode); | 2659 void set(int index, Object* value, WriteBarrierMode mode); |
2661 DISALLOW_IMPLICIT_CONSTRUCTORS(WeakFixedArray); | 2660 DISALLOW_IMPLICIT_CONSTRUCTORS(WeakFixedArray); |
2662 }; | 2661 }; |
(...skipping 8441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11104 } else { | 11103 } else { |
11105 value &= ~(1 << bit_position); | 11104 value &= ~(1 << bit_position); |
11106 } | 11105 } |
11107 return value; | 11106 return value; |
11108 } | 11107 } |
11109 }; | 11108 }; |
11110 | 11109 |
11111 } } // namespace v8::internal | 11110 } } // namespace v8::internal |
11112 | 11111 |
11113 #endif // V8_OBJECTS_H_ | 11112 #endif // V8_OBJECTS_H_ |
OLD | NEW |