Reviewers: jochen,
Description:
Version 4.5.103.15 (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/1271203003/
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
d8a0363fa5555d67f208005421359d9cc1bb8969..c51edbbd35b5b0a99a3877573f4a48c387318b37
100644
--- a/include/v8-version.h
+++ b/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 4
#define V8_MINOR_VERSION 5
#define V8_BUILD_NUMBER 103
-#define V8_PATCH_LEVEL 14
+#define V8_PATCH_LEVEL 15
// 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
640befc4a63ab60726caa13fedb5b2a83dd7146c..2a0e2c3919ccb887f2650969c21392fb57412a56
100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -11353,16 +11353,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
@@ -11402,9 +11406,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(),
@@ -11505,10 +11508,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.