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 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1119 Handle<Object> object, Handle<Name> key, Handle<Object> value, | 1119 Handle<Object> object, Handle<Name> key, Handle<Object> value, |
1120 StrictMode strict_mode, | 1120 StrictMode strict_mode, |
1121 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); | 1121 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED); |
1122 | 1122 |
1123 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( | 1123 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( |
1124 LookupIterator* it, Handle<Object> value, StrictMode strict_mode, | 1124 LookupIterator* it, Handle<Object> value, StrictMode strict_mode, |
1125 StoreFromKeyed store_mode, | 1125 StoreFromKeyed store_mode, |
1126 StorePropertyMode data_store_mode = NORMAL_PROPERTY); | 1126 StorePropertyMode data_store_mode = NORMAL_PROPERTY); |
1127 MUST_USE_RESULT static MaybeHandle<Object> WriteToReadOnlyProperty( | 1127 MUST_USE_RESULT static MaybeHandle<Object> WriteToReadOnlyProperty( |
1128 LookupIterator* it, Handle<Object> value, StrictMode strict_mode); | 1128 LookupIterator* it, Handle<Object> value, StrictMode strict_mode); |
1129 MUST_USE_RESULT static MaybeHandle<Object> WriteToReadOnlyElement( | |
1130 Isolate* isolate, Handle<Object> receiver, uint32_t index, | |
1131 Handle<Object> value, StrictMode strict_mode); | |
1129 static Handle<Object> SetDataProperty(LookupIterator* it, | 1132 static Handle<Object> SetDataProperty(LookupIterator* it, |
1130 Handle<Object> value); | 1133 Handle<Object> value); |
1131 MUST_USE_RESULT static MaybeHandle<Object> AddDataProperty( | 1134 MUST_USE_RESULT static MaybeHandle<Object> AddDataProperty( |
1132 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, | 1135 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, |
1133 StrictMode strict_mode, StoreFromKeyed store_mode); | 1136 StrictMode strict_mode, StoreFromKeyed store_mode); |
1134 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( | 1137 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( |
1135 Handle<Object> object, | 1138 Handle<Object> object, |
1136 Handle<Name> key); | 1139 Handle<Name> key); |
1137 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( | 1140 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( |
1138 Isolate* isolate, | 1141 Isolate* isolate, |
(...skipping 25 matching lines...) Expand all Loading... | |
1164 Isolate* isolate, | 1167 Isolate* isolate, |
1165 Handle<Object> object, | 1168 Handle<Object> object, |
1166 uint32_t index); | 1169 uint32_t index); |
1167 | 1170 |
1168 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithReceiver( | 1171 MUST_USE_RESULT static MaybeHandle<Object> GetElementWithReceiver( |
1169 Isolate* isolate, | 1172 Isolate* isolate, |
1170 Handle<Object> object, | 1173 Handle<Object> object, |
1171 Handle<Object> receiver, | 1174 Handle<Object> receiver, |
1172 uint32_t index); | 1175 uint32_t index); |
1173 | 1176 |
1177 MUST_USE_RESULT static MaybeHandle<Object> SetElementWithReceiver( | |
1178 Isolate* isolate, Handle<Object> object, Handle<Object> receiver, | |
1179 uint32_t index, Handle<Object> value, StrictMode strict_mode); | |
1180 | |
1174 static inline Handle<Object> GetPrototypeSkipHiddenPrototypes( | 1181 static inline Handle<Object> GetPrototypeSkipHiddenPrototypes( |
1175 Isolate* isolate, Handle<Object> receiver); | 1182 Isolate* isolate, Handle<Object> receiver); |
1176 | 1183 |
1177 // Returns the permanent hash code associated with this object. May return | 1184 // Returns the permanent hash code associated with this object. May return |
1178 // undefined if not yet created. | 1185 // undefined if not yet created. |
1179 Object* GetHash(); | 1186 Object* GetHash(); |
1180 | 1187 |
1181 // Returns the permanent hash code associated with this object depending on | 1188 // Returns the permanent hash code associated with this object depending on |
1182 // the actual object type. May create and store a hash code if needed and none | 1189 // the actual object type. May create and store a hash code if needed and none |
1183 // exists. | 1190 // exists. |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1914 // be represented as a double and not a Smi. | 1921 // be represented as a double and not a Smi. |
1915 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); | 1922 bool ShouldConvertToFastDoubleElements(bool* has_smi_only_elements); |
1916 | 1923 |
1917 // Computes the new capacity when expanding the elements of a JSObject. | 1924 // Computes the new capacity when expanding the elements of a JSObject. |
1918 static int NewElementsCapacity(int old_capacity) { | 1925 static int NewElementsCapacity(int old_capacity) { |
1919 // (old_capacity + 50%) + 16 | 1926 // (old_capacity + 50%) + 16 |
1920 return old_capacity + (old_capacity >> 1) + 16; | 1927 return old_capacity + (old_capacity >> 1) + 16; |
1921 } | 1928 } |
1922 | 1929 |
1923 // These methods do not perform access checks! | 1930 // These methods do not perform access checks! |
1924 MUST_USE_RESULT static MaybeHandle<AccessorPair> GetOwnElementAccessorPair( | 1931 MUST_USE_RESULT static MaybeHandle<Object> GetOwnElementStructure( |
1925 Handle<JSObject> object, | 1932 Handle<JSObject> object, uint32_t index); |
1926 uint32_t index); | |
1927 | 1933 |
1928 MUST_USE_RESULT static MaybeHandle<Object> SetFastElement( | 1934 MUST_USE_RESULT static MaybeHandle<Object> SetFastElement( |
1929 Handle<JSObject> object, | 1935 Handle<JSObject> object, |
1930 uint32_t index, | 1936 uint32_t index, |
1931 Handle<Object> value, | 1937 Handle<Object> value, |
1932 StrictMode strict_mode, | 1938 StrictMode strict_mode, |
1933 bool check_prototype); | 1939 bool check_prototype); |
1934 | 1940 |
1935 MUST_USE_RESULT static MaybeHandle<Object> SetOwnElement( | 1941 MUST_USE_RESULT static MaybeHandle<Object> SetOwnElement( |
1936 Handle<JSObject> object, | 1942 Handle<JSObject> object, |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2242 Handle<JSObject> object, | 2248 Handle<JSObject> object, |
2243 Handle<Object> receiver, | 2249 Handle<Object> receiver, |
2244 Handle<Object> structure, | 2250 Handle<Object> structure, |
2245 uint32_t index, | 2251 uint32_t index, |
2246 Handle<Object> holder); | 2252 Handle<Object> holder); |
2247 | 2253 |
2248 MUST_USE_RESULT static Maybe<PropertyAttributes> | 2254 MUST_USE_RESULT static Maybe<PropertyAttributes> |
2249 GetElementAttributeWithInterceptor(Handle<JSObject> object, | 2255 GetElementAttributeWithInterceptor(Handle<JSObject> object, |
2250 Handle<JSReceiver> receiver, | 2256 Handle<JSReceiver> receiver, |
2251 uint32_t index, bool continue_search); | 2257 uint32_t index, bool continue_search); |
2258 | |
2259 // Queries indexed interceptor on an object for property attributes. | |
2260 // | |
2261 // We determine property attributes as follows: | |
2262 // - if interceptor has a query callback, then the property attributes are | |
2263 // the result of query callback for index. | |
2264 // - otherwise if interceptor has a getter callback and it returns | |
2265 // non-empty value on index, then the property attributes is NONE | |
2266 // (property is present, and it is enumerable, configurable, writable) | |
2267 // - otherwise there are no property attributes that can be inferred for | |
2268 // interceptor, and this fucntion returns ABSENT. | |
Toon Verwaest
2014/10/15 08:31:28
typo: function
| |
2269 MUST_USE_RESULT static Maybe<PropertyAttributes> | |
2270 GetElementAttributeFromInterceptor(Handle<JSObject> object, | |
2271 Handle<Object> receiver, | |
2272 uint32_t index); | |
2273 | |
2252 MUST_USE_RESULT static Maybe<PropertyAttributes> | 2274 MUST_USE_RESULT static Maybe<PropertyAttributes> |
2253 GetElementAttributeWithoutInterceptor(Handle<JSObject> object, | 2275 GetElementAttributeWithoutInterceptor(Handle<JSObject> object, |
2254 Handle<JSReceiver> receiver, | 2276 Handle<JSReceiver> receiver, |
2255 uint32_t index, | 2277 uint32_t index, |
2256 bool continue_search); | 2278 bool continue_search); |
2257 MUST_USE_RESULT static MaybeHandle<Object> SetElementWithCallback( | 2279 MUST_USE_RESULT static MaybeHandle<Object> SetElementWithCallback( |
2258 Handle<JSObject> object, | 2280 Handle<Object> object, Handle<Object> structure, uint32_t index, |
2259 Handle<Object> structure, | 2281 Handle<Object> value, Handle<JSObject> holder, StrictMode strict_mode); |
2260 uint32_t index, | |
2261 Handle<Object> value, | |
2262 Handle<JSObject> holder, | |
2263 StrictMode strict_mode); | |
2264 MUST_USE_RESULT static MaybeHandle<Object> SetElementWithInterceptor( | 2282 MUST_USE_RESULT static MaybeHandle<Object> SetElementWithInterceptor( |
2265 Handle<JSObject> object, | 2283 Handle<JSObject> object, |
2266 uint32_t index, | 2284 uint32_t index, |
2267 Handle<Object> value, | 2285 Handle<Object> value, |
2268 PropertyAttributes attributes, | 2286 PropertyAttributes attributes, |
2269 StrictMode strict_mode, | 2287 StrictMode strict_mode, |
2270 bool check_prototype, | 2288 bool check_prototype, |
2271 SetPropertyMode set_mode); | 2289 SetPropertyMode set_mode); |
2272 MUST_USE_RESULT static MaybeHandle<Object> SetElementWithoutInterceptor( | 2290 MUST_USE_RESULT static MaybeHandle<Object> SetElementWithoutInterceptor( |
2273 Handle<JSObject> object, | 2291 Handle<JSObject> object, |
(...skipping 8584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10858 } else { | 10876 } else { |
10859 value &= ~(1 << bit_position); | 10877 value &= ~(1 << bit_position); |
10860 } | 10878 } |
10861 return value; | 10879 return value; |
10862 } | 10880 } |
10863 }; | 10881 }; |
10864 | 10882 |
10865 } } // namespace v8::internal | 10883 } } // namespace v8::internal |
10866 | 10884 |
10867 #endif // V8_OBJECTS_H_ | 10885 #endif // V8_OBJECTS_H_ |
OLD | NEW |