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

Unified Diff: src/objects.h

Issue 2428473002: [ic] Cache weak cells containing prototypes in respective PrototypeInfo objects. (Closed)
Patch Set: Created 4 years, 2 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/ic/x87/handler-compiler-x87.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 0a1e39458bd99f1a95818424201ca0d62a3782a1..0d1eac17a780a8c400e3e644b53b4dfd98f4bf38 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -6222,6 +6222,11 @@ class Map: public HeapObject {
static const int kPrototypeChainValid = 0;
static const int kPrototypeChainInvalid = 1;
+ // Returns a WeakCell object containing given prototype. The cell is cached
+ // in PrototypeInfo which is created lazily.
+ static Handle<WeakCell> GetOrCreatePrototypeWeakCell(
+ Handle<JSObject> prototype, Isolate* isolate);
+
Map* FindRootMap();
Map* FindFieldOwner(int descriptor);
@@ -6823,6 +6828,9 @@ class PrototypeInfo : public Struct {
public:
static const int UNREGISTERED = -1;
+ // [weak_cell]: A WeakCell containing this prototype. ICs cache the cell here.
+ DECL_ACCESSORS(weak_cell, Object)
+
// [prototype_users]: WeakFixedArray containing maps using this prototype,
// or Smi(0) if uninitialized.
DECL_ACCESSORS(prototype_users, Object)
@@ -6856,7 +6864,8 @@ class PrototypeInfo : public Struct {
DECLARE_PRINTER(PrototypeInfo)
DECLARE_VERIFIER(PrototypeInfo)
- static const int kPrototypeUsersOffset = HeapObject::kHeaderSize;
+ static const int kWeakCellOffset = HeapObject::kHeaderSize;
+ static const int kPrototypeUsersOffset = kWeakCellOffset + kPointerSize;
static const int kRegistrySlotOffset = kPrototypeUsersOffset + kPointerSize;
static const int kValidityCellOffset = kRegistrySlotOffset + kPointerSize;
static const int kObjectCreateMap = kValidityCellOffset + kPointerSize;
« no previous file with comments | « src/ic/x87/handler-compiler-x87.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698