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

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

Issue 1435313002: Refactor dependent code. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « src/objects-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 41e6c24b9f0331c24a5b86599ba6bdc409655588..4500ade73df21b75c0cfdb8a60f3f548fa097a8a 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -4722,12 +4722,12 @@ TEST(EnsureAllocationSiteDependentCodesProcessed) {
CompileRun("%OptimizeFunctionOnNextCall(bar); bar();");
- DependentCode::GroupStartIndexes starts(site->dependent_code());
- CHECK_GE(starts.number_of_entries(), 1);
- int index = starts.at(DependentCode::kAllocationSiteTransitionChangedGroup);
- CHECK(site->dependent_code()->object_at(index)->IsWeakCell());
+ 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(index))->value());
+ 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()
@@ -4744,10 +4744,8 @@ TEST(EnsureAllocationSiteDependentCodesProcessed) {
// The site still exists because of our global handle, but the code is no
// longer referred to by dependent_code().
- DependentCode::GroupStartIndexes starts(site->dependent_code());
- int index = starts.at(DependentCode::kAllocationSiteTransitionChangedGroup);
- CHECK(site->dependent_code()->object_at(index)->IsWeakCell() &&
- WeakCell::cast(site->dependent_code()->object_at(index))->cleared());
+ CHECK(site->dependent_code()->object_at(0)->IsWeakCell() &&
+ WeakCell::cast(site->dependent_code()->object_at(0))->cleared());
}
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698