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