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

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

Issue 1089853005: prepare to deprecate non phantom weak callbacks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/test-api.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | 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 8858a82d9adf7f838a0add8538918278d1ba7748..21fa4cecd432c0177d804f47d77a431feb0afde2 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -4470,13 +4470,11 @@ TEST(NextCodeLinkIsWeak2) {
static bool weak_ic_cleared = false;
-static void ClearWeakIC(const v8::WeakCallbackData<v8::Object, void>& data) {
+static void ClearWeakIC(
+ const v8::WeakCallbackInfo<v8::Persistent<v8::Object>>& data) {
printf("clear weak is called\n");
weak_ic_cleared = true;
- v8::Persistent<v8::Value>* p =
- reinterpret_cast<v8::Persistent<v8::Value>*>(data.GetParameter());
- CHECK(p->IsNearDeath());
- p->Reset();
+ data.GetParameter()->Reset();
}
@@ -4507,7 +4505,7 @@ TEST(WeakFunctionInConstructor) {
garbage.Reset(isolate, CompileRun(source)->ToObject(isolate));
}
weak_ic_cleared = false;
- garbage.SetWeak(static_cast<void*>(&garbage), &ClearWeakIC);
+ garbage.SetWeak(&garbage, &ClearWeakIC, v8::WeakCallbackType::kParameter);
Heap* heap = CcTest::i_isolate()->heap();
heap->CollectAllGarbage();
CHECK(weak_ic_cleared);
@@ -4546,7 +4544,7 @@ void CheckWeakness(const char* source) {
garbage.Reset(isolate, CompileRun(source)->ToObject(isolate));
}
weak_ic_cleared = false;
- garbage.SetWeak(static_cast<void*>(&garbage), &ClearWeakIC);
+ garbage.SetWeak(&garbage, &ClearWeakIC, v8::WeakCallbackType::kParameter);
Heap* heap = CcTest::i_isolate()->heap();
heap->CollectAllGarbage();
CHECK(weak_ic_cleared);
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698