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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 | 240 |
241 | 241 |
242 // PropertyNormalizationMode is used to specify whether to keep | 242 // PropertyNormalizationMode is used to specify whether to keep |
243 // inobject properties when normalizing properties of a JSObject. | 243 // inobject properties when normalizing properties of a JSObject. |
244 enum PropertyNormalizationMode { | 244 enum PropertyNormalizationMode { |
245 CLEAR_INOBJECT_PROPERTIES, | 245 CLEAR_INOBJECT_PROPERTIES, |
246 KEEP_INOBJECT_PROPERTIES | 246 KEEP_INOBJECT_PROPERTIES |
247 }; | 247 }; |
248 | 248 |
249 | 249 |
250 // Internal properties (e.g. the hidden properties dictionary) might | |
251 // be added even though the receiver is non-extensible. | |
252 enum ExtensibilityCheck { | |
253 PERFORM_EXTENSIBILITY_CHECK, | |
254 OMIT_EXTENSIBILITY_CHECK | |
255 }; | |
256 | |
257 | |
258 // Indicates how aggressively the prototype should be optimized. FAST_PROTOTYPE | 250 // Indicates how aggressively the prototype should be optimized. FAST_PROTOTYPE |
259 // will give the fastest result by tailoring the map to the prototype, but that | 251 // will give the fastest result by tailoring the map to the prototype, but that |
260 // will cause polymorphism with other objects. REGULAR_PROTOTYPE is to be used | 252 // will cause polymorphism with other objects. REGULAR_PROTOTYPE is to be used |
261 // (at least for now) when dynamically modifying the prototype chain of an | 253 // (at least for now) when dynamically modifying the prototype chain of an |
262 // object using __proto__ or Object.setPrototypeOf. | 254 // object using __proto__ or Object.setPrototypeOf. |
263 enum PrototypeOptimizationMode { REGULAR_PROTOTYPE, FAST_PROTOTYPE }; | 255 enum PrototypeOptimizationMode { REGULAR_PROTOTYPE, FAST_PROTOTYPE }; |
264 | 256 |
265 | 257 |
266 // Indicates whether transitions can be added to a source map or not. | 258 // Indicates whether transitions can be added to a source map or not. |
267 enum TransitionFlag { | 259 enum TransitionFlag { |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 | 1496 |
1505 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( | 1497 MUST_USE_RESULT static MaybeHandle<Object> SetProperty( |
1506 LookupIterator* it, Handle<Object> value, StrictMode strict_mode, | 1498 LookupIterator* it, Handle<Object> value, StrictMode strict_mode, |
1507 StoreFromKeyed store_mode); | 1499 StoreFromKeyed store_mode); |
1508 MUST_USE_RESULT static MaybeHandle<Object> WriteToReadOnlyProperty( | 1500 MUST_USE_RESULT static MaybeHandle<Object> WriteToReadOnlyProperty( |
1509 LookupIterator* it, Handle<Object> value, StrictMode strict_mode); | 1501 LookupIterator* it, Handle<Object> value, StrictMode strict_mode); |
1510 MUST_USE_RESULT static MaybeHandle<Object> SetDataProperty( | 1502 MUST_USE_RESULT static MaybeHandle<Object> SetDataProperty( |
1511 LookupIterator* it, Handle<Object> value); | 1503 LookupIterator* it, Handle<Object> value); |
1512 MUST_USE_RESULT static MaybeHandle<Object> AddDataProperty( | 1504 MUST_USE_RESULT static MaybeHandle<Object> AddDataProperty( |
1513 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, | 1505 LookupIterator* it, Handle<Object> value, PropertyAttributes attributes, |
1514 StrictMode strict_mode, StoreFromKeyed store_mode, | 1506 StrictMode strict_mode, StoreFromKeyed store_mode); |
1515 ExtensibilityCheck check); | |
1516 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( | 1507 MUST_USE_RESULT static inline MaybeHandle<Object> GetPropertyOrElement( |
1517 Handle<Object> object, | 1508 Handle<Object> object, |
1518 Handle<Name> key); | 1509 Handle<Name> key); |
1519 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( | 1510 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( |
1520 Isolate* isolate, | 1511 Isolate* isolate, |
1521 Handle<Object> object, | 1512 Handle<Object> object, |
1522 const char* key); | 1513 const char* key); |
1523 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( | 1514 MUST_USE_RESULT static inline MaybeHandle<Object> GetProperty( |
1524 Handle<Object> object, | 1515 Handle<Object> object, |
1525 Handle<Name> key); | 1516 Handle<Name> key); |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2153 enum ExecutableAccessorInfoHandling { | 2144 enum ExecutableAccessorInfoHandling { |
2154 DEFAULT_HANDLING, | 2145 DEFAULT_HANDLING, |
2155 DONT_FORCE_FIELD | 2146 DONT_FORCE_FIELD |
2156 }; | 2147 }; |
2157 | 2148 |
2158 MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes( | 2149 MUST_USE_RESULT static MaybeHandle<Object> SetOwnPropertyIgnoreAttributes( |
2159 Handle<JSObject> object, | 2150 Handle<JSObject> object, |
2160 Handle<Name> key, | 2151 Handle<Name> key, |
2161 Handle<Object> value, | 2152 Handle<Object> value, |
2162 PropertyAttributes attributes, | 2153 PropertyAttributes attributes, |
2163 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK, | |
2164 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, | 2154 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED, |
2165 ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING); | 2155 ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING); |
2166 | 2156 |
2167 static void AddProperty(Handle<JSObject> object, Handle<Name> key, | 2157 static void AddProperty(Handle<JSObject> object, Handle<Name> key, |
2168 Handle<Object> value, PropertyAttributes attributes); | 2158 Handle<Object> value, PropertyAttributes attributes); |
2169 | 2159 |
2170 // Extend the receiver with a single fast property appeared first in the | 2160 // Extend the receiver with a single fast property appeared first in the |
2171 // passed map. This also extends the property backing store if necessary. | 2161 // passed map. This also extends the property backing store if necessary. |
2172 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); | 2162 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); |
2173 | 2163 |
(...skipping 9066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11240 } else { | 11230 } else { |
11241 value &= ~(1 << bit_position); | 11231 value &= ~(1 << bit_position); |
11242 } | 11232 } |
11243 return value; | 11233 return value; |
11244 } | 11234 } |
11245 }; | 11235 }; |
11246 | 11236 |
11247 } } // namespace v8::internal | 11237 } } // namespace v8::internal |
11248 | 11238 |
11249 #endif // V8_OBJECTS_H_ | 11239 #endif // V8_OBJECTS_H_ |
OLD | NEW |