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 9427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9438 | 9438 |
9439 // Base class for both JSWeakMap and JSWeakSet | 9439 // Base class for both JSWeakMap and JSWeakSet |
9440 class JSWeakCollection: public JSObject { | 9440 class JSWeakCollection: public JSObject { |
9441 public: | 9441 public: |
9442 // [table]: the backing hash table mapping keys to values. | 9442 // [table]: the backing hash table mapping keys to values. |
9443 DECL_ACCESSORS(table, Object) | 9443 DECL_ACCESSORS(table, Object) |
9444 | 9444 |
9445 // [next]: linked list of encountered weak maps during GC. | 9445 // [next]: linked list of encountered weak maps during GC. |
9446 DECL_ACCESSORS(next, Object) | 9446 DECL_ACCESSORS(next, Object) |
9447 | 9447 |
| 9448 static void Initialize(Handle<JSWeakCollection> collection, Isolate* isolate); |
| 9449 static void Set(Handle<JSWeakCollection> collection, Handle<Object> key, |
| 9450 Handle<Object> value, int32_t hash); |
| 9451 static bool Delete(Handle<JSWeakCollection> collection, Handle<Object> key, |
| 9452 int32_t hash); |
| 9453 |
9448 static const int kTableOffset = JSObject::kHeaderSize; | 9454 static const int kTableOffset = JSObject::kHeaderSize; |
9449 static const int kNextOffset = kTableOffset + kPointerSize; | 9455 static const int kNextOffset = kTableOffset + kPointerSize; |
9450 static const int kSize = kNextOffset + kPointerSize; | 9456 static const int kSize = kNextOffset + kPointerSize; |
9451 | 9457 |
9452 private: | 9458 private: |
9453 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakCollection); | 9459 DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakCollection); |
9454 }; | 9460 }; |
9455 | 9461 |
9456 | 9462 |
9457 // The JSWeakMap describes EcmaScript Harmony weak maps | 9463 // The JSWeakMap describes EcmaScript Harmony weak maps |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10320 } else { | 10326 } else { |
10321 value &= ~(1 << bit_position); | 10327 value &= ~(1 << bit_position); |
10322 } | 10328 } |
10323 return value; | 10329 return value; |
10324 } | 10330 } |
10325 }; | 10331 }; |
10326 | 10332 |
10327 } } // namespace v8::internal | 10333 } } // namespace v8::internal |
10328 | 10334 |
10329 #endif // V8_OBJECTS_H_ | 10335 #endif // V8_OBJECTS_H_ |
OLD | NEW |