| 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 3567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3578 // boots, but if the 20 small arrays don't fit on the first page then that's | 3578 // boots, but if the 20 small arrays don't fit on the first page then that's |
| 3579 // an indication that it is too small. | 3579 // an indication that it is too small. |
| 3580 heap->CollectAllAvailableGarbage("triggered really hard"); | 3580 heap->CollectAllAvailableGarbage("triggered really hard"); |
| 3581 CHECK_EQ(1, old_space->CountTotalPages()); | 3581 CHECK_EQ(1, old_space->CountTotalPages()); |
| 3582 } | 3582 } |
| 3583 | 3583 |
| 3584 static int forced_gc_counter = 0; | 3584 static int forced_gc_counter = 0; |
| 3585 | 3585 |
| 3586 void MockUseCounterCallback(v8::Isolate* isolate, | 3586 void MockUseCounterCallback(v8::Isolate* isolate, |
| 3587 v8::Isolate::UseCounterFeature feature) { | 3587 v8::Isolate::UseCounterFeature feature) { |
| 3588 isolate->GetCallingContext(); | 3588 isolate->GetCurrentContext(); |
| 3589 if (feature == v8::Isolate::kForcedGC) { | 3589 if (feature == v8::Isolate::kForcedGC) { |
| 3590 forced_gc_counter++; | 3590 forced_gc_counter++; |
| 3591 } | 3591 } |
| 3592 } | 3592 } |
| 3593 | 3593 |
| 3594 | 3594 |
| 3595 TEST(CountForcedGC) { | 3595 TEST(CountForcedGC) { |
| 3596 i::FLAG_expose_gc = true; | 3596 i::FLAG_expose_gc = true; |
| 3597 CcTest::InitializeVM(); | 3597 CcTest::InitializeVM(); |
| 3598 Isolate* isolate = CcTest::i_isolate(); | 3598 Isolate* isolate = CcTest::i_isolate(); |
| (...skipping 2670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6269 // The CollectGarbage call above starts sweeper threads. | 6269 // The CollectGarbage call above starts sweeper threads. |
| 6270 // The crash will happen if the following two functions | 6270 // The crash will happen if the following two functions |
| 6271 // are called before sweeping finishes. | 6271 // are called before sweeping finishes. |
| 6272 heap->StartIncrementalMarking(); | 6272 heap->StartIncrementalMarking(); |
| 6273 heap->FinalizeIncrementalMarkingIfComplete("test"); | 6273 heap->FinalizeIncrementalMarkingIfComplete("test"); |
| 6274 } | 6274 } |
| 6275 | 6275 |
| 6276 | 6276 |
| 6277 } // namespace internal | 6277 } // namespace internal |
| 6278 } // namespace v8 | 6278 } // namespace v8 |
| OLD | NEW |