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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // When a target requires the code range feature, we put all code objects | 103 // When a target requires the code range feature, we put all code objects |
104 // in a kMaximalCodeRangeSize range of virtual address space, so that | 104 // in a kMaximalCodeRangeSize range of virtual address space, so that |
105 // they can call each other with near calls. | 105 // they can call each other with near calls. |
106 if (kRequiresCodeRange) { | 106 if (kRequiresCodeRange) { |
107 requested = kMaximalCodeRangeSize; | 107 requested = kMaximalCodeRangeSize; |
108 } else { | 108 } else { |
109 return true; | 109 return true; |
110 } | 110 } |
111 } | 111 } |
112 | 112 |
113 if (requested < kMinimumCodeRangeSize) { | 113 if (requested <= kMinimumCodeRangeSize) { |
114 requested = kMinimumCodeRangeSize; | 114 requested = kMinimumCodeRangeSize; |
115 } | 115 } |
116 | 116 |
117 DCHECK(!kRequiresCodeRange || requested <= kMaximalCodeRangeSize); | 117 DCHECK(!kRequiresCodeRange || requested <= kMaximalCodeRangeSize); |
118 code_range_ = new base::VirtualMemory(requested); | 118 code_range_ = new base::VirtualMemory(requested); |
119 CHECK(code_range_ != NULL); | 119 CHECK(code_range_ != NULL); |
120 if (!code_range_->IsReserved()) { | 120 if (!code_range_->IsReserved()) { |
121 delete code_range_; | 121 delete code_range_; |
122 code_range_ = NULL; | 122 code_range_ = NULL; |
123 return false; | 123 return false; |
(...skipping 2987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3111 object->ShortPrint(); | 3111 object->ShortPrint(); |
3112 PrintF("\n"); | 3112 PrintF("\n"); |
3113 } | 3113 } |
3114 printf(" --------------------------------------\n"); | 3114 printf(" --------------------------------------\n"); |
3115 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3115 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3116 } | 3116 } |
3117 | 3117 |
3118 #endif // DEBUG | 3118 #endif // DEBUG |
3119 } | 3119 } |
3120 } // namespace v8::internal | 3120 } // namespace v8::internal |
OLD | NEW |