OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2059 uint32_t limit); | 2059 uint32_t limit); |
2060 // As PrepareElementsForSort, but only on objects where elements is | 2060 // As PrepareElementsForSort, but only on objects where elements is |
2061 // a dictionary, and it will stay a dictionary. Collates undefined and | 2061 // a dictionary, and it will stay a dictionary. Collates undefined and |
2062 // unexisting elements below limit from position zero of the elements. | 2062 // unexisting elements below limit from position zero of the elements. |
2063 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, | 2063 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, |
2064 uint32_t limit); | 2064 uint32_t limit); |
2065 | 2065 |
2066 MUST_USE_RESULT static Maybe<bool> SetPropertyWithInterceptor( | 2066 MUST_USE_RESULT static Maybe<bool> SetPropertyWithInterceptor( |
2067 LookupIterator* it, ShouldThrow should_throw, Handle<Object> value); | 2067 LookupIterator* it, ShouldThrow should_throw, Handle<Object> value); |
2068 | 2068 |
2069 // SetLocalPropertyIgnoreAttributes converts callbacks to fields. We need to | 2069 // The API currently still wants DefineOwnPropertyIgnoreAttributes to convert |
2070 // grant an exemption to AccessorInfo callbacks in some cases. | 2070 // AccessorInfo objects to data fields. We allow FORCE_FIELD as an exception |
2071 enum AccessorInfoHandling { DEFAULT_HANDLING, DONT_FORCE_FIELD }; | 2071 // to the default behavior that calls the setter. |
| 2072 enum AccessorInfoHandling { FORCE_FIELD, DONT_FORCE_FIELD }; |
2072 | 2073 |
2073 MUST_USE_RESULT static MaybeHandle<Object> DefineOwnPropertyIgnoreAttributes( | 2074 MUST_USE_RESULT static MaybeHandle<Object> DefineOwnPropertyIgnoreAttributes( |
2074 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, | 2075 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, |
2075 AccessorInfoHandling handling = DEFAULT_HANDLING); | 2076 AccessorInfoHandling handling = DONT_FORCE_FIELD); |
2076 | 2077 |
2077 MUST_USE_RESULT static Maybe<bool> DefineOwnPropertyIgnoreAttributes( | 2078 MUST_USE_RESULT static Maybe<bool> DefineOwnPropertyIgnoreAttributes( |
2078 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, | 2079 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, |
2079 ShouldThrow should_throw, | 2080 ShouldThrow should_throw, |
2080 AccessorInfoHandling handling = DEFAULT_HANDLING); | 2081 AccessorInfoHandling handling = DONT_FORCE_FIELD); |
2081 | 2082 |
2082 MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes( | 2083 MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes( |
2083 Handle<JSObject> object, Handle<Name> name, Handle<Object> value, | 2084 Handle<JSObject> object, Handle<Name> name, Handle<Object> value, |
2084 PropertyAttributes attributes, | 2085 PropertyAttributes attributes); |
2085 AccessorInfoHandling handling = DEFAULT_HANDLING); | |
2086 | 2086 |
2087 MUST_USE_RESULT static MaybeHandle<Object> SetOwnElementIgnoreAttributes( | 2087 MUST_USE_RESULT static MaybeHandle<Object> SetOwnElementIgnoreAttributes( |
2088 Handle<JSObject> object, uint32_t index, Handle<Object> value, | 2088 Handle<JSObject> object, uint32_t index, Handle<Object> value, |
2089 PropertyAttributes attributes, | 2089 PropertyAttributes attributes); |
2090 AccessorInfoHandling handling = DEFAULT_HANDLING); | |
2091 | 2090 |
2092 // Equivalent to one of the above depending on whether |name| can be converted | 2091 // Equivalent to one of the above depending on whether |name| can be converted |
2093 // to an array index. | 2092 // to an array index. |
2094 MUST_USE_RESULT static MaybeHandle<Object> | 2093 MUST_USE_RESULT static MaybeHandle<Object> |
2095 DefinePropertyOrElementIgnoreAttributes( | 2094 DefinePropertyOrElementIgnoreAttributes(Handle<JSObject> object, |
2096 Handle<JSObject> object, Handle<Name> name, Handle<Object> value, | 2095 Handle<Name> name, |
2097 PropertyAttributes attributes = NONE, | 2096 Handle<Object> value, |
2098 AccessorInfoHandling handling = DEFAULT_HANDLING); | 2097 PropertyAttributes attributes = NONE); |
2099 | 2098 |
2100 // Adds or reconfigures a property to attributes NONE. It will fail when it | 2099 // Adds or reconfigures a property to attributes NONE. It will fail when it |
2101 // cannot. | 2100 // cannot. |
2102 MUST_USE_RESULT static Maybe<bool> CreateDataProperty(LookupIterator* it, | 2101 MUST_USE_RESULT static Maybe<bool> CreateDataProperty(LookupIterator* it, |
2103 Handle<Object> value); | 2102 Handle<Object> value); |
2104 | 2103 |
2105 static void AddProperty(Handle<JSObject> object, Handle<Name> name, | 2104 static void AddProperty(Handle<JSObject> object, Handle<Name> name, |
2106 Handle<Object> value, PropertyAttributes attributes); | 2105 Handle<Object> value, PropertyAttributes attributes); |
2107 | 2106 |
2108 MUST_USE_RESULT static Maybe<bool> AddDataElement( | 2107 MUST_USE_RESULT static Maybe<bool> AddDataElement( |
(...skipping 8696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10805 } | 10804 } |
10806 return value; | 10805 return value; |
10807 } | 10806 } |
10808 }; | 10807 }; |
10809 | 10808 |
10810 | 10809 |
10811 } // NOLINT, false-positive due to second-order macros. | 10810 } // NOLINT, false-positive due to second-order macros. |
10812 } // NOLINT, false-positive due to second-order macros. | 10811 } // NOLINT, false-positive due to second-order macros. |
10813 | 10812 |
10814 #endif // V8_OBJECTS_H_ | 10813 #endif // V8_OBJECTS_H_ |
OLD | NEW |