From 784b8207cf8e5cf69bd773521d199bca8a609826 Mon Sep 17 00:00:00 2001 From: "mvstanton@chromium.org" Date: Wed, 4 Dec 2013 09:54:23 +0000 Subject: [PATCH] AllocationSite::memento_found_count() and friends need Smi access. Some new AllocationSite fields weren't accessed with the correct representation. R=hpayer@chromium.org Review URL: https://codereview.chromium.org/101783005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18253 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/hydrogen-instructions.cc | 23 +++++++++++++++++++++++ src/hydrogen-instructions.h | 5 +---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc index 9f96202..91bd01e 100644 --- a/src/hydrogen-instructions.cc +++ b/src/hydrogen-instructions.cc @@ -4269,6 +4269,29 @@ HObjectAccess HObjectAccess::ForJSObjectOffset(int offset, } +HObjectAccess HObjectAccess::ForAllocationSiteOffset(int offset) { + switch (offset) { + case AllocationSite::kTransitionInfoOffset: + return HObjectAccess(kInobject, offset, Representation::Tagged()); + case AllocationSite::kNestedSiteOffset: + return HObjectAccess(kInobject, offset, Representation::Tagged()); + case AllocationSite::kMementoFoundCountOffset: + return HObjectAccess(kInobject, offset, Representation::Smi()); + case AllocationSite::kMementoCreateCountOffset: + return HObjectAccess(kInobject, offset, Representation::Smi()); + case AllocationSite::kPretenureDecisionOffset: + return HObjectAccess(kInobject, offset, Representation::Smi()); + case AllocationSite::kDependentCodeOffset: + return HObjectAccess(kInobject, offset, Representation::Tagged()); + case AllocationSite::kWeakNextOffset: + return HObjectAccess(kInobject, offset, Representation::Tagged()); + default: + UNREACHABLE(); + } + return HObjectAccess(kInobject, offset); +} + + HObjectAccess HObjectAccess::ForContextSlot(int index) { ASSERT(index >= 0); Portion portion = kInobject; diff --git a/src/hydrogen-instructions.h b/src/hydrogen-instructions.h index 9f7605f..30a6b20 100644 --- a/src/hydrogen-instructions.h +++ b/src/hydrogen-instructions.h @@ -5961,10 +5961,7 @@ class HObjectAccess V8_FINAL { ? Representation::Smi() : Representation::Tagged()); } - static HObjectAccess ForAllocationSiteOffset(int offset) { - ASSERT(offset >= HeapObject::kHeaderSize && offset < AllocationSite::kSize); - return HObjectAccess(kInobject, offset); - } + static HObjectAccess ForAllocationSiteOffset(int offset); static HObjectAccess ForAllocationSiteList() { return HObjectAccess(kExternalMemory, 0, Representation::Tagged()); -- 2.7.4