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 2274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2285 Context* GetCreationContext(); | 2285 Context* GetCreationContext(); |
2286 | 2286 |
2287 // Enqueue change record for Object.observe. May cause GC. | 2287 // Enqueue change record for Object.observe. May cause GC. |
2288 MUST_USE_RESULT static MaybeHandle<Object> EnqueueChangeRecord( | 2288 MUST_USE_RESULT static MaybeHandle<Object> EnqueueChangeRecord( |
2289 Handle<JSObject> object, const char* type, Handle<Name> name, | 2289 Handle<JSObject> object, const char* type, Handle<Name> name, |
2290 Handle<Object> old_value); | 2290 Handle<Object> old_value); |
2291 | 2291 |
2292 // Gets the current elements capacity and the number of used elements. | 2292 // Gets the current elements capacity and the number of used elements. |
2293 void GetElementsCapacityAndUsage(int* capacity, int* used); | 2293 void GetElementsCapacityAndUsage(int* capacity, int* used); |
2294 | 2294 |
| 2295 // Deletes an existing named property in a normalized object. |
| 2296 static void DeleteNormalizedProperty(Handle<JSObject> object, |
| 2297 Handle<Name> name, int entry); |
| 2298 |
2295 private: | 2299 private: |
2296 friend class DictionaryElementsAccessor; | 2300 friend class DictionaryElementsAccessor; |
2297 friend class JSReceiver; | 2301 friend class JSReceiver; |
2298 friend class Object; | 2302 friend class Object; |
2299 | 2303 |
2300 static void MigrateFastToFast(Handle<JSObject> object, Handle<Map> new_map); | 2304 static void MigrateFastToFast(Handle<JSObject> object, Handle<Map> new_map); |
2301 static void MigrateFastToSlow(Handle<JSObject> object, | 2305 static void MigrateFastToSlow(Handle<JSObject> object, |
2302 Handle<Map> new_map, | 2306 Handle<Map> new_map, |
2303 int expected_additional_properties); | 2307 int expected_additional_properties); |
2304 | 2308 |
2305 // Used from Object::GetProperty(). | 2309 // Used from Object::GetProperty(). |
2306 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck( | 2310 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck( |
2307 LookupIterator* it); | 2311 LookupIterator* it); |
2308 | 2312 |
2309 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithFailedAccessCheck( | 2313 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithFailedAccessCheck( |
2310 LookupIterator* it, Handle<Object> value); | 2314 LookupIterator* it, Handle<Object> value); |
2311 | 2315 |
2312 // Add a property to a slow-case object. | 2316 // Add a property to a slow-case object. |
2313 static void AddSlowProperty(Handle<JSObject> object, | 2317 static void AddSlowProperty(Handle<JSObject> object, |
2314 Handle<Name> name, | 2318 Handle<Name> name, |
2315 Handle<Object> value, | 2319 Handle<Object> value, |
2316 PropertyAttributes attributes); | 2320 PropertyAttributes attributes); |
2317 | 2321 |
2318 MUST_USE_RESULT static MaybeHandle<Object> DeletePropertyWithInterceptor( | 2322 MUST_USE_RESULT static MaybeHandle<Object> DeletePropertyWithInterceptor( |
2319 LookupIterator* it); | 2323 LookupIterator* it); |
2320 | 2324 |
2321 // Deletes an existing named property in a normalized object. | |
2322 static void DeleteNormalizedProperty(Handle<JSObject> object, | |
2323 Handle<Name> name); | |
2324 | |
2325 bool ReferencesObjectFromElements(FixedArray* elements, | 2325 bool ReferencesObjectFromElements(FixedArray* elements, |
2326 ElementsKind kind, | 2326 ElementsKind kind, |
2327 Object* object); | 2327 Object* object); |
2328 | 2328 |
2329 static bool CanSetCallback(Handle<JSObject> object, Handle<Name> name); | 2329 static bool CanSetCallback(Handle<JSObject> object, Handle<Name> name); |
2330 static void SetElementCallback(Handle<JSObject> object, | 2330 static void SetElementCallback(Handle<JSObject> object, |
2331 uint32_t index, | 2331 uint32_t index, |
2332 Handle<Object> structure, | 2332 Handle<Object> structure, |
2333 PropertyAttributes attributes); | 2333 PropertyAttributes attributes); |
2334 static void SetPropertyCallback(Handle<JSObject> object, | 2334 static void SetPropertyCallback(Handle<JSObject> object, |
(...skipping 8491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10826 } else { | 10826 } else { |
10827 value &= ~(1 << bit_position); | 10827 value &= ~(1 << bit_position); |
10828 } | 10828 } |
10829 return value; | 10829 return value; |
10830 } | 10830 } |
10831 }; | 10831 }; |
10832 | 10832 |
10833 } } // namespace v8::internal | 10833 } } // namespace v8::internal |
10834 | 10834 |
10835 #endif // V8_OBJECTS_H_ | 10835 #endif // V8_OBJECTS_H_ |
OLD | NEW |