Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 8ed90605f1a586a0d303b6449d5552213edc714f..eb82df9b5fbcbdb6aa96a3cc8742300e73f6eff2 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -51,6 +51,7 @@ |
| // - JSReceiver (suitable for property access) |
| // - JSObject |
| // - JSArray |
| +// - JSWeakMap |
| // - JSRegExp |
| // - JSFunction |
| // - GlobalObject |
| @@ -331,6 +332,7 @@ static const int kVariableSizeSentinel = 0; |
| V(JS_GLOBAL_PROXY_TYPE) \ |
| V(JS_ARRAY_TYPE) \ |
| V(JS_PROXY_TYPE) \ |
| + V(JS_WEAKMAP_TYPE) \ |
|
danno
2011/07/29 08:17:33
nit: WEAK_MAP is more consistent
|
| V(JS_REGEXP_TYPE) \ |
| \ |
| V(JS_FUNCTION_TYPE) \ |
| @@ -568,6 +570,7 @@ enum InstanceType { |
| JS_GLOBAL_PROXY_TYPE, |
| JS_ARRAY_TYPE, |
| JS_PROXY_TYPE, |
| + JS_WEAKMAP_TYPE, |
| JS_REGEXP_TYPE, // LAST_NONCALLABLE_SPEC_OBJECT_TYPE |
| @@ -748,6 +751,7 @@ class MaybeObject BASE_EMBEDDED { |
| V(JSArray) \ |
| V(JSProxy) \ |
| V(JSFunctionProxy) \ |
| + V(JSWeakMap) \ |
| V(JSRegExp) \ |
| V(HashTable) \ |
| V(Dictionary) \ |
| @@ -6618,6 +6622,23 @@ class JSFunctionProxy: public JSProxy { |
| }; |
| +// The JSWeakMap describes EcmaScript Harmony weak maps |
| +class JSWeakMap: public JSObject { |
| + public: |
| + // [table]: the backing hash table mapping keys to values. |
| + DECL_ACCESSORS(table, ObjectHashTable) |
| + |
| + // Casting. |
| + static inline JSWeakMap* cast(Object* obj); |
| + |
| + static const int kTableOffset = JSObject::kHeaderSize; |
| + static const int kSize = kTableOffset + kPointerSize; |
| + |
| + private: |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); |
| +}; |
| + |
| + |
| // Foreign describes objects pointing from JavaScript to C structures. |
| // Since they cannot contain references to JS HeapObjects they can be |
| // placed in old_data_space. |