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 228 matching lines...) Loading... | |
239 } | 239 } |
240 isolate->Dispose(); | 240 isolate->Dispose(); |
241 } | 241 } |
242 private: | 242 private: |
243 }; | 243 }; |
244 | 244 |
245 // Run many threads each accessing its own isolate without locking | 245 // Run many threads each accessing its own isolate without locking |
246 TEST(MultithreadedParallelIsolates) { | 246 TEST(MultithreadedParallelIsolates) { |
247 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS | 247 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS |
248 const int kNThreads = 10; | 248 const int kNThreads = 10; |
249 #elif V8_TARGET_ARCH_X32 | |
250 const int kNThreads = 4; | |
danno
2013/07/17 13:33:21
Why is this special handling of x32 needed? I woul
haitao.feng
2013/07/18 10:04:09
This is related to the code range feature. We used
| |
249 #else | 251 #else |
250 const int kNThreads = 50; | 252 const int kNThreads = 50; |
251 #endif | 253 #endif |
252 i::List<JoinableThread*> threads(kNThreads); | 254 i::List<JoinableThread*> threads(kNThreads); |
253 for (int i = 0; i < kNThreads; i++) { | 255 for (int i = 0; i < kNThreads; i++) { |
254 threads.Add(new IsolateNonlockingThread()); | 256 threads.Add(new IsolateNonlockingThread()); |
255 } | 257 } |
256 StartJoinAndDeleteThreads(threads); | 258 StartJoinAndDeleteThreads(threads); |
257 } | 259 } |
258 | 260 |
(...skipping 435 matching lines...) Loading... | |
694 private: | 696 private: |
695 int count_; | 697 int count_; |
696 const char** extension_names_; | 698 const char** extension_names_; |
697 }; | 699 }; |
698 | 700 |
699 // Test installing extensions in separate isolates concurrently. | 701 // Test installing extensions in separate isolates concurrently. |
700 // http://code.google.com/p/v8/issues/detail?id=1821 | 702 // http://code.google.com/p/v8/issues/detail?id=1821 |
701 TEST(ExtensionsRegistration) { | 703 TEST(ExtensionsRegistration) { |
702 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS | 704 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_MIPS |
703 const int kNThreads = 10; | 705 const int kNThreads = 10; |
706 #elif V8_TARGET_ARCH_X32 | |
danno
2013/07/17 13:33:21
Why is this special handling of x32 needed? I woul
| |
707 const int kNThreads = 4; | |
704 #else | 708 #else |
705 const int kNThreads = 40; | 709 const int kNThreads = 40; |
706 #endif | 710 #endif |
707 v8::RegisterExtension(new v8::Extension("test0", | 711 v8::RegisterExtension(new v8::Extension("test0", |
708 kSimpleExtensionSource)); | 712 kSimpleExtensionSource)); |
709 v8::RegisterExtension(new v8::Extension("test1", | 713 v8::RegisterExtension(new v8::Extension("test1", |
710 kSimpleExtensionSource)); | 714 kSimpleExtensionSource)); |
711 v8::RegisterExtension(new v8::Extension("test2", | 715 v8::RegisterExtension(new v8::Extension("test2", |
712 kSimpleExtensionSource)); | 716 kSimpleExtensionSource)); |
713 v8::RegisterExtension(new v8::Extension("test3", | 717 v8::RegisterExtension(new v8::Extension("test3", |
714 kSimpleExtensionSource)); | 718 kSimpleExtensionSource)); |
715 v8::RegisterExtension(new v8::Extension("test4", | 719 v8::RegisterExtension(new v8::Extension("test4", |
716 kSimpleExtensionSource)); | 720 kSimpleExtensionSource)); |
717 v8::RegisterExtension(new v8::Extension("test5", | 721 v8::RegisterExtension(new v8::Extension("test5", |
718 kSimpleExtensionSource)); | 722 kSimpleExtensionSource)); |
719 v8::RegisterExtension(new v8::Extension("test6", | 723 v8::RegisterExtension(new v8::Extension("test6", |
720 kSimpleExtensionSource)); | 724 kSimpleExtensionSource)); |
721 v8::RegisterExtension(new v8::Extension("test7", | 725 v8::RegisterExtension(new v8::Extension("test7", |
722 kSimpleExtensionSource)); | 726 kSimpleExtensionSource)); |
723 const char* extension_names[] = { "test0", "test1", | 727 const char* extension_names[] = { "test0", "test1", |
724 "test2", "test3", "test4", | 728 "test2", "test3", "test4", |
725 "test5", "test6", "test7" }; | 729 "test5", "test6", "test7" }; |
726 i::List<JoinableThread*> threads(kNThreads); | 730 i::List<JoinableThread*> threads(kNThreads); |
727 for (int i = 0; i < kNThreads; i++) { | 731 for (int i = 0; i < kNThreads; i++) { |
728 threads.Add(new IsolateGenesisThread(8, extension_names)); | 732 threads.Add(new IsolateGenesisThread(8, extension_names)); |
729 } | 733 } |
730 StartJoinAndDeleteThreads(threads); | 734 StartJoinAndDeleteThreads(threads); |
731 } | 735 } |
OLD | NEW |