Revision: 17986
Author:   [email protected]
Date:     Fri Nov 22 07:34:21 2013 UTC
Log:      Pretenuring calculation fields in AllocationSite.

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

[email protected]

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

Modified:
 /branches/bleeding_edge/src/code-stubs-hydrogen.cc
 /branches/bleeding_edge/src/heap-snapshot-generator.cc
 /branches/bleeding_edge/src/objects-inl.h
 /branches/bleeding_edge/src/objects-printer.cc
 /branches/bleeding_edge/src/objects.h

=======================================
--- /branches/bleeding_edge/src/code-stubs-hydrogen.cc Fri Nov 22 07:27:26 2013 UTC +++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Fri Nov 22 07:34:21 2013 UTC
@@ -511,6 +511,22 @@
                             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());
=======================================
--- /branches/bleeding_edge/src/heap-snapshot-generator.cc Thu Nov 14 12:13:26 2013 UTC +++ /branches/bleeding_edge/src/heap-snapshot-generator.cc Fri Nov 22 07:34:21 2013 UTC
@@ -1526,6 +1526,15 @@
                        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);
 }
=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Thu Nov 21 16:55:16 2013 UTC
+++ /branches/bleeding_edge/src/objects-inl.h   Fri Nov 22 07:34:21 2013 UTC
@@ -1314,6 +1314,9 @@
   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(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)
=======================================
--- /branches/bleeding_edge/src/objects-printer.cc Thu Nov 14 12:05:09 2013 UTC +++ /branches/bleeding_edge/src/objects-printer.cc Fri Nov 22 07:34:21 2013 UTC
@@ -1125,6 +1125,12 @@
   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();
=======================================
--- /branches/bleeding_edge/src/objects.h       Thu Nov 21 17:21:00 2013 UTC
+++ /branches/bleeding_edge/src/objects.h       Fri Nov 22 07:34:21 2013 UTC
@@ -8111,6 +8111,9 @@
   // 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 @@

   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;

--
--
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/groups/opt_out.

Reply via email to