OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 #endif | 86 #endif |
87 #if (defined(V8_TARGET_ARCH_ARM) && \ | 87 #if (defined(V8_TARGET_ARCH_ARM) && \ |
88 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) | 88 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_ARM))) |
89 #error Target architecture arm is only supported on arm and ia32 host | 89 #error Target architecture arm is only supported on arm and ia32 host |
90 #endif | 90 #endif |
91 #if (defined(V8_TARGET_ARCH_MIPS) && \ | 91 #if (defined(V8_TARGET_ARCH_MIPS) && \ |
92 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) | 92 !(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_MIPS))) |
93 #error Target architecture mips is only supported on mips and ia32 host | 93 #error Target architecture mips is only supported on mips and ia32 host |
94 #endif | 94 #endif |
95 | 95 |
| 96 // Determine whether we are running in a simulated environment. |
| 97 // Setting USE_SIMULATOR explicitly from the build script will force |
| 98 // the use of a simulated environment. |
| 99 #if !defined(USE_SIMULATOR) |
| 100 #if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM)) |
| 101 #define USE_SIMULATOR 1 |
| 102 #endif |
| 103 #if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS)) |
| 104 #define USE_SIMULATOR 1 |
| 105 #endif |
| 106 #endif |
| 107 |
96 // Define unaligned read for the target architectures supporting it. | 108 // Define unaligned read for the target architectures supporting it. |
97 #if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32) | 109 #if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32) |
98 #define V8_TARGET_CAN_READ_UNALIGNED 1 | 110 #define V8_TARGET_CAN_READ_UNALIGNED 1 |
99 #elif V8_TARGET_ARCH_ARM | 111 #elif V8_TARGET_ARCH_ARM |
100 // Some CPU-OS combinations allow unaligned access on ARM. We assume | 112 // Some CPU-OS combinations allow unaligned access on ARM. We assume |
101 // that unaligned accesses are not allowed unless the build system | 113 // that unaligned accesses are not allowed unless the build system |
102 // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero. | 114 // defines the CAN_USE_UNALIGNED_ACCESSES macro to be non-zero. |
103 #if CAN_USE_UNALIGNED_ACCESSES | 115 #if CAN_USE_UNALIGNED_ACCESSES |
104 #define V8_TARGET_CAN_READ_UNALIGNED 1 | 116 #define V8_TARGET_CAN_READ_UNALIGNED 1 |
105 #endif | 117 #endif |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 const int kCharSize = sizeof(char); // NOLINT | 194 const int kCharSize = sizeof(char); // NOLINT |
183 const int kShortSize = sizeof(short); // NOLINT | 195 const int kShortSize = sizeof(short); // NOLINT |
184 const int kIntSize = sizeof(int); // NOLINT | 196 const int kIntSize = sizeof(int); // NOLINT |
185 const int kDoubleSize = sizeof(double); // NOLINT | 197 const int kDoubleSize = sizeof(double); // NOLINT |
186 const int kPointerSize = sizeof(void*); // NOLINT | 198 const int kPointerSize = sizeof(void*); // NOLINT |
187 const int kIntptrSize = sizeof(intptr_t); // NOLINT | 199 const int kIntptrSize = sizeof(intptr_t); // NOLINT |
188 | 200 |
189 #if V8_HOST_ARCH_64_BIT | 201 #if V8_HOST_ARCH_64_BIT |
190 const int kPointerSizeLog2 = 3; | 202 const int kPointerSizeLog2 = 3; |
191 const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000); | 203 const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000); |
| 204 const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF); |
192 #else | 205 #else |
193 const int kPointerSizeLog2 = 2; | 206 const int kPointerSizeLog2 = 2; |
194 const intptr_t kIntptrSignBit = 0x80000000; | 207 const intptr_t kIntptrSignBit = 0x80000000; |
| 208 const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu; |
195 #endif | 209 #endif |
196 | 210 |
197 // Mask for the sign bit in a smi. | 211 // Mask for the sign bit in a smi. |
198 const intptr_t kSmiSignMask = kIntptrSignBit; | 212 const intptr_t kSmiSignMask = kIntptrSignBit; |
199 | 213 |
200 const int kObjectAlignmentBits = kPointerSizeLog2; | 214 const int kObjectAlignmentBits = kPointerSizeLog2; |
201 const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits; | 215 const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits; |
202 const intptr_t kObjectAlignmentMask = kObjectAlignment - 1; | 216 const intptr_t kObjectAlignmentMask = kObjectAlignment - 1; |
203 | 217 |
204 // Desired alignment for pointers. | 218 // Desired alignment for pointers. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 class LargeObjectSpace; | 331 class LargeObjectSpace; |
318 template <typename T, class P = FreeStoreAllocationPolicy> class List; | 332 template <typename T, class P = FreeStoreAllocationPolicy> class List; |
319 class LookupResult; | 333 class LookupResult; |
320 class MacroAssembler; | 334 class MacroAssembler; |
321 class Map; | 335 class Map; |
322 class MapSpace; | 336 class MapSpace; |
323 class MarkCompactCollector; | 337 class MarkCompactCollector; |
324 class NewSpace; | 338 class NewSpace; |
325 class NodeVisitor; | 339 class NodeVisitor; |
326 class Object; | 340 class Object; |
| 341 class MaybeObject; |
327 class OldSpace; | 342 class OldSpace; |
328 class Property; | 343 class Property; |
329 class Proxy; | 344 class Proxy; |
330 class RegExpNode; | 345 class RegExpNode; |
331 struct RegExpCompileData; | 346 struct RegExpCompileData; |
332 class RegExpTree; | 347 class RegExpTree; |
333 class RegExpCompiler; | 348 class RegExpCompiler; |
334 class RegExpVisitor; | 349 class RegExpVisitor; |
335 class Scope; | 350 class Scope; |
336 template<class Allocator = FreeStoreAllocationPolicy> class ScopeInfo; | 351 template<class Allocator = FreeStoreAllocationPolicy> class ScopeInfo; |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 unsigned int sign :1; | 550 unsigned int sign :1; |
536 unsigned int exp :11; | 551 unsigned int exp :11; |
537 unsigned int man_high :20; | 552 unsigned int man_high :20; |
538 unsigned int man_low :32; | 553 unsigned int man_low :32; |
539 } bits; | 554 } bits; |
540 }; | 555 }; |
541 | 556 |
542 | 557 |
543 // AccessorCallback | 558 // AccessorCallback |
544 struct AccessorDescriptor { | 559 struct AccessorDescriptor { |
545 Object* (*getter)(Object* object, void* data); | 560 MaybeObject* (*getter)(Object* object, void* data); |
546 Object* (*setter)(JSObject* object, Object* value, void* data); | 561 MaybeObject* (*setter)(JSObject* object, Object* value, void* data); |
547 void* data; | 562 void* data; |
548 }; | 563 }; |
549 | 564 |
550 | 565 |
551 // Logging and profiling. | 566 // Logging and profiling. |
552 // A StateTag represents a possible state of the VM. When compiled with | 567 // A StateTag represents a possible state of the VM. When compiled with |
553 // ENABLE_VMSTATE_TRACKING, the logger maintains a stack of these. | 568 // ENABLE_VMSTATE_TRACKING, the logger maintains a stack of these. |
554 // Creating a VMState object enters a state by pushing on the stack, and | 569 // Creating a VMState object enters a state by pushing on the stack, and |
555 // destroying a VMState object leaves a state by popping the current state | 570 // destroying a VMState object leaves a state by popping the current state |
556 // from the stack. | 571 // from the stack. |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
708 CMOV = 15, // x86 | 723 CMOV = 15, // x86 |
709 RDTSC = 4, // x86 | 724 RDTSC = 4, // x86 |
710 CPUID = 10, // x86 | 725 CPUID = 10, // x86 |
711 VFP3 = 1, // ARM | 726 VFP3 = 1, // ARM |
712 ARMv7 = 2, // ARM | 727 ARMv7 = 2, // ARM |
713 SAHF = 0}; // x86 | 728 SAHF = 0}; // x86 |
714 | 729 |
715 } } // namespace v8::internal | 730 } } // namespace v8::internal |
716 | 731 |
717 #endif // V8_GLOBALS_H_ | 732 #endif // V8_GLOBALS_H_ |
OLD | NEW |