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

Side by Side Diff: src/spaces.cc

Issue 10271010: Merge r11471 from the bleeding_edge to the 3.8 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.8/
Patch Set: Created 8 years, 7 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.h ('k') | src/version.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 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 Address MemoryAllocator::AllocateAlignedMemory(size_t size, 356 Address MemoryAllocator::AllocateAlignedMemory(size_t size,
357 size_t alignment, 357 size_t alignment,
358 Executability executable, 358 Executability executable,
359 VirtualMemory* controller) { 359 VirtualMemory* controller) {
360 VirtualMemory reservation; 360 VirtualMemory reservation;
361 Address base = ReserveAlignedMemory(size, alignment, &reservation); 361 Address base = ReserveAlignedMemory(size, alignment, &reservation);
362 if (base == NULL) return NULL; 362 if (base == NULL) return NULL;
363 363
364 if (executable == EXECUTABLE) { 364 if (executable == EXECUTABLE) {
365 CommitCodePage(&reservation, base, size); 365 if (!CommitCodePage(&reservation, base, size)) {
366 base = NULL;
367 }
366 } else { 368 } else {
367 if (!reservation.Commit(base, 369 if (!reservation.Commit(base, size, false)) {
368 size, 370 base = NULL;
369 executable == EXECUTABLE)) {
370 return NULL;
371 } 371 }
372 } 372 }
373 373
374 if (base == NULL) {
375 // Failed to commit the body. Release the mapping and any partially
376 // commited regions inside it.
377 reservation.Release();
378 return NULL;
379 }
380
374 controller->TakeControl(&reservation); 381 controller->TakeControl(&reservation);
375 return base; 382 return base;
376 } 383 }
377 384
378 385
379 void Page::InitializeAsAnchor(PagedSpace* owner) { 386 void Page::InitializeAsAnchor(PagedSpace* owner) {
380 set_owner(owner); 387 set_owner(owner);
381 set_prev_page(this); 388 set_prev_page(this);
382 set_next_page(this); 389 set_next_page(this);
383 } 390 }
(...skipping 2398 matching lines...) Expand 10 before | Expand all | Expand 10 after
2782 object->ShortPrint(); 2789 object->ShortPrint();
2783 PrintF("\n"); 2790 PrintF("\n");
2784 } 2791 }
2785 printf(" --------------------------------------\n"); 2792 printf(" --------------------------------------\n");
2786 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 2793 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
2787 } 2794 }
2788 2795
2789 #endif // DEBUG 2796 #endif // DEBUG
2790 2797
2791 } } // namespace v8::internal 2798 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698