OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2291 // Gets the value of a hidden property with the given key. Returns the hole | 2291 // Gets the value of a hidden property with the given key. Returns the hole |
2292 // if the property doesn't exist (or if called on a detached proxy), | 2292 // if the property doesn't exist (or if called on a detached proxy), |
2293 // otherwise returns the value set for the key. | 2293 // otherwise returns the value set for the key. |
2294 Object* GetHiddenProperty(Name* key); | 2294 Object* GetHiddenProperty(Name* key); |
2295 // Deletes a hidden property. Deleting a non-existing property is | 2295 // Deletes a hidden property. Deleting a non-existing property is |
2296 // considered successful. | 2296 // considered successful. |
2297 void DeleteHiddenProperty(Name* key); | 2297 void DeleteHiddenProperty(Name* key); |
2298 // Returns true if the object has a property with the hidden string as name. | 2298 // Returns true if the object has a property with the hidden string as name. |
2299 bool HasHiddenProperties(); | 2299 bool HasHiddenProperties(); |
2300 | 2300 |
2301 static int GetIdentityHash(Handle<JSObject> obj); | 2301 static int GetIdentityHash(Handle<JSObject> object); |
2302 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | 2302 static void SetIdentityHash(Handle<JSObject> object, Smi* hash); |
2303 MUST_USE_RESULT MaybeObject* SetIdentityHash(Smi* hash, CreationFlag flag); | |
2304 | 2303 |
2305 inline void ValidateElements(); | 2304 inline void ValidateElements(); |
2306 | 2305 |
2307 // Makes sure that this object can contain HeapObject as elements. | 2306 // Makes sure that this object can contain HeapObject as elements. |
2308 MUST_USE_RESULT inline MaybeObject* EnsureCanContainHeapObjectElements(); | 2307 MUST_USE_RESULT inline MaybeObject* EnsureCanContainHeapObjectElements(); |
2309 | 2308 |
2310 // Makes sure that this object can contain the specified elements. | 2309 // Makes sure that this object can contain the specified elements. |
2311 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( | 2310 MUST_USE_RESULT inline MaybeObject* EnsureCanContainElements( |
2312 Object** elements, | 2311 Object** elements, |
2313 uint32_t count, | 2312 uint32_t count, |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2840 // for hidden properties. If there is no backing store, allocate one. | 2839 // for hidden properties. If there is no backing store, allocate one. |
2841 // If create_if_absent is false, return the hash table backing store | 2840 // If create_if_absent is false, return the hash table backing store |
2842 // or the inline stored identity hash, whatever is found. | 2841 // or the inline stored identity hash, whatever is found. |
2843 MUST_USE_RESULT MaybeObject* GetHiddenPropertiesHashTable( | 2842 MUST_USE_RESULT MaybeObject* GetHiddenPropertiesHashTable( |
2844 InitializeHiddenProperties init_option); | 2843 InitializeHiddenProperties init_option); |
2845 // Set the hidden property backing store to either a hash table or | 2844 // Set the hidden property backing store to either a hash table or |
2846 // the inline-stored identity hash. | 2845 // the inline-stored identity hash. |
2847 MUST_USE_RESULT MaybeObject* SetHiddenPropertiesHashTable( | 2846 MUST_USE_RESULT MaybeObject* SetHiddenPropertiesHashTable( |
2848 Object* value); | 2847 Object* value); |
2849 | 2848 |
| 2849 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); |
| 2850 |
2850 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); | 2851 DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject); |
2851 }; | 2852 }; |
2852 | 2853 |
2853 | 2854 |
2854 // Common superclass for FixedArrays that allow implementations to share | 2855 // Common superclass for FixedArrays that allow implementations to share |
2855 // common accessors and some code paths. | 2856 // common accessors and some code paths. |
2856 class FixedArrayBase: public HeapObject { | 2857 class FixedArrayBase: public HeapObject { |
2857 public: | 2858 public: |
2858 // [length]: length of the array. | 2859 // [length]: length of the array. |
2859 inline int length(); | 2860 inline int length(); |
(...skipping 6238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9098 StrictModeFlag strict_mode, | 9099 StrictModeFlag strict_mode, |
9099 bool* done); | 9100 bool* done); |
9100 | 9101 |
9101 MUST_USE_RESULT PropertyAttributes GetPropertyAttributeWithHandler( | 9102 MUST_USE_RESULT PropertyAttributes GetPropertyAttributeWithHandler( |
9102 JSReceiver* receiver, | 9103 JSReceiver* receiver, |
9103 Name* name); | 9104 Name* name); |
9104 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithHandler( | 9105 MUST_USE_RESULT PropertyAttributes GetElementAttributeWithHandler( |
9105 JSReceiver* receiver, | 9106 JSReceiver* receiver, |
9106 uint32_t index); | 9107 uint32_t index); |
9107 | 9108 |
9108 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); | |
9109 | |
9110 // Turn this into an (empty) JSObject. | 9109 // Turn this into an (empty) JSObject. |
9111 void Fix(); | 9110 void Fix(); |
9112 | 9111 |
9113 // Initializes the body after the handler slot. | 9112 // Initializes the body after the handler slot. |
9114 inline void InitializeBody(int object_size, Object* value); | 9113 inline void InitializeBody(int object_size, Object* value); |
9115 | 9114 |
9116 // Invoke a trap by name. If the trap does not exist on this's handler, | 9115 // Invoke a trap by name. If the trap does not exist on this's handler, |
9117 // but derived_trap is non-NULL, invoke that instead. May cause GC. | 9116 // but derived_trap is non-NULL, invoke that instead. May cause GC. |
9118 Handle<Object> CallTrap(const char* name, | 9117 Handle<Object> CallTrap(const char* name, |
9119 Handle<Object> derived_trap, | 9118 Handle<Object> derived_trap, |
(...skipping 29 matching lines...) Expand all Loading... |
9149 Handle<Object> value, | 9148 Handle<Object> value, |
9150 StrictModeFlag strict_mode); | 9149 StrictModeFlag strict_mode); |
9151 | 9150 |
9152 static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> proxy, | 9151 static Handle<Object> DeletePropertyWithHandler(Handle<JSProxy> proxy, |
9153 Handle<Name> name, | 9152 Handle<Name> name, |
9154 DeleteMode mode); | 9153 DeleteMode mode); |
9155 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> proxy, | 9154 static Handle<Object> DeleteElementWithHandler(Handle<JSProxy> proxy, |
9156 uint32_t index, | 9155 uint32_t index, |
9157 DeleteMode mode); | 9156 DeleteMode mode); |
9158 | 9157 |
| 9158 MUST_USE_RESULT MaybeObject* GetIdentityHash(CreationFlag flag); |
| 9159 |
9159 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); | 9160 DISALLOW_IMPLICIT_CONSTRUCTORS(JSProxy); |
9160 }; | 9161 }; |
9161 | 9162 |
9162 | 9163 |
9163 class JSFunctionProxy: public JSProxy { | 9164 class JSFunctionProxy: public JSProxy { |
9164 public: | 9165 public: |
9165 // [call_trap]: The call trap. | 9166 // [call_trap]: The call trap. |
9166 DECL_ACCESSORS(call_trap, Object) | 9167 DECL_ACCESSORS(call_trap, Object) |
9167 | 9168 |
9168 // [construct_trap]: The construct trap. | 9169 // [construct_trap]: The construct trap. |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10232 } else { | 10233 } else { |
10233 value &= ~(1 << bit_position); | 10234 value &= ~(1 << bit_position); |
10234 } | 10235 } |
10235 return value; | 10236 return value; |
10236 } | 10237 } |
10237 }; | 10238 }; |
10238 | 10239 |
10239 } } // namespace v8::internal | 10240 } } // namespace v8::internal |
10240 | 10241 |
10241 #endif // V8_OBJECTS_H_ | 10242 #endif // V8_OBJECTS_H_ |
OLD | NEW |