Ben Murdoch | 3ef787d | 2012-04-12 10:51:47 +0100 | [diff] [blame] | 1 | // Copyright 2012 the V8 project authors. All rights reserved. |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 4 | |
| 5 | #ifndef V8_GLOBALS_H_ |
| 6 | #define V8_GLOBALS_H_ |
| 7 | |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 8 | #include <stddef.h> |
| 9 | #include <stdint.h> |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 10 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 11 | #include "src/base/build_config.h" |
| 12 | #include "src/base/logging.h" |
| 13 | #include "src/base/macros.h" |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 14 | |
| 15 | // Unfortunately, the INFINITY macro cannot be used with the '-pedantic' |
| 16 | // warning flag and certain versions of GCC due to a bug: |
| 17 | // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11931 |
| 18 | // For now, we use the more involved template-based version from <limits>, but |
| 19 | // only when compiling with GCC versions affected by the bug (2.96.x - 4.0.x) |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 20 | #if V8_CC_GNU && V8_GNUC_PREREQ(2, 96, 0) && !V8_GNUC_PREREQ(4, 1, 0) |
| 21 | # include <limits> // NOLINT |
| 22 | # define V8_INFINITY std::numeric_limits<double>::infinity() |
| 23 | #elif V8_LIBC_MSVCRT |
| 24 | # define V8_INFINITY HUGE_VAL |
| 25 | #else |
| 26 | # define V8_INFINITY INFINITY |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 27 | #endif |
| 28 | |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 29 | #if V8_TARGET_ARCH_IA32 || (V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_32_BIT) || \ |
| 30 | V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS || \ |
| 31 | V8_TARGET_ARCH_MIPS64 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 32 | #define V8_TURBOFAN_BACKEND 1 |
| 33 | #else |
| 34 | #define V8_TURBOFAN_BACKEND 0 |
| 35 | #endif |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 36 | #if V8_TURBOFAN_BACKEND |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 37 | #define V8_TURBOFAN_TARGET 1 |
| 38 | #else |
| 39 | #define V8_TURBOFAN_TARGET 0 |
| 40 | #endif |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 41 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 42 | namespace v8 { |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 43 | |
| 44 | namespace base { |
| 45 | class Mutex; |
| 46 | class RecursiveMutex; |
| 47 | class VirtualMemory; |
| 48 | } |
| 49 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 50 | namespace internal { |
| 51 | |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 52 | // Determine whether we are running in a simulated environment. |
| 53 | // Setting USE_SIMULATOR explicitly from the build script will force |
| 54 | // the use of a simulated environment. |
| 55 | #if !defined(USE_SIMULATOR) |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 56 | #if (V8_TARGET_ARCH_ARM64 && !V8_HOST_ARCH_ARM64) |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 57 | #define USE_SIMULATOR 1 |
| 58 | #endif |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 59 | #if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM) |
| 60 | #define USE_SIMULATOR 1 |
| 61 | #endif |
| 62 | #if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS) |
| 63 | #define USE_SIMULATOR 1 |
| 64 | #endif |
| 65 | #if (V8_TARGET_ARCH_MIPS64 && !V8_HOST_ARCH_MIPS64) |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 66 | #define USE_SIMULATOR 1 |
| 67 | #endif |
| 68 | #endif |
| 69 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 70 | // Determine whether the architecture uses an out-of-line constant pool. |
| 71 | #define V8_OOL_CONSTANT_POOL 0 |
| 72 | |
| 73 | #ifdef V8_TARGET_ARCH_ARM |
| 74 | // Set stack limit lower for ARM than for other architectures because |
| 75 | // stack allocating MacroAssembler takes 120K bytes. |
| 76 | // See issue crbug.com/405338 |
| 77 | #define V8_DEFAULT_STACK_SIZE_KB 864 |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 78 | #else |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 79 | // Slightly less than 1MB, since Windows' default stack size for |
| 80 | // the main execution thread is 1MB for both 32 and 64-bit. |
| 81 | #define V8_DEFAULT_STACK_SIZE_KB 984 |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 82 | #endif |
| 83 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 84 | |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 85 | // Determine whether double field unboxing feature is enabled. |
| 86 | #if (V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM64) |
| 87 | #define V8_DOUBLE_FIELDS_UNBOXING 0 |
| 88 | #else |
| 89 | #define V8_DOUBLE_FIELDS_UNBOXING 0 |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 90 | #endif |
| 91 | |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 92 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 93 | typedef uint8_t byte; |
| 94 | typedef byte* Address; |
| 95 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 96 | // ----------------------------------------------------------------------------- |
| 97 | // Constants |
| 98 | |
| 99 | const int KB = 1024; |
| 100 | const int MB = KB * KB; |
| 101 | const int GB = KB * KB * KB; |
| 102 | const int kMaxInt = 0x7FFFFFFF; |
| 103 | const int kMinInt = -kMaxInt - 1; |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 104 | const int kMaxInt8 = (1 << 7) - 1; |
| 105 | const int kMinInt8 = -(1 << 7); |
| 106 | const int kMaxUInt8 = (1 << 8) - 1; |
| 107 | const int kMinUInt8 = 0; |
| 108 | const int kMaxInt16 = (1 << 15) - 1; |
| 109 | const int kMinInt16 = -(1 << 15); |
| 110 | const int kMaxUInt16 = (1 << 16) - 1; |
| 111 | const int kMinUInt16 = 0; |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 112 | |
| 113 | const uint32_t kMaxUInt32 = 0xFFFFFFFFu; |
| 114 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 115 | const int kCharSize = sizeof(char); // NOLINT |
| 116 | const int kShortSize = sizeof(short); // NOLINT |
| 117 | const int kIntSize = sizeof(int); // NOLINT |
| 118 | const int kInt32Size = sizeof(int32_t); // NOLINT |
| 119 | const int kInt64Size = sizeof(int64_t); // NOLINT |
| 120 | const int kDoubleSize = sizeof(double); // NOLINT |
| 121 | const int kIntptrSize = sizeof(intptr_t); // NOLINT |
| 122 | const int kPointerSize = sizeof(void*); // NOLINT |
| 123 | #if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT |
| 124 | const int kRegisterSize = kPointerSize + kPointerSize; |
| 125 | #else |
| 126 | const int kRegisterSize = kPointerSize; |
| 127 | #endif |
| 128 | const int kPCOnStackSize = kRegisterSize; |
| 129 | const int kFPOnStackSize = kRegisterSize; |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 130 | |
Ben Murdoch | 3fb3ca8 | 2011-12-02 17:19:32 +0000 | [diff] [blame] | 131 | const int kDoubleSizeLog2 = 3; |
| 132 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 133 | #if V8_HOST_ARCH_64_BIT |
| 134 | const int kPointerSizeLog2 = 3; |
| 135 | const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000); |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 136 | const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF); |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 137 | const bool kRequiresCodeRange = true; |
| 138 | const size_t kMaximalCodeRangeSize = 512 * MB; |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 139 | #if V8_OS_WIN |
| 140 | const size_t kMinimumCodeRangeSize = 4 * MB; |
| 141 | const size_t kReservedCodeRangePages = 1; |
| 142 | #else |
| 143 | const size_t kMinimumCodeRangeSize = 3 * MB; |
| 144 | const size_t kReservedCodeRangePages = 0; |
| 145 | #endif |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 146 | #else |
| 147 | const int kPointerSizeLog2 = 2; |
| 148 | const intptr_t kIntptrSignBit = 0x80000000; |
John Reck | 5913587 | 2010-11-02 12:39:01 -0700 | [diff] [blame] | 149 | const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu; |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 150 | #if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT |
| 151 | // x32 port also requires code range. |
| 152 | const bool kRequiresCodeRange = true; |
| 153 | const size_t kMaximalCodeRangeSize = 256 * MB; |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 154 | const size_t kMinimumCodeRangeSize = 3 * MB; |
| 155 | const size_t kReservedCodeRangePages = 0; |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 156 | #else |
| 157 | const bool kRequiresCodeRange = false; |
| 158 | const size_t kMaximalCodeRangeSize = 0 * MB; |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 159 | const size_t kMinimumCodeRangeSize = 0 * MB; |
| 160 | const size_t kReservedCodeRangePages = 0; |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 161 | #endif |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 162 | #endif |
| 163 | |
| 164 | STATIC_ASSERT(kPointerSize == (1 << kPointerSizeLog2)); |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 165 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 166 | const int kBitsPerByte = 8; |
| 167 | const int kBitsPerByteLog2 = 3; |
| 168 | const int kBitsPerPointer = kPointerSize * kBitsPerByte; |
| 169 | const int kBitsPerInt = kIntSize * kBitsPerByte; |
| 170 | |
Steve Block | 6ded16b | 2010-05-10 14:33:55 +0100 | [diff] [blame] | 171 | // IEEE 754 single precision floating point number bit layout. |
| 172 | const uint32_t kBinary32SignMask = 0x80000000u; |
| 173 | const uint32_t kBinary32ExponentMask = 0x7f800000u; |
| 174 | const uint32_t kBinary32MantissaMask = 0x007fffffu; |
| 175 | const int kBinary32ExponentBias = 127; |
| 176 | const int kBinary32MaxExponent = 0xFE; |
| 177 | const int kBinary32MinExponent = 0x01; |
| 178 | const int kBinary32MantissaBits = 23; |
| 179 | const int kBinary32ExponentShift = 23; |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 180 | |
Ben Murdoch | 3ef787d | 2012-04-12 10:51:47 +0100 | [diff] [blame] | 181 | // Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no |
| 182 | // other bits set. |
| 183 | const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51; |
| 184 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 185 | // Latin1/UTF-16 constants |
Steve Block | 9fac840 | 2011-05-12 15:51:54 +0100 | [diff] [blame] | 186 | // Code-point values in Unicode 4.0 are 21 bits wide. |
Ben Murdoch | 3ef787d | 2012-04-12 10:51:47 +0100 | [diff] [blame] | 187 | // Code units in UTF-16 are 16 bits wide. |
Steve Block | 9fac840 | 2011-05-12 15:51:54 +0100 | [diff] [blame] | 188 | typedef uint16_t uc16; |
| 189 | typedef int32_t uc32; |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 190 | const int kOneByteSize = kCharSize; |
Steve Block | 9fac840 | 2011-05-12 15:51:54 +0100 | [diff] [blame] | 191 | const int kUC16Size = sizeof(uc16); // NOLINT |
Steve Block | 9fac840 | 2011-05-12 15:51:54 +0100 | [diff] [blame] | 192 | |
Ben Murdoch | b0fe162 | 2011-05-05 13:52:32 +0100 | [diff] [blame] | 193 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 194 | // Round up n to be a multiple of sz, where sz is a power of 2. |
| 195 | #define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1)) |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 196 | |
| 197 | |
| 198 | // FUNCTION_ADDR(f) gets the address of a C function f. |
| 199 | #define FUNCTION_ADDR(f) \ |
| 200 | (reinterpret_cast<v8::internal::Address>(reinterpret_cast<intptr_t>(f))) |
| 201 | |
| 202 | |
| 203 | // FUNCTION_CAST<F>(addr) casts an address into a function |
| 204 | // of type F. Used to invoke generated code from within C. |
| 205 | template <typename F> |
| 206 | F FUNCTION_CAST(Address addr) { |
| 207 | return reinterpret_cast<F>(reinterpret_cast<intptr_t>(addr)); |
| 208 | } |
| 209 | |
| 210 | |
Shimeng (Simon) Wang | 8a31eba | 2010-12-06 19:01:33 -0800 | [diff] [blame] | 211 | // ----------------------------------------------------------------------------- |
| 212 | // Forward declarations for frequently used classes |
| 213 | // (sorted alphabetically) |
Kristian Monsen | 80d68ea | 2010-09-08 11:05:35 +0100 | [diff] [blame] | 214 | |
Shimeng (Simon) Wang | 8a31eba | 2010-12-06 19:01:33 -0800 | [diff] [blame] | 215 | class FreeStoreAllocationPolicy; |
| 216 | template <typename T, class P = FreeStoreAllocationPolicy> class List; |
Steve Block | d0582a6 | 2009-12-15 09:54:21 +0000 | [diff] [blame] | 217 | |
Ben Murdoch | 3ef787d | 2012-04-12 10:51:47 +0100 | [diff] [blame] | 218 | // ----------------------------------------------------------------------------- |
| 219 | // Declarations for use in both the preparser and the rest of V8. |
| 220 | |
Ben Murdoch | 3ef787d | 2012-04-12 10:51:47 +0100 | [diff] [blame] | 221 | // The Strict Mode (ECMA-262 5th edition, 4.2.2). |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 222 | |
| 223 | enum StrictMode { SLOPPY, STRICT }; |
| 224 | |
| 225 | |
| 226 | // Mask for the sign bit in a smi. |
| 227 | const intptr_t kSmiSignMask = kIntptrSignBit; |
| 228 | |
| 229 | const int kObjectAlignmentBits = kPointerSizeLog2; |
| 230 | const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits; |
| 231 | const intptr_t kObjectAlignmentMask = kObjectAlignment - 1; |
| 232 | |
| 233 | // Desired alignment for pointers. |
| 234 | const intptr_t kPointerAlignment = (1 << kPointerSizeLog2); |
| 235 | const intptr_t kPointerAlignmentMask = kPointerAlignment - 1; |
| 236 | |
| 237 | // Desired alignment for double values. |
| 238 | const intptr_t kDoubleAlignment = 8; |
| 239 | const intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1; |
| 240 | |
| 241 | // Desired alignment for generated code is 32 bytes (to improve cache line |
| 242 | // utilization). |
| 243 | const int kCodeAlignmentBits = 5; |
| 244 | const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits; |
| 245 | const intptr_t kCodeAlignmentMask = kCodeAlignment - 1; |
| 246 | |
| 247 | // The owner field of a page is tagged with the page header tag. We need that |
| 248 | // to find out if a slot is part of a large object. If we mask out the lower |
| 249 | // 0xfffff bits (1M pages), go to the owner offset, and see that this field |
| 250 | // is tagged with the page header tag, we can just look up the owner. |
| 251 | // Otherwise, we know that we are somewhere (not within the first 1M) in a |
| 252 | // large object. |
| 253 | const int kPageHeaderTag = 3; |
| 254 | const int kPageHeaderTagSize = 2; |
| 255 | const intptr_t kPageHeaderTagMask = (1 << kPageHeaderTagSize) - 1; |
| 256 | |
| 257 | |
| 258 | // Zap-value: The value used for zapping dead objects. |
| 259 | // Should be a recognizable hex value tagged as a failure. |
| 260 | #ifdef V8_HOST_ARCH_64_BIT |
| 261 | const Address kZapValue = |
| 262 | reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeef)); |
| 263 | const Address kHandleZapValue = |
| 264 | reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddeaf)); |
| 265 | const Address kGlobalHandleZapValue = |
| 266 | reinterpret_cast<Address>(V8_UINT64_C(0x1baffed00baffedf)); |
| 267 | const Address kFromSpaceZapValue = |
| 268 | reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdaf)); |
| 269 | const uint64_t kDebugZapValue = V8_UINT64_C(0xbadbaddbbadbaddb); |
| 270 | const uint64_t kSlotsZapValue = V8_UINT64_C(0xbeefdeadbeefdeef); |
| 271 | const uint64_t kFreeListZapValue = 0xfeed1eaffeed1eaf; |
| 272 | #else |
| 273 | const Address kZapValue = reinterpret_cast<Address>(0xdeadbeef); |
| 274 | const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddeaf); |
| 275 | const Address kGlobalHandleZapValue = reinterpret_cast<Address>(0xbaffedf); |
| 276 | const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdaf); |
| 277 | const uint32_t kSlotsZapValue = 0xbeefdeef; |
| 278 | const uint32_t kDebugZapValue = 0xbadbaddb; |
| 279 | const uint32_t kFreeListZapValue = 0xfeed1eaf; |
| 280 | #endif |
| 281 | |
| 282 | const int kCodeZapValue = 0xbadc0de; |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 283 | const uint32_t kPhantomReferenceZap = 0xca11bac; |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 284 | |
| 285 | // On Intel architecture, cache line size is 64 bytes. |
| 286 | // On ARM it may be less (32 bytes), but as far this constant is |
| 287 | // used for aligning data, it doesn't hurt to align on a greater value. |
| 288 | #define PROCESSOR_CACHE_LINE_SIZE 64 |
| 289 | |
| 290 | // Constants relevant to double precision floating point numbers. |
| 291 | // If looking only at the top 32 bits, the QNaN mask is bits 19 to 30. |
| 292 | const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32); |
| 293 | |
| 294 | |
| 295 | // ----------------------------------------------------------------------------- |
| 296 | // Forward declarations for frequently used classes |
| 297 | |
| 298 | class AccessorInfo; |
| 299 | class Allocation; |
| 300 | class Arguments; |
| 301 | class Assembler; |
| 302 | class Code; |
| 303 | class CodeGenerator; |
| 304 | class CodeStub; |
| 305 | class Context; |
| 306 | class Debug; |
| 307 | class Debugger; |
| 308 | class DebugInfo; |
| 309 | class Descriptor; |
| 310 | class DescriptorArray; |
| 311 | class TransitionArray; |
| 312 | class ExternalReference; |
| 313 | class FixedArray; |
| 314 | class FunctionTemplateInfo; |
| 315 | class MemoryChunk; |
| 316 | class SeededNumberDictionary; |
| 317 | class UnseededNumberDictionary; |
| 318 | class NameDictionary; |
| 319 | template <typename T> class MaybeHandle; |
| 320 | template <typename T> class Handle; |
| 321 | class Heap; |
| 322 | class HeapObject; |
| 323 | class IC; |
| 324 | class InterceptorInfo; |
| 325 | class Isolate; |
| 326 | class JSReceiver; |
| 327 | class JSArray; |
| 328 | class JSFunction; |
| 329 | class JSObject; |
| 330 | class LargeObjectSpace; |
| 331 | class LookupResult; |
| 332 | class MacroAssembler; |
| 333 | class Map; |
| 334 | class MapSpace; |
| 335 | class MarkCompactCollector; |
| 336 | class NewSpace; |
| 337 | class Object; |
| 338 | class OldSpace; |
| 339 | class Foreign; |
| 340 | class Scope; |
| 341 | class ScopeInfo; |
| 342 | class Script; |
| 343 | class Smi; |
| 344 | template <typename Config, class Allocator = FreeStoreAllocationPolicy> |
| 345 | class SplayTree; |
| 346 | class String; |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 347 | class Symbol; |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 348 | class Name; |
| 349 | class Struct; |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 350 | class Symbol; |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 351 | class Variable; |
| 352 | class RelocInfo; |
| 353 | class Deserializer; |
| 354 | class MessageLocation; |
| 355 | |
| 356 | typedef bool (*WeakSlotCallback)(Object** pointer); |
| 357 | |
| 358 | typedef bool (*WeakSlotCallbackWithHeap)(Heap* heap, Object** pointer); |
| 359 | |
| 360 | // ----------------------------------------------------------------------------- |
| 361 | // Miscellaneous |
| 362 | |
| 363 | // NOTE: SpaceIterator depends on AllocationSpace enumeration values being |
| 364 | // consecutive. |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 365 | // Keep this enum in sync with the ObjectSpace enum in v8.h |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 366 | enum AllocationSpace { |
| 367 | NEW_SPACE, // Semispaces collected with copying collector. |
| 368 | OLD_POINTER_SPACE, // May contain pointers to new space. |
| 369 | OLD_DATA_SPACE, // Must not have pointers to new space. |
| 370 | CODE_SPACE, // No pointers to new space, marked executable. |
| 371 | MAP_SPACE, // Only and all map objects. |
| 372 | CELL_SPACE, // Only and all cell objects. |
| 373 | PROPERTY_CELL_SPACE, // Only and all global property cell objects. |
| 374 | LO_SPACE, // Promoted large objects. |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 375 | |
| 376 | FIRST_SPACE = NEW_SPACE, |
| 377 | LAST_SPACE = LO_SPACE, |
| 378 | FIRST_PAGED_SPACE = OLD_POINTER_SPACE, |
| 379 | LAST_PAGED_SPACE = PROPERTY_CELL_SPACE |
| 380 | }; |
| 381 | const int kSpaceTagSize = 3; |
| 382 | const int kSpaceTagMask = (1 << kSpaceTagSize) - 1; |
| 383 | |
| 384 | |
| 385 | // A flag that indicates whether objects should be pretenured when |
| 386 | // allocated (allocated directly into the old generation) or not |
| 387 | // (allocated in the young generation if the object size and type |
| 388 | // allows). |
| 389 | enum PretenureFlag { NOT_TENURED, TENURED }; |
| 390 | |
| 391 | enum MinimumCapacity { |
| 392 | USE_DEFAULT_MINIMUM_CAPACITY, |
| 393 | USE_CUSTOM_MINIMUM_CAPACITY |
| 394 | }; |
| 395 | |
| 396 | enum GarbageCollector { SCAVENGER, MARK_COMPACTOR }; |
| 397 | |
| 398 | enum Executability { NOT_EXECUTABLE, EXECUTABLE }; |
| 399 | |
| 400 | enum VisitMode { |
| 401 | VISIT_ALL, |
| 402 | VISIT_ALL_IN_SCAVENGE, |
| 403 | VISIT_ALL_IN_SWEEP_NEWSPACE, |
| 404 | VISIT_ONLY_STRONG |
| 405 | }; |
| 406 | |
| 407 | // Flag indicating whether code is built into the VM (one of the natives files). |
| 408 | enum NativesFlag { NOT_NATIVES_CODE, NATIVES_CODE }; |
| 409 | |
| 410 | |
| 411 | // A CodeDesc describes a buffer holding instructions and relocation |
| 412 | // information. The instructions start at the beginning of the buffer |
| 413 | // and grow forward, the relocation information starts at the end of |
| 414 | // the buffer and grows backward. |
Ben Murdoch | 3ef787d | 2012-04-12 10:51:47 +0100 | [diff] [blame] | 415 | // |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 416 | // |<--------------- buffer_size ---------------->| |
| 417 | // |<-- instr_size -->| |<-- reloc_size -->| |
| 418 | // +==================+========+==================+ |
| 419 | // | instructions | free | reloc info | |
| 420 | // +==================+========+==================+ |
| 421 | // ^ |
| 422 | // | |
| 423 | // buffer |
| 424 | |
| 425 | struct CodeDesc { |
| 426 | byte* buffer; |
| 427 | int buffer_size; |
| 428 | int instr_size; |
| 429 | int reloc_size; |
| 430 | Assembler* origin; |
Ben Murdoch | 3ef787d | 2012-04-12 10:51:47 +0100 | [diff] [blame] | 431 | }; |
| 432 | |
| 433 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 434 | // Callback function used for iterating objects in heap spaces, |
| 435 | // for example, scanning heap objects. |
| 436 | typedef int (*HeapObjectCallback)(HeapObject* obj); |
| 437 | |
| 438 | |
| 439 | // Callback function used for checking constraints when copying/relocating |
| 440 | // objects. Returns true if an object can be copied/relocated from its |
| 441 | // old_addr to a new_addr. |
| 442 | typedef bool (*ConstraintCallback)(Address new_addr, Address old_addr); |
| 443 | |
| 444 | |
| 445 | // Callback function on inline caches, used for iterating over inline caches |
| 446 | // in compiled code. |
| 447 | typedef void (*InlineCacheCallback)(Code* code, Address ic); |
| 448 | |
| 449 | |
| 450 | // State for inline cache call sites. Aliased as IC::State. |
| 451 | enum InlineCacheState { |
| 452 | // Has never been executed. |
| 453 | UNINITIALIZED, |
| 454 | // Has been executed but monomorhic state has been delayed. |
| 455 | PREMONOMORPHIC, |
| 456 | // Has been executed and only one receiver type has been seen. |
| 457 | MONOMORPHIC, |
| 458 | // Check failed due to prototype (or map deprecation). |
| 459 | PROTOTYPE_FAILURE, |
| 460 | // Multiple receiver types have been seen. |
| 461 | POLYMORPHIC, |
| 462 | // Many receiver types have been seen. |
| 463 | MEGAMORPHIC, |
| 464 | // A generic handler is installed and no extra typefeedback is recorded. |
| 465 | GENERIC, |
| 466 | // Special state for debug break or step in prepare stubs. |
| 467 | DEBUG_STUB, |
| 468 | // Type-vector-based ICs have a default state, with the full calculation |
| 469 | // of IC state only determined by a look at the IC and the typevector |
| 470 | // together. |
| 471 | DEFAULT |
| 472 | }; |
| 473 | |
| 474 | |
| 475 | enum CallFunctionFlags { |
| 476 | NO_CALL_FUNCTION_FLAGS, |
| 477 | CALL_AS_METHOD, |
| 478 | // Always wrap the receiver and call to the JSFunction. Only use this flag |
| 479 | // both the receiver type and the target method are statically known. |
| 480 | WRAP_AND_CALL |
| 481 | }; |
| 482 | |
| 483 | |
| 484 | enum CallConstructorFlags { |
| 485 | NO_CALL_CONSTRUCTOR_FLAGS, |
| 486 | // The call target is cached in the instruction stream. |
| 487 | RECORD_CONSTRUCTOR_TARGET |
| 488 | }; |
| 489 | |
| 490 | |
| 491 | enum CacheHolderFlag { |
| 492 | kCacheOnPrototype, |
| 493 | kCacheOnPrototypeReceiverIsDictionary, |
| 494 | kCacheOnPrototypeReceiverIsPrimitive, |
| 495 | kCacheOnReceiver |
| 496 | }; |
| 497 | |
| 498 | |
| 499 | // The Store Buffer (GC). |
| 500 | typedef enum { |
| 501 | kStoreBufferFullEvent, |
| 502 | kStoreBufferStartScanningPagesEvent, |
| 503 | kStoreBufferScanningPageEvent |
| 504 | } StoreBufferEvent; |
| 505 | |
| 506 | |
| 507 | typedef void (*StoreBufferCallback)(Heap* heap, |
| 508 | MemoryChunk* page, |
| 509 | StoreBufferEvent event); |
| 510 | |
| 511 | |
| 512 | // Union used for fast testing of specific double values. |
| 513 | union DoubleRepresentation { |
| 514 | double value; |
| 515 | int64_t bits; |
| 516 | DoubleRepresentation(double x) { value = x; } |
| 517 | bool operator==(const DoubleRepresentation& other) const { |
| 518 | return bits == other.bits; |
| 519 | } |
| 520 | }; |
| 521 | |
| 522 | |
| 523 | // Union used for customized checking of the IEEE double types |
| 524 | // inlined within v8 runtime, rather than going to the underlying |
| 525 | // platform headers and libraries |
| 526 | union IeeeDoubleLittleEndianArchType { |
| 527 | double d; |
| 528 | struct { |
| 529 | unsigned int man_low :32; |
| 530 | unsigned int man_high :20; |
| 531 | unsigned int exp :11; |
| 532 | unsigned int sign :1; |
| 533 | } bits; |
| 534 | }; |
| 535 | |
| 536 | |
| 537 | union IeeeDoubleBigEndianArchType { |
| 538 | double d; |
| 539 | struct { |
| 540 | unsigned int sign :1; |
| 541 | unsigned int exp :11; |
| 542 | unsigned int man_high :20; |
| 543 | unsigned int man_low :32; |
| 544 | } bits; |
| 545 | }; |
| 546 | |
| 547 | |
| 548 | // AccessorCallback |
| 549 | struct AccessorDescriptor { |
| 550 | Object* (*getter)(Isolate* isolate, Object* object, void* data); |
| 551 | Object* (*setter)( |
| 552 | Isolate* isolate, JSObject* object, Object* value, void* data); |
| 553 | void* data; |
| 554 | }; |
| 555 | |
| 556 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 557 | // ----------------------------------------------------------------------------- |
| 558 | // Macros |
| 559 | |
| 560 | // Testers for test. |
| 561 | |
| 562 | #define HAS_SMI_TAG(value) \ |
| 563 | ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag) |
| 564 | |
| 565 | #define HAS_FAILURE_TAG(value) \ |
| 566 | ((reinterpret_cast<intptr_t>(value) & kFailureTagMask) == kFailureTag) |
| 567 | |
| 568 | // OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer |
| 569 | #define OBJECT_POINTER_ALIGN(value) \ |
| 570 | (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask) |
| 571 | |
| 572 | // POINTER_SIZE_ALIGN returns the value aligned as a pointer. |
| 573 | #define POINTER_SIZE_ALIGN(value) \ |
| 574 | (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask) |
| 575 | |
| 576 | // CODE_POINTER_ALIGN returns the value aligned as a generated code segment. |
| 577 | #define CODE_POINTER_ALIGN(value) \ |
| 578 | (((value) + kCodeAlignmentMask) & ~kCodeAlignmentMask) |
| 579 | |
| 580 | // Support for tracking C++ memory allocation. Insert TRACK_MEMORY("Fisk") |
| 581 | // inside a C++ class and new and delete will be overloaded so logging is |
| 582 | // performed. |
| 583 | // This file (globals.h) is included before log.h, so we use direct calls to |
| 584 | // the Logger rather than the LOG macro. |
| 585 | #ifdef DEBUG |
| 586 | #define TRACK_MEMORY(name) \ |
| 587 | void* operator new(size_t size) { \ |
| 588 | void* result = ::operator new(size); \ |
| 589 | Logger::NewEventStatic(name, result, size); \ |
| 590 | return result; \ |
| 591 | } \ |
| 592 | void operator delete(void* object) { \ |
| 593 | Logger::DeleteEventStatic(name, object); \ |
| 594 | ::operator delete(object); \ |
| 595 | } |
| 596 | #else |
| 597 | #define TRACK_MEMORY(name) |
| 598 | #endif |
| 599 | |
| 600 | |
| 601 | // CPU feature flags. |
| 602 | enum CpuFeature { |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 603 | // x86 |
| 604 | SSE4_1, |
| 605 | SSE3, |
| 606 | SAHF, |
| 607 | AVX, |
| 608 | FMA3, |
| 609 | // ARM |
| 610 | VFP3, |
| 611 | ARMv7, |
| 612 | ARMv8, |
| 613 | SUDIV, |
| 614 | MLS, |
| 615 | UNALIGNED_ACCESSES, |
| 616 | MOVW_MOVT_IMMEDIATE_LOADS, |
| 617 | VFP32DREGS, |
| 618 | NEON, |
| 619 | // MIPS, MIPS64 |
| 620 | FPU, |
| 621 | FP64FPU, |
| 622 | MIPSr1, |
| 623 | MIPSr2, |
| 624 | MIPSr6, |
| 625 | // ARM64 |
| 626 | ALWAYS_ALIGN_CSP, |
| 627 | COHERENT_CACHE, |
| 628 | NUMBER_OF_CPU_FEATURES |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 629 | }; |
| 630 | |
| 631 | |
| 632 | // Used to specify if a macro instruction must perform a smi check on tagged |
| 633 | // values. |
| 634 | enum SmiCheckType { |
| 635 | DONT_DO_SMI_CHECK, |
| 636 | DO_SMI_CHECK |
| 637 | }; |
| 638 | |
| 639 | |
| 640 | enum ScopeType { |
| 641 | EVAL_SCOPE, // The top-level scope for an eval source. |
| 642 | FUNCTION_SCOPE, // The top-level scope for a function. |
| 643 | MODULE_SCOPE, // The scope introduced by a module literal |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 644 | SCRIPT_SCOPE, // The top-level scope for a script or a top-level eval. |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 645 | CATCH_SCOPE, // The scope introduced by catch. |
| 646 | BLOCK_SCOPE, // The scope introduced by a new block. |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 647 | WITH_SCOPE, // The scope introduced by with. |
| 648 | ARROW_SCOPE // The top-level scope for an arrow function literal. |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 649 | }; |
| 650 | |
| 651 | |
| 652 | const uint32_t kHoleNanUpper32 = 0x7FFFFFFF; |
| 653 | const uint32_t kHoleNanLower32 = 0xFFFFFFFF; |
| 654 | const uint32_t kNaNOrInfinityLowerBoundUpper32 = 0x7FF00000; |
| 655 | |
| 656 | const uint64_t kHoleNanInt64 = |
| 657 | (static_cast<uint64_t>(kHoleNanUpper32) << 32) | kHoleNanLower32; |
| 658 | const uint64_t kLastNonNaNInt64 = |
| 659 | (static_cast<uint64_t>(kNaNOrInfinityLowerBoundUpper32) << 32); |
| 660 | |
| 661 | |
| 662 | // The order of this enum has to be kept in sync with the predicates below. |
| 663 | enum VariableMode { |
| 664 | // User declared variables: |
| 665 | VAR, // declared via 'var', and 'function' declarations |
| 666 | |
| 667 | CONST_LEGACY, // declared via legacy 'const' declarations |
| 668 | |
| 669 | LET, // declared via 'let' declarations (first lexical) |
| 670 | |
| 671 | CONST, // declared via 'const' declarations |
| 672 | |
| 673 | MODULE, // declared via 'module' declaration (last lexical) |
| 674 | |
| 675 | // Variables introduced by the compiler: |
| 676 | INTERNAL, // like VAR, but not user-visible (may or may not |
| 677 | // be in a context) |
| 678 | |
| 679 | TEMPORARY, // temporary variables (not user-visible), stack-allocated |
| 680 | // unless the scope as a whole has forced context allocation |
| 681 | |
| 682 | DYNAMIC, // always require dynamic lookup (we don't know |
| 683 | // the declaration) |
| 684 | |
| 685 | DYNAMIC_GLOBAL, // requires dynamic lookup, but we know that the |
| 686 | // variable is global unless it has been shadowed |
| 687 | // by an eval-introduced variable |
| 688 | |
| 689 | DYNAMIC_LOCAL // requires dynamic lookup, but we know that the |
| 690 | // variable is local and where it is unless it |
| 691 | // has been shadowed by an eval-introduced |
| 692 | // variable |
| 693 | }; |
| 694 | |
| 695 | |
| 696 | inline bool IsDynamicVariableMode(VariableMode mode) { |
| 697 | return mode >= DYNAMIC && mode <= DYNAMIC_LOCAL; |
| 698 | } |
| 699 | |
| 700 | |
| 701 | inline bool IsDeclaredVariableMode(VariableMode mode) { |
| 702 | return mode >= VAR && mode <= MODULE; |
| 703 | } |
| 704 | |
| 705 | |
| 706 | inline bool IsLexicalVariableMode(VariableMode mode) { |
| 707 | return mode >= LET && mode <= MODULE; |
| 708 | } |
| 709 | |
| 710 | |
| 711 | inline bool IsImmutableVariableMode(VariableMode mode) { |
| 712 | return (mode >= CONST && mode <= MODULE) || mode == CONST_LEGACY; |
| 713 | } |
| 714 | |
| 715 | |
| 716 | // ES6 Draft Rev3 10.2 specifies declarative environment records with mutable |
| 717 | // and immutable bindings that can be in two states: initialized and |
| 718 | // uninitialized. In ES5 only immutable bindings have these two states. When |
| 719 | // accessing a binding, it needs to be checked for initialization. However in |
| 720 | // the following cases the binding is initialized immediately after creation |
| 721 | // so the initialization check can always be skipped: |
| 722 | // 1. Var declared local variables. |
| 723 | // var foo; |
| 724 | // 2. A local variable introduced by a function declaration. |
| 725 | // function foo() {} |
| 726 | // 3. Parameters |
| 727 | // function x(foo) {} |
| 728 | // 4. Catch bound variables. |
| 729 | // try {} catch (foo) {} |
| 730 | // 6. Function variables of named function expressions. |
| 731 | // var x = function foo() {} |
| 732 | // 7. Implicit binding of 'this'. |
| 733 | // 8. Implicit binding of 'arguments' in functions. |
| 734 | // |
| 735 | // ES5 specified object environment records which are introduced by ES elements |
| 736 | // such as Program and WithStatement that associate identifier bindings with the |
| 737 | // properties of some object. In the specification only mutable bindings exist |
| 738 | // (which may be non-writable) and have no distinct initialization step. However |
| 739 | // V8 allows const declarations in global code with distinct creation and |
| 740 | // initialization steps which are represented by non-writable properties in the |
| 741 | // global object. As a result also these bindings need to be checked for |
| 742 | // initialization. |
| 743 | // |
| 744 | // The following enum specifies a flag that indicates if the binding needs a |
| 745 | // distinct initialization step (kNeedsInitialization) or if the binding is |
| 746 | // immediately initialized upon creation (kCreatedInitialized). |
| 747 | enum InitializationFlag { |
| 748 | kNeedsInitialization, |
| 749 | kCreatedInitialized |
| 750 | }; |
| 751 | |
| 752 | |
| 753 | enum MaybeAssignedFlag { kNotAssigned, kMaybeAssigned }; |
| 754 | |
| 755 | |
| 756 | enum ClearExceptionFlag { |
| 757 | KEEP_EXCEPTION, |
| 758 | CLEAR_EXCEPTION |
| 759 | }; |
| 760 | |
| 761 | |
| 762 | enum MinusZeroMode { |
| 763 | TREAT_MINUS_ZERO_AS_ZERO, |
| 764 | FAIL_ON_MINUS_ZERO |
| 765 | }; |
| 766 | |
| 767 | |
| 768 | enum Signedness { kSigned, kUnsigned }; |
| 769 | |
| 770 | |
| 771 | enum FunctionKind { |
| 772 | kNormalFunction = 0, |
| 773 | kArrowFunction = 1, |
| 774 | kGeneratorFunction = 2, |
| 775 | kConciseMethod = 4, |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 776 | kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod, |
| 777 | kDefaultConstructor = 8 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 778 | }; |
| 779 | |
| 780 | |
| 781 | inline bool IsValidFunctionKind(FunctionKind kind) { |
| 782 | return kind == FunctionKind::kNormalFunction || |
| 783 | kind == FunctionKind::kArrowFunction || |
| 784 | kind == FunctionKind::kGeneratorFunction || |
| 785 | kind == FunctionKind::kConciseMethod || |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 786 | kind == FunctionKind::kConciseGeneratorMethod || |
| 787 | kind == FunctionKind::kDefaultConstructor; |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 788 | } |
| 789 | |
| 790 | |
| 791 | inline bool IsArrowFunction(FunctionKind kind) { |
| 792 | DCHECK(IsValidFunctionKind(kind)); |
| 793 | return kind & FunctionKind::kArrowFunction; |
| 794 | } |
| 795 | |
| 796 | |
| 797 | inline bool IsGeneratorFunction(FunctionKind kind) { |
| 798 | DCHECK(IsValidFunctionKind(kind)); |
| 799 | return kind & FunctionKind::kGeneratorFunction; |
| 800 | } |
| 801 | |
| 802 | |
| 803 | inline bool IsConciseMethod(FunctionKind kind) { |
| 804 | DCHECK(IsValidFunctionKind(kind)); |
| 805 | return kind & FunctionKind::kConciseMethod; |
| 806 | } |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame^] | 807 | |
| 808 | |
| 809 | inline bool IsDefaultConstructor(FunctionKind kind) { |
| 810 | DCHECK(IsValidFunctionKind(kind)); |
| 811 | return kind & FunctionKind::kDefaultConstructor; |
| 812 | } |
| 813 | |
| 814 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 815 | } } // namespace v8::internal |
| 816 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 817 | namespace i = v8::internal; |
| 818 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 819 | #endif // V8_GLOBALS_H_ |