Commit b3c067ff authored by hpayer@chromium.org's avatar hpayer@chromium.org

Remove global pretenuring mode.

BUG=
R=bmeurer@chromium.org, mvstanton@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21511 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c03b9848
......@@ -190,7 +190,6 @@ DEFINE_bool(compiled_keyed_dictionary_loads, true,
"use optimizing compiler to generate keyed dictionary load stubs")
DEFINE_bool(clever_optimizations, true,
"Optimize object size, Array shift, DOM strings and string +")
DEFINE_bool(pretenuring, true, "allocate objects in old space")
// TODO(hpayer): We will remove this flag as soon as we have pretenuring
// support for specific allocation sites.
DEFINE_bool(pretenuring_call_new, false, "pretenure call new")
......
......@@ -1034,12 +1034,6 @@ class Heap {
inline int64_t AdjustAmountOfExternalAllocatedMemory(
int64_t change_in_bytes);
// Returns the allocation mode (pre-tenuring) based on observed promotion
// rates of previous collections.
inline PretenureFlag GetPretenureMode() {
return FLAG_pretenuring ? TENURED : NOT_TENURED;
}
inline intptr_t PromotedTotalSize() {
int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
if (total > kMaxInt) return static_cast<intptr_t>(kMaxInt);
......
......@@ -2293,11 +2293,8 @@ HValue* HGraphBuilder::BuildAllocateElements(ElementsKind kind,
HValue* total_size = AddUncasted<HAdd>(mul, header_size);
total_size->ClearFlag(HValue::kCanOverflow);
PretenureFlag pretenure_flag = !FLAG_allocation_site_pretenuring ?
isolate()->heap()->GetPretenureMode() : NOT_TENURED;
return Add<HAllocate>(total_size, HType::NonPrimitive(),
pretenure_flag, instance_type);
return Add<HAllocate>(total_size, HType::NonPrimitive(), NOT_TENURED,
instance_type);
}
......@@ -5482,12 +5479,10 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField(
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;
// TODO(hpayer): Allocation site pretenuring support.
HInstruction* heap_number = Add<HAllocate>(heap_number_size,
HType::HeapNumber(),
pretenure_flag,
NOT_TENURED,
HEAP_NUMBER_TYPE);
AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map());
Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(),
......@@ -8605,9 +8600,6 @@ void HOptimizedGraphBuilder::VisitCallNew(CallNew* expr) {
AllocationSite::AddDependentCompilationInfo(allocation_site,
AllocationSite::TENURING,
top_info());
} else {
allocation_mode = HAllocationMode(
isolate()->heap()->GetPretenureMode());
}
}
......@@ -9536,15 +9528,10 @@ 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(pretenure_flag);
HAllocationMode allocation_mode;
if (FLAG_allocation_site_pretenuring && !allocation_site.is_null()) {
allocation_mode = HAllocationMode(allocation_site);
}
HValue* result = HGraphBuilder::BuildBinaryOperation(
expr->op(), left, right, left_type, right_type, result_type,
......@@ -10251,7 +10238,7 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
HValue* object_size_constant = Add<HConstant>(
boilerplate_object->map()->instance_size());
PretenureFlag pretenure_flag = isolate()->heap()->GetPretenureMode();
PretenureFlag pretenure_flag = NOT_TENURED;
if (FLAG_allocation_site_pretenuring) {
pretenure_flag = site_context->current()->GetPretenureMode();
Handle<AllocationSite> site(site_context->current());
......
......@@ -1566,7 +1566,7 @@ inline bool AllocationSite::IncrementMementoFoundCount() {
int value = memento_found_count();
set_memento_found_count(value + 1);
return value == kPretenureMinimumCreated;
return memento_found_count() == kPretenureMinimumCreated;
}
......
This diff is collapsed.
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