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 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2150 enum ExecutableAccessorInfoHandling { | 2150 enum ExecutableAccessorInfoHandling { |
2151 DEFAULT_HANDLING, | 2151 DEFAULT_HANDLING, |
2152 DONT_FORCE_FIELD | 2152 DONT_FORCE_FIELD |
2153 }; | 2153 }; |
2154 | 2154 |
2155 MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes( | 2155 MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes( |
2156 Handle<JSObject> object, | 2156 Handle<JSObject> object, |
2157 Handle<Name> key, | 2157 Handle<Name> key, |
2158 Handle<Object> value, | 2158 Handle<Object> value, |
2159 PropertyAttributes attributes, | 2159 PropertyAttributes attributes, |
2160 StoreMode mode = ALLOW_AS_CONSTANT, | |
2161 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK, | 2160 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK, |
2162 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, | 2161 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, |
2163 ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING); | 2162 ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING); |
2164 | 2163 |
2165 static void AddProperty(Handle<JSObject> object, | 2164 static void AddProperty(Handle<JSObject> object, Handle<Name> key, |
2166 Handle<Name> key, | 2165 Handle<Object> value, PropertyAttributes attributes); |
2167 Handle<Object> value, | |
2168 PropertyAttributes attributes, | |
2169 StoreMode mode = ALLOW_AS_CONSTANT); | |
2170 | 2166 |
2171 // Extend the receiver with a single fast property appeared first in the | 2167 // Extend the receiver with a single fast property appeared first in the |
2172 // passed map. This also extends the property backing store if necessary. | 2168 // passed map. This also extends the property backing store if necessary. |
2173 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); | 2169 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); |
2174 | 2170 |
2175 // Migrates the given object to a map whose field representations are the | 2171 // Migrates the given object to a map whose field representations are the |
2176 // lowest upper bound of all known representations for that field. | 2172 // lowest upper bound of all known representations for that field. |
2177 static void MigrateInstance(Handle<JSObject> instance); | 2173 static void MigrateInstance(Handle<JSObject> instance); |
2178 | 2174 |
2179 // Migrates the given object only if the target map is already available, | 2175 // Migrates the given object only if the target map is already available, |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2643 Handle<Object> value, | 2639 Handle<Object> value, |
2644 PropertyAttributes attributes); | 2640 PropertyAttributes attributes); |
2645 | 2641 |
2646 static void SetPropertyToFieldWithAttributes(LookupResult* lookup, | 2642 static void SetPropertyToFieldWithAttributes(LookupResult* lookup, |
2647 Handle<Name> name, | 2643 Handle<Name> name, |
2648 Handle<Object> value, | 2644 Handle<Object> value, |
2649 PropertyAttributes attributes); | 2645 PropertyAttributes attributes); |
2650 static void GeneralizeFieldRepresentation(Handle<JSObject> object, | 2646 static void GeneralizeFieldRepresentation(Handle<JSObject> object, |
2651 int modify_index, | 2647 int modify_index, |
2652 Representation new_representation, | 2648 Representation new_representation, |
2653 Handle<HeapType> new_field_type, | 2649 Handle<HeapType> new_field_type); |
2654 StoreMode store_mode); | |
2655 | 2650 |
2656 static void UpdateAllocationSite(Handle<JSObject> object, | 2651 static void UpdateAllocationSite(Handle<JSObject> object, |
2657 ElementsKind to_kind); | 2652 ElementsKind to_kind); |
2658 | 2653 |
2659 // Used from Object::GetProperty(). | 2654 // Used from Object::GetProperty(). |
2660 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck( | 2655 MUST_USE_RESULT static MaybeHandle<Object> GetPropertyWithFailedAccessCheck( |
2661 LookupIterator* it); | 2656 LookupIterator* it); |
2662 | 2657 |
2663 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithCallback( | 2658 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithCallback( |
2664 Handle<JSObject> object, | 2659 Handle<JSObject> object, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2726 Handle<JSObject> object, | 2721 Handle<JSObject> object, |
2727 LookupResult* lookup, | 2722 LookupResult* lookup, |
2728 Handle<Name> name, | 2723 Handle<Name> name, |
2729 Handle<Object> value, | 2724 Handle<Object> value, |
2730 PropertyAttributes attributes); | 2725 PropertyAttributes attributes); |
2731 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithFailedAccessCheck( | 2726 MUST_USE_RESULT static MaybeHandle<Object> SetPropertyWithFailedAccessCheck( |
2732 LookupIterator* it, Handle<Object> value, StrictMode strict_mode); | 2727 LookupIterator* it, Handle<Object> value, StrictMode strict_mode); |
2733 | 2728 |
2734 // Add a property to an object. | 2729 // Add a property to an object. |
2735 MUST_USE_RESULT static MaybeHandle<Object> AddPropertyInternal( | 2730 MUST_USE_RESULT static MaybeHandle<Object> AddPropertyInternal( |
2736 Handle<JSObject> object, | 2731 Handle<JSObject> object, Handle<Name> name, Handle<Object> value, |
2737 Handle<Name> name, | 2732 PropertyAttributes attributes, StoreMode mode, StoreFromKeyed store_mode, |
2738 Handle<Object> value, | 2733 ExtensibilityCheck extensibility_check, TransitionFlag flag); |
2739 PropertyAttributes attributes, | |
2740 StrictMode strict_mode, | |
2741 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, | |
2742 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK, | |
2743 StoreMode mode = ALLOW_AS_CONSTANT, | |
2744 TransitionFlag flag = INSERT_TRANSITION); | |
2745 | 2734 |
2746 // Add a property to a fast-case object. | 2735 // Add a property to a fast-case object. |
2747 static void AddFastProperty(Handle<JSObject> object, | 2736 static void AddFastProperty(Handle<JSObject> object, |
2748 Handle<Name> name, | 2737 Handle<Name> name, |
2749 Handle<Object> value, | 2738 Handle<Object> value, |
2750 PropertyAttributes attributes, | 2739 PropertyAttributes attributes, |
2751 StoreFromKeyed store_mode, | 2740 StoreFromKeyed store_mode, |
2752 TransitionFlag flag); | 2741 TransitionFlag flag); |
2753 | 2742 |
2754 // Add a property to a slow-case object. | 2743 // Add a property to a slow-case object. |
(...skipping 8467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11222 } else { | 11211 } else { |
11223 value &= ~(1 << bit_position); | 11212 value &= ~(1 << bit_position); |
11224 } | 11213 } |
11225 return value; | 11214 return value; |
11226 } | 11215 } |
11227 }; | 11216 }; |
11228 | 11217 |
11229 } } // namespace v8::internal | 11218 } } // namespace v8::internal |
11230 | 11219 |
11231 #endif // V8_OBJECTS_H_ | 11220 #endif // V8_OBJECTS_H_ |
OLD | NEW |