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

Side by Side Diff: src/globals.h

Issue 358363002: Move platform abstraction to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 5 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
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 "include/v8stdint.h" 8 #include "include/v8stdint.h"
9 9
10 #include "src/base/build_config.h" 10 #include "src/base/build_config.h"
11 #include "src/base/logging.h"
11 #include "src/base/macros.h" 12 #include "src/base/macros.h"
12 #include "src/checks.h"
13 13
14 // Unfortunately, the INFINITY macro cannot be used with the '-pedantic' 14 // Unfortunately, the INFINITY macro cannot be used with the '-pedantic'
15 // warning flag and certain versions of GCC due to a bug: 15 // warning flag and certain versions of GCC due to a bug:
16 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11931 16 // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11931
17 // For now, we use the more involved template-based version from <limits>, but 17 // For now, we use the more involved template-based version from <limits>, but
18 // only when compiling with GCC versions affected by the bug (2.96.x - 4.0.x) 18 // only when compiling with GCC versions affected by the bug (2.96.x - 4.0.x)
19 #if V8_CC_GNU && V8_GNUC_PREREQ(2, 96, 0) && !V8_GNUC_PREREQ(4, 1, 0) 19 #if V8_CC_GNU && V8_GNUC_PREREQ(2, 96, 0) && !V8_GNUC_PREREQ(4, 1, 0)
20 # include <limits> // NOLINT 20 # include <limits> // NOLINT
21 # define V8_INFINITY std::numeric_limits<double>::infinity() 21 # define V8_INFINITY std::numeric_limits<double>::infinity()
22 #elif V8_LIBC_MSVCRT 22 #elif V8_LIBC_MSVCRT
23 # define V8_INFINITY HUGE_VAL 23 # define V8_INFINITY HUGE_VAL
24 #else 24 #else
25 # define V8_INFINITY INFINITY 25 # define V8_INFINITY INFINITY
26 #endif 26 #endif
27 27
28 namespace v8 { 28 namespace v8 {
29
30 namespace base {
31 class Mutex;
32 class RecursiveMutex;
33 class VirtualMemory;
34 }
35
29 namespace internal { 36 namespace internal {
30 37
31 // Determine whether we are running in a simulated environment. 38 // Determine whether we are running in a simulated environment.
32 // Setting USE_SIMULATOR explicitly from the build script will force 39 // Setting USE_SIMULATOR explicitly from the build script will force
33 // the use of a simulated environment. 40 // the use of a simulated environment.
34 #if !defined(USE_SIMULATOR) 41 #if !defined(USE_SIMULATOR)
35 #if (V8_TARGET_ARCH_ARM64 && !V8_HOST_ARCH_ARM64) 42 #if (V8_TARGET_ARCH_ARM64 && !V8_HOST_ARCH_ARM64)
36 #define USE_SIMULATOR 1 43 #define USE_SIMULATOR 1
37 #endif 44 #endif
38 #if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM) 45 #if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM)
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddeaf); 239 const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddeaf);
233 const Address kGlobalHandleZapValue = reinterpret_cast<Address>(0xbaffedf); 240 const Address kGlobalHandleZapValue = reinterpret_cast<Address>(0xbaffedf);
234 const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdaf); 241 const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdaf);
235 const uint32_t kSlotsZapValue = 0xbeefdeef; 242 const uint32_t kSlotsZapValue = 0xbeefdeef;
236 const uint32_t kDebugZapValue = 0xbadbaddb; 243 const uint32_t kDebugZapValue = 0xbadbaddb;
237 const uint32_t kFreeListZapValue = 0xfeed1eaf; 244 const uint32_t kFreeListZapValue = 0xfeed1eaf;
238 #endif 245 #endif
239 246
240 const int kCodeZapValue = 0xbadc0de; 247 const int kCodeZapValue = 0xbadc0de;
241 248
242 // Number of bits to represent the page size for paged spaces. The value of 20
243 // gives 1Mb bytes per page.
244 const int kPageSizeBits = 20;
245
246 // On Intel architecture, cache line size is 64 bytes. 249 // On Intel architecture, cache line size is 64 bytes.
247 // On ARM it may be less (32 bytes), but as far this constant is 250 // On ARM it may be less (32 bytes), but as far this constant is
248 // used for aligning data, it doesn't hurt to align on a greater value. 251 // used for aligning data, it doesn't hurt to align on a greater value.
249 #define PROCESSOR_CACHE_LINE_SIZE 64 252 #define PROCESSOR_CACHE_LINE_SIZE 64
250 253
251 // Constants relevant to double precision floating point numbers. 254 // Constants relevant to double precision floating point numbers.
252 // If looking only at the top 32 bits, the QNaN mask is bits 19 to 30. 255 // If looking only at the top 32 bits, the QNaN mask is bits 19 to 30.
253 const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32); 256 const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32);
254 257
255 258
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 class Smi; 307 class Smi;
305 template <typename Config, class Allocator = FreeStoreAllocationPolicy> 308 template <typename Config, class Allocator = FreeStoreAllocationPolicy>
306 class SplayTree; 309 class SplayTree;
307 class String; 310 class String;
308 class Name; 311 class Name;
309 class Struct; 312 class Struct;
310 class Variable; 313 class Variable;
311 class RelocInfo; 314 class RelocInfo;
312 class Deserializer; 315 class Deserializer;
313 class MessageLocation; 316 class MessageLocation;
314 class VirtualMemory;
315 class Mutex;
316 class RecursiveMutex;
317 317
318 typedef bool (*WeakSlotCallback)(Object** pointer); 318 typedef bool (*WeakSlotCallback)(Object** pointer);
319 319
320 typedef bool (*WeakSlotCallbackWithHeap)(Heap* heap, Object** pointer); 320 typedef bool (*WeakSlotCallbackWithHeap)(Heap* heap, Object** pointer);
321 321
322 // ----------------------------------------------------------------------------- 322 // -----------------------------------------------------------------------------
323 // Miscellaneous 323 // Miscellaneous
324 324
325 // NOTE: SpaceIterator depends on AllocationSpace enumeration values being 325 // NOTE: SpaceIterator depends on AllocationSpace enumeration values being
326 // consecutive. 326 // consecutive.
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 enum MinusZeroMode { 722 enum MinusZeroMode {
723 TREAT_MINUS_ZERO_AS_ZERO, 723 TREAT_MINUS_ZERO_AS_ZERO,
724 FAIL_ON_MINUS_ZERO 724 FAIL_ON_MINUS_ZERO
725 }; 725 };
726 726
727 } } // namespace v8::internal 727 } } // namespace v8::internal
728 728
729 namespace i = v8::internal; 729 namespace i = v8::internal;
730 730
731 #endif // V8_GLOBALS_H_ 731 #endif // V8_GLOBALS_H_
OLDNEW
« src/base/macros.h ('K') | « src/gdb-jit.cc ('k') | src/hashmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698