Commit 7dbc2239 authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[turbofan] Enable pretenuring tests for optimized code.

This enables tests which verify allocation site feedback is used and
influences pretenuring decisions. By now TurboFan is respecting such
feedback. Ignition however doesn't provide such feedback yet.

R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2135563003
Cr-Commit-Position: refs/heads/master@{#37628}
parent 7f162dbc
......@@ -102,16 +102,8 @@
# coverage).
'test-heap/ObjectsInOptimizedCodeAreWeak': [PASS, NO_VARIANTS],
# TurboFan doesn't support allocation sites currently.
'test-heap/EnsureAllocationSiteDependentCodesProcessed': [PASS, NO_VARIANTS],
'test-heap/OptimizedPretenuringAllocationFolding': [PASS, NO_VARIANTS],
'test-heap/OptimizedPretenuringdoubleArrayLiterals': [PASS, NO_VARIANTS],
'test-heap/OptimizedPretenuringDoubleArrayProperties': [PASS, NO_VARIANTS],
# TODO(mstarzinger): The pretenuring decision is different in TurboFan.
'test-heap/OptimizedPretenuringMixedInObjectProperties': [PASS, NO_VARIANTS],
'test-heap/OptimizedPretenuringNestedDoubleLiterals': [PASS, NO_VARIANTS],
'test-heap/OptimizedPretenuringNestedMixedArrayLiterals': [PASS, NO_VARIANTS],
'test-heap/OptimizedPretenuringNestedObjectLiterals': [PASS, NO_VARIANTS],
'test-heap/OptimizedPretenuringObjectArrayLiterals': [PASS, NO_VARIANTS],
# TurboFan cpu profiler result is different.
'test-cpu-profiler/CollectDeoptEvents': [PASS, NO_VARIANTS],
......@@ -173,6 +165,16 @@
'test-heap/ResetSharedFunctionInfoCountersDuringIncrementalMarking': [PASS, NO_IGNITION],
'test-heap/ResetSharedFunctionInfoCountersDuringMarkSweep': [PASS, NO_IGNITION],
# BUG(4680): Ignition doesn't support allocation sites currently.
'test-heap/EnsureAllocationSiteDependentCodesProcessed': [PASS, NO_IGNITION],
'test-heap/OptimizedPretenuringAllocationFolding': [PASS, NO_IGNITION],
'test-heap/OptimizedPretenuringdoubleArrayLiterals': [PASS, NO_IGNITION],
'test-heap/OptimizedPretenuringDoubleArrayProperties': [PASS, NO_IGNITION],
'test-heap/OptimizedPretenuringNestedDoubleLiterals': [PASS, NO_IGNITION],
'test-heap/OptimizedPretenuringNestedMixedArrayLiterals': [PASS, NO_IGNITION],
'test-heap/OptimizedPretenuringNestedObjectLiterals': [PASS, NO_IGNITION],
'test-heap/OptimizedPretenuringObjectArrayLiterals': [PASS, NO_IGNITION],
# BUG(4751). Flaky with ignition.
'test-cpu-profiler/JsNativeJsSample': [PASS, NO_IGNITION],
}], # ALWAYS
......@@ -554,6 +556,16 @@
# TODO(mvstanton,4900): CHECK(!g_function->is_compiled());
'test-heap/TestUseOfIncrementalBarrierOnCompileLazy': [FAIL],
# BUG(4680): Ignition doesn't support allocation sites currently.
'test-heap/EnsureAllocationSiteDependentCodesProcessed': [FAIL],
'test-heap/OptimizedPretenuringAllocationFolding': [FAIL],
'test-heap/OptimizedPretenuringdoubleArrayLiterals': [FAIL],
'test-heap/OptimizedPretenuringDoubleArrayProperties': [FAIL],
'test-heap/OptimizedPretenuringNestedDoubleLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedMixedArrayLiterals': [FAIL],
'test-heap/OptimizedPretenuringNestedObjectLiterals': [FAIL],
'test-heap/OptimizedPretenuringObjectArrayLiterals': [FAIL],
# BUG(4751). Flaky with Ignition.
'test-cpu-profiler/JsNativeJsSample': [SKIP],
}], # ignition or ignition_turbofan
......
......@@ -4703,18 +4703,31 @@ TEST(EnsureAllocationSiteDependentCodesProcessed) {
CompileRun("%OptimizeFunctionOnNextCall(bar); bar();");
CHECK_EQ(DependentCode::kAllocationSiteTransitionChangedGroup,
site->dependent_code()->group());
CHECK_EQ(1, site->dependent_code()->count());
CHECK(site->dependent_code()->object_at(0)->IsWeakCell());
Code* function_bar = Code::cast(
WeakCell::cast(site->dependent_code()->object_at(0))->value());
Handle<JSFunction> bar_handle = Handle<JSFunction>::cast(
v8::Utils::OpenHandle(*v8::Local<v8::Function>::Cast(
CcTest::global()
->Get(context.local(), v8_str("bar"))
.ToLocalChecked())));
CHECK_EQ(bar_handle->code(), function_bar);
int dependency_group_count = 0;
DependentCode* dependency = site->dependent_code();
while (dependency != heap->empty_fixed_array()) {
CHECK(dependency->group() ==
DependentCode::kAllocationSiteTransitionChangedGroup ||
dependency->group() ==
DependentCode::kAllocationSiteTenuringChangedGroup);
CHECK_EQ(1, dependency->count());
CHECK(dependency->object_at(0)->IsWeakCell());
Code* function_bar =
Code::cast(WeakCell::cast(dependency->object_at(0))->value());
CHECK_EQ(bar_handle->code(), function_bar);
dependency = dependency->next_link();
dependency_group_count++;
}
// TurboFan respects pretenuring feedback from allocation sites, Crankshaft
// does not. Either is fine for the purposes of this test.
CHECK(dependency_group_count == 1 || dependency_group_count == 2);
}
// Now make sure that a gc should get rid of the function, even though we
......
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