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 "allocation.h" | 8 #include "allocation.h" |
9 #include "assert-scope.h" | 9 #include "assert-scope.h" |
10 #include "builtins.h" | 10 #include "builtins.h" |
(...skipping 4253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4264 | 4264 |
4265 // Returns an OrderedHashTable (possibly |table|) that's shrunken | 4265 // Returns an OrderedHashTable (possibly |table|) that's shrunken |
4266 // if possible. | 4266 // if possible. |
4267 static Handle<Derived> Shrink(Handle<Derived> table); | 4267 static Handle<Derived> Shrink(Handle<Derived> table); |
4268 | 4268 |
4269 // Returns a new empty OrderedHashTable and updates all the iterators to | 4269 // Returns a new empty OrderedHashTable and updates all the iterators to |
4270 // point to the new table. | 4270 // point to the new table. |
4271 static Handle<Derived> Clear(Handle<Derived> table); | 4271 static Handle<Derived> Clear(Handle<Derived> table); |
4272 | 4272 |
4273 // Returns kNotFound if the key isn't present. | 4273 // Returns kNotFound if the key isn't present. |
4274 int FindEntry(Object* key); | 4274 int FindEntry(Handle<Object> key); |
4275 | 4275 |
4276 int NumberOfElements() { | 4276 int NumberOfElements() { |
4277 return Smi::cast(get(kNumberOfElementsIndex))->value(); | 4277 return Smi::cast(get(kNumberOfElementsIndex))->value(); |
4278 } | 4278 } |
4279 | 4279 |
4280 int NumberOfDeletedElements() { | 4280 int NumberOfDeletedElements() { |
4281 return Smi::cast(get(kNumberOfDeletedElementsIndex))->value(); | 4281 return Smi::cast(get(kNumberOfDeletedElementsIndex))->value(); |
4282 } | 4282 } |
4283 | 4283 |
4284 int UsedCapacity() { return NumberOfElements() + NumberOfDeletedElements(); } | 4284 int UsedCapacity() { return NumberOfElements() + NumberOfDeletedElements(); } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4363 | 4363 |
4364 | 4364 |
4365 class OrderedHashSet: public OrderedHashTable< | 4365 class OrderedHashSet: public OrderedHashTable< |
4366 OrderedHashSet, JSSetIterator, 1> { | 4366 OrderedHashSet, JSSetIterator, 1> { |
4367 public: | 4367 public: |
4368 static OrderedHashSet* cast(Object* obj) { | 4368 static OrderedHashSet* cast(Object* obj) { |
4369 ASSERT(obj->IsOrderedHashTable()); | 4369 ASSERT(obj->IsOrderedHashTable()); |
4370 return reinterpret_cast<OrderedHashSet*>(obj); | 4370 return reinterpret_cast<OrderedHashSet*>(obj); |
4371 } | 4371 } |
4372 | 4372 |
4373 bool Contains(Object* key); | 4373 bool Contains(Handle<Object> key); |
4374 static Handle<OrderedHashSet> Add( | 4374 static Handle<OrderedHashSet> Add( |
4375 Handle<OrderedHashSet> table, Handle<Object> key); | 4375 Handle<OrderedHashSet> table, Handle<Object> key); |
4376 static Handle<OrderedHashSet> Remove( | 4376 static Handle<OrderedHashSet> Remove( |
4377 Handle<OrderedHashSet> table, Handle<Object> key); | 4377 Handle<OrderedHashSet> table, Handle<Object> key); |
4378 }; | 4378 }; |
4379 | 4379 |
4380 | 4380 |
4381 class JSMapIterator; | 4381 class JSMapIterator; |
4382 | 4382 |
4383 | 4383 |
(...skipping 6808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11192 } else { | 11192 } else { |
11193 value &= ~(1 << bit_position); | 11193 value &= ~(1 << bit_position); |
11194 } | 11194 } |
11195 return value; | 11195 return value; |
11196 } | 11196 } |
11197 }; | 11197 }; |
11198 | 11198 |
11199 } } // namespace v8::internal | 11199 } } // namespace v8::internal |
11200 | 11200 |
11201 #endif // V8_OBJECTS_H_ | 11201 #endif // V8_OBJECTS_H_ |
OLD | NEW |