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

Unified Diff: src/objects.h

Issue 1029783003: Populate PrototypeInfo with prototype_object value (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 | « src/factory.cc ('k') | 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 d604b8b580f3219fa3fedbd4923aad0c5d6212df..8c2271d33178048644b42670d0a12fd4d3e04f37 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -5775,6 +5775,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
@@ -5982,6 +5985,16 @@ class Map: public HeapObject {
// [prototype_info]: Per-prototype metadata. Aliased with transitions
// (which prototype maps don't have).
DECL_ACCESSORS(prototype_info, Object)
+ static Handle<PrototypeInfo> GetOrCreatePrototypeInfo(Handle<Map> map,
+ Isolate* isolate);
+ // [prototype object]: points from a prototype map (which is never shared)
+ // to the object using it. Can be a Smi if the map is no longer used by a
+ // prototype object. Always use the GetPrototypeObject() getter, which zaps
+ // invalid references on the fly; the raw value is in the prototype_info.
+ static void SetPrototypeObject(Handle<Map> map,
+ Handle<JSObject> prototype_obj,
+ Isolate* isolate);
+ Object* GetPrototypeObject();
Map* FindRootMap();
Map* FindFieldOwner(int descriptor);
@@ -6553,8 +6566,9 @@ class Box : public Struct {
// Container for metadata stored on each prototype map.
class PrototypeInfo : public Struct {
public:
- // [prototype_object]: The object using the map holding this PrototypeInfo.
- DECL_ACCESSORS(prototype_object, JSObject)
+ // [prototype_object]: The object using the map holding this PrototypeInfo,
+ // or Smi(0) if uninitialized.
+ DECL_ACCESSORS(prototype_object, Object)
// [prototype_users]: WeakFixedArray containing maps using this prototype,
// or Smi(0) if uninitialized.
DECL_ACCESSORS(prototype_users, Object)
« no previous file with comments | « src/factory.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698