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

Side by Side Diff: src/globals.h

Issue 2187833002: PPC: Set CodeRange constants correctly for PPC Linux (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_GLOBALS_H_ 5 #ifndef V8_GLOBALS_H_
6 #define V8_GLOBALS_H_ 6 #define V8_GLOBALS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 const int kPointerSizeLog2 = 3; 144 const int kPointerSizeLog2 = 3;
145 const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000); 145 const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000);
146 const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF); 146 const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF);
147 const bool kRequiresCodeRange = true; 147 const bool kRequiresCodeRange = true;
148 #if V8_TARGET_ARCH_MIPS64 148 #if V8_TARGET_ARCH_MIPS64
149 // To use pseudo-relative jumps such as j/jal instructions which have 28-bit 149 // To use pseudo-relative jumps such as j/jal instructions which have 28-bit
150 // encoded immediate, the addresses have to be in range of 256MB aligned 150 // encoded immediate, the addresses have to be in range of 256MB aligned
151 // region. Used only for large object space. 151 // region. Used only for large object space.
152 const size_t kMaximalCodeRangeSize = 256 * MB; 152 const size_t kMaximalCodeRangeSize = 256 * MB;
153 const size_t kCodeRangeAreaAlignment = 256 * MB; 153 const size_t kCodeRangeAreaAlignment = 256 * MB;
154 #elif V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX
155 const size_t kMaximalCodeRangeSize = 512 * MB;
156 const size_t kCodeRangeAreaAlignment = 64 * KB; // OS page on PPC Linux
154 #else 157 #else
155 const size_t kMaximalCodeRangeSize = 512 * MB; 158 const size_t kMaximalCodeRangeSize = 512 * MB;
156 const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page. 159 const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page.
157 #endif 160 #endif
158 #if V8_OS_WIN 161 #if V8_OS_WIN
159 const size_t kMinimumCodeRangeSize = 4 * MB; 162 const size_t kMinimumCodeRangeSize = 4 * MB;
160 const size_t kReservedCodeRangePages = 1; 163 const size_t kReservedCodeRangePages = 1;
164 // On PPC Linux PageSize is 4MB
165 #elif V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX
166 const size_t kMinimumCodeRangeSize = 12 * MB;
167 const size_t kReservedCodeRangePages = 0;
161 #else 168 #else
162 const size_t kMinimumCodeRangeSize = 3 * MB; 169 const size_t kMinimumCodeRangeSize = 3 * MB;
163 const size_t kReservedCodeRangePages = 0; 170 const size_t kReservedCodeRangePages = 0;
164 #endif 171 #endif
165 #else 172 #else
166 const int kPointerSizeLog2 = 2; 173 const int kPointerSizeLog2 = 2;
167 const intptr_t kIntptrSignBit = 0x80000000; 174 const intptr_t kIntptrSignBit = 0x80000000;
168 const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu; 175 const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu;
169 #if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT 176 #if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT
170 // x32 port also requires code range. 177 // x32 port also requires code range.
171 const bool kRequiresCodeRange = true; 178 const bool kRequiresCodeRange = true;
172 const size_t kMaximalCodeRangeSize = 256 * MB; 179 const size_t kMaximalCodeRangeSize = 256 * MB;
173 const size_t kMinimumCodeRangeSize = 3 * MB; 180 const size_t kMinimumCodeRangeSize = 3 * MB;
174 const size_t kReservedCodeRangePages = 0;
175 const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page. 181 const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page.
182 #elif V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX
183 const bool kRequiresCodeRange = false;
184 const size_t kMaximalCodeRangeSize = 0 * MB;
185 const size_t kMinimumCodeRangeSize = 0 * MB;
186 const size_t kCodeRangeAreaAlignment = 64 * KB; // OS page on PPC Linux
176 #else 187 #else
177 const bool kRequiresCodeRange = false; 188 const bool kRequiresCodeRange = false;
178 const size_t kMaximalCodeRangeSize = 0 * MB; 189 const size_t kMaximalCodeRangeSize = 0 * MB;
179 const size_t kMinimumCodeRangeSize = 0 * MB; 190 const size_t kMinimumCodeRangeSize = 0 * MB;
180 const size_t kReservedCodeRangePages = 0;
181 const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page. 191 const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page.
182 #endif 192 #endif
193 const size_t kReservedCodeRangePages = 0;
183 #endif 194 #endif
184 195
185 // The external allocation limit should be below 256 MB on all architectures 196 // The external allocation limit should be below 256 MB on all architectures
186 // to avoid that resource-constrained embedders run low on memory. 197 // to avoid that resource-constrained embedders run low on memory.
187 const int kExternalAllocationLimit = 192 * 1024 * 1024; 198 const int kExternalAllocationLimit = 192 * 1024 * 1024;
188 199
189 STATIC_ASSERT(kPointerSize == (1 << kPointerSizeLog2)); 200 STATIC_ASSERT(kPointerSize == (1 << kPointerSizeLog2));
190 201
191 const int kBitsPerByte = 8; 202 const int kBitsPerByte = 8;
192 const int kBitsPerByteLog2 = 3; 203 const int kBitsPerByteLog2 = 3;
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >> 1144 return static_cast<uint32_t>(bit_cast<uintptr_t>(address) >>
1134 kPointerSizeLog2); 1145 kPointerSizeLog2);
1135 } 1146 }
1136 1147
1137 } // namespace internal 1148 } // namespace internal
1138 } // namespace v8 1149 } // namespace v8
1139 1150
1140 namespace i = v8::internal; 1151 namespace i = v8::internal;
1141 1152
1142 #endif // V8_GLOBALS_H_ 1153 #endif // V8_GLOBALS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698