Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: test/cctest/heap/test-spaces.cc

Issue 2371133002: [heap] Make committed counters on space size_t (Closed)
Patch Set: rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 // Freshly initialized VM gets by with the snapshot size (which is below 508 // Freshly initialized VM gets by with the snapshot size (which is below
509 // kMaxInitialSizePerSpace per space). 509 // kMaxInitialSizePerSpace per space).
510 Heap* heap = isolate->heap(); 510 Heap* heap = isolate->heap();
511 int page_count[LAST_PAGED_SPACE + 1] = {0, 0, 0, 0}; 511 int page_count[LAST_PAGED_SPACE + 1] = {0, 0, 0, 0};
512 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { 512 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) {
513 // Debug code can be very large, so skip CODE_SPACE if we are generating it. 513 // Debug code can be very large, so skip CODE_SPACE if we are generating it.
514 if (i == CODE_SPACE && i::FLAG_debug_code) continue; 514 if (i == CODE_SPACE && i::FLAG_debug_code) continue;
515 515
516 page_count[i] = heap->paged_space(i)->CountTotalPages(); 516 page_count[i] = heap->paged_space(i)->CountTotalPages();
517 // Check that the initial heap is also below the limit. 517 // Check that the initial heap is also below the limit.
518 CHECK_LT(static_cast<size_t>(heap->paged_space(i)->CommittedMemory()), 518 CHECK_LT(heap->paged_space(i)->CommittedMemory(), kMaxInitialSizePerSpace);
519 kMaxInitialSizePerSpace);
520 } 519 }
521 520
522 // Executing the empty script gets by with the same number of pages, i.e., 521 // Executing the empty script gets by with the same number of pages, i.e.,
523 // requires no extra space. 522 // requires no extra space.
524 CompileRun("/*empty*/"); 523 CompileRun("/*empty*/");
525 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) { 524 for (int i = FIRST_PAGED_SPACE; i <= LAST_PAGED_SPACE; i++) {
526 // Debug code can be very large, so skip CODE_SPACE if we are generating it. 525 // Debug code can be very large, so skip CODE_SPACE if we are generating it.
527 if (i == CODE_SPACE && i::FLAG_debug_code) continue; 526 if (i == CODE_SPACE && i::FLAG_debug_code) continue;
528 CHECK_EQ(page_count[i], isolate->heap()->paged_space(i)->CountTotalPages()); 527 CHECK_EQ(page_count[i], isolate->heap()->paged_space(i)->CountTotalPages());
529 } 528 }
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 HeapObject* filler = 789 HeapObject* filler =
791 HeapObject::FromAddress(array->address() + array->Size()); 790 HeapObject::FromAddress(array->address() + array->Size());
792 CHECK_EQ(filler->map(), CcTest::heap()->two_pointer_filler_map()); 791 CHECK_EQ(filler->map(), CcTest::heap()->two_pointer_filler_map());
793 792
794 const size_t shrinked = page->ShrinkToHighWaterMark(); 793 const size_t shrinked = page->ShrinkToHighWaterMark();
795 CHECK_EQ(0, shrinked); 794 CHECK_EQ(0, shrinked);
796 } 795 }
797 796
798 } // namespace internal 797 } // namespace internal
799 } // namespace v8 798 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698