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 11265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11276 " return 42;" | 11276 " return 42;" |
11277 "})();"); | 11277 "})();"); |
11278 CHECK_EQ(42, script->Run()->Int32Value()); | 11278 CHECK_EQ(42, script->Run()->Int32Value()); |
11279 } | 11279 } |
11280 } | 11280 } |
11281 | 11281 |
11282 | 11282 |
11283 static int GetGlobalObjectsCount() { | 11283 static int GetGlobalObjectsCount() { |
11284 i::Isolate::Current()->heap()->EnsureHeapIsIterable(); | 11284 i::Isolate::Current()->heap()->EnsureHeapIsIterable(); |
11285 int count = 0; | 11285 int count = 0; |
11286 i::HeapIterator it; | 11286 i::HeapIterator it(HEAP); |
11287 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) | 11287 for (i::HeapObject* object = it.next(); object != NULL; object = it.next()) |
11288 if (object->IsJSGlobalObject()) count++; | 11288 if (object->IsJSGlobalObject()) count++; |
11289 return count; | 11289 return count; |
11290 } | 11290 } |
11291 | 11291 |
11292 | 11292 |
11293 static void CheckSurvivingGlobalObjectsCount(int expected) { | 11293 static void CheckSurvivingGlobalObjectsCount(int expected) { |
11294 // We need to collect all garbage twice to be sure that everything | 11294 // We need to collect all garbage twice to be sure that everything |
11295 // has been collected. This is because inline caches are cleared in | 11295 // has been collected. This is because inline caches are cleared in |
11296 // the first garbage collection but some of the maps have already | 11296 // the first garbage collection but some of the maps have already |
(...skipping 6918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
18215 i::Semaphore* sem_; | 18215 i::Semaphore* sem_; |
18216 volatile int sem_value_; | 18216 volatile int sem_value_; |
18217 }; | 18217 }; |
18218 | 18218 |
18219 | 18219 |
18220 THREADED_TEST(SemaphoreInterruption) { | 18220 THREADED_TEST(SemaphoreInterruption) { |
18221 ThreadInterruptTest().RunTest(); | 18221 ThreadInterruptTest().RunTest(); |
18222 } | 18222 } |
18223 | 18223 |
18224 #endif // WIN32 | 18224 #endif // WIN32 |
OLD | NEW |