OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 ThreadB() : Thread("ThreadB") { } | 104 ThreadB() : Thread("ThreadB") { } |
105 void Run() { | 105 void Run() { |
106 do { | 106 do { |
107 { | 107 { |
108 v8::Locker locker; | 108 v8::Locker locker; |
109 if (turn == CLEAN_CACHE) { | 109 if (turn == CLEAN_CACHE) { |
110 v8::HandleScope scope; | 110 v8::HandleScope scope; |
111 v8::Context::Scope context_scope(v8::Context::New()); | 111 v8::Context::Scope context_scope(v8::Context::New()); |
112 | 112 |
113 // Clear the caches by forcing major GC. | 113 // Clear the caches by forcing major GC. |
114 HEAP->CollectAllGarbage(false); | 114 HEAP->CollectAllGarbage(v8::internal::Heap::kNoGCFlags); |
115 turn = SECOND_TIME_FILL_CACHE; | 115 turn = SECOND_TIME_FILL_CACHE; |
116 break; | 116 break; |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 Thread::YieldCPU(); | 120 Thread::YieldCPU(); |
121 } while (true); | 121 } while (true); |
122 } | 122 } |
123 }; | 123 }; |
124 | 124 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 refs.Add(i::ThreadId::Invalid()); | 183 refs.Add(i::ThreadId::Invalid()); |
184 } | 184 } |
185 prev->Start(); | 185 prev->Start(); |
186 for (int i = 0; i < kNThreads; i++) { | 186 for (int i = 0; i < kNThreads; i++) { |
187 semaphore->Wait(); | 187 semaphore->Wait(); |
188 } | 188 } |
189 for (int i = 0; i < kNThreads; i++) { | 189 for (int i = 0; i < kNThreads; i++) { |
190 delete threads[i]; | 190 delete threads[i]; |
191 } | 191 } |
192 } | 192 } |
OLD | NEW |