Commit 0213fc90 authored by hpayer@chromium.org's avatar hpayer@chromium.org

Added tracing support for pretenuring.

BUG=
R=mvstanton@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@18117 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d53e3877
...@@ -215,6 +215,8 @@ DEFINE_bool(pretenuring, true, "allocate objects in old space") ...@@ -215,6 +215,8 @@ DEFINE_bool(pretenuring, true, "allocate objects in old space")
DEFINE_bool(pretenuring_call_new, false, "pretenure call new") DEFINE_bool(pretenuring_call_new, false, "pretenure call new")
DEFINE_bool(allocation_site_pretenuring, false, DEFINE_bool(allocation_site_pretenuring, false,
"pretenure with allocation sites") "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_fields, true, "track fields with only smi values")
DEFINE_bool(track_double_fields, true, "track fields with double values") DEFINE_bool(track_double_fields, true, "track fields with double values")
DEFINE_bool(track_heap_object_fields, true, "track fields with heap values") DEFINE_bool(track_heap_object_fields, true, "track fields with heap values")
......
...@@ -5439,9 +5439,11 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> { ...@@ -5439,9 +5439,11 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> {
HValue* size, HValue* size,
HType type, HType type,
PretenureFlag pretenure_flag, 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, return new(zone) HAllocate(context, size, type, pretenure_flag,
instance_type); instance_type, allocation_site);
} }
// Maximum instance size for which allocations will be inlined. // Maximum instance size for which allocations will be inlined.
...@@ -5514,7 +5516,9 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> { ...@@ -5514,7 +5516,9 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> {
HValue* size, HValue* size,
HType type, HType type,
PretenureFlag pretenure_flag, PretenureFlag pretenure_flag,
InstanceType instance_type) InstanceType instance_type,
Handle<AllocationSite> allocation_site =
Handle<AllocationSite>::null())
: HTemplateInstruction<2>(type), : HTemplateInstruction<2>(type),
dominating_allocate_(NULL), dominating_allocate_(NULL),
filler_free_space_size_(NULL), filler_free_space_size_(NULL),
...@@ -5542,6 +5546,14 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> { ...@@ -5542,6 +5546,14 @@ class HAllocate V8_FINAL : public HTemplateInstruction<2> {
} }
clear_next_map_word_ = pretenure_flag == NOT_TENURED && clear_next_map_word_ = pretenure_flag == NOT_TENURED &&
AllocationSite::CanTrack(instance_type); 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) { void UpdateSize(HValue* size) {
......
...@@ -9359,16 +9359,10 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral( ...@@ -9359,16 +9359,10 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
pretenure_flag = site_context->current()->GetPretenureMode() pretenure_flag = site_context->current()->GetPretenureMode()
? TENURED ? TENURED
: NOT_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, HInstruction* object = Add<HAllocate>(object_size_constant, type,
pretenure_flag, instance_type); pretenure_flag, instance_type, site_context->current());
BuildEmitObjectHeader(boilerplate_object, object); BuildEmitObjectHeader(boilerplate_object, object);
...@@ -9382,10 +9376,10 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral( ...@@ -9382,10 +9376,10 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
HValue* object_elements_size = Add<HConstant>(elements_size); HValue* object_elements_size = Add<HConstant>(elements_size);
if (boilerplate_object->HasFastDoubleElements()) { if (boilerplate_object->HasFastDoubleElements()) {
object_elements = Add<HAllocate>(object_elements_size, HType::JSObject(), 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 { } else {
object_elements = Add<HAllocate>(object_elements_size, HType::JSObject(), 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); BuildInitElementsInObjectHeader(boilerplate_object, object, object_elements);
......
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