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

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

Issue 14208005: Use worst-fit allocation in old space for prentured objects. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/spaces-inl.h ('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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 356
357 OldSpace* s = new OldSpace(heap, 357 OldSpace* s = new OldSpace(heap,
358 heap->MaxOldGenerationSize(), 358 heap->MaxOldGenerationSize(),
359 OLD_POINTER_SPACE, 359 OLD_POINTER_SPACE,
360 NOT_EXECUTABLE); 360 NOT_EXECUTABLE);
361 CHECK(s != NULL); 361 CHECK(s != NULL);
362 362
363 CHECK(s->SetUp()); 363 CHECK(s->SetUp());
364 364
365 while (s->Available() > 0) { 365 while (s->Available() > 0) {
366 s->AllocateRaw(Page::kMaxNonCodeHeapObjectSize)->ToObjectUnchecked(); 366 s->AllocateRaw<FreeList::BEST_FIT>(Page::kMaxNonCodeHeapObjectSize)->
367 ToObjectUnchecked();
367 } 368 }
368 369
369 s->TearDown(); 370 s->TearDown();
370 delete s; 371 delete s;
371 memory_allocator->TearDown(); 372 memory_allocator->TearDown();
372 delete memory_allocator; 373 delete memory_allocator;
373 } 374 }
374 375
375 376
376 TEST(LargeObjectSpace) { 377 TEST(LargeObjectSpace) {
(...skipping 20 matching lines...) Expand all
397 { MaybeObject* maybe_obj = lo->AllocateRaw(lo_size, NOT_EXECUTABLE); 398 { MaybeObject* maybe_obj = lo->AllocateRaw(lo_size, NOT_EXECUTABLE);
398 if (!maybe_obj->ToObject(&obj)) break; 399 if (!maybe_obj->ToObject(&obj)) break;
399 } 400 }
400 CHECK(lo->Available() < available); 401 CHECK(lo->Available() < available);
401 }; 402 };
402 403
403 CHECK(!lo->IsEmpty()); 404 CHECK(!lo->IsEmpty());
404 405
405 CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->IsFailure()); 406 CHECK(lo->AllocateRaw(lo_size, NOT_EXECUTABLE)->IsFailure());
406 } 407 }
OLDNEW
« no previous file with comments | « src/spaces-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698