Reviewers: jochen,
Description:
Version 4.4.63.27 (cherry-pick)
Merged aa84551622799c6c44b8ee60ea6c40405465177a
Pretenuring decision of outermost literal is propagated to inner literals.
BUG=chromium:514721
LOG=N
[email protected]
Please review this at https://codereview.chromium.org/1270343002/
Base URL: https://chromium.googlesource.com/v8/[email protected]
Affected files (+11, -12 lines):
M include/v8-version.h
M src/hydrogen.cc
Index: include/v8-version.h
diff --git a/include/v8-version.h b/include/v8-version.h
index
c52267e024ca30e7461cfd684cad7766c64d69ef..6aabb65580e4aa0334ab73e27a2c2ae02b08e95f
100644
--- a/include/v8-version.h
+++ b/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 4
#define V8_BUILD_NUMBER 63
-#define V8_PATCH_LEVEL 26
+#define V8_PATCH_LEVEL 27
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index
6a86c736ee5e63208e697fc5e114ecf4d24844b0..455af79bb69dee283e80a282a0f1ee470758c1e3
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -11300,16 +11300,20 @@ HInstruction*
HOptimizedGraphBuilder::BuildFastLiteral(
HValue* object_size_constant =
Add<HConstant>(initial_map->instance_size());
PretenureFlag pretenure_flag = NOT_TENURED;
- Handle<AllocationSite> current_site(*site_context->current(), isolate());
+ Handle<AllocationSite> top_site(*site_context->top(), isolate());
if (FLAG_allocation_site_pretenuring) {
- pretenure_flag = current_site->GetPretenureMode();
- top_info()->dependencies()->AssumeTenuringDecision(current_site);
+ pretenure_flag = top_site->GetPretenureMode();
}
+ Handle<AllocationSite> current_site(*site_context->current(), isolate());
+ if (*top_site == *current_site) {
+ // We install a dependency for pretenuring only on the outermost
literal.
+ top_info()->dependencies()->AssumeTenuringDecision(top_site);
+ }
top_info()->dependencies()->AssumeTransitionStable(current_site);
HInstruction* object = Add<HAllocate>(
- object_size_constant, type, pretenure_flag, instance_type,
current_site);
+ object_size_constant, type, pretenure_flag, instance_type, top_site);
// If allocation folding reaches Page::kMaxRegularHeapObjectSize the
// elements array may not get folded into the object. Hence, we set the
@@ -11349,9 +11353,8 @@ HInstruction*
HOptimizedGraphBuilder::BuildFastLiteral(
HValue* object_elements_size = Add<HConstant>(elements_size);
InstanceType instance_type =
boilerplate_object->HasFastDoubleElements()
? FIXED_DOUBLE_ARRAY_TYPE : FIXED_ARRAY_TYPE;
- object_elements =
- Add<HAllocate>(object_elements_size, HType::HeapObject(),
- pretenure_flag, instance_type, current_site);
+ object_elements = Add<HAllocate>(object_elements_size,
HType::HeapObject(),
+ pretenure_flag, instance_type,
top_site);
BuildEmitElements(boilerplate_object, elements, object_elements,
site_context);
Add<HStoreNamedField>(object, HObjectAccess::ForElementsPointer(),
@@ -11452,10 +11455,6 @@ void
HOptimizedGraphBuilder::BuildEmitInObjectProperties(
if (representation.IsDouble()) {
// Allocate a HeapNumber box and store the value into it.
HValue* heap_number_constant = Add<HConstant>(HeapNumber::kSize);
- // This heap number alloc does not have a corresponding
- // AllocationSite. That is okay because
- // 1) it's a child object of another object with a valid
allocation site
- // 2) we can just use the mode of the parent object for pretenuring
HInstruction* double_box =
Add<HAllocate>(heap_number_constant, HType::HeapObject(),
pretenure_flag, MUTABLE_HEAP_NUMBER_TYPE);
--
--
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/d/optout.