Revision: 22655
Author:   [email protected]
Date:     Mon Jul 28 18:54:06 2014 UTC
Log:      Rename failure tag to page owner tag and add proper description.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/420293003
http://code.google.com/p/v8/source/detail?r=22655

Modified:
 /branches/bleeding_edge/src/globals.h
 /branches/bleeding_edge/src/spaces.h

=======================================
--- /branches/bleeding_edge/src/globals.h       Fri Jul 18 13:50:21 2014 UTC
+++ /branches/bleeding_edge/src/globals.h       Mon Jul 28 18:54:06 2014 UTC
@@ -216,11 +216,15 @@
 const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits;
 const intptr_t kCodeAlignmentMask = kCodeAlignment - 1;

-// Tag information for Failure.
-// TODO(yangguo): remove this from space owner calculation.
-const int kFailureTag = 3;
-const int kFailureTagSize = 2;
-const intptr_t kFailureTagMask = (1 << kFailureTagSize) - 1;
+// The owner field of a page is tagged with the page header tag. We need that +// to find out if a slot is part of a large object. If we mask out the lower
+// 0xfffff bits (1M pages), go to the owner offset, and see that this field
+// is tagged with the page header tag, we can just look up the owner.
+// Otherwise, we know that we are somewhere (not within the first 1M) in a
+// large object.
+const int kPageHeaderTag = 3;
+const int kPageHeaderTagSize = 2;
+const intptr_t kPageHeaderTagMask = (1 << kPageHeaderTagSize) - 1;


 // Zap-value: The value used for zapping dead objects.
=======================================
--- /branches/bleeding_edge/src/spaces.h        Mon Jul 28 12:28:28 2014 UTC
+++ /branches/bleeding_edge/src/spaces.h        Mon Jul 28 18:54:06 2014 UTC
@@ -312,20 +312,20 @@
   }

   Space* owner() const {
-    if ((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) ==
-        kFailureTag) {
+    if ((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) ==
+        kPageHeaderTag) {
       return reinterpret_cast<Space*>(reinterpret_cast<intptr_t>(owner_) -
-                                      kFailureTag);
+                                      kPageHeaderTag);
     } else {
       return NULL;
     }
   }

   void set_owner(Space* space) {
-    ASSERT((reinterpret_cast<intptr_t>(space) & kFailureTagMask) == 0);
-    owner_ = reinterpret_cast<Address>(space) + kFailureTag;
-    ASSERT((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) ==
-           kFailureTag);
+    ASSERT((reinterpret_cast<intptr_t>(space) & kPageHeaderTagMask) == 0);
+    owner_ = reinterpret_cast<Address>(space) + kPageHeaderTag;
+    ASSERT((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) ==
+           kPageHeaderTag);
   }

   base::VirtualMemory* reserved_memory() {

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to