OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 return IsSmi(); | 1433 return IsSmi(); |
1434 } else if (FLAG_track_double_fields && representation.IsDouble()) { | 1434 } else if (FLAG_track_double_fields && representation.IsDouble()) { |
1435 return IsNumber(); | 1435 return IsNumber(); |
1436 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { | 1436 } else if (FLAG_track_heap_object_fields && representation.IsHeapObject()) { |
1437 return IsHeapObject(); | 1437 return IsHeapObject(); |
1438 } | 1438 } |
1439 return true; | 1439 return true; |
1440 } | 1440 } |
1441 | 1441 |
1442 inline MaybeObject* AllocateNewStorageFor(Heap* heap, | 1442 inline MaybeObject* AllocateNewStorageFor(Heap* heap, |
1443 Representation representation); | 1443 Representation representation, |
| 1444 PretenureFlag tenure = NOT_TENURED); |
1444 | 1445 |
1445 // Returns true if the object is of the correct type to be used as a | 1446 // Returns true if the object is of the correct type to be used as a |
1446 // implementation of a JSObject's elements. | 1447 // implementation of a JSObject's elements. |
1447 inline bool HasValidElements(); | 1448 inline bool HasValidElements(); |
1448 | 1449 |
1449 inline bool HasSpecificClassOf(String* name); | 1450 inline bool HasSpecificClassOf(String* name); |
1450 | 1451 |
1451 MUST_USE_RESULT MaybeObject* ToObject(Isolate* isolate); // ECMA-262 9.9. | 1452 MUST_USE_RESULT MaybeObject* ToObject(Isolate* isolate); // ECMA-262 9.9. |
1452 bool BooleanValue(); // ECMA-262 9.2. | 1453 bool BooleanValue(); // ECMA-262 9.2. |
1453 | 1454 |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2165 // return value indicates whether the transition was successful. | 2166 // return value indicates whether the transition was successful. |
2166 static inline Handle<Map> FindTransitionToField(Handle<Map> map, | 2167 static inline Handle<Map> FindTransitionToField(Handle<Map> map, |
2167 Handle<Name> key); | 2168 Handle<Name> key); |
2168 | 2169 |
2169 inline int LastAddedFieldIndex(); | 2170 inline int LastAddedFieldIndex(); |
2170 | 2171 |
2171 // Extend the receiver with a single fast property appeared first in the | 2172 // Extend the receiver with a single fast property appeared first in the |
2172 // passed map. This also extends the property backing store if necessary. | 2173 // passed map. This also extends the property backing store if necessary. |
2173 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); | 2174 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); |
2174 | 2175 |
2175 // Migrates the given object to a map whose field representations are the | |
2176 // lowest upper bound of all known representations for that field. | |
2177 static void MigrateInstance(Handle<JSObject> instance); | 2176 static void MigrateInstance(Handle<JSObject> instance); |
2178 | 2177 |
2179 // Migrates the given object only if the target map is already available, | |
2180 // or returns an empty handle if such a map is not yet available. | |
2181 static Handle<Object> TryMigrateInstance(Handle<JSObject> instance); | 2178 static Handle<Object> TryMigrateInstance(Handle<JSObject> instance); |
| 2179 inline MUST_USE_RESULT MaybeObject* TryMigrateInstance(); |
2182 | 2180 |
2183 // Can cause GC. | 2181 // Can cause GC. |
2184 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributesTrampoline( | 2182 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributesTrampoline( |
2185 Name* key, | 2183 Name* key, |
2186 Object* value, | 2184 Object* value, |
2187 PropertyAttributes attributes, | 2185 PropertyAttributes attributes, |
2188 ValueType value_type = OPTIMAL_REPRESENTATION, | 2186 ValueType value_type = OPTIMAL_REPRESENTATION, |
2189 StoreMode mode = ALLOW_AS_CONSTANT, | 2187 StoreMode mode = ALLOW_AS_CONSTANT, |
2190 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK); | 2188 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK); |
2191 | 2189 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2465 ElementsKind elements_kind); | 2463 ElementsKind elements_kind); |
2466 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow( | 2464 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow( |
2467 ElementsKind elements_kind); | 2465 ElementsKind elements_kind); |
2468 | 2466 |
2469 static void TransitionElementsKind(Handle<JSObject> object, | 2467 static void TransitionElementsKind(Handle<JSObject> object, |
2470 ElementsKind to_kind); | 2468 ElementsKind to_kind); |
2471 | 2469 |
2472 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); | 2470 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); |
2473 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind); | 2471 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind); |
2474 | 2472 |
2475 // TODO(mstarzinger): Both public because of ConvertAnsSetLocalProperty(). | |
2476 static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map); | 2473 static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map); |
| 2474 MUST_USE_RESULT MaybeObject* MigrateToMap(Map* new_map); |
2477 static void GeneralizeFieldRepresentation(Handle<JSObject> object, | 2475 static void GeneralizeFieldRepresentation(Handle<JSObject> object, |
2478 int modify_index, | 2476 int modify_index, |
2479 Representation new_representation, | 2477 Representation new_representation, |
2480 StoreMode store_mode); | 2478 StoreMode store_mode); |
2481 | 2479 |
2482 // Convert the object to use the canonical dictionary | 2480 // Convert the object to use the canonical dictionary |
2483 // representation. If the object is expected to have additional properties | 2481 // representation. If the object is expected to have additional properties |
2484 // added this number can be indicated to have the backing store allocated to | 2482 // added this number can be indicated to have the backing store allocated to |
2485 // an initial capacity for holding these properties. | 2483 // an initial capacity for holding these properties. |
2486 static void NormalizeProperties(Handle<JSObject> object, | 2484 static void NormalizeProperties(Handle<JSObject> object, |
(...skipping 7745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10232 } else { | 10230 } else { |
10233 value &= ~(1 << bit_position); | 10231 value &= ~(1 << bit_position); |
10234 } | 10232 } |
10235 return value; | 10233 return value; |
10236 } | 10234 } |
10237 }; | 10235 }; |
10238 | 10236 |
10239 } } // namespace v8::internal | 10237 } } // namespace v8::internal |
10240 | 10238 |
10241 #endif // V8_OBJECTS_H_ | 10239 #endif // V8_OBJECTS_H_ |
OLD | NEW |