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 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2058 uint32_t limit); | 2058 uint32_t limit); |
2059 // As PrepareElementsForSort, but only on objects where elements is | 2059 // As PrepareElementsForSort, but only on objects where elements is |
2060 // a dictionary, and it will stay a dictionary. Collates undefined and | 2060 // a dictionary, and it will stay a dictionary. Collates undefined and |
2061 // unexisting elements below limit from position zero of the elements. | 2061 // unexisting elements below limit from position zero of the elements. |
2062 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, | 2062 static Handle<Object> PrepareSlowElementsForSort(Handle<JSObject> object, |
2063 uint32_t limit); | 2063 uint32_t limit); |
2064 | 2064 |
2065 MUST_USE_RESULT static Maybe<bool> SetPropertyWithInterceptor( | 2065 MUST_USE_RESULT static Maybe<bool> SetPropertyWithInterceptor( |
2066 LookupIterator* it, ShouldThrow should_throw, Handle<Object> value); | 2066 LookupIterator* it, ShouldThrow should_throw, Handle<Object> value); |
2067 | 2067 |
2068 // The API currently still wants DefineOwnPropertyIgnoreAttributes to convert | 2068 // SetLocalPropertyIgnoreAttributes converts callbacks to fields. We need to |
2069 // AccessorInfo objects to data fields. We allow FORCE_FIELD as an exception | 2069 // grant an exemption to AccessorInfo callbacks in some cases. |
2070 // to the default behavior that calls the setter. | 2070 enum AccessorInfoHandling { DEFAULT_HANDLING, DONT_FORCE_FIELD }; |
2071 enum AccessorInfoHandling { FORCE_FIELD, DONT_FORCE_FIELD }; | |
2072 | 2071 |
2073 MUST_USE_RESULT static MaybeHandle<Object> DefineOwnPropertyIgnoreAttributes( | 2072 MUST_USE_RESULT static MaybeHandle<Object> DefineOwnPropertyIgnoreAttributes( |
2074 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, | 2073 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, |
2075 AccessorInfoHandling handling = DONT_FORCE_FIELD); | 2074 AccessorInfoHandling handling = DEFAULT_HANDLING); |
2076 | 2075 |
2077 MUST_USE_RESULT static Maybe<bool> DefineOwnPropertyIgnoreAttributes( | 2076 MUST_USE_RESULT static Maybe<bool> DefineOwnPropertyIgnoreAttributes( |
2078 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, | 2077 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, |
2079 ShouldThrow should_throw, | 2078 ShouldThrow should_throw, |
2080 AccessorInfoHandling handling = DONT_FORCE_FIELD); | 2079 AccessorInfoHandling handling = DEFAULT_HANDLING); |
2081 | 2080 |
2082 MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes( | 2081 MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes( |
2083 Handle<JSObject> object, Handle<Name> name, Handle<Object> value, | 2082 Handle<JSObject> object, Handle<Name> name, Handle<Object> value, |
2084 PropertyAttributes attributes); | 2083 PropertyAttributes attributes, |
| 2084 AccessorInfoHandling handling = DEFAULT_HANDLING); |
2085 | 2085 |
2086 MUST_USE_RESULT static MaybeHandle<Object> SetOwnElementIgnoreAttributes( | 2086 MUST_USE_RESULT static MaybeHandle<Object> SetOwnElementIgnoreAttributes( |
2087 Handle<JSObject> object, uint32_t index, Handle<Object> value, | 2087 Handle<JSObject> object, uint32_t index, Handle<Object> value, |
2088 PropertyAttributes attributes); | 2088 PropertyAttributes attributes, |
| 2089 AccessorInfoHandling handling = DEFAULT_HANDLING); |
2089 | 2090 |
2090 // 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 |
2091 // to an array index. | 2092 // to an array index. |
2092 MUST_USE_RESULT static MaybeHandle<Object> | 2093 MUST_USE_RESULT static MaybeHandle<Object> |
2093 DefinePropertyOrElementIgnoreAttributes(Handle<JSObject> object, | 2094 DefinePropertyOrElementIgnoreAttributes( |
2094 Handle<Name> name, | 2095 Handle<JSObject> object, Handle<Name> name, Handle<Object> value, |
2095 Handle<Object> value, | 2096 PropertyAttributes attributes = NONE, |
2096 PropertyAttributes attributes = NONE); | 2097 AccessorInfoHandling handling = DEFAULT_HANDLING); |
2097 | 2098 |
2098 // 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 |
2099 // cannot. | 2100 // cannot. |
2100 MUST_USE_RESULT static Maybe<bool> CreateDataProperty(LookupIterator* it, | 2101 MUST_USE_RESULT static Maybe<bool> CreateDataProperty(LookupIterator* it, |
2101 Handle<Object> value); | 2102 Handle<Object> value); |
2102 | 2103 |
2103 static void AddProperty(Handle<JSObject> object, Handle<Name> name, | 2104 static void AddProperty(Handle<JSObject> object, Handle<Name> name, |
2104 Handle<Object> value, PropertyAttributes attributes); | 2105 Handle<Object> value, PropertyAttributes attributes); |
2105 | 2106 |
2106 MUST_USE_RESULT static Maybe<bool> AddDataElement( | 2107 MUST_USE_RESULT static Maybe<bool> AddDataElement( |
(...skipping 8671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10778 } | 10779 } |
10779 return value; | 10780 return value; |
10780 } | 10781 } |
10781 }; | 10782 }; |
10782 | 10783 |
10783 | 10784 |
10784 } // NOLINT, false-positive due to second-order macros. | 10785 } // NOLINT, false-positive due to second-order macros. |
10785 } // NOLINT, false-positive due to second-order macros. | 10786 } // NOLINT, false-positive due to second-order macros. |
10786 | 10787 |
10787 #endif // V8_OBJECTS_H_ | 10788 #endif // V8_OBJECTS_H_ |
OLD | NEW |