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

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

Issue 9104039: Revert memory saving change due to failures on multithreaded tests (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « src/utils.h ('k') | test/cctest/test-mark-compact.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 2
3 #include <stdlib.h> 3 #include <stdlib.h>
4 4
5 #include "v8.h" 5 #include "v8.h"
6 6
7 #include "execution.h" 7 #include "execution.h"
8 #include "factory.h" 8 #include "factory.h"
9 #include "macro-assembler.h" 9 #include "macro-assembler.h"
10 #include "global-handles.h" 10 #include "global-handles.h"
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 InitializeVM(); 1229 InitializeVM();
1230 HEAP->EnsureHeapIsIterable(); 1230 HEAP->EnsureHeapIsIterable();
1231 intptr_t size_of_objects_1 = HEAP->SizeOfObjects(); 1231 intptr_t size_of_objects_1 = HEAP->SizeOfObjects();
1232 HeapIterator iterator; 1232 HeapIterator iterator;
1233 intptr_t size_of_objects_2 = 0; 1233 intptr_t size_of_objects_2 = 0;
1234 for (HeapObject* obj = iterator.next(); 1234 for (HeapObject* obj = iterator.next();
1235 obj != NULL; 1235 obj != NULL;
1236 obj = iterator.next()) { 1236 obj = iterator.next()) {
1237 size_of_objects_2 += obj->Size(); 1237 size_of_objects_2 += obj->Size();
1238 } 1238 }
1239 // Delta must be within 1% of the larger result. 1239 // Delta must be within 5% of the larger result.
1240 // TODO(gc): Tighten this up by distinguishing between byte
1241 // arrays that are real and those that merely mark free space
1242 // on the heap.
1240 if (size_of_objects_1 > size_of_objects_2) { 1243 if (size_of_objects_1 > size_of_objects_2) {
1241 intptr_t delta = size_of_objects_1 - size_of_objects_2; 1244 intptr_t delta = size_of_objects_1 - size_of_objects_2;
1242 PrintF("Heap::SizeOfObjects: %" V8_PTR_PREFIX "d, " 1245 PrintF("Heap::SizeOfObjects: %" V8_PTR_PREFIX "d, "
1243 "Iterator: %" V8_PTR_PREFIX "d, " 1246 "Iterator: %" V8_PTR_PREFIX "d, "
1244 "delta: %" V8_PTR_PREFIX "d\n", 1247 "delta: %" V8_PTR_PREFIX "d\n",
1245 size_of_objects_1, size_of_objects_2, delta); 1248 size_of_objects_1, size_of_objects_2, delta);
1246 CHECK_GT(size_of_objects_1 / 100, delta); 1249 CHECK_GT(size_of_objects_1 / 20, delta);
1247 } else { 1250 } else {
1248 intptr_t delta = size_of_objects_2 - size_of_objects_1; 1251 intptr_t delta = size_of_objects_2 - size_of_objects_1;
1249 PrintF("Heap::SizeOfObjects: %" V8_PTR_PREFIX "d, " 1252 PrintF("Heap::SizeOfObjects: %" V8_PTR_PREFIX "d, "
1250 "Iterator: %" V8_PTR_PREFIX "d, " 1253 "Iterator: %" V8_PTR_PREFIX "d, "
1251 "delta: %" V8_PTR_PREFIX "d\n", 1254 "delta: %" V8_PTR_PREFIX "d\n",
1252 size_of_objects_1, size_of_objects_2, delta); 1255 size_of_objects_1, size_of_objects_2, delta);
1253 CHECK_GT(size_of_objects_2 / 20, delta); 1256 CHECK_GT(size_of_objects_2 / 20, delta);
1254 } 1257 }
1255 } 1258 }
1256 1259
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 // clearing correctly records slots in prototype transition array. 1619 // clearing correctly records slots in prototype transition array.
1617 i::FLAG_always_compact = true; 1620 i::FLAG_always_compact = true;
1618 Handle<Map> map(baseObject->map()); 1621 Handle<Map> map(baseObject->map());
1619 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address())); 1622 CHECK(!space->LastPage()->Contains(map->prototype_transitions()->address()));
1620 CHECK(space->LastPage()->Contains(prototype->address())); 1623 CHECK(space->LastPage()->Contains(prototype->address()));
1621 baseObject->SetPrototype(*prototype, false)->ToObjectChecked(); 1624 baseObject->SetPrototype(*prototype, false)->ToObjectChecked();
1622 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); 1625 CHECK(map->GetPrototypeTransition(*prototype)->IsMap());
1623 HEAP->CollectAllGarbage(Heap::kNoGCFlags); 1626 HEAP->CollectAllGarbage(Heap::kNoGCFlags);
1624 CHECK(map->GetPrototypeTransition(*prototype)->IsMap()); 1627 CHECK(map->GetPrototypeTransition(*prototype)->IsMap());
1625 } 1628 }
OLDNEW
« no previous file with comments | « src/utils.h ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698