Revision: 18868
Author: [email protected]
Date: Tue Jan 28 09:47:03 2014 UTC
Log: Turn off global pretenuring when allocation site pretenuring is
in use.
BUG=
[email protected], [email protected]
Review URL: https://codereview.chromium.org/133803002
http://code.google.com/p/v8/source/detail?r=18868
Modified:
/branches/bleeding_edge/src/hydrogen.cc
/branches/bleeding_edge/test/cctest/test-heap.cc
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc Tue Jan 28 09:42:24 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc Tue Jan 28 09:47:03 2014 UTC
@@ -2243,8 +2243,11 @@
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);
}
@@ -5259,8 +5262,13 @@
// 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(),
@@ -8174,9 +8182,8 @@
// 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);
@@ -8939,12 +8946,15 @@
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,
=======================================
--- /branches/bleeding_edge/test/cctest/test-heap.cc Thu Jan 23 13:02:27
2014 UTC
+++ /branches/bleeding_edge/test/cctest/test-heap.cc Tue Jan 28 09:47:03
2014 UTC
@@ -2191,6 +2191,7 @@
TEST(OptimizedPretenuringAllocationFolding) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_max_new_space_size = 2048;
+ i::FLAG_allocation_site_pretenuring = false;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
@@ -2233,6 +2234,7 @@
TEST(OptimizedPretenuringAllocationFoldingBlocks) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_max_new_space_size = 2048;
+ i::FLAG_allocation_site_pretenuring = false;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
--
--
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.