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

Side by Side Diff: runtime/vm/pages.cc

Issue 1119403003: Propagate failures from VirtualMemory::Commit. (Closed) Base URL: http://dart.googlecode.com/svn/trunk/dart/
Patch Set: Created 5 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 | « runtime/vm/pages.h ('k') | runtime/vm/virtual_memory.h » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/compiler_stats.h" 8 #include "vm/compiler_stats.h"
9 #include "vm/gc_marker.h" 9 #include "vm/gc_marker.h"
10 #include "vm/gc_sweeper.h" 10 #include "vm/gc_sweeper.h"
(...skipping 30 matching lines...) Expand all
41 "Concurrent sweep for old generation."); 41 "Concurrent sweep for old generation.");
42 #else // TARGET_ARCH_MIPS || TARGET_ARCH_ARM64 42 #else // TARGET_ARCH_MIPS || TARGET_ARCH_ARM64
43 DEFINE_FLAG(bool, concurrent_sweep, true, 43 DEFINE_FLAG(bool, concurrent_sweep, true,
44 "Concurrent sweep for old generation."); 44 "Concurrent sweep for old generation.");
45 #endif // TARGET_ARCH_MIPS || TARGET_ARCH_ARM64 45 #endif // TARGET_ARCH_MIPS || TARGET_ARCH_ARM64
46 DEFINE_FLAG(bool, log_growth, false, "Log PageSpace growth policy decisions."); 46 DEFINE_FLAG(bool, log_growth, false, "Log PageSpace growth policy decisions.");
47 47
48 HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) { 48 HeapPage* HeapPage::Initialize(VirtualMemory* memory, PageType type) {
49 ASSERT(memory->size() > VirtualMemory::PageSize()); 49 ASSERT(memory->size() > VirtualMemory::PageSize());
50 bool is_executable = (type == kExecutable); 50 bool is_executable = (type == kExecutable);
51 memory->Commit(is_executable); 51 if (!memory->Commit(is_executable)) {
52 52 return NULL;
Ivan Posva 2015/05/04 18:16:02 We should unreserve if we fail.
koda 2015/05/04 18:19:08 Done.
53 }
53 HeapPage* result = reinterpret_cast<HeapPage*>(memory->address()); 54 HeapPage* result = reinterpret_cast<HeapPage*>(memory->address());
54 result->memory_ = memory; 55 result->memory_ = memory;
55 result->next_ = NULL; 56 result->next_ = NULL;
56 result->executable_ = is_executable; 57 result->executable_ = is_executable;
57 return result; 58 return result;
58 } 59 }
59 60
60 61
61 HeapPage* HeapPage::Allocate(intptr_t size_in_words, PageType type) { 62 HeapPage* HeapPage::Allocate(intptr_t size_in_words, PageType type) {
62 VirtualMemory* memory = 63 VirtualMemory* memory =
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 return 0; 1118 return 0;
1118 } else { 1119 } else {
1119 ASSERT(total_time >= gc_time); 1120 ASSERT(total_time >= gc_time);
1120 int result = static_cast<int>((static_cast<double>(gc_time) / 1121 int result = static_cast<int>((static_cast<double>(gc_time) /
1121 static_cast<double>(total_time)) * 100); 1122 static_cast<double>(total_time)) * 100);
1122 return result; 1123 return result;
1123 } 1124 }
1124 } 1125 }
1125 1126
1126 } // namespace dart 1127 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/pages.h ('k') | runtime/vm/virtual_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698