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
3 // found in the LICENSE file.
8 #include "include/v8stdint.h"
10 #include "src/base/build_config.h"
11 #include "src/base/logging.h"
12 #include "src/base/macros.h"
14 // Unfortunately, the INFINITY macro cannot be used with the '-pedantic'
15 // warning flag and certain versions of GCC due to a bug:
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
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)
20 # include <limits> // NOLINT
21 # define V8_INFINITY std::numeric_limits<double>::infinity()
23 # define V8_INFINITY HUGE_VAL
25 # define V8_INFINITY INFINITY
28 #if V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_ARM || \
30 #define V8_TURBOFAN_BACKEND 1
32 #define V8_TURBOFAN_BACKEND 0
34 #if V8_TURBOFAN_BACKEND && !(V8_OS_WIN && V8_TARGET_ARCH_X64)
35 #define V8_TURBOFAN_TARGET 1
37 #define V8_TURBOFAN_TARGET 0
50 // Determine whether we are running in a simulated environment.
51 // Setting USE_SIMULATOR explicitly from the build script will force
52 // the use of a simulated environment.
53 #if !defined(USE_SIMULATOR)
54 #if (V8_TARGET_ARCH_ARM64 && !V8_HOST_ARCH_ARM64)
55 #define USE_SIMULATOR 1
57 #if (V8_TARGET_ARCH_ARM && !V8_HOST_ARCH_ARM)
58 #define USE_SIMULATOR 1
60 #if (V8_TARGET_ARCH_MIPS && !V8_HOST_ARCH_MIPS)
61 #define USE_SIMULATOR 1
63 #if (V8_TARGET_ARCH_MIPS64 && !V8_HOST_ARCH_MIPS64)
64 #define USE_SIMULATOR 1
68 // Determine whether the architecture uses an out-of-line constant pool.
69 #define V8_OOL_CONSTANT_POOL 0
71 #ifdef V8_TARGET_ARCH_ARM
72 // Set stack limit lower for ARM than for other architectures because
73 // stack allocating MacroAssembler takes 120K bytes.
74 // See issue crbug.com/405338
75 #define V8_DEFAULT_STACK_SIZE_KB 864
77 // Slightly less than 1MB, since Windows' default stack size for
78 // the main execution thread is 1MB for both 32 and 64-bit.
79 #define V8_DEFAULT_STACK_SIZE_KB 984
83 // Support for alternative bool type. This is only enabled if the code is
84 // compiled with USE_MYBOOL defined. This catches some nasty type bugs.
85 // For instance, 'bool b = "false";' results in b == true! This is a hidden
87 // However, redefining the bool type does have some negative impact on some
88 // platforms. It gives rise to compiler warnings (i.e. with
89 // MSVC) in the API header files when mixing code that uses the standard
90 // bool with code that uses the redefined version.
91 // This does not actually belong in the platform code, but needs to be
92 // defined here because the platform code uses bool, and platform.h is
93 // include very early in the main include file.
96 typedef unsigned int __my_bool__;
97 #define bool __my_bool__ // use 'indirection' to avoid name clashes
100 typedef uint8_t byte;
101 typedef byte* Address;
103 // -----------------------------------------------------------------------------
107 const int MB = KB * KB;
108 const int GB = KB * KB * KB;
109 const int kMaxInt = 0x7FFFFFFF;
110 const int kMinInt = -kMaxInt - 1;
111 const int kMaxInt8 = (1 << 7) - 1;
112 const int kMinInt8 = -(1 << 7);
113 const int kMaxUInt8 = (1 << 8) - 1;
114 const int kMinUInt8 = 0;
115 const int kMaxInt16 = (1 << 15) - 1;
116 const int kMinInt16 = -(1 << 15);
117 const int kMaxUInt16 = (1 << 16) - 1;
118 const int kMinUInt16 = 0;
120 const uint32_t kMaxUInt32 = 0xFFFFFFFFu;
122 const int kCharSize = sizeof(char); // NOLINT
123 const int kShortSize = sizeof(short); // NOLINT
124 const int kIntSize = sizeof(int); // NOLINT
125 const int kInt32Size = sizeof(int32_t); // NOLINT
126 const int kInt64Size = sizeof(int64_t); // NOLINT
127 const int kDoubleSize = sizeof(double); // NOLINT
128 const int kIntptrSize = sizeof(intptr_t); // NOLINT
129 const int kPointerSize = sizeof(void*); // NOLINT
130 #if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT
131 const int kRegisterSize = kPointerSize + kPointerSize;
133 const int kRegisterSize = kPointerSize;
135 const int kPCOnStackSize = kRegisterSize;
136 const int kFPOnStackSize = kRegisterSize;
138 const int kDoubleSizeLog2 = 3;
140 #if V8_HOST_ARCH_64_BIT
141 const int kPointerSizeLog2 = 3;
142 const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000);
143 const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF);
144 const bool kRequiresCodeRange = true;
145 const size_t kMaximalCodeRangeSize = 512 * MB;
147 const int kPointerSizeLog2 = 2;
148 const intptr_t kIntptrSignBit = 0x80000000;
149 const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu;
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;
155 const bool kRequiresCodeRange = false;
156 const size_t kMaximalCodeRangeSize = 0 * MB;
160 STATIC_ASSERT(kPointerSize == (1 << kPointerSizeLog2));
162 const int kBitsPerByte = 8;
163 const int kBitsPerByteLog2 = 3;
164 const int kBitsPerPointer = kPointerSize * kBitsPerByte;
165 const int kBitsPerInt = kIntSize * kBitsPerByte;
167 // IEEE 754 single precision floating point number bit layout.
168 const uint32_t kBinary32SignMask = 0x80000000u;
169 const uint32_t kBinary32ExponentMask = 0x7f800000u;
170 const uint32_t kBinary32MantissaMask = 0x007fffffu;
171 const int kBinary32ExponentBias = 127;
172 const int kBinary32MaxExponent = 0xFE;
173 const int kBinary32MinExponent = 0x01;
174 const int kBinary32MantissaBits = 23;
175 const int kBinary32ExponentShift = 23;
177 // Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no
179 const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
181 // Latin1/UTF-16 constants
182 // Code-point values in Unicode 4.0 are 21 bits wide.
183 // Code units in UTF-16 are 16 bits wide.
184 typedef uint16_t uc16;
185 typedef int32_t uc32;
186 const int kOneByteSize = kCharSize;
187 const int kUC16Size = sizeof(uc16); // NOLINT
190 // Round up n to be a multiple of sz, where sz is a power of 2.
191 #define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))
194 // FUNCTION_ADDR(f) gets the address of a C function f.
195 #define FUNCTION_ADDR(f) \
196 (reinterpret_cast<v8::internal::Address>(reinterpret_cast<intptr_t>(f)))
199 // FUNCTION_CAST<F>(addr) casts an address into a function
200 // of type F. Used to invoke generated code from within C.
201 template <typename F>
202 F FUNCTION_CAST(Address addr) {
203 return reinterpret_cast<F>(reinterpret_cast<intptr_t>(addr));
207 // -----------------------------------------------------------------------------
208 // Forward declarations for frequently used classes
209 // (sorted alphabetically)
211 class FreeStoreAllocationPolicy;
212 template <typename T, class P = FreeStoreAllocationPolicy> class List;
214 // -----------------------------------------------------------------------------
215 // Declarations for use in both the preparser and the rest of V8.
217 // The Strict Mode (ECMA-262 5th edition, 4.2.2).
219 enum StrictMode { SLOPPY, STRICT };
222 // Mask for the sign bit in a smi.
223 const intptr_t kSmiSignMask = kIntptrSignBit;
225 const int kObjectAlignmentBits = kPointerSizeLog2;
226 const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits;
227 const intptr_t kObjectAlignmentMask = kObjectAlignment - 1;
229 // Desired alignment for pointers.
230 const intptr_t kPointerAlignment = (1 << kPointerSizeLog2);
231 const intptr_t kPointerAlignmentMask = kPointerAlignment - 1;
233 // Desired alignment for double values.
234 const intptr_t kDoubleAlignment = 8;
235 const intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1;
237 // Desired alignment for generated code is 32 bytes (to improve cache line
239 const int kCodeAlignmentBits = 5;
240 const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits;
241 const intptr_t kCodeAlignmentMask = kCodeAlignment - 1;
243 // The owner field of a page is tagged with the page header tag. We need that
244 // to find out if a slot is part of a large object. If we mask out the lower
245 // 0xfffff bits (1M pages), go to the owner offset, and see that this field
246 // is tagged with the page header tag, we can just look up the owner.
247 // Otherwise, we know that we are somewhere (not within the first 1M) in a
249 const int kPageHeaderTag = 3;
250 const int kPageHeaderTagSize = 2;
251 const intptr_t kPageHeaderTagMask = (1 << kPageHeaderTagSize) - 1;
254 // Zap-value: The value used for zapping dead objects.
255 // Should be a recognizable hex value tagged as a failure.
256 #ifdef V8_HOST_ARCH_64_BIT
257 const Address kZapValue =
258 reinterpret_cast<Address>(V8_UINT64_C(0xdeadbeedbeadbeef));
259 const Address kHandleZapValue =
260 reinterpret_cast<Address>(V8_UINT64_C(0x1baddead0baddeaf));
261 const Address kGlobalHandleZapValue =
262 reinterpret_cast<Address>(V8_UINT64_C(0x1baffed00baffedf));
263 const Address kFromSpaceZapValue =
264 reinterpret_cast<Address>(V8_UINT64_C(0x1beefdad0beefdaf));
265 const uint64_t kDebugZapValue = V8_UINT64_C(0xbadbaddbbadbaddb);
266 const uint64_t kSlotsZapValue = V8_UINT64_C(0xbeefdeadbeefdeef);
267 const uint64_t kFreeListZapValue = 0xfeed1eaffeed1eaf;
269 const Address kZapValue = reinterpret_cast<Address>(0xdeadbeef);
270 const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddeaf);
271 const Address kGlobalHandleZapValue = reinterpret_cast<Address>(0xbaffedf);
272 const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdaf);
273 const uint32_t kSlotsZapValue = 0xbeefdeef;
274 const uint32_t kDebugZapValue = 0xbadbaddb;
275 const uint32_t kFreeListZapValue = 0xfeed1eaf;
278 const int kCodeZapValue = 0xbadc0de;
280 // On Intel architecture, cache line size is 64 bytes.
281 // On ARM it may be less (32 bytes), but as far this constant is
282 // used for aligning data, it doesn't hurt to align on a greater value.
283 #define PROCESSOR_CACHE_LINE_SIZE 64
285 // Constants relevant to double precision floating point numbers.
286 // If looking only at the top 32 bits, the QNaN mask is bits 19 to 30.
287 const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32);
290 // -----------------------------------------------------------------------------
291 // Forward declarations for frequently used classes
305 class DescriptorArray;
306 class TransitionArray;
307 class ExternalReference;
309 class FunctionTemplateInfo;
311 class SeededNumberDictionary;
312 class UnseededNumberDictionary;
313 class NameDictionary;
314 template <typename T> class MaybeHandle;
315 template <typename T> class Handle;
319 class InterceptorInfo;
325 class LargeObjectSpace;
327 class MacroAssembler;
330 class MarkCompactCollector;
339 template <typename Config, class Allocator = FreeStoreAllocationPolicy>
347 class MessageLocation;
349 typedef bool (*WeakSlotCallback)(Object** pointer);
351 typedef bool (*WeakSlotCallbackWithHeap)(Heap* heap, Object** pointer);
353 // -----------------------------------------------------------------------------
356 // NOTE: SpaceIterator depends on AllocationSpace enumeration values being
358 enum AllocationSpace {
359 NEW_SPACE, // Semispaces collected with copying collector.
360 OLD_POINTER_SPACE, // May contain pointers to new space.
361 OLD_DATA_SPACE, // Must not have pointers to new space.
362 CODE_SPACE, // No pointers to new space, marked executable.
363 MAP_SPACE, // Only and all map objects.
364 CELL_SPACE, // Only and all cell objects.
365 PROPERTY_CELL_SPACE, // Only and all global property cell objects.
366 LO_SPACE, // Promoted large objects.
367 INVALID_SPACE, // Only used in AllocationResult to signal success.
369 FIRST_SPACE = NEW_SPACE,
370 LAST_SPACE = LO_SPACE,
371 FIRST_PAGED_SPACE = OLD_POINTER_SPACE,
372 LAST_PAGED_SPACE = PROPERTY_CELL_SPACE
374 const int kSpaceTagSize = 3;
375 const int kSpaceTagMask = (1 << kSpaceTagSize) - 1;
378 // A flag that indicates whether objects should be pretenured when
379 // allocated (allocated directly into the old generation) or not
380 // (allocated in the young generation if the object size and type
382 enum PretenureFlag { NOT_TENURED, TENURED };
384 enum MinimumCapacity {
385 USE_DEFAULT_MINIMUM_CAPACITY,
386 USE_CUSTOM_MINIMUM_CAPACITY
389 enum GarbageCollector { SCAVENGER, MARK_COMPACTOR };
391 enum Executability { NOT_EXECUTABLE, EXECUTABLE };
395 VISIT_ALL_IN_SCAVENGE,
396 VISIT_ALL_IN_SWEEP_NEWSPACE,
400 // Flag indicating whether code is built into the VM (one of the natives files).
401 enum NativesFlag { NOT_NATIVES_CODE, NATIVES_CODE };
404 // A CodeDesc describes a buffer holding instructions and relocation
405 // information. The instructions start at the beginning of the buffer
406 // and grow forward, the relocation information starts at the end of
407 // the buffer and grows backward.
409 // |<--------------- buffer_size ---------------->|
410 // |<-- instr_size -->| |<-- reloc_size -->|
411 // +==================+========+==================+
412 // | instructions | free | reloc info |
413 // +==================+========+==================+
427 // Callback function used for iterating objects in heap spaces,
428 // for example, scanning heap objects.
429 typedef int (*HeapObjectCallback)(HeapObject* obj);
432 // Callback function used for checking constraints when copying/relocating
433 // objects. Returns true if an object can be copied/relocated from its
434 // old_addr to a new_addr.
435 typedef bool (*ConstraintCallback)(Address new_addr, Address old_addr);
438 // Callback function on inline caches, used for iterating over inline caches
440 typedef void (*InlineCacheCallback)(Code* code, Address ic);
443 // State for inline cache call sites. Aliased as IC::State.
444 enum InlineCacheState {
445 // Has never been executed.
447 // Has been executed but monomorhic state has been delayed.
449 // Has been executed and only one receiver type has been seen.
451 // Check failed due to prototype (or map deprecation).
453 // Multiple receiver types have been seen.
455 // Many receiver types have been seen.
457 // A generic handler is installed and no extra typefeedback is recorded.
459 // Special state for debug break or step in prepare stubs.
461 // Type-vector-based ICs have a default state, with the full calculation
462 // of IC state only determined by a look at the IC and the typevector
468 enum CallFunctionFlags {
469 NO_CALL_FUNCTION_FLAGS,
471 // Always wrap the receiver and call to the JSFunction. Only use this flag
472 // both the receiver type and the target method are statically known.
477 enum CallConstructorFlags {
478 NO_CALL_CONSTRUCTOR_FLAGS,
479 // The call target is cached in the instruction stream.
480 RECORD_CONSTRUCTOR_TARGET
484 enum CacheHolderFlag {
486 kCacheOnPrototypeReceiverIsDictionary,
487 kCacheOnPrototypeReceiverIsPrimitive,
492 // The Store Buffer (GC).
494 kStoreBufferFullEvent,
495 kStoreBufferStartScanningPagesEvent,
496 kStoreBufferScanningPageEvent
500 typedef void (*StoreBufferCallback)(Heap* heap,
502 StoreBufferEvent event);
505 // Union used for fast testing of specific double values.
506 union DoubleRepresentation {
509 DoubleRepresentation(double x) { value = x; }
510 bool operator==(const DoubleRepresentation& other) const {
511 return bits == other.bits;
516 // Union used for customized checking of the IEEE double types
517 // inlined within v8 runtime, rather than going to the underlying
518 // platform headers and libraries
519 union IeeeDoubleLittleEndianArchType {
522 unsigned int man_low :32;
523 unsigned int man_high :20;
524 unsigned int exp :11;
525 unsigned int sign :1;
530 union IeeeDoubleBigEndianArchType {
533 unsigned int sign :1;
534 unsigned int exp :11;
535 unsigned int man_high :20;
536 unsigned int man_low :32;
542 struct AccessorDescriptor {
543 Object* (*getter)(Isolate* isolate, Object* object, void* data);
545 Isolate* isolate, JSObject* object, Object* value, void* data);
550 // Logging and profiling. A StateTag represents a possible state of
551 // the VM. The logger maintains a stack of these. Creating a VMState
552 // object enters a state by pushing on the stack, and destroying a
553 // VMState object leaves a state by popping the current state from the
566 // -----------------------------------------------------------------------------
571 #define HAS_SMI_TAG(value) \
572 ((reinterpret_cast<intptr_t>(value) & kSmiTagMask) == kSmiTag)
574 #define HAS_FAILURE_TAG(value) \
575 ((reinterpret_cast<intptr_t>(value) & kFailureTagMask) == kFailureTag)
577 // OBJECT_POINTER_ALIGN returns the value aligned as a HeapObject pointer
578 #define OBJECT_POINTER_ALIGN(value) \
579 (((value) + kObjectAlignmentMask) & ~kObjectAlignmentMask)
581 // POINTER_SIZE_ALIGN returns the value aligned as a pointer.
582 #define POINTER_SIZE_ALIGN(value) \
583 (((value) + kPointerAlignmentMask) & ~kPointerAlignmentMask)
585 // CODE_POINTER_ALIGN returns the value aligned as a generated code segment.
586 #define CODE_POINTER_ALIGN(value) \
587 (((value) + kCodeAlignmentMask) & ~kCodeAlignmentMask)
589 // Support for tracking C++ memory allocation. Insert TRACK_MEMORY("Fisk")
590 // inside a C++ class and new and delete will be overloaded so logging is
592 // This file (globals.h) is included before log.h, so we use direct calls to
593 // the Logger rather than the LOG macro.
595 #define TRACK_MEMORY(name) \
596 void* operator new(size_t size) { \
597 void* result = ::operator new(size); \
598 Logger::NewEventStatic(name, result, size); \
601 void operator delete(void* object) { \
602 Logger::DeleteEventStatic(name, object); \
603 ::operator delete(object); \
606 #define TRACK_MEMORY(name)
610 // CPU feature flags.
622 MOVW_MOVT_IMMEDIATE_LOADS,
633 NUMBER_OF_CPU_FEATURES
637 // Used to specify if a macro instruction must perform a smi check on tagged
646 EVAL_SCOPE, // The top-level scope for an eval source.
647 FUNCTION_SCOPE, // The top-level scope for a function.
648 MODULE_SCOPE, // The scope introduced by a module literal
649 GLOBAL_SCOPE, // The top-level scope for a program or a top-level eval.
650 CATCH_SCOPE, // The scope introduced by catch.
651 BLOCK_SCOPE, // The scope introduced by a new block.
652 WITH_SCOPE // The scope introduced by with.
656 const uint32_t kHoleNanUpper32 = 0x7FFFFFFF;
657 const uint32_t kHoleNanLower32 = 0xFFFFFFFF;
658 const uint32_t kNaNOrInfinityLowerBoundUpper32 = 0x7FF00000;
660 const uint64_t kHoleNanInt64 =
661 (static_cast<uint64_t>(kHoleNanUpper32) << 32) | kHoleNanLower32;
662 const uint64_t kLastNonNaNInt64 =
663 (static_cast<uint64_t>(kNaNOrInfinityLowerBoundUpper32) << 32);
666 // The order of this enum has to be kept in sync with the predicates below.
668 // User declared variables:
669 VAR, // declared via 'var', and 'function' declarations
671 CONST_LEGACY, // declared via legacy 'const' declarations
673 LET, // declared via 'let' declarations (first lexical)
675 CONST, // declared via 'const' declarations
677 MODULE, // declared via 'module' declaration (last lexical)
679 // Variables introduced by the compiler:
680 INTERNAL, // like VAR, but not user-visible (may or may not
683 TEMPORARY, // temporary variables (not user-visible), stack-allocated
684 // unless the scope as a whole has forced context allocation
686 DYNAMIC, // always require dynamic lookup (we don't know
689 DYNAMIC_GLOBAL, // requires dynamic lookup, but we know that the
690 // variable is global unless it has been shadowed
691 // by an eval-introduced variable
693 DYNAMIC_LOCAL // requires dynamic lookup, but we know that the
694 // variable is local and where it is unless it
695 // has been shadowed by an eval-introduced
700 inline bool IsDynamicVariableMode(VariableMode mode) {
701 return mode >= DYNAMIC && mode <= DYNAMIC_LOCAL;
705 inline bool IsDeclaredVariableMode(VariableMode mode) {
706 return mode >= VAR && mode <= MODULE;
710 inline bool IsLexicalVariableMode(VariableMode mode) {
711 return mode >= LET && mode <= MODULE;
715 inline bool IsImmutableVariableMode(VariableMode mode) {
716 return (mode >= CONST && mode <= MODULE) || mode == CONST_LEGACY;
720 // ES6 Draft Rev3 10.2 specifies declarative environment records with mutable
721 // and immutable bindings that can be in two states: initialized and
722 // uninitialized. In ES5 only immutable bindings have these two states. When
723 // accessing a binding, it needs to be checked for initialization. However in
724 // the following cases the binding is initialized immediately after creation
725 // so the initialization check can always be skipped:
726 // 1. Var declared local variables.
728 // 2. A local variable introduced by a function declaration.
731 // function x(foo) {}
732 // 4. Catch bound variables.
733 // try {} catch (foo) {}
734 // 6. Function variables of named function expressions.
735 // var x = function foo() {}
736 // 7. Implicit binding of 'this'.
737 // 8. Implicit binding of 'arguments' in functions.
739 // ES5 specified object environment records which are introduced by ES elements
740 // such as Program and WithStatement that associate identifier bindings with the
741 // properties of some object. In the specification only mutable bindings exist
742 // (which may be non-writable) and have no distinct initialization step. However
743 // V8 allows const declarations in global code with distinct creation and
744 // initialization steps which are represented by non-writable properties in the
745 // global object. As a result also these bindings need to be checked for
748 // The following enum specifies a flag that indicates if the binding needs a
749 // distinct initialization step (kNeedsInitialization) or if the binding is
750 // immediately initialized upon creation (kCreatedInitialized).
751 enum InitializationFlag {
752 kNeedsInitialization,
757 enum MaybeAssignedFlag { kNotAssigned, kMaybeAssigned };
760 enum ClearExceptionFlag {
767 TREAT_MINUS_ZERO_AS_ZERO,
772 enum Signedness { kSigned, kUnsigned };
778 kGeneratorFunction = 2,
780 kConciseGeneratorMethod = kGeneratorFunction | kConciseMethod
784 inline bool IsValidFunctionKind(FunctionKind kind) {
785 return kind == FunctionKind::kNormalFunction ||
786 kind == FunctionKind::kArrowFunction ||
787 kind == FunctionKind::kGeneratorFunction ||
788 kind == FunctionKind::kConciseMethod ||
789 kind == FunctionKind::kConciseGeneratorMethod;
793 inline bool IsArrowFunction(FunctionKind kind) {
794 DCHECK(IsValidFunctionKind(kind));
795 return kind & FunctionKind::kArrowFunction;
799 inline bool IsGeneratorFunction(FunctionKind kind) {
800 DCHECK(IsValidFunctionKind(kind));
801 return kind & FunctionKind::kGeneratorFunction;
805 inline bool IsConciseMethod(FunctionKind kind) {
806 DCHECK(IsValidFunctionKind(kind));
807 return kind & FunctionKind::kConciseMethod;
809 } } // namespace v8::internal
811 namespace i = v8::internal;
813 #endif // V8_GLOBALS_H_