| 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 isolate->Dispose(); | 667 isolate->Dispose(); |
| 668 } | 668 } |
| 669 private: | 669 private: |
| 670 int count_; | 670 int count_; |
| 671 const char** extension_names_; | 671 const char** extension_names_; |
| 672 }; | 672 }; |
| 673 | 673 |
| 674 // Test installing extensions in separate isolates concurrently. | 674 // Test installing extensions in separate isolates concurrently. |
| 675 // http://code.google.com/p/v8/issues/detail?id=1821 | 675 // http://code.google.com/p/v8/issues/detail?id=1821 |
| 676 TEST(ExtensionsRegistration) { | 676 TEST(ExtensionsRegistration) { |
| 677 #ifdef V8_TARGET_ARCH_ARM |
| 678 const int kNThreads = 10; |
| 679 #else |
| 677 const int kNThreads = 40; | 680 const int kNThreads = 40; |
| 681 #endif |
| 678 v8::RegisterExtension(new v8::Extension("test0", | 682 v8::RegisterExtension(new v8::Extension("test0", |
| 679 kSimpleExtensionSource)); | 683 kSimpleExtensionSource)); |
| 680 v8::RegisterExtension(new v8::Extension("test1", | 684 v8::RegisterExtension(new v8::Extension("test1", |
| 681 kSimpleExtensionSource)); | 685 kSimpleExtensionSource)); |
| 682 v8::RegisterExtension(new v8::Extension("test2", | 686 v8::RegisterExtension(new v8::Extension("test2", |
| 683 kSimpleExtensionSource)); | 687 kSimpleExtensionSource)); |
| 684 v8::RegisterExtension(new v8::Extension("test3", | 688 v8::RegisterExtension(new v8::Extension("test3", |
| 685 kSimpleExtensionSource)); | 689 kSimpleExtensionSource)); |
| 686 v8::RegisterExtension(new v8::Extension("test4", | 690 v8::RegisterExtension(new v8::Extension("test4", |
| 687 kSimpleExtensionSource)); | 691 kSimpleExtensionSource)); |
| 688 v8::RegisterExtension(new v8::Extension("test5", | 692 v8::RegisterExtension(new v8::Extension("test5", |
| 689 kSimpleExtensionSource)); | 693 kSimpleExtensionSource)); |
| 690 v8::RegisterExtension(new v8::Extension("test6", | 694 v8::RegisterExtension(new v8::Extension("test6", |
| 691 kSimpleExtensionSource)); | 695 kSimpleExtensionSource)); |
| 692 v8::RegisterExtension(new v8::Extension("test7", | 696 v8::RegisterExtension(new v8::Extension("test7", |
| 693 kSimpleExtensionSource)); | 697 kSimpleExtensionSource)); |
| 694 const char* extension_names[] = { "test0", "test1", | 698 const char* extension_names[] = { "test0", "test1", |
| 695 "test2", "test3", "test4", | 699 "test2", "test3", "test4", |
| 696 "test5", "test6", "test7" }; | 700 "test5", "test6", "test7" }; |
| 697 i::List<JoinableThread*> threads(kNThreads); | 701 i::List<JoinableThread*> threads(kNThreads); |
| 698 for (int i = 0; i < kNThreads; i++) { | 702 for (int i = 0; i < kNThreads; i++) { |
| 699 threads.Add(new IsolateGenesisThread(8, extension_names)); | 703 threads.Add(new IsolateGenesisThread(8, extension_names)); |
| 700 } | 704 } |
| 701 StartJoinAndDeleteThreads(threads); | 705 StartJoinAndDeleteThreads(threads); |
| 702 } | 706 } |
| OLD | NEW |