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

Side by Side Diff: test/cctest/test-api.cc

Issue 11368053: Implement IsIndependent(Isolate*) (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: A correct patch for IsIndependent(Isolate*) 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 unified diff | Download patch
« no previous file with comments | « src/api.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 5297 matching lines...) Expand 10 before | Expand all | Expand 10 after
5308 v8::Persistent<Context> context = Context::New(); 5308 v8::Persistent<Context> context = Context::New();
5309 Context::Scope context_scope(context); 5309 Context::Scope context_scope(context);
5310 5310
5311 v8::Persistent<v8::Object> object_a; 5311 v8::Persistent<v8::Object> object_a;
5312 5312
5313 { 5313 {
5314 v8::HandleScope handle_scope; 5314 v8::HandleScope handle_scope;
5315 object_a = v8::Persistent<v8::Object>::New(v8::Object::New()); 5315 object_a = v8::Persistent<v8::Object>::New(v8::Object::New());
5316 } 5316 }
5317 5317
5318 v8::Isolate* isolate = v8::Isolate::GetCurrent();
5318 bool object_a_disposed = false; 5319 bool object_a_disposed = false;
5319 object_a.MakeWeak(&object_a_disposed, &DisposeAndSetFlag); 5320 object_a.MakeWeak(&object_a_disposed, &DisposeAndSetFlag);
5320 CHECK(!object_a.IsIndependent()); 5321 CHECK(!object_a.IsIndependent());
5322 CHECK(!object_a.IsIndependent(isolate));
5321 object_a.MarkIndependent(); 5323 object_a.MarkIndependent();
5322 CHECK(object_a.IsIndependent()); 5324 CHECK(object_a.IsIndependent());
5325 CHECK(object_a.IsIndependent(isolate));
5323 HEAP->PerformScavenge(); 5326 HEAP->PerformScavenge();
5324 CHECK(object_a_disposed); 5327 CHECK(object_a_disposed);
5325 } 5328 }
5326 5329
5327 5330
5328 static void InvokeScavenge() { 5331 static void InvokeScavenge() {
5329 HEAP->PerformScavenge(); 5332 HEAP->PerformScavenge();
5330 } 5333 }
5331 5334
5332 5335
(...skipping 12429 matching lines...) Expand 10 before | Expand all | Expand 10 after
17762 17765
17763 i::Semaphore* sem_; 17766 i::Semaphore* sem_;
17764 volatile int sem_value_; 17767 volatile int sem_value_;
17765 }; 17768 };
17766 17769
17767 17770
17768 THREADED_TEST(SemaphoreInterruption) { 17771 THREADED_TEST(SemaphoreInterruption) {
17769 ThreadInterruptTest().RunTest(); 17772 ThreadInterruptTest().RunTest();
17770 } 17773 }
17771 #endif // WIN32 17774 #endif // WIN32
OLDNEW
« 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