Pretenuring calculation fields in AllocationSite.

AllocationSite-based pretenuring needs additional fields to carry out
calculations.

R=hpayer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17986 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent da87c188
......@@ -511,6 +511,22 @@ HValue* CodeStubGraphBuilder<CreateAllocationSiteStub>::BuildCodeStub() {
AllocationSite::kNestedSiteOffset),
graph()->GetConstant0());
// Pretenuring calculation fields.
Add<HStoreNamedField>(object,
HObjectAccess::ForAllocationSiteOffset(
AllocationSite::kMementoFoundCountOffset),
graph()->GetConstant0());
Add<HStoreNamedField>(object,
HObjectAccess::ForAllocationSiteOffset(
AllocationSite::kMementoCreateCountOffset),
graph()->GetConstant0());
Add<HStoreNamedField>(object,
HObjectAccess::ForAllocationSiteOffset(
AllocationSite::kPretenureDecisionOffset),
graph()->GetConstant0());
// Store an empty fixed array for the code dependency.
HConstant* empty_fixed_array =
Add<HConstant>(isolate()->factory()->empty_fixed_array());
......
......@@ -1526,6 +1526,15 @@ void V8HeapExplorer::ExtractAllocationSiteReferences(int entry,
AllocationSite::kTransitionInfoOffset);
SetInternalReference(site, entry, "nested_site", site->nested_site(),
AllocationSite::kNestedSiteOffset);
SetInternalReference(site, entry, "memento_found_count",
site->memento_found_count(),
AllocationSite::kMementoFoundCountOffset);
SetInternalReference(site, entry, "memento_create_count",
site->memento_create_count(),
AllocationSite::kMementoCreateCountOffset);
SetInternalReference(site, entry, "pretenure_decision",
site->pretenure_decision(),
AllocationSite::kPretenureDecisionOffset);
SetInternalReference(site, entry, "dependent_code", site->dependent_code(),
AllocationSite::kDependentCodeOffset);
}
......
......@@ -1314,6 +1314,9 @@ void AllocationSite::Initialize() {
set_transition_info(Smi::FromInt(0));
SetElementsKind(GetInitialFastElementsKind());
set_nested_site(Smi::FromInt(0));
set_memento_create_count(Smi::FromInt(0));
set_memento_found_count(Smi::FromInt(0));
set_pretenure_decision(Smi::FromInt(0));
set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()),
SKIP_WRITE_BARRIER);
}
......@@ -4548,6 +4551,10 @@ ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset)
ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset)
ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset)
ACCESSORS_TO_SMI(AllocationSite, memento_found_count, kMementoFoundCountOffset)
ACCESSORS_TO_SMI(AllocationSite, memento_create_count,
kMementoCreateCountOffset)
ACCESSORS_TO_SMI(AllocationSite, pretenure_decision, kPretenureDecisionOffset)
ACCESSORS(AllocationSite, dependent_code, DependentCode,
kDependentCodeOffset)
ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset)
......
......@@ -1125,6 +1125,12 @@ void AllocationSite::AllocationSitePrint(FILE* out) {
dependent_code()->ShortPrint(out);
PrintF(out, "\n - nested site: ");
nested_site()->ShortPrint(out);
PrintF(out, "\n - memento found count: ");
memento_found_count()->ShortPrint(out);
PrintF(out, "\n - memento create count: ");
memento_create_count()->ShortPrint(out);
PrintF(out, "\n - pretenure decision: ");
pretenure_decision()->ShortPrint(out);
PrintF(out, "\n - transition_info: ");
if (transition_info()->IsSmi()) {
ElementsKind kind = GetElementsKind();
......
......@@ -8111,6 +8111,9 @@ class AllocationSite: public Struct {
// walked in a particular order. So [[1, 2], 1, 2] will have one
// nested_site, but [[1, 2], 3, [4]] will have a list of two.
DECL_ACCESSORS(nested_site, Object)
DECL_ACCESSORS(memento_found_count, Smi)
DECL_ACCESSORS(memento_create_count, Smi)
DECL_ACCESSORS(pretenure_decision, Smi)
DECL_ACCESSORS(dependent_code, DependentCode)
DECL_ACCESSORS(weak_next, Object)
......@@ -8178,7 +8181,13 @@ class AllocationSite: public Struct {
static const int kTransitionInfoOffset = HeapObject::kHeaderSize;
static const int kNestedSiteOffset = kTransitionInfoOffset + kPointerSize;
static const int kDependentCodeOffset = kNestedSiteOffset + kPointerSize;
static const int kMementoFoundCountOffset = kNestedSiteOffset + kPointerSize;
static const int kMementoCreateCountOffset =
kMementoFoundCountOffset + kPointerSize;
static const int kPretenureDecisionOffset =
kMementoCreateCountOffset + kPointerSize;
static const int kDependentCodeOffset =
kPretenureDecisionOffset + kPointerSize;
static const int kWeakNextOffset = kDependentCodeOffset + kPointerSize;
static const int kSize = kWeakNextOffset + kPointerSize;
......
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