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

Unified Diff: test/cctest/heap/test-heap.cc

Issue 2135563003: [turbofan] Enable pretenuring tests for optimized code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed. Created 4 years, 5 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 | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-heap.cc
diff --git a/test/cctest/heap/test-heap.cc b/test/cctest/heap/test-heap.cc
index deaa6fbdf57e8f927bc9dfa8f3bca69c7b16310e..9d55945361ae4c72905d7a31567260de62061acf 100644
--- a/test/cctest/heap/test-heap.cc
+++ b/test/cctest/heap/test-heap.cc
@@ -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
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698