Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 8ed90605f1a586a0d303b6449d5552213edc714f..58b6f281b4b986ebd7ea6f7946830b0d90eadd42 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_WEAK_MAP_TYPE) \ |
| 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_WEAK_MAP_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,33 @@ 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); |
| + |
| +#ifdef OBJECT_PRINT |
| + inline void JSWeakMapPrint() { |
| + JSWeakMapPrint(stdout); |
| + } |
| + void JSWeakMapPrint(FILE* out); |
| +#endif |
| +#ifdef DEBUG |
| + void JSWeakMapVerify(); |
| +#endif |
| + |
| + static const int kTableOffset = JSObject::kHeaderSize; |
| + static const int kSize = kTableOffset + kPointerSize; |
| + |
| + private: |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap); |
|
danno
2011/08/02 12:48:02
I wonder, do you really properly handle in-line pr
Michael Starzinger
2011/08/02 14:05:22
Yes, any in-object properties would overwrite the
|
| +}; |
| + |
| + |
| // 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. |