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

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

Issue 1867383002: Revert of Fix printf formats (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/x87/disasm-x87.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 if (!obj->IsFreeSpace()) { 2289 if (!obj->IsFreeSpace()) {
2290 size_of_objects_2 += obj->Size(); 2290 size_of_objects_2 += obj->Size();
2291 } 2291 }
2292 } 2292 }
2293 // Delta must be within 5% of the larger result. 2293 // Delta must be within 5% of the larger result.
2294 // TODO(gc): Tighten this up by distinguishing between byte 2294 // TODO(gc): Tighten this up by distinguishing between byte
2295 // arrays that are real and those that merely mark free space 2295 // arrays that are real and those that merely mark free space
2296 // on the heap. 2296 // on the heap.
2297 if (size_of_objects_1 > size_of_objects_2) { 2297 if (size_of_objects_1 > size_of_objects_2) {
2298 intptr_t delta = size_of_objects_1 - size_of_objects_2; 2298 intptr_t delta = size_of_objects_1 - size_of_objects_2;
2299 PrintF("Heap::SizeOfObjects: %" V8PRIdPTR 2299 PrintF("Heap::SizeOfObjects: %" V8_PTR_PREFIX "d, "
2300 ", " 2300 "Iterator: %" V8_PTR_PREFIX "d, "
2301 "Iterator: %" V8PRIdPTR 2301 "delta: %" V8_PTR_PREFIX "d\n",
2302 ", "
2303 "delta: %" V8PRIdPTR "\n",
2304 size_of_objects_1, size_of_objects_2, delta); 2302 size_of_objects_1, size_of_objects_2, delta);
2305 CHECK_GT(size_of_objects_1 / 20, delta); 2303 CHECK_GT(size_of_objects_1 / 20, delta);
2306 } else { 2304 } else {
2307 intptr_t delta = size_of_objects_2 - size_of_objects_1; 2305 intptr_t delta = size_of_objects_2 - size_of_objects_1;
2308 PrintF("Heap::SizeOfObjects: %" V8PRIdPTR 2306 PrintF("Heap::SizeOfObjects: %" V8_PTR_PREFIX "d, "
2309 ", " 2307 "Iterator: %" V8_PTR_PREFIX "d, "
2310 "Iterator: %" V8PRIdPTR 2308 "delta: %" V8_PTR_PREFIX "d\n",
2311 ", "
2312 "delta: %" V8PRIdPTR "\n",
2313 size_of_objects_1, size_of_objects_2, delta); 2309 size_of_objects_1, size_of_objects_2, delta);
2314 CHECK_GT(size_of_objects_2 / 20, delta); 2310 CHECK_GT(size_of_objects_2 / 20, delta);
2315 } 2311 }
2316 } 2312 }
2317 2313
2318 2314
2319 static void FillUpNewSpace(NewSpace* new_space) { 2315 static void FillUpNewSpace(NewSpace* new_space) {
2320 // Fill up new space to the point that it is completely full. Make sure 2316 // Fill up new space to the point that it is completely full. Make sure
2321 // that the scavenger does not undo the filling. 2317 // that the scavenger does not undo the filling.
2322 Heap* heap = new_space->heap(); 2318 Heap* heap = new_space->heap();
(...skipping 4282 matching lines...) Expand 10 before | Expand all | Expand 10 after
6605 heap->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>(arrays[j], N - 1); 6601 heap->RightTrimFixedArray<Heap::CONCURRENT_TO_SWEEPER>(arrays[j], N - 1);
6606 } 6602 }
6607 } 6603 }
6608 // Force allocation from the free list. 6604 // Force allocation from the free list.
6609 heap->set_force_oom(true); 6605 heap->set_force_oom(true);
6610 heap->CollectGarbage(OLD_SPACE); 6606 heap->CollectGarbage(OLD_SPACE);
6611 } 6607 }
6612 6608
6613 } // namespace internal 6609 } // namespace internal
6614 } // namespace v8 6610 } // namespace v8
OLDNEW
« no previous file with comments | « src/x87/disasm-x87.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698