OLD | NEW |
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/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/full-codegen.h" | 9 #include "src/full-codegen.h" |
10 #include "src/heap/mark-compact.h" | 10 #include "src/heap/mark-compact.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 if (kReservedCodeRangePages) { | 133 if (kReservedCodeRangePages) { |
134 if (!code_range_->Commit( | 134 if (!code_range_->Commit( |
135 base, kReservedCodeRangePages * base::OS::CommitPageSize(), true)) { | 135 base, kReservedCodeRangePages * base::OS::CommitPageSize(), true)) { |
136 delete code_range_; | 136 delete code_range_; |
137 code_range_ = NULL; | 137 code_range_ = NULL; |
138 return false; | 138 return false; |
139 } | 139 } |
140 base += kReservedCodeRangePages * base::OS::CommitPageSize(); | 140 base += kReservedCodeRangePages * base::OS::CommitPageSize(); |
141 } | 141 } |
142 Address aligned_base = RoundUp(base, MemoryChunk::kAlignment); | 142 Address aligned_base = RoundUp(base, MemoryChunk::kAlignment); |
143 size_t size = code_range_->size() - (aligned_base - base); | 143 size_t size = code_range_->size() - (aligned_base - base) - |
| 144 kReservedCodeRangePages * base::OS::CommitPageSize(); |
144 allocation_list_.Add(FreeBlock(aligned_base, size)); | 145 allocation_list_.Add(FreeBlock(aligned_base, size)); |
145 current_allocation_block_index_ = 0; | 146 current_allocation_block_index_ = 0; |
146 | 147 |
147 LOG(isolate_, NewEvent("CodeRange", code_range_->address(), requested)); | 148 LOG(isolate_, NewEvent("CodeRange", code_range_->address(), requested)); |
148 ReserveEmergencyBlock(); | 149 ReserveEmergencyBlock(); |
149 return true; | 150 return true; |
150 } | 151 } |
151 | 152 |
152 | 153 |
153 int CodeRange::CompareFreeBlockAddress(const FreeBlock* left, | 154 int CodeRange::CompareFreeBlockAddress(const FreeBlock* left, |
(...skipping 3069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3223 object->ShortPrint(); | 3224 object->ShortPrint(); |
3224 PrintF("\n"); | 3225 PrintF("\n"); |
3225 } | 3226 } |
3226 printf(" --------------------------------------\n"); | 3227 printf(" --------------------------------------\n"); |
3227 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3228 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3228 } | 3229 } |
3229 | 3230 |
3230 #endif // DEBUG | 3231 #endif // DEBUG |
3231 } | 3232 } |
3232 } // namespace v8::internal | 3233 } // namespace v8::internal |
OLD | NEW |