Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Side by Side Diff: src/objects.h

Issue 251683003: Fix CurrentMapForDeprecated() to return MaybeHandle instead of a null handle. (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2290 matching lines...) Expand 10 before | Expand all | Expand 10 after
2301 2301
2302 // Extend the receiver with a single fast property appeared first in the 2302 // Extend the receiver with a single fast property appeared first in the
2303 // passed map. This also extends the property backing store if necessary. 2303 // passed map. This also extends the property backing store if necessary.
2304 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map); 2304 static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map> map);
2305 2305
2306 // Migrates the given object to a map whose field representations are the 2306 // Migrates the given object to a map whose field representations are the
2307 // lowest upper bound of all known representations for that field. 2307 // lowest upper bound of all known representations for that field.
2308 static void MigrateInstance(Handle<JSObject> instance); 2308 static void MigrateInstance(Handle<JSObject> instance);
2309 2309
2310 // Migrates the given object only if the target map is already available, 2310 // Migrates the given object only if the target map is already available,
2311 // or returns an empty handle if such a map is not yet available. 2311 // or returns false if such a map is not yet available.
2312 static Handle<Object> TryMigrateInstance(Handle<JSObject> instance); 2312 static bool TryMigrateInstance(Handle<JSObject> instance);
2313 2313
2314 // Retrieve a value in a normalized object given a lookup result. 2314 // Retrieve a value in a normalized object given a lookup result.
2315 // Handles the special representation of JS global objects. 2315 // Handles the special representation of JS global objects.
2316 Object* GetNormalizedProperty(const LookupResult* result); 2316 Object* GetNormalizedProperty(const LookupResult* result);
2317 static Handle<Object> GetNormalizedProperty(Handle<JSObject> object, 2317 static Handle<Object> GetNormalizedProperty(Handle<JSObject> object,
2318 const LookupResult* result); 2318 const LookupResult* result);
2319 2319
2320 // Sets the property value in a normalized object given a lookup result. 2320 // Sets the property value in a normalized object given a lookup result.
2321 // Handles the special representation of JS global objects. 2321 // Handles the special representation of JS global objects.
2322 static void SetNormalizedProperty(Handle<JSObject> object, 2322 static void SetNormalizedProperty(Handle<JSObject> object,
(...skipping 4128 matching lines...) Expand 10 before | Expand all | Expand 10 after
6451 inline void set_migration_target(bool value); 6451 inline void set_migration_target(bool value);
6452 inline bool is_migration_target(); 6452 inline bool is_migration_target();
6453 inline void deprecate(); 6453 inline void deprecate();
6454 inline bool is_deprecated(); 6454 inline bool is_deprecated();
6455 inline bool CanBeDeprecated(); 6455 inline bool CanBeDeprecated();
6456 // Returns a non-deprecated version of the input. If the input was not 6456 // Returns a non-deprecated version of the input. If the input was not
6457 // deprecated, it is directly returned. Otherwise, the non-deprecated version 6457 // deprecated, it is directly returned. Otherwise, the non-deprecated version
6458 // is found by re-transitioning from the root of the transition tree using the 6458 // is found by re-transitioning from the root of the transition tree using the
6459 // descriptor array of the map. Returns NULL if no updated map is found. 6459 // descriptor array of the map. Returns NULL if no updated map is found.
6460 // This method also applies any pending migrations along the prototype chain. 6460 // This method also applies any pending migrations along the prototype chain.
6461 static Handle<Map> CurrentMapForDeprecated(Handle<Map> map); 6461 static MaybeHandle<Map> CurrentMapForDeprecated(Handle<Map> map);
Yang 2014/04/25 11:48:06 We generally mark functions that return MaybeHandl
Benedikt Meurer 2014/04/26 10:12:42 Done.
6462 // Same as above, but does not touch the prototype chain. 6462 // Same as above, but does not touch the prototype chain.
6463 static Handle<Map> CurrentMapForDeprecatedInternal(Handle<Map> map); 6463 static MaybeHandle<Map> CurrentMapForDeprecatedInternal(Handle<Map> map);
6464 6464
6465 static Handle<Map> CopyDropDescriptors(Handle<Map> map); 6465 static Handle<Map> CopyDropDescriptors(Handle<Map> map);
6466 static Handle<Map> CopyInsertDescriptor(Handle<Map> map, 6466 static Handle<Map> CopyInsertDescriptor(Handle<Map> map,
6467 Descriptor* descriptor, 6467 Descriptor* descriptor,
6468 TransitionFlag flag); 6468 TransitionFlag flag);
6469 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map, 6469 static Handle<Map> CopyReplaceDescriptor(Handle<Map> map,
6470 Handle<DescriptorArray> descriptors, 6470 Handle<DescriptorArray> descriptors,
6471 Descriptor* descriptor, 6471 Descriptor* descriptor,
6472 int index, 6472 int index,
6473 TransitionFlag flag); 6473 TransitionFlag flag);
(...skipping 4809 matching lines...) Expand 10 before | Expand all | Expand 10 after
11283 } else { 11283 } else {
11284 value &= ~(1 << bit_position); 11284 value &= ~(1 << bit_position);
11285 } 11285 }
11286 return value; 11286 return value;
11287 } 11287 }
11288 }; 11288 };
11289 11289
11290 } } // namespace v8::internal 11290 } } // namespace v8::internal
11291 11291
11292 #endif // V8_OBJECTS_H_ 11292 #endif // V8_OBJECTS_H_
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698