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

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

Issue 11369131: Implement MarkIndependent(Isolate*) and MarkPartiallyDependent(Isolate*) (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Created 8 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/api.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 0fb12af930b0483791cfb1c274939b1e57db5ac5..50de8b1cb58c660ac895e3bf1fe353d552da5187 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -2608,14 +2608,15 @@ THREADED_TEST(ApiObjectGroupsCycleForScavenger) {
root.MakeWeak(reinterpret_cast<void*>(&counter), &WeakPointerCallback);
root.MarkPartiallyDependent();
+ v8::Isolate* isolate = v8::Isolate::GetCurrent();
// Groups are deleted, rebuild groups.
{
- g1s1.MarkPartiallyDependent();
- g1s2.MarkPartiallyDependent();
- g2s1.MarkPartiallyDependent();
- g2s2.MarkPartiallyDependent();
- g3s1.MarkPartiallyDependent();
- g3s2.MarkPartiallyDependent();
+ g1s1.MarkPartiallyDependent(isolate);
+ g1s2.MarkPartiallyDependent(isolate);
+ g2s1.MarkPartiallyDependent(isolate);
+ g2s2.MarkPartiallyDependent(isolate);
+ g3s1.MarkPartiallyDependent(isolate);
+ g3s2.MarkPartiallyDependent(isolate);
Persistent<Value> g1_objects[] = { g1s1, g1s2 };
Persistent<Value> g2_objects[] = { g2s1, g2s2 };
Persistent<Value> g3_objects[] = { g3s1, g3s2 };
@@ -5503,23 +5504,28 @@ THREADED_TEST(IndependentWeakHandle) {
v8::Persistent<Context> context = Context::New();
Context::Scope context_scope(context);
- v8::Persistent<v8::Object> object_a;
+ v8::Persistent<v8::Object> object_a, object_b;
{
v8::HandleScope handle_scope;
object_a = v8::Persistent<v8::Object>::New(v8::Object::New());
+ object_b = v8::Persistent<v8::Object>::New(v8::Object::New());
}
v8::Isolate* isolate = v8::Isolate::GetCurrent();
bool object_a_disposed = false;
+ bool object_b_disposed = false;
object_a.MakeWeak(&object_a_disposed, &DisposeAndSetFlag);
+ object_b.MakeWeak(&object_b_disposed, &DisposeAndSetFlag);
CHECK(!object_a.IsIndependent());
- CHECK(!object_a.IsIndependent(isolate));
+ CHECK(!object_b.IsIndependent(isolate));
object_a.MarkIndependent();
+ object_b.MarkIndependent(isolate);
CHECK(object_a.IsIndependent());
- CHECK(object_a.IsIndependent(isolate));
+ CHECK(object_b.IsIndependent(isolate));
HEAP->PerformScavenge();
CHECK(object_a_disposed);
+ CHECK(object_b_disposed);
}
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698