Revision: 18117
Author:   [email protected]
Date:     Thu Nov 28 10:49:02 2013 UTC
Log:      Added tracing support for pretenuring.

BUG=
[email protected]

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

Modified:
 /branches/bleeding_edge/src/flag-definitions.h
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/flag-definitions.h Wed Nov 27 17:21:40 2013 UTC +++ /branches/bleeding_edge/src/flag-definitions.h Thu Nov 28 10:49:02 2013 UTC
@@ -215,6 +215,8 @@
 DEFINE_bool(pretenuring_call_new, false, "pretenure call new")
 DEFINE_bool(allocation_site_pretenuring, false,
             "pretenure with allocation sites")
+DEFINE_bool(trace_pretenuring, false,
+            "trace pretenuring decisions of HAllocate instructions")
 DEFINE_bool(track_fields, true, "track fields with only smi values")
 DEFINE_bool(track_double_fields, true, "track fields with double values")
DEFINE_bool(track_heap_object_fields, true, "track fields with heap values")
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Tue Nov 26 13:52:44 2013 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Thu Nov 28 10:49:02 2013 UTC
@@ -5439,9 +5439,11 @@
                         HValue* size,
                         HType type,
                         PretenureFlag pretenure_flag,
-                        InstanceType instance_type) {
+                        InstanceType instance_type,
+                        Handle<AllocationSite> allocation_site =
+                            Handle<AllocationSite>::null()) {
     return new(zone) HAllocate(context, size, type, pretenure_flag,
-        instance_type);
+        instance_type, allocation_site);
   }

   // Maximum instance size for which allocations will be inlined.
@@ -5514,7 +5516,9 @@
             HValue* size,
             HType type,
             PretenureFlag pretenure_flag,
-            InstanceType instance_type)
+            InstanceType instance_type,
+            Handle<AllocationSite> allocation_site =
+                Handle<AllocationSite>::null())
       : HTemplateInstruction<2>(type),
         dominating_allocate_(NULL),
         filler_free_space_size_(NULL),
@@ -5542,6 +5546,14 @@
     }
     clear_next_map_word_ = pretenure_flag == NOT_TENURED &&
         AllocationSite::CanTrack(instance_type);
+
+    if (FLAG_trace_pretenuring) {
+      PrintF("HAllocate with AllocationSite %p %s\n",
+             allocation_site.is_null()
+                 ? static_cast<void*>(NULL)
+                 : static_cast<void*>(*allocation_site),
+             pretenure_flag == TENURED ? "tenured" : "not tenured");
+    }
   }

   void UpdateSize(HValue* size) {
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Wed Nov 27 14:03:40 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Thu Nov 28 10:49:02 2013 UTC
@@ -9359,16 +9359,10 @@
     pretenure_flag = site_context->current()->GetPretenureMode()
         ? TENURED
         : NOT_TENURED;
-    if (FLAG_trace_track_allocation_sites) {
-      PrintF("Hydrogen: AllocationSite %p boilerplate %p %s\n",
-             static_cast<void*>(*(site_context->current())),
-             static_cast<void*>(*boilerplate_object),
-             pretenure_flag == TENURED ? "tenured" : "not tenured");
-    }
   }

   HInstruction* object = Add<HAllocate>(object_size_constant, type,
-      pretenure_flag, instance_type);
+      pretenure_flag, instance_type, site_context->current());

   BuildEmitObjectHeader(boilerplate_object, object);

@@ -9382,10 +9376,10 @@
     HValue* object_elements_size = Add<HConstant>(elements_size);
     if (boilerplate_object->HasFastDoubleElements()) {
object_elements = Add<HAllocate>(object_elements_size, HType::JSObject(),
-          pretenure_flag, FIXED_DOUBLE_ARRAY_TYPE);
+ pretenure_flag, FIXED_DOUBLE_ARRAY_TYPE, site_context->current());
     } else {
object_elements = Add<HAllocate>(object_elements_size, HType::JSObject(),
-          pretenure_flag, FIXED_ARRAY_TYPE);
+          pretenure_flag, FIXED_ARRAY_TYPE, site_context->current());
     }
   }
BuildInitElementsInObjectHeader(boilerplate_object, object, object_elements);

--
--
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