Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Unified Diff: src/hydrogen.cc

Issue 133803002: Turn off global pretenuring when allocation site pretenuring is in use. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 3698a322c046681ec8471a14fa3db2110a8b678a..bebdc98eb837f8a973c3c5713403f002a5564915 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -2243,8 +2243,11 @@ HValue* HGraphBuilder::BuildAllocateElements(ElementsKind kind,
HValue* total_size = AddUncasted<HAdd>(mul, header_size);
total_size->ClearFlag(HValue::kCanOverflow);
- return Add<HAllocate>(total_size, HType::JSArray(),
- isolate()->heap()->GetPretenureMode(), instance_type);
+ PretenureFlag pretenure_flag = !FLAG_allocation_site_pretenuring ?
+ isolate()->heap()->GetPretenureMode() : NOT_TENURED;
+
+ return Add<HAllocate>(total_size, HType::JSArray(), pretenure_flag,
+ instance_type);
}
@@ -5258,8 +5261,13 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
// The store requires a mutable HeapNumber to be allocated.
NoObservableSideEffectsScope no_side_effects(this);
HInstruction* heap_number_size = Add<HConstant>(HeapNumber::kSize);
+
+ PretenureFlag pretenure_flag = !FLAG_allocation_site_pretenuring ?
+ isolate()->heap()->GetPretenureMode() : NOT_TENURED;
+
HInstruction* heap_number = Add<HAllocate>(heap_number_size,
- HType::HeapNumber(), isolate()->heap()->GetPretenureMode(),
+ HType::HeapNumber(),
+ pretenure_flag,
HEAP_NUMBER_TYPE);
AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map());
Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(),
@@ -8173,9 +8181,8 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
// Allocate an instance of the implicit receiver object.
HValue* size_in_bytes = Add<HConstant>(instance_size);
PretenureFlag pretenure_flag =
- (FLAG_pretenuring_call_new &&
- isolate()->heap()->GetPretenureMode() == TENURED)
- ? TENURED : NOT_TENURED;
+ (FLAG_pretenuring_call_new && !FLAG_allocation_site_pretenuring) ?
+ isolate()->heap()->GetPretenureMode() : NOT_TENURED;
HAllocate* receiver =
Add<HAllocate>(size_in_bytes, HType::JSObject(), pretenure_flag,
JS_OBJECT_TYPE);
@@ -8938,12 +8945,15 @@ HValue* HOptimizedGraphBuilder::BuildBinaryOperation(
Maybe<int> fixed_right_arg = expr->fixed_right_arg();
Handle<AllocationSite> allocation_site = expr->allocation_site();
+ PretenureFlag pretenure_flag = !FLAG_allocation_site_pretenuring ?
+ isolate()->heap()->GetPretenureMode() : NOT_TENURED;
+
HAllocationMode allocation_mode =
FLAG_allocation_site_pretenuring
? (allocation_site.is_null()
? HAllocationMode(NOT_TENURED)
: HAllocationMode(allocation_site))
- : HAllocationMode(isolate()->heap()->GetPretenureMode());
+ : HAllocationMode(pretenure_flag);
HValue* result = HGraphBuilder::BuildBinaryOperation(
expr->op(), left, right, left_type, right_type, result_type,
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698