| 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; | 
| 3517   CcTest::InitializeVM(); | 3521   CcTest::InitializeVM(); | 
| 3518   Isolate* isolate = CcTest::i_isolate(); | 3522   Isolate* isolate = CcTest::i_isolate(); | 
| 3519   Factory* factory = isolate->factory(); | 3523   Factory* factory = isolate->factory(); | 
| 3520   Heap* heap = isolate->heap(); | 3524   Heap* heap = isolate->heap(); | 
| 3521   v8::HandleScope scope(CcTest::isolate()); | 3525   v8::HandleScope scope(CcTest::isolate()); | 
| 3522   static const int number_of_test_pages = 20; | 3526   static const int number_of_test_pages = 20; | 
| 3523 | 3527 | 
| 3524   // Prepare many pages with low live-bytes count. | 3528   // Prepare many pages with low live-bytes count. | 
| 3525   PagedSpace* old_space = heap->old_space(); | 3529   PagedSpace* old_space = heap->old_space(); | 
| 3526   CHECK_EQ(1, old_space->CountTotalPages()); | 3530   CHECK_EQ(1, old_space->CountTotalPages()); | 
| (...skipping 2939 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 6466   isolate->IncrementJsCallsFromApiCounter(); | 6470   isolate->IncrementJsCallsFromApiCounter(); | 
| 6467   isolate->IncrementJsCallsFromApiCounter(); | 6471   isolate->IncrementJsCallsFromApiCounter(); | 
| 6468   isolate->IncrementJsCallsFromApiCounter(); | 6472   isolate->IncrementJsCallsFromApiCounter(); | 
| 6469   calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); | 6473   calls_per_ms = memory_reducer->SampleAndGetJsCallsPerMs(4); | 
| 6470   CheckDoubleEquals(2, calls_per_ms); | 6474   CheckDoubleEquals(2, calls_per_ms); | 
| 6471 } | 6475 } | 
| 6472 | 6476 | 
| 6473 | 6477 | 
| 6474 }  // namespace internal | 6478 }  // namespace internal | 
| 6475 }  // namespace v8 | 6479 }  // namespace v8 | 
| OLD | NEW | 
|---|