diff options
author | Michaël Zasso <targos@protonmail.com> | 2016-09-06 22:49:51 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2016-09-22 09:51:19 +0200 |
commit | ec02b811a8a5c999bab4de312be2d732b7d9d50b (patch) | |
tree | ca3068017254f238cf413a451c57a803572983a4 /deps/v8/src/globals.h | |
parent | d2eb7ce0105369a9cad82787cb33a665e9bd00ad (diff) | |
download | android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.gz android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.tar.bz2 android-node-v8-ec02b811a8a5c999bab4de312be2d732b7d9d50b.zip |
deps: update V8 to 5.4.500.27
Pick up latest commit from the 5.4-lkgr branch.
deps: edit V8 gitignore to allow trace event copy
deps: update V8 trace event to 315bf1e2d45be7d53346c31cfcc37424a32c30c8
deps: edit V8 gitignore to allow gtest_prod.h copy
deps: update V8 gtest to 6f8a66431cb592dad629028a50b3dd418a408c87
PR-URL: https://github.com/nodejs/node/pull/8317
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'deps/v8/src/globals.h')
-rw-r--r-- | deps/v8/src/globals.h | 222 |
1 files changed, 169 insertions, 53 deletions
diff --git a/deps/v8/src/globals.h b/deps/v8/src/globals.h index e7ac2b9f7f..0d02f77fd6 100644 --- a/deps/v8/src/globals.h +++ b/deps/v8/src/globals.h @@ -124,11 +124,6 @@ const int kFloatSize = sizeof(float); // NOLINT const int kDoubleSize = sizeof(double); // NOLINT const int kIntptrSize = sizeof(intptr_t); // NOLINT const int kPointerSize = sizeof(void*); // NOLINT -#if V8_TARGET_ARCH_ARM64 -const int kFrameAlignmentInBytes = 2 * kPointerSize; -#else -const int kFrameAlignmentInBytes = kPointerSize; -#endif #if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT const int kRegisterSize = kPointerSize + kPointerSize; #else @@ -155,12 +150,21 @@ const bool kRequiresCodeRange = true; // encoded immediate, the addresses have to be in range of 256MB aligned // region. Used only for large object space. const size_t kMaximalCodeRangeSize = 256 * MB; +const size_t kCodeRangeAreaAlignment = 256 * MB; +#elif V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX +const size_t kMaximalCodeRangeSize = 512 * MB; +const size_t kCodeRangeAreaAlignment = 64 * KB; // OS page on PPC Linux #else const size_t kMaximalCodeRangeSize = 512 * MB; +const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page. #endif #if V8_OS_WIN const size_t kMinimumCodeRangeSize = 4 * MB; const size_t kReservedCodeRangePages = 1; +// On PPC Linux PageSize is 4MB +#elif V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX +const size_t kMinimumCodeRangeSize = 12 * MB; +const size_t kReservedCodeRangePages = 0; #else const size_t kMinimumCodeRangeSize = 3 * MB; const size_t kReservedCodeRangePages = 0; @@ -174,15 +178,25 @@ const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu; const bool kRequiresCodeRange = true; const size_t kMaximalCodeRangeSize = 256 * MB; const size_t kMinimumCodeRangeSize = 3 * MB; -const size_t kReservedCodeRangePages = 0; +const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page. +#elif V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX +const bool kRequiresCodeRange = false; +const size_t kMaximalCodeRangeSize = 0 * MB; +const size_t kMinimumCodeRangeSize = 0 * MB; +const size_t kCodeRangeAreaAlignment = 64 * KB; // OS page on PPC Linux #else const bool kRequiresCodeRange = false; const size_t kMaximalCodeRangeSize = 0 * MB; const size_t kMinimumCodeRangeSize = 0 * MB; -const size_t kReservedCodeRangePages = 0; +const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page. #endif +const size_t kReservedCodeRangePages = 0; #endif +// The external allocation limit should be below 256 MB on all architectures +// to avoid that resource-constrained embedders run low on memory. +const int kExternalAllocationLimit = 192 * 1024 * 1024; + STATIC_ASSERT(kPointerSize == (1 << kPointerSizeLog2)); const int kBitsPerByte = 8; @@ -258,8 +272,7 @@ template <typename T, class P = FreeStoreAllocationPolicy> class List; // The Strict Mode (ECMA-262 5th edition, 4.2.2). -enum LanguageMode { SLOPPY, STRICT, LANGUAGE_END = 3 }; - +enum LanguageMode : uint32_t { SLOPPY, STRICT, LANGUAGE_END }; inline std::ostream& operator<<(std::ostream& os, const LanguageMode& mode) { switch (mode) { @@ -290,6 +303,11 @@ inline LanguageMode construct_language_mode(bool strict_bit) { return static_cast<LanguageMode>(strict_bit); } +// This constant is used as an undefined value when passing source positions. +const int kNoSourcePosition = -1; + +// This constant is used to indicate missing deoptimization information. +const int kNoDeoptimizationId = -1; // Mask for the sign bit in a smi. const intptr_t kSmiSignMask = kIntptrSignBit; @@ -410,6 +428,8 @@ class OldSpace; class ParameterCount; class Foreign; class Scope; +class DeclarationScope; +class ModuleScope; class ScopeInfo; class Script; class Smi; @@ -457,6 +477,53 @@ enum AllocationAlignment { kSimd128Unaligned }; +// Possible outcomes for decisions. +enum class Decision : uint8_t { kUnknown, kTrue, kFalse }; + +inline size_t hash_value(Decision decision) { + return static_cast<uint8_t>(decision); +} + +inline std::ostream& operator<<(std::ostream& os, Decision decision) { + switch (decision) { + case Decision::kUnknown: + return os << "Unknown"; + case Decision::kTrue: + return os << "True"; + case Decision::kFalse: + return os << "False"; + } + UNREACHABLE(); + return os; +} + +// Supported write barrier modes. +enum WriteBarrierKind : uint8_t { + kNoWriteBarrier, + kMapWriteBarrier, + kPointerWriteBarrier, + kFullWriteBarrier +}; + +inline size_t hash_value(WriteBarrierKind kind) { + return static_cast<uint8_t>(kind); +} + +inline std::ostream& operator<<(std::ostream& os, WriteBarrierKind kind) { + switch (kind) { + case kNoWriteBarrier: + return os << "NoWriteBarrier"; + case kMapWriteBarrier: + return os << "MapWriteBarrier"; + case kPointerWriteBarrier: + return os << "PointerWriteBarrier"; + case kFullWriteBarrier: + return os << "FullWriteBarrier"; + } + UNREACHABLE(); + return os; +} + // A flag that indicates whether objects should be pretenured when // allocated (allocated directly into the old generation) or not // (allocated in the young generation if the object size and type @@ -527,6 +594,8 @@ struct CodeDesc { int instr_size; int reloc_size; int constant_pool_size; + byte* unwinding_info; + int unwinding_info_size; Assembler* origin; }; @@ -551,18 +620,15 @@ enum InlineCacheState { // Has been executed and only one receiver type has been seen. MONOMORPHIC, // Check failed due to prototype (or map deprecation). - PROTOTYPE_FAILURE, + RECOMPUTE_HANDLER, // Multiple receiver types have been seen. POLYMORPHIC, // Many receiver types have been seen. MEGAMORPHIC, // A generic handler is installed and no extra typefeedback is recorded. GENERIC, - // Special state for debug break or step in prepare stubs. - DEBUG_STUB }; - enum CacheHolderFlag { kCacheOnPrototype, kCacheOnPrototypeReceiverIsDictionary, @@ -570,6 +636,7 @@ enum CacheHolderFlag { kCacheOnReceiver }; +enum WhereToStart { kStartAtReceiver, kStartAtPrototype }; // The Store Buffer (GC). typedef enum { @@ -583,18 +650,6 @@ typedef void (*StoreBufferCallback)(Heap* heap, MemoryChunk* page, StoreBufferEvent event); - -// Union used for fast testing of specific double values. -union DoubleRepresentation { - double value; - int64_t bits; - DoubleRepresentation(double x) { value = x; } - bool operator==(const DoubleRepresentation& other) const { - return bits == other.bits; - } -}; - - // Union used for customized checking of the IEEE double types // inlined within v8 runtime, rather than going to the underlying // platform headers and libraries @@ -619,6 +674,15 @@ union IeeeDoubleBigEndianArchType { } bits; }; +#if V8_TARGET_LITTLE_ENDIAN +typedef IeeeDoubleLittleEndianArchType IeeeDoubleArchType; +const int kIeeeDoubleMantissaWordOffset = 0; +const int kIeeeDoubleExponentWordOffset = 4; +#else +typedef IeeeDoubleBigEndianArchType IeeeDoubleArchType; +const int kIeeeDoubleMantissaWordOffset = 4; +const int kIeeeDoubleExponentWordOffset = 0; +#endif // AccessorCallback struct AccessorDescriptor { @@ -672,8 +736,6 @@ enum CpuFeature { ARMv7, ARMv8, SUDIV, - MLS, - UNALIGNED_ACCESSES, MOVW_MOVT_IMMEDIATE_LOADS, VFP32DREGS, NEON, @@ -685,7 +747,6 @@ enum CpuFeature { MIPSr6, // ARM64 ALWAYS_ALIGN_CSP, - COHERENT_CACHE, // PPC FPR_GPR_MOV, LWSYNC, @@ -694,6 +755,9 @@ enum CpuFeature { DISTINCT_OPS, GENERAL_INSTR_EXT, FLOATING_POINT_EXT, + // PPC/S390 + UNALIGNED_ACCESSES, + NUMBER_OF_CPU_FEATURES }; @@ -737,6 +801,14 @@ inline std::ostream& operator<<(std::ostream& os, TailCallMode mode) { return os; } +// Valid hints for the abstract operation OrdinaryToPrimitive, +// implemented according to ES6, section 7.1.1. +enum class OrdinaryToPrimitiveHint { kNumber, kString }; + +// Valid hints for the abstract operation ToPrimitive, +// implemented according to ES6, section 7.1.1. +enum class ToPrimitiveHint { kDefault, kNumber, kString }; + // Defines specifics about arguments object or rest parameter creation. enum class CreateArgumentsType : uint8_t { kMappedArguments, @@ -780,8 +852,16 @@ enum ScopeType { }; // The mips architecture prior to revision 5 has inverted encoding for sNaN. -#if (V8_TARGET_ARCH_MIPS && !defined(_MIPS_ARCH_MIPS32R6)) || \ - (V8_TARGET_ARCH_MIPS64 && !defined(_MIPS_ARCH_MIPS64R6)) +// The x87 FPU convert the sNaN to qNaN automatically when loading sNaN from +// memmory. +// Use mips sNaN which is a not used qNaN in x87 port as sNaN to workaround this +// issue +// for some test cases. +#if (V8_TARGET_ARCH_MIPS && !defined(_MIPS_ARCH_MIPS32R6) && \ + (!defined(USE_SIMULATOR) || !defined(_MIPS_TARGET_SIMULATOR))) || \ + (V8_TARGET_ARCH_MIPS64 && !defined(_MIPS_ARCH_MIPS64R6) && \ + (!defined(USE_SIMULATOR) || !defined(_MIPS_TARGET_SIMULATOR))) || \ + (V8_TARGET_ARCH_X87) const uint32_t kHoleNanUpper32 = 0xFFFF7FFF; const uint32_t kHoleNanLower32 = 0xFFFF7FFF; #else @@ -800,54 +880,50 @@ const double kMaxSafeInteger = 9007199254740991.0; // 2^53-1 // The order of this enum has to be kept in sync with the predicates below. enum VariableMode { // User declared variables: - VAR, // declared via 'var', and 'function' declarations - - CONST_LEGACY, // declared via legacy 'const' declarations + VAR, // declared via 'var', and 'function' declarations - LET, // declared via 'let' declarations (first lexical) + CONST_LEGACY, // declared via legacy 'const' declarations - CONST, // declared via 'const' declarations + LET, // declared via 'let' declarations (first lexical) - IMPORT, // declared via 'import' declarations (last lexical) + CONST, // declared via 'const' declarations (last lexical) // Variables introduced by the compiler: - TEMPORARY, // temporary variables (not user-visible), stack-allocated - // unless the scope as a whole has forced context allocation + TEMPORARY, // temporary variables (not user-visible), stack-allocated + // unless the scope as a whole has forced context allocation - DYNAMIC, // always require dynamic lookup (we don't know - // the declaration) + DYNAMIC, // always require dynamic lookup (we don't know + // the declaration) DYNAMIC_GLOBAL, // requires dynamic lookup, but we know that the // variable is global unless it has been shadowed // by an eval-introduced variable - DYNAMIC_LOCAL // requires dynamic lookup, but we know that the - // variable is local and where it is unless it - // has been shadowed by an eval-introduced - // variable + DYNAMIC_LOCAL // requires dynamic lookup, but we know that the + // variable is local and where it is unless it + // has been shadowed by an eval-introduced + // variable }; - inline bool IsDynamicVariableMode(VariableMode mode) { return mode >= DYNAMIC && mode <= DYNAMIC_LOCAL; } inline bool IsDeclaredVariableMode(VariableMode mode) { - return mode >= VAR && mode <= IMPORT; + return mode >= VAR && mode <= CONST; } inline bool IsLexicalVariableMode(VariableMode mode) { - return mode >= LET && mode <= IMPORT; + return mode >= LET && mode <= CONST; } inline bool IsImmutableVariableMode(VariableMode mode) { - return mode == CONST || mode == CONST_LEGACY || mode == IMPORT; + return mode == CONST || mode == CONST_LEGACY; } - enum class VariableLocation { // Before and during variable allocation, a variable whose location is // not yet determined. After allocation, a variable looked up as a @@ -878,9 +954,11 @@ enum class VariableLocation { // A named slot in a heap context. name() is the variable name in the // context object on the heap, with lookup starting at the current // context. index() is invalid. - LOOKUP -}; + LOOKUP, + // A named slot in a module's export table. + MODULE +}; // ES6 Draft Rev3 10.2 specifies declarative environment records with mutable // and immutable bindings that can be in two states: initialized and @@ -934,7 +1012,7 @@ enum MinusZeroMode { enum Signedness { kSigned, kUnsigned }; -enum FunctionKind { +enum FunctionKind : uint16_t { kNormalFunction = 0, kArrowFunction = 1 << 0, kGeneratorFunction = 1 << 1, @@ -945,11 +1023,14 @@ enum FunctionKind { kBaseConstructor = 1 << 5, kGetterFunction = 1 << 6, kSetterFunction = 1 << 7, + kAsyncFunction = 1 << 8, kAccessorFunction = kGetterFunction | kSetterFunction, kDefaultBaseConstructor = kDefaultConstructor | kBaseConstructor, kDefaultSubclassConstructor = kDefaultConstructor | kSubclassConstructor, kClassConstructor = kBaseConstructor | kSubclassConstructor | kDefaultConstructor, + kAsyncArrowFunction = kArrowFunction | kAsyncFunction, + kAsyncConciseMethod = kAsyncFunction | kConciseMethod }; inline bool IsValidFunctionKind(FunctionKind kind) { @@ -964,7 +1045,10 @@ inline bool IsValidFunctionKind(FunctionKind kind) { kind == FunctionKind::kDefaultBaseConstructor || kind == FunctionKind::kDefaultSubclassConstructor || kind == FunctionKind::kBaseConstructor || - kind == FunctionKind::kSubclassConstructor; + kind == FunctionKind::kSubclassConstructor || + kind == FunctionKind::kAsyncFunction || + kind == FunctionKind::kAsyncArrowFunction || + kind == FunctionKind::kAsyncConciseMethod; } @@ -979,6 +1063,14 @@ inline bool IsGeneratorFunction(FunctionKind kind) { return kind & FunctionKind::kGeneratorFunction; } +inline bool IsAsyncFunction(FunctionKind kind) { + DCHECK(IsValidFunctionKind(kind)); + return kind & FunctionKind::kAsyncFunction; +} + +inline bool IsResumableFunction(FunctionKind kind) { + return IsGeneratorFunction(kind) || IsAsyncFunction(kind); +} inline bool IsConciseMethod(FunctionKind kind) { DCHECK(IsValidFunctionKind(kind)); @@ -1030,9 +1122,24 @@ inline bool IsConstructable(FunctionKind kind, LanguageMode mode) { if (IsConciseMethod(kind)) return false; if (IsArrowFunction(kind)) return false; if (IsGeneratorFunction(kind)) return false; + if (IsAsyncFunction(kind)) return false; return true; } +enum class CallableType : unsigned { kJSFunction, kAny }; + +inline size_t hash_value(CallableType type) { return bit_cast<unsigned>(type); } + +inline std::ostream& operator<<(std::ostream& os, CallableType function_type) { + switch (function_type) { + case CallableType::kJSFunction: + return os << "JSFunction"; + case CallableType::kAny: + return os << "Any"; + } + UNREACHABLE(); + return os; +} inline uint32_t ObjectHash(Address address) { // All objects are at least pointer aligned, so we can remove the trailing @@ -1041,6 +1148,15 @@ inline uint32_t ObjectHash(Address address) { kPointerSizeLog2); } +// Type feedback is encoded in such a way that, we can combine the feedback +// at different points by performing an 'OR' operation. Type feedback moves +// to a more generic type when we combine feedback. +// kSignedSmall -> kNumber -> kAny +class BinaryOperationFeedback { + public: + enum { kNone = 0x00, kSignedSmall = 0x01, kNumber = 0x3, kAny = 0x7 }; +}; + } // namespace internal } // namespace v8 |