Commit 41c6b0ba authored by hpayer@chromium.org's avatar hpayer@chromium.org

Rename failure tag to page owner tag and add proper description.

BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/420293003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22655 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1d51e637
...@@ -216,11 +216,15 @@ const int kCodeAlignmentBits = 5; ...@@ -216,11 +216,15 @@ const int kCodeAlignmentBits = 5;
const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits; const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits;
const intptr_t kCodeAlignmentMask = kCodeAlignment - 1; const intptr_t kCodeAlignmentMask = kCodeAlignment - 1;
// Tag information for Failure. // The owner field of a page is tagged with the page header tag. We need that
// TODO(yangguo): remove this from space owner calculation. // to find out if a slot is part of a large object. If we mask out the lower
const int kFailureTag = 3; // 0xfffff bits (1M pages), go to the owner offset, and see that this field
const int kFailureTagSize = 2; // is tagged with the page header tag, we can just look up the owner.
const intptr_t kFailureTagMask = (1 << kFailureTagSize) - 1; // 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. // Zap-value: The value used for zapping dead objects.
......
...@@ -312,20 +312,20 @@ class MemoryChunk { ...@@ -312,20 +312,20 @@ class MemoryChunk {
} }
Space* owner() const { Space* owner() const {
if ((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) == if ((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) ==
kFailureTag) { kPageHeaderTag) {
return reinterpret_cast<Space*>(reinterpret_cast<intptr_t>(owner_) - return reinterpret_cast<Space*>(reinterpret_cast<intptr_t>(owner_) -
kFailureTag); kPageHeaderTag);
} else { } else {
return NULL; return NULL;
} }
} }
void set_owner(Space* space) { void set_owner(Space* space) {
ASSERT((reinterpret_cast<intptr_t>(space) & kFailureTagMask) == 0); ASSERT((reinterpret_cast<intptr_t>(space) & kPageHeaderTagMask) == 0);
owner_ = reinterpret_cast<Address>(space) + kFailureTag; owner_ = reinterpret_cast<Address>(space) + kPageHeaderTag;
ASSERT((reinterpret_cast<intptr_t>(owner_) & kFailureTagMask) == ASSERT((reinterpret_cast<intptr_t>(owner_) & kPageHeaderTagMask) ==
kFailureTag); kPageHeaderTag);
} }
base::VirtualMemory* reserved_memory() { base::VirtualMemory* reserved_memory() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment