Revision: 16912
Author:   [email protected]
Date:     Tue Sep 24 10:30:41 2013 UTC
Log: Add field nested_sites to AllocationSite. This field is used to maintain
allocation site information for nested array and object literals.
It's not used productively in this CL, merely maintained in a minimal
way. (that comes next :)).

BUG=
[email protected]

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

Modified:
 /branches/bleeding_edge/src/code-stubs-hydrogen.cc
 /branches/bleeding_edge/src/heap-snapshot-generator.cc
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /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 Tue Sep 24 09:31:07 2013 UTC +++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Tue Sep 24 10:30:41 2013 UTC
@@ -486,6 +486,11 @@
                         HObjectAccess::ForAllocationSiteTransitionInfo(),
                         initial_elements_kind);

+  // Unlike literals, constructed arrays don't have nested sites
+  Add<HStoreNamedField>(object,
+                        HObjectAccess::ForAllocationSiteNestedSite(),
+                        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 Sep 19 14:13:34 2013 UTC +++ /branches/bleeding_edge/src/heap-snapshot-generator.cc Tue Sep 24 10:30:41 2013 UTC
@@ -1301,6 +1301,8 @@
AllocationSite* site) { SetInternalReference(site, entry, "transition_info", site->transition_info(),
                        AllocationSite::kTransitionInfoOffset);
+  SetInternalReference(site, entry, "nested_site", site->nested_site(),
+                       AllocationSite::kNestedSiteOffset);
SetInternalReference(site, entry, "dependent_code", site->dependent_code(),
                        AllocationSite::kDependentCodeOffset);
 }
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Tue Sep 24 09:48:39 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Tue Sep 24 10:30:41 2013 UTC
@@ -5636,6 +5636,10 @@
   static HObjectAccess ForAllocationSiteTransitionInfo() {
     return HObjectAccess(kInobject, AllocationSite::kTransitionInfoOffset);
   }
+
+  static HObjectAccess ForAllocationSiteNestedSite() {
+    return HObjectAccess(kInobject, AllocationSite::kNestedSiteOffset);
+  }

   static HObjectAccess ForAllocationSiteDependentCode() {
     return HObjectAccess(kInobject, AllocationSite::kDependentCodeOffset);
=======================================
--- /branches/bleeding_edge/src/objects-inl.h   Mon Sep 23 19:56:36 2013 UTC
+++ /branches/bleeding_edge/src/objects-inl.h   Tue Sep 24 10:30:41 2013 UTC
@@ -1324,6 +1324,7 @@

 void AllocationSite::Initialize() {
   SetElementsKind(GetInitialFastElementsKind());
+  set_nested_site(Smi::FromInt(0));
   set_dependent_code(DependentCode::cast(GetHeap()->empty_fixed_array()),
                      SKIP_WRITE_BARRIER);
 }
@@ -4442,6 +4443,7 @@
 ACCESSORS(TypeSwitchInfo, types, Object, kTypesOffset)

 ACCESSORS(AllocationSite, transition_info, Object, kTransitionInfoOffset)
+ACCESSORS(AllocationSite, nested_site, Object, kNestedSiteOffset)
 ACCESSORS(AllocationSite, dependent_code, DependentCode,
           kDependentCodeOffset)
 ACCESSORS(AllocationSite, weak_next, Object, kWeakNextOffset)
=======================================
--- /branches/bleeding_edge/src/objects-printer.cc Thu Sep 19 14:13:34 2013 UTC +++ /branches/bleeding_edge/src/objects-printer.cc Tue Sep 24 10:30:41 2013 UTC
@@ -1102,7 +1102,8 @@
   weak_next()->ShortPrint(out);
   PrintF(out, "\n - dependent code: ");
   dependent_code()->ShortPrint(out);
-
+  PrintF(out, "\n - nested site: ");
+  nested_site()->ShortPrint(out);
   PrintF(out, "\n - transition_info: ");
   if (transition_info()->IsCell()) {
     Cell* cell = Cell::cast(transition_info());
=======================================
--- /branches/bleeding_edge/src/objects.h       Mon Sep 23 19:56:36 2013 UTC
+++ /branches/bleeding_edge/src/objects.h       Tue Sep 24 10:30:41 2013 UTC
@@ -7827,6 +7827,10 @@
   static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024;

   DECL_ACCESSORS(transition_info, Object)
+  // nested_site threads a list of sites that represent nested literals
+  // 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(dependent_code, DependentCode)
   DECL_ACCESSORS(weak_next, Object)

@@ -7858,7 +7862,8 @@
   static inline bool CanTrack(InstanceType type);

   static const int kTransitionInfoOffset = HeapObject::kHeaderSize;
- static const int kDependentCodeOffset = kTransitionInfoOffset + kPointerSize; + static const int kNestedSiteOffset = kTransitionInfoOffset + kPointerSize;
+  static const int kDependentCodeOffset = kNestedSiteOffset + 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