| 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 "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
| 10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
| (...skipping 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2717 PropertyAttributes attributes); | 2717 PropertyAttributes attributes); |
| 2718 static void SetPropertyCallback(Handle<JSObject> object, | 2718 static void SetPropertyCallback(Handle<JSObject> object, |
| 2719 Handle<Name> name, | 2719 Handle<Name> name, |
| 2720 Handle<Object> structure, | 2720 Handle<Object> structure, |
| 2721 PropertyAttributes attributes); | 2721 PropertyAttributes attributes); |
| 2722 static void DefineElementAccessor(Handle<JSObject> object, | 2722 static void DefineElementAccessor(Handle<JSObject> object, |
| 2723 uint32_t index, | 2723 uint32_t index, |
| 2724 Handle<Object> getter, | 2724 Handle<Object> getter, |
| 2725 Handle<Object> setter, | 2725 Handle<Object> setter, |
| 2726 PropertyAttributes attributes); | 2726 PropertyAttributes attributes); |
| 2727 static Handle<AccessorPair> CreateAccessorPairFor(Handle<JSObject> object, | |
| 2728 Handle<Name> name); | |
| 2729 static void DefinePropertyAccessor(Handle<JSObject> object, | |
| 2730 Handle<Name> name, | |
| 2731 Handle<Object> getter, | |
| 2732 Handle<Object> setter, | |
| 2733 PropertyAttributes attributes); | |
| 2734 | |
| 2735 // Try to define a single accessor paying attention to map transitions. | |
| 2736 // Returns false if this was not possible and we have to use the slow case. | |
| 2737 static bool DefineFastAccessor(Handle<JSObject> object, | |
| 2738 Handle<Name> name, | |
| 2739 AccessorComponent component, | |
| 2740 Handle<Object> accessor, | |
| 2741 PropertyAttributes attributes); | |
| 2742 | |
| 2743 | 2727 |
| 2744 // Return the hash table backing store or the inline stored identity hash, | 2728 // Return the hash table backing store or the inline stored identity hash, |
| 2745 // whatever is found. | 2729 // whatever is found. |
| 2746 MUST_USE_RESULT Object* GetHiddenPropertiesHashTable(); | 2730 MUST_USE_RESULT Object* GetHiddenPropertiesHashTable(); |
| 2747 | 2731 |
| 2748 // Return the hash table backing store for hidden properties. If there is no | 2732 // Return the hash table backing store for hidden properties. If there is no |
| 2749 // backing store, allocate one. | 2733 // backing store, allocate one. |
| 2750 static Handle<ObjectHashTable> GetOrCreateHiddenPropertiesHashtable( | 2734 static Handle<ObjectHashTable> GetOrCreateHiddenPropertiesHashtable( |
| 2751 Handle<JSObject> object); | 2735 Handle<JSObject> object); |
| 2752 | 2736 |
| (...skipping 3702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6455 static Handle<Map> CopyForFreeze(Handle<Map> map); | 6439 static Handle<Map> CopyForFreeze(Handle<Map> map); |
| 6456 // Maximal number of fast properties. Used to restrict the number of map | 6440 // Maximal number of fast properties. Used to restrict the number of map |
| 6457 // transitions to avoid an explosion in the number of maps for objects used as | 6441 // transitions to avoid an explosion in the number of maps for objects used as |
| 6458 // dictionaries. | 6442 // dictionaries. |
| 6459 inline bool TooManyFastProperties(StoreFromKeyed store_mode); | 6443 inline bool TooManyFastProperties(StoreFromKeyed store_mode); |
| 6460 static Handle<Map> TransitionToDataProperty(Handle<Map> map, | 6444 static Handle<Map> TransitionToDataProperty(Handle<Map> map, |
| 6461 Handle<Name> name, | 6445 Handle<Name> name, |
| 6462 Handle<Object> value, | 6446 Handle<Object> value, |
| 6463 PropertyAttributes attributes, | 6447 PropertyAttributes attributes, |
| 6464 StoreFromKeyed store_mode); | 6448 StoreFromKeyed store_mode); |
| 6449 static Handle<Map> TransitionToAccessorProperty( |
| 6450 Handle<Map> map, Handle<Name> name, AccessorComponent component, |
| 6451 Handle<Object> accessor, PropertyAttributes attributes); |
| 6465 static Handle<Map> ReconfigureDataProperty(Handle<Map> map, int descriptor, | 6452 static Handle<Map> ReconfigureDataProperty(Handle<Map> map, int descriptor, |
| 6466 PropertyAttributes attributes); | 6453 PropertyAttributes attributes); |
| 6467 | 6454 |
| 6468 inline void AppendDescriptor(Descriptor* desc); | 6455 inline void AppendDescriptor(Descriptor* desc); |
| 6469 | 6456 |
| 6470 // Returns a copy of the map, with all transitions dropped from the | 6457 // Returns a copy of the map, with all transitions dropped from the |
| 6471 // instance descriptors. | 6458 // instance descriptors. |
| 6472 static Handle<Map> Copy(Handle<Map> map); | 6459 static Handle<Map> Copy(Handle<Map> map); |
| 6473 static Handle<Map> Create(Handle<JSFunction> constructor, | 6460 static Handle<Map> Create(Handle<JSFunction> constructor, |
| 6474 int extra_inobject_properties); | 6461 int extra_inobject_properties); |
| (...skipping 4734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11209 } else { | 11196 } else { |
| 11210 value &= ~(1 << bit_position); | 11197 value &= ~(1 << bit_position); |
| 11211 } | 11198 } |
| 11212 return value; | 11199 return value; |
| 11213 } | 11200 } |
| 11214 }; | 11201 }; |
| 11215 | 11202 |
| 11216 } } // namespace v8::internal | 11203 } } // namespace v8::internal |
| 11217 | 11204 |
| 11218 #endif // V8_OBJECTS_H_ | 11205 #endif // V8_OBJECTS_H_ |
| OLD | NEW |