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

Side by Side Diff: src/spaces.cc

Issue 331823002: Reland "Rename kIs64BitArch with kRequiresCodeRange." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Only assert requested <= kMaximalCodeRangeSize when the port requires code range" Created 6 years, 6 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/heap.cc ('k') | test/cctest/test-alloc.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/full-codegen.h" 7 #include "src/full-codegen.h"
8 #include "src/macro-assembler.h" 8 #include "src/macro-assembler.h"
9 #include "src/mark-compact.h" 9 #include "src/mark-compact.h"
10 #include "src/msan.h" 10 #include "src/msan.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 free_list_(0), 108 free_list_(0),
109 allocation_list_(0), 109 allocation_list_(0),
110 current_allocation_block_index_(0) { 110 current_allocation_block_index_(0) {
111 } 111 }
112 112
113 113
114 bool CodeRange::SetUp(size_t requested) { 114 bool CodeRange::SetUp(size_t requested) {
115 ASSERT(code_range_ == NULL); 115 ASSERT(code_range_ == NULL);
116 116
117 if (requested == 0) { 117 if (requested == 0) {
118 // On 64-bit platform(s), we put all code objects in a 512 MB range of 118 // When a target requires the code range feature, we put all code objects
119 // virtual address space, so that they can call each other with near calls. 119 // in a kMaximalCodeRangeSize range of virtual address space, so that
120 if (kIs64BitArch) { 120 // they can call each other with near calls.
121 requested = 512 * MB; 121 if (kRequiresCodeRange) {
122 requested = kMaximalCodeRangeSize;
122 } else { 123 } else {
123 return true; 124 return true;
124 } 125 }
125 } 126 }
126 127
128 ASSERT(!kRequiresCodeRange || requested <= kMaximalCodeRangeSize);
127 code_range_ = new VirtualMemory(requested); 129 code_range_ = new VirtualMemory(requested);
128 CHECK(code_range_ != NULL); 130 CHECK(code_range_ != NULL);
129 if (!code_range_->IsReserved()) { 131 if (!code_range_->IsReserved()) {
130 delete code_range_; 132 delete code_range_;
131 code_range_ = NULL; 133 code_range_ = NULL;
132 return false; 134 return false;
133 } 135 }
134 136
135 // We are sure that we have mapped a block of requested addresses. 137 // We are sure that we have mapped a block of requested addresses.
136 ASSERT(code_range_->size() == requested); 138 ASSERT(code_range_->size() == requested);
(...skipping 2976 matching lines...) Expand 10 before | Expand all | Expand 10 after
3113 object->ShortPrint(); 3115 object->ShortPrint();
3114 PrintF("\n"); 3116 PrintF("\n");
3115 } 3117 }
3116 printf(" --------------------------------------\n"); 3118 printf(" --------------------------------------\n");
3117 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3119 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3118 } 3120 }
3119 3121
3120 #endif // DEBUG 3122 #endif // DEBUG
3121 3123
3122 } } // namespace v8::internal 3124 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | test/cctest/test-alloc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698