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); | |
1445 | 1444 |
1446 // Returns true if the object is of the correct type to be used as a | 1445 // Returns true if the object is of the correct type to be used as a |
1447 // implementation of a JSObject's elements. | 1446 // implementation of a JSObject's elements. |
1448 inline bool HasValidElements(); | 1447 inline bool HasValidElements(); |
1449 | 1448 |
1450 inline bool HasSpecificClassOf(String* name); | 1449 inline bool HasSpecificClassOf(String* name); |
1451 | 1450 |
1452 MUST_USE_RESULT MaybeObject* ToObject(Isolate* isolate); // ECMA-262 9.9. | 1451 MUST_USE_RESULT MaybeObject* ToObject(Isolate* isolate); // ECMA-262 9.9. |
1453 bool BooleanValue(); // ECMA-262 9.2. | 1452 bool BooleanValue(); // ECMA-262 9.2. |
1454 | 1453 |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 // return value indicates whether the transition was successful. | 2165 // return value indicates whether the transition was successful. |
2167 static inline Handle<Map> FindTransitionToField(Handle<Map> map, | 2166 static inline Handle<Map> FindTransitionToField(Handle<Map> map, |
2168 Handle<Name> key); | 2167 Handle<Name> key); |
2169 | 2168 |
2170 inline int LastAddedFieldIndex(); | 2169 inline int LastAddedFieldIndex(); |
2171 | 2170 |
2172 // Extend the receiver with a single fast property appeared first in the | 2171 // Extend the receiver with a single fast property appeared first in the |
2173 // passed map. This also extends the property backing store if necessary. | 2172 // passed map. This also extends the property backing store if necessary. |
2174 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); | 2173 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); |
2175 | 2174 |
| 2175 // Migrates the given object to a map whose field representations are the |
| 2176 // lowest upper bound of all known representations for that field. |
2176 static void MigrateInstance(Handle<JSObject> instance); | 2177 static void MigrateInstance(Handle<JSObject> instance); |
2177 | 2178 |
| 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. |
2178 static Handle<Object> TryMigrateInstance(Handle<JSObject> instance); | 2181 static Handle<Object> TryMigrateInstance(Handle<JSObject> instance); |
2179 inline MUST_USE_RESULT MaybeObject* TryMigrateInstance(); | |
2180 | 2182 |
2181 // Can cause GC. | 2183 // Can cause GC. |
2182 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributesTrampoline( | 2184 MUST_USE_RESULT MaybeObject* SetLocalPropertyIgnoreAttributesTrampoline( |
2183 Name* key, | 2185 Name* key, |
2184 Object* value, | 2186 Object* value, |
2185 PropertyAttributes attributes, | 2187 PropertyAttributes attributes, |
2186 ValueType value_type = OPTIMAL_REPRESENTATION, | 2188 ValueType value_type = OPTIMAL_REPRESENTATION, |
2187 StoreMode mode = ALLOW_AS_CONSTANT, | 2189 StoreMode mode = ALLOW_AS_CONSTANT, |
2188 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK); | 2190 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK); |
2189 | 2191 |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2463 ElementsKind elements_kind); | 2465 ElementsKind elements_kind); |
2464 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow( | 2466 MUST_USE_RESULT MaybeObject* GetElementsTransitionMapSlow( |
2465 ElementsKind elements_kind); | 2467 ElementsKind elements_kind); |
2466 | 2468 |
2467 static void TransitionElementsKind(Handle<JSObject> object, | 2469 static void TransitionElementsKind(Handle<JSObject> object, |
2468 ElementsKind to_kind); | 2470 ElementsKind to_kind); |
2469 | 2471 |
2470 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); | 2472 MUST_USE_RESULT MaybeObject* TransitionElementsKind(ElementsKind to_kind); |
2471 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind); | 2473 MUST_USE_RESULT MaybeObject* UpdateAllocationSite(ElementsKind to_kind); |
2472 | 2474 |
| 2475 // TODO(mstarzinger): Both public because of ConvertAnsSetLocalProperty(). |
2473 static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map); | 2476 static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map); |
2474 MUST_USE_RESULT MaybeObject* MigrateToMap(Map* new_map); | |
2475 static void GeneralizeFieldRepresentation(Handle<JSObject> object, | 2477 static void GeneralizeFieldRepresentation(Handle<JSObject> object, |
2476 int modify_index, | 2478 int modify_index, |
2477 Representation new_representation, | 2479 Representation new_representation, |
2478 StoreMode store_mode); | 2480 StoreMode store_mode); |
2479 | 2481 |
2480 // Convert the object to use the canonical dictionary | 2482 // Convert the object to use the canonical dictionary |
2481 // representation. If the object is expected to have additional properties | 2483 // representation. If the object is expected to have additional properties |
2482 // added this number can be indicated to have the backing store allocated to | 2484 // added this number can be indicated to have the backing store allocated to |
2483 // an initial capacity for holding these properties. | 2485 // an initial capacity for holding these properties. |
2484 static void NormalizeProperties(Handle<JSObject> object, | 2486 static void NormalizeProperties(Handle<JSObject> object, |
(...skipping 7745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10230 } else { | 10232 } else { |
10231 value &= ~(1 << bit_position); | 10233 value &= ~(1 << bit_position); |
10232 } | 10234 } |
10233 return value; | 10235 return value; |
10234 } | 10236 } |
10235 }; | 10237 }; |
10236 | 10238 |
10237 } } // namespace v8::internal | 10239 } } // namespace v8::internal |
10238 | 10240 |
10239 #endif // V8_OBJECTS_H_ | 10241 #endif // V8_OBJECTS_H_ |
OLD | NEW |