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

Unified Diff: src/objects.h

Issue 1110513002: Reland "Lazily register prototype users..." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: assert trumps comment Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 8f8a3534f1bbaf8f41c8f24220d1e895316c77ef..8b0477a983ab429e919ec83135a59f0533bf09f3 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -1841,9 +1841,11 @@ class JSObject: public JSReceiver {
static void OptimizeAsPrototype(Handle<JSObject> object,
PrototypeOptimizationMode mode);
static void ReoptimizeIfPrototype(Handle<JSObject> object);
- static void RegisterPrototypeUser(Handle<JSObject> prototype,
- Handle<HeapObject> user);
- static void UnregisterPrototypeUser(Handle<JSObject> prototype,
+ static void LazyRegisterPrototypeUser(Handle<Map> user, Isolate* isolate);
+ static bool RegisterPrototypeUserIfNotRegistered(Handle<JSObject> prototype,
+ Handle<HeapObject> user,
+ Isolate* isolate);
+ static bool UnregisterPrototypeUser(Handle<JSObject> prototype,
Handle<HeapObject> user);
static void InvalidatePrototypeChains(Map* map);
@@ -2621,9 +2623,11 @@ class WeakFixedArray : public FixedArray {
// If |maybe_array| is not a WeakFixedArray, a fresh one will be allocated.
static Handle<WeakFixedArray> Add(
Handle<Object> maybe_array, Handle<HeapObject> value,
- SearchForDuplicates search_for_duplicates = kAlwaysAdd);
+ SearchForDuplicates search_for_duplicates = kAlwaysAdd,
+ bool* was_present = NULL);
- void Remove(Handle<HeapObject> value);
+ // Returns true if an entry was found and removed.
+ bool Remove(Handle<HeapObject> value);
void Compact();
@@ -5844,6 +5848,9 @@ class DependentCode: public FixedArray {
};
+class PrototypeInfo;
+
+
// All heap objects have a Map that describes their structure.
// A Map contains information about:
// - Size information about the object
@@ -6051,6 +6058,10 @@ class Map: public HeapObject {
// [prototype_info]: Per-prototype metadata. Aliased with transitions
// (which prototype maps don't have).
DECL_ACCESSORS(prototype_info, Object)
+ // PrototypeInfo is created lazily using this helper (which installs it on
+ // the given prototype's map).
+ static Handle<PrototypeInfo> GetOrCreatePrototypeInfo(
+ Handle<JSObject> prototype, Isolate* isolate);
// [prototype chain validity cell]: Associated with a prototype object,
// stored in that object's map's PrototypeInfo, indicates that prototype
@@ -6123,9 +6134,6 @@ class Map: public HeapObject {
static void SetPrototype(
Handle<Map> map, Handle<Object> prototype,
PrototypeOptimizationMode proto_mode = FAST_PROTOTYPE);
- static bool ShouldRegisterAsPrototypeUser(Handle<Map> map,
- Handle<JSObject> prototype);
- bool CanUseOptimizationsBasedOnPrototypeRegistry();
// [constructor]: points back to the function responsible for this map.
// The field overlaps with the back pointer. All maps in a transition tree
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698