| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |