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 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3507 CHECK(root->map()->IsMap()); | 3507 CHECK(root->map()->IsMap()); |
3508 } | 3508 } |
3509 | 3509 |
3510 | 3510 |
3511 TEST(ReleaseOverReservedPages) { | 3511 TEST(ReleaseOverReservedPages) { |
3512 if (FLAG_never_compact) return; | 3512 if (FLAG_never_compact) return; |
3513 i::FLAG_trace_gc = true; | 3513 i::FLAG_trace_gc = true; |
3514 // The optimizer can allocate stuff, messing up the test. | 3514 // The optimizer can allocate stuff, messing up the test. |
3515 i::FLAG_crankshaft = false; | 3515 i::FLAG_crankshaft = false; |
3516 i::FLAG_always_opt = false; | 3516 i::FLAG_always_opt = false; |
3517 // Parallel compaction increases fragmentation, depending on how existing | |
3518 // memory is distributed. Since this is non-deterministic because of | |
3519 // concurrent sweeping, we disable it for this test. | |
3520 i::FLAG_parallel_compaction = false; | |
3521 // Concurrent sweeping adds non determinism, depending on when memory is | |
3522 // available for further reuse. | |
3523 i::FLAG_concurrent_sweeping = false; | |
3524 CcTest::InitializeVM(); | 3517 CcTest::InitializeVM(); |
3525 Isolate* isolate = CcTest::i_isolate(); | 3518 Isolate* isolate = CcTest::i_isolate(); |
3526 Factory* factory = isolate->factory(); | 3519 Factory* factory = isolate->factory(); |
3527 Heap* heap = isolate->heap(); | 3520 Heap* heap = isolate->heap(); |
3528 v8::HandleScope scope(CcTest::isolate()); | 3521 v8::HandleScope scope(CcTest::isolate()); |
3529 static const int number_of_test_pages = 20; | 3522 static const int number_of_test_pages = 20; |
3530 | 3523 |
3531 // Prepare many pages with low live-bytes count. | 3524 // Prepare many pages with low live-bytes count. |
3532 PagedSpace* old_space = heap->old_space(); | 3525 PagedSpace* old_space = heap->old_space(); |
3533 CHECK_EQ(1, old_space->CountTotalPages()); | 3526 CHECK_EQ(1, old_space->CountTotalPages()); |
(...skipping 2912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6446 isolate->IncrementJsCallsFromApiCounter(); | 6439 isolate->IncrementJsCallsFromApiCounter(); |
6447 isolate->IncrementJsCallsFromApiCounter(); | 6440 isolate->IncrementJsCallsFromApiCounter(); |
6448 isolate->IncrementJsCallsFromApiCounter(); | 6441 isolate->IncrementJsCallsFromApiCounter(); |
6449 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); | 6442 calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); |
6450 CheckDoubleEquals(2, calls_per_ms); | 6443 CheckDoubleEquals(2, calls_per_ms); |
6451 } | 6444 } |
6452 | 6445 |
6453 | 6446 |
6454 } // namespace internal | 6447 } // namespace internal |
6455 } // namespace v8 | 6448 } // namespace v8 |
OLD | NEW |