OLD | NEW |
1 // Copyright 2007-2011 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2011 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 const int kNThreads = 50; | 282 const int kNThreads = 50; |
283 #else | 283 #else |
284 const int kNThreads = 100; | 284 const int kNThreads = 100; |
285 #endif | 285 #endif |
286 v8::Isolate* isolate = v8::Isolate::New(); | 286 v8::Isolate* isolate = v8::Isolate::New(); |
287 i::List<JoinableThread*> threads(kNThreads); | 287 i::List<JoinableThread*> threads(kNThreads); |
288 for (int i = 0; i < kNThreads; i++) { | 288 for (int i = 0; i < kNThreads; i++) { |
289 threads.Add(new IsolateNestedLockingThread(isolate)); | 289 threads.Add(new IsolateNestedLockingThread(isolate)); |
290 } | 290 } |
291 StartJoinAndDeleteThreads(threads); | 291 StartJoinAndDeleteThreads(threads); |
| 292 isolate->Dispose(); |
292 } | 293 } |
293 | 294 |
294 | 295 |
295 class SeparateIsolatesLocksNonexclusiveThread : public JoinableThread { | 296 class SeparateIsolatesLocksNonexclusiveThread : public JoinableThread { |
296 public: | 297 public: |
297 SeparateIsolatesLocksNonexclusiveThread(v8::Isolate* isolate1, | 298 SeparateIsolatesLocksNonexclusiveThread(v8::Isolate* isolate1, |
298 v8::Isolate* isolate2) | 299 v8::Isolate* isolate2) |
299 : JoinableThread("SeparateIsolatesLocksNonexclusiveThread"), | 300 : JoinableThread("SeparateIsolatesLocksNonexclusiveThread"), |
300 isolate1_(isolate1), isolate2_(isolate2) { | 301 isolate1_(isolate1), isolate2_(isolate2) { |
301 } | 302 } |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 v8::Locker locker_(isolate); | 578 v8::Locker locker_(isolate); |
578 v8::Isolate::Scope isolate_scope(isolate); | 579 v8::Isolate::Scope isolate_scope(isolate); |
579 v8::HandleScope handle_scope; | 580 v8::HandleScope handle_scope; |
580 context = v8::Context::New(); | 581 context = v8::Context::New(); |
581 } | 582 } |
582 i::List<JoinableThread*> threads(kNThreads); | 583 i::List<JoinableThread*> threads(kNThreads); |
583 for (int i = 0; i < kNThreads; i++) { | 584 for (int i = 0; i < kNThreads; i++) { |
584 threads.Add(new LockUnlockLockThread(isolate, context)); | 585 threads.Add(new LockUnlockLockThread(isolate, context)); |
585 } | 586 } |
586 StartJoinAndDeleteThreads(threads); | 587 StartJoinAndDeleteThreads(threads); |
| 588 isolate->Dispose(); |
587 } | 589 } |
588 | 590 |
589 class LockUnlockLockDefaultIsolateThread : public JoinableThread { | 591 class LockUnlockLockDefaultIsolateThread : public JoinableThread { |
590 public: | 592 public: |
591 explicit LockUnlockLockDefaultIsolateThread(v8::Handle<v8::Context> context) | 593 explicit LockUnlockLockDefaultIsolateThread(v8::Handle<v8::Context> context) |
592 : JoinableThread("LockUnlockLockDefaultIsolateThread"), | 594 : JoinableThread("LockUnlockLockDefaultIsolateThread"), |
593 context_(context) { | 595 context_(context) { |
594 } | 596 } |
595 | 597 |
596 virtual void Run() { | 598 virtual void Run() { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 kSimpleExtensionSource)); | 714 kSimpleExtensionSource)); |
713 const char* extension_names[] = { "test0", "test1", | 715 const char* extension_names[] = { "test0", "test1", |
714 "test2", "test3", "test4", | 716 "test2", "test3", "test4", |
715 "test5", "test6", "test7" }; | 717 "test5", "test6", "test7" }; |
716 i::List<JoinableThread*> threads(kNThreads); | 718 i::List<JoinableThread*> threads(kNThreads); |
717 for (int i = 0; i < kNThreads; i++) { | 719 for (int i = 0; i < kNThreads; i++) { |
718 threads.Add(new IsolateGenesisThread(8, extension_names)); | 720 threads.Add(new IsolateGenesisThread(8, extension_names)); |
719 } | 721 } |
720 StartJoinAndDeleteThreads(threads); | 722 StartJoinAndDeleteThreads(threads); |
721 } | 723 } |
OLD | NEW |