23 #if V8_TARGET_ARCH_ARM
25 #elif V8_TARGET_ARCH_ARM64
27 #elif V8_TARGET_ARCH_MIPS
29 #elif V8_TARGET_ARCH_MIPS64
339 #define INSTANCE_TYPE_LIST(V) \
341 V(ONE_BYTE_STRING_TYPE) \
342 V(CONS_STRING_TYPE) \
343 V(CONS_ONE_BYTE_STRING_TYPE) \
344 V(SLICED_STRING_TYPE) \
345 V(SLICED_ONE_BYTE_STRING_TYPE) \
346 V(EXTERNAL_STRING_TYPE) \
347 V(EXTERNAL_ONE_BYTE_STRING_TYPE) \
348 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \
349 V(SHORT_EXTERNAL_STRING_TYPE) \
350 V(SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE) \
351 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE) \
353 V(INTERNALIZED_STRING_TYPE) \
354 V(ONE_BYTE_INTERNALIZED_STRING_TYPE) \
355 V(EXTERNAL_INTERNALIZED_STRING_TYPE) \
356 V(EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \
357 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \
358 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE) \
359 V(SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE) \
360 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE) \
368 V(PROPERTY_CELL_TYPE) \
370 V(HEAP_NUMBER_TYPE) \
371 V(MUTABLE_HEAP_NUMBER_TYPE) \
378 V(EXTERNAL_INT8_ARRAY_TYPE) \
379 V(EXTERNAL_UINT8_ARRAY_TYPE) \
380 V(EXTERNAL_INT16_ARRAY_TYPE) \
381 V(EXTERNAL_UINT16_ARRAY_TYPE) \
382 V(EXTERNAL_INT32_ARRAY_TYPE) \
383 V(EXTERNAL_UINT32_ARRAY_TYPE) \
384 V(EXTERNAL_FLOAT32_ARRAY_TYPE) \
385 V(EXTERNAL_FLOAT64_ARRAY_TYPE) \
386 V(EXTERNAL_UINT8_CLAMPED_ARRAY_TYPE) \
388 V(FIXED_INT8_ARRAY_TYPE) \
389 V(FIXED_UINT8_ARRAY_TYPE) \
390 V(FIXED_INT16_ARRAY_TYPE) \
391 V(FIXED_UINT16_ARRAY_TYPE) \
392 V(FIXED_INT32_ARRAY_TYPE) \
393 V(FIXED_UINT32_ARRAY_TYPE) \
394 V(FIXED_FLOAT32_ARRAY_TYPE) \
395 V(FIXED_FLOAT64_ARRAY_TYPE) \
396 V(FIXED_UINT8_CLAMPED_ARRAY_TYPE) \
400 V(DECLARED_ACCESSOR_DESCRIPTOR_TYPE) \
401 V(DECLARED_ACCESSOR_INFO_TYPE) \
402 V(EXECUTABLE_ACCESSOR_INFO_TYPE) \
403 V(ACCESSOR_PAIR_TYPE) \
404 V(ACCESS_CHECK_INFO_TYPE) \
405 V(INTERCEPTOR_INFO_TYPE) \
406 V(CALL_HANDLER_INFO_TYPE) \
407 V(FUNCTION_TEMPLATE_INFO_TYPE) \
408 V(OBJECT_TEMPLATE_INFO_TYPE) \
409 V(SIGNATURE_INFO_TYPE) \
410 V(TYPE_SWITCH_INFO_TYPE) \
411 V(ALLOCATION_MEMENTO_TYPE) \
412 V(ALLOCATION_SITE_TYPE) \
415 V(POLYMORPHIC_CODE_CACHE_TYPE) \
416 V(TYPE_FEEDBACK_INFO_TYPE) \
417 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
420 V(FIXED_ARRAY_TYPE) \
421 V(FIXED_DOUBLE_ARRAY_TYPE) \
422 V(CONSTANT_POOL_ARRAY_TYPE) \
423 V(SHARED_FUNCTION_INFO_TYPE) \
425 V(JS_MESSAGE_OBJECT_TYPE) \
430 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
431 V(JS_GENERATOR_OBJECT_TYPE) \
433 V(JS_GLOBAL_OBJECT_TYPE) \
434 V(JS_BUILTINS_OBJECT_TYPE) \
435 V(JS_GLOBAL_PROXY_TYPE) \
437 V(JS_ARRAY_BUFFER_TYPE) \
438 V(JS_TYPED_ARRAY_TYPE) \
439 V(JS_DATA_VIEW_TYPE) \
443 V(JS_SET_ITERATOR_TYPE) \
444 V(JS_MAP_ITERATOR_TYPE) \
445 V(JS_WEAK_MAP_TYPE) \
446 V(JS_WEAK_SET_TYPE) \
449 V(JS_FUNCTION_TYPE) \
450 V(JS_FUNCTION_PROXY_TYPE) \
452 V(BREAK_POINT_INFO_TYPE)
457 #define STRING_TYPE_LIST(V) \
458 V(STRING_TYPE, kVariableSizeSentinel, string, String) \
459 V(ONE_BYTE_STRING_TYPE, kVariableSizeSentinel, one_byte_string, \
461 V(CONS_STRING_TYPE, ConsString::kSize, cons_string, ConsString) \
462 V(CONS_ONE_BYTE_STRING_TYPE, ConsString::kSize, cons_one_byte_string, \
464 V(SLICED_STRING_TYPE, SlicedString::kSize, sliced_string, SlicedString) \
465 V(SLICED_ONE_BYTE_STRING_TYPE, SlicedString::kSize, sliced_one_byte_string, \
466 SlicedOneByteString) \
467 V(EXTERNAL_STRING_TYPE, ExternalTwoByteString::kSize, external_string, \
469 V(EXTERNAL_ONE_BYTE_STRING_TYPE, ExternalOneByteString::kSize, \
470 external_one_byte_string, ExternalOneByteString) \
471 V(EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, ExternalTwoByteString::kSize, \
472 external_string_with_one_byte_data, ExternalStringWithOneByteData) \
473 V(SHORT_EXTERNAL_STRING_TYPE, ExternalTwoByteString::kShortSize, \
474 short_external_string, ShortExternalString) \
475 V(SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE, ExternalOneByteString::kShortSize, \
476 short_external_one_byte_string, ShortExternalOneByteString) \
477 V(SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE, \
478 ExternalTwoByteString::kShortSize, \
479 short_external_string_with_one_byte_data, \
480 ShortExternalStringWithOneByteData) \
482 V(INTERNALIZED_STRING_TYPE, kVariableSizeSentinel, internalized_string, \
483 InternalizedString) \
484 V(ONE_BYTE_INTERNALIZED_STRING_TYPE, kVariableSizeSentinel, \
485 one_byte_internalized_string, OneByteInternalizedString) \
486 V(EXTERNAL_INTERNALIZED_STRING_TYPE, ExternalTwoByteString::kSize, \
487 external_internalized_string, ExternalInternalizedString) \
488 V(EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE, ExternalOneByteString::kSize, \
489 external_one_byte_internalized_string, ExternalOneByteInternalizedString) \
490 V(EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE, \
491 ExternalTwoByteString::kSize, \
492 external_internalized_string_with_one_byte_data, \
493 ExternalInternalizedStringWithOneByteData) \
494 V(SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE, \
495 ExternalTwoByteString::kShortSize, short_external_internalized_string, \
496 ShortExternalInternalizedString) \
497 V(SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE, \
498 ExternalOneByteString::kShortSize, \
499 short_external_one_byte_internalized_string, \
500 ShortExternalOneByteInternalizedString) \
501 V(SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE, \
502 ExternalTwoByteString::kShortSize, \
503 short_external_internalized_string_with_one_byte_data, \
504 ShortExternalInternalizedStringWithOneByteData)
515 #define STRUCT_LIST(V) \
517 V(DECLARED_ACCESSOR_DESCRIPTOR, \
518 DeclaredAccessorDescriptor, \
519 declared_accessor_descriptor) \
520 V(DECLARED_ACCESSOR_INFO, DeclaredAccessorInfo, declared_accessor_info) \
521 V(EXECUTABLE_ACCESSOR_INFO, ExecutableAccessorInfo, executable_accessor_info)\
522 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \
523 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \
524 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \
525 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \
526 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \
527 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \
528 V(SIGNATURE_INFO, SignatureInfo, signature_info) \
529 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \
530 V(SCRIPT, Script, script) \
531 V(ALLOCATION_SITE, AllocationSite, allocation_site) \
532 V(ALLOCATION_MEMENTO, AllocationMemento, allocation_memento) \
533 V(CODE_CACHE, CodeCache, code_cache) \
534 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \
535 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \
536 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry) \
537 V(DEBUG_INFO, DebugInfo, debug_info) \
538 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info)
800 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \
801 V(FAST_ELEMENTS_SUB_TYPE) \
802 V(DICTIONARY_ELEMENTS_SUB_TYPE) \
803 V(FAST_PROPERTIES_SUB_TYPE) \
804 V(DICTIONARY_PROPERTIES_SUB_TYPE) \
805 V(MAP_CODE_CACHE_SUB_TYPE) \
806 V(SCOPE_INFO_SUB_TYPE) \
807 V(STRING_TABLE_SUB_TYPE) \
808 V(DESCRIPTOR_ARRAY_SUB_TYPE) \
809 V(TRANSITION_ARRAY_SUB_TYPE)
812 #define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name) name,
814 #undef DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE
828 #define DECL_BOOLEAN_ACCESSORS(name) \
829 inline bool name() const; \
830 inline void set_##name(bool value); \
833 #define DECL_ACCESSORS(name, type) \
834 inline type* name() const; \
835 inline void set_##name(type* value, \
836 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \
839 #define DECLARE_CAST(type) \
840 INLINE(static type* cast(Object* object)); \
841 INLINE(static const type* cast(const Object* object));
845 class AllocationSite;
846 class AllocationSiteCreationContext;
847 class AllocationSiteUsageContext;
848 class DictionaryElementsAccessor;
849 class ElementsAccessor;
850 class FixedArrayBase;
853 class LookupIterator;
857 template<
class>
class TypeImpl;
858 struct HeapTypeConfig;
859 typedef TypeImpl<HeapTypeConfig>
HeapType;
866 #define DECLARE_VERIFIER(Name) void Name##Verify();
868 #define DECLARE_VERIFIER(Name)
872 #define DECLARE_PRINTER(Name) void Name##Print(OStream& os);
874 #define DECLARE_PRINTER(Name)
878 #define OBJECT_TYPE_LIST(V) \
883 #define HEAP_OBJECT_TYPE_LIST(V) \
885 V(MutableHeapNumber) \
893 V(ExternalTwoByteString) \
894 V(ExternalOneByteString) \
895 V(SeqTwoByteString) \
896 V(SeqOneByteString) \
897 V(InternalizedString) \
901 V(ExternalInt8Array) \
902 V(ExternalUint8Array) \
903 V(ExternalInt16Array) \
904 V(ExternalUint16Array) \
905 V(ExternalInt32Array) \
906 V(ExternalUint32Array) \
907 V(ExternalFloat32Array) \
908 V(ExternalFloat64Array) \
909 V(ExternalUint8ClampedArray) \
910 V(FixedTypedArrayBase) \
913 V(FixedUint16Array) \
915 V(FixedUint32Array) \
917 V(FixedFloat32Array) \
918 V(FixedFloat64Array) \
919 V(FixedUint8ClampedArray) \
924 V(JSContextExtensionObject) \
925 V(JSGeneratorObject) \
930 V(TypeFeedbackVector) \
931 V(DeoptimizationInputData) \
932 V(DeoptimizationOutputData) \
935 V(FixedDoubleArray) \
936 V(ConstantPoolArray) \
943 V(SharedFunctionInfo) \
952 V(JSArrayBufferView) \
961 V(JSWeakCollection) \
968 V(JSFunctionResultCache) \
969 V(NormalizedMapCache) \
970 V(CompilationCacheTable) \
971 V(CodeCacheHashTable) \
972 V(PolymorphicCodeCacheHashTable) \
977 V(JSBuiltinsObject) \
979 V(UndetectableObject) \
980 V(AccessCheckNeeded) \
998 #define IS_TYPE_FUNCTION_DECL(type_) INLINE(bool Is##type_() const);
1001 #undef IS_TYPE_FUNCTION_DECL
1017 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) \
1018 INLINE(bool Is##Name() const);
1020 #undef DECLARE_STRUCT_PREDICATE
1026 INLINE(
bool IsSeededNumberDictionary()
const);
1027 INLINE(
bool IsUnseededNumberDictionary()
const);
1056 }
else if (FLAG_track_double_fields && IsHeapNumber()) {
1058 }
else if (FLAG_track_computed_fields && IsUninitialized()) {
1060 }
else if (FLAG_track_heap_object_fields) {
1069 if (FLAG_track_fields && representation.
IsNone()) {
1071 }
else if (FLAG_track_fields && representation.
IsSmi()) {
1073 }
else if (FLAG_track_double_fields && representation.
IsDouble()) {
1074 return IsMutableHeapNumber() || IsNumber();
1075 }
else if (FLAG_track_heap_object_fields && representation.
IsHeapObject()) {
1076 return IsHeapObject();
1201 static void VerifyPointer(
Object* p);
1254 inline int value()
const;
1309 return MapWord(
value);
1337 inline void set_map_no_write_barrier(
Map*
value);
1340 inline Map* synchronized_map();
1341 inline MapWord synchronized_map_word()
const;
1344 inline void synchronized_set_map(
Map*
value);
1345 inline void synchronized_set_map_no_write_barrier(
Map*
value);
1346 inline void synchronized_set_map_word(MapWord map_word);
1350 inline MapWord map_word()
const;
1351 inline void set_map_word(MapWord map_word);
1354 inline Heap* GetHeap()
const;
1357 inline Isolate* GetIsolate()
const;
1379 inline bool MayContainRawValues();
1384 inline int SizeFromMap(
Map*
map);
1410 void HeapObjectShortPrint(
OStream& os);
1412 void PrintHeader(
OStream& os,
const char*
id);
1417 inline void VerifyObjectField(
int offset);
1418 inline void VerifySmiField(
int offset);
1422 static void VerifyHeapPointer(
Object* p);
1435 inline void IteratePointers(
ObjectVisitor* v,
int start,
int end);
1439 inline void IterateNextCodeLink(
ObjectVisitor* v,
int offset);
1449 template<
int start_offset,
int end_offset,
int size>
1452 static const int kStartOffset = start_offset;
1453 static const int kEndOffset = end_offset;
1458 template<
typename StaticVisitor>
1469 template<
int start_offset>
1472 static const int kStartOffset = start_offset;
1474 static inline void IterateBody(
HeapObject* obj,
1478 template<
typename StaticVisitor>
1491 inline double value()
const;
1492 inline void set_value(
double value);
1497 bool HeapNumberBooleanValue();
1499 void HeapNumberPrint(
OStream& os);
1502 inline int get_exponent();
1503 inline int get_sign();
1511 #if defined(V8_TARGET_LITTLE_ENDIAN)
1512 static const int kMantissaOffset = kValueOffset;
1513 static const int kExponentOffset = kValueOffset + 4;
1514 #elif defined(V8_TARGET_BIG_ENDIAN)
1515 static const int kMantissaOffset = kValueOffset + 4;
1516 static const int kExponentOffset = kValueOffset;
1518 #error Unknown byte ordering
1525 static const int kMantissaBits = 52;
1526 static const int kExponentBits = 11;
1527 static const int kExponentBias = 1023;
1528 static const int kExponentShift = 20;
1529 static const int kInfinityOrNanExponent =
1530 (kExponentMask >> kExponentShift) - kExponentBias;
1531 static const int kMantissaBitsInTopWord = 20;
1532 static const int kNonMantissaBitsInTopWord = 12;
1596 DeleteMode
mode = NORMAL_DELETION);
1600 DeleteMode
mode = NORMAL_DELETION);
1603 bool IsSimpleEnum();
1610 String* constructor_name();
1625 inline Object* GetConstructor();
1629 inline Object* GetIdentityHash();
1633 inline static Handle<Smi> GetOrCreateIdentityHash(
1642 KeyCollectionType type);
1665 inline void initialize_properties();
1666 inline bool HasFastProperties();
1688 inline void initialize_elements();
1696 inline bool HasFastSmiElements();
1698 inline bool HasFastObjectElements();
1701 inline bool HasFastSmiOrObjectElements();
1703 inline bool HasFastElements();
1706 inline bool HasFastDoubleElements();
1709 inline bool HasFastHoleyElements();
1710 inline bool HasSloppyArgumentsElements();
1711 inline bool HasDictionaryElements();
1714 inline bool HasExternalArrayElements();
1724 inline bool HasFixedTypedArrayElements();
1737 bool HasFastArgumentsElements();
1738 bool HasDictionaryArgumentsElements();
1771 ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
1793 PropertyDetails details);
1813 uint32_t index,
bool check_prototype);
1874 static inline void EnsureCanContainHeapObjectElements(
Handle<JSObject> obj);
1877 static inline void EnsureCanContainElements(
1882 static inline void EnsureCanContainElements(
1887 static void EnsureCanContainElements(
1899 bool ShouldConvertToSlowElements(
int new_capacity);
1904 bool ShouldConvertToFastElements();
1908 bool ShouldConvertToFastDoubleElements(
bool* has_smi_only_elements);
1913 return old_capacity + (old_capacity >> 1) + 16;
1926 bool check_prototype);
1941 bool check_prototype =
true,
1954 kDontAllowSmiElements
1964 SetFastElementsCapacitySmiMode smi_mode);
1965 static void SetFastDoubleElementsCapacityAndLength(
1972 inline bool HasNamedInterceptor();
1973 inline bool HasIndexedInterceptor();
1994 inline int GetHeaderSize();
1996 inline int GetInternalFieldCount();
1997 inline int GetInternalFieldOffset(
int index);
1998 inline Object* GetInternalField(
int index);
1999 inline void SetInternalField(
int index,
Object*
value);
2000 inline void SetInternalField(
int index,
Smi*
value);
2007 void GetOwnPropertyNames(
2014 int NumberOfEnumElements();
2040 int expected_additional_properties);
2049 int unused_property_fields);
2055 inline Object* RawFastPropertyAt(FieldIndex index);
2056 inline void FastPropertyAtPut(FieldIndex index,
Object*
value);
2060 inline int GetInObjectPropertyOffset(
int index);
2061 inline Object* InObjectPropertyAt(
int index);
2062 inline Object* InObjectPropertyAtPut(
int index,
2076 inline void InitializeBody(
Map*
map,
2077 Object* pre_allocated_value,
2081 bool ReferencesObject(
Object* obj);
2112 void JSObjectShortPrint(StringStream* accumulator);
2116 void PrintProperties(
OStream& os);
2117 void PrintElements(
OStream& os);
2118 void PrintTransitions(
OStream& os);
2121 static void PrintElementsTransition(
2126 void PrintInstanceMigration(FILE*
file,
Map* original_map,
Map* new_map);
2130 class SpillInformation {
2134 int number_of_objects_;
2135 int number_of_objects_with_fast_properties_;
2136 int number_of_objects_with_fast_elements_;
2137 int number_of_fast_used_fields_;
2138 int number_of_fast_unused_fields_;
2139 int number_of_slow_used_properties_;
2140 int number_of_slow_unused_properties_;
2141 int number_of_fast_used_elements_;
2142 int number_of_fast_unused_elements_;
2143 int number_of_slow_used_elements_;
2144 int number_of_slow_unused_elements_;
2147 void IncrementSpillStatistics(SpillInformation* info);
2154 bool ElementsAreSafeToExamine();
2172 static const int kMaxUncheckedFastElementsLength = 5000;
2176 static const int kMaxUncheckedOldFastElementsLength = 500;
2180 static const int kInitialMaxFastElementArray = 100000;
2184 static const int kInitialGlobalObjectUnusedPropertiesCount = 4;
2190 static const int kFieldsAdded = 3;
2204 Context* GetCreationContext();
2224 int expected_additional_properties);
2248 uint32_t index,
bool continue_search);
2253 bool continue_search);
2267 bool check_prototype,
2275 bool check_prototype,
2290 bool check_prototype,
2297 bool check_prototype =
true);
2328 bool ReferencesObjectFromElements(
FixedArray* elements,
2333 bool HasDenseElements();
2336 void GetElementsCapacityAndUsage(
int* capacity,
int* used);
2405 inline Object* get(
int index);
2409 inline bool is_the_hole(
int index);
2412 inline void set(
int index,
Smi*
value);
2417 inline void set_undefined(
int index);
2418 inline void set_null(
int index);
2419 inline void set_the_hole(
int index);
2421 inline Object** GetFirstElementAddress();
2422 inline bool ContainsOnlySmisOrHoles();
2425 inline Object** data_start();
2427 inline void FillWithHoles(
int from,
int to);
2430 void Shrink(
int length);
2449 void CopyTo(
int pos,
FixedArray* dest,
int dest_pos,
int len);
2482 void SwapPairs(
FixedArray* numbers,
int i,
int j);
2492 return SizeFor(
reinterpret_cast<FixedArray*
>(
object)->length());
2499 static inline void NoWriteBarrierSet(
FixedArray* array,
2506 static inline void NoIncrementalWriteBarrierSet(
FixedArray* array,
2521 inline double get_scalar(
int index);
2522 inline int64_t get_representation(
int index);
2524 inline void set(
int index,
double value);
2525 inline void set_the_hole(
int index);
2528 inline bool is_the_hole(
int index);
2536 inline double* data_start();
2538 inline void FillWithHoles(
int from,
int to);
2543 inline static bool is_the_hole_nan(
double value);
2544 inline static double hole_nan_as_double();
2545 inline static double canonical_not_the_hole_nan_as_double();
2552 static const
int kMaxSize = 512 *
MB;
2622 NUMBER_OF_LAYOUT_SECTIONS
2628 for (
int i = 0;
i < NUMBER_OF_TYPES;
i++) {
2629 element_counts_[
i] = 0;
2634 int heap_ptr_count,
int int32_count) {
2635 element_counts_[INT64] = int64_count;
2636 element_counts_[CODE_PTR] = code_ptr_count;
2637 element_counts_[HEAP_PTR] = heap_ptr_count;
2638 element_counts_[INT32] = int32_count;
2649 inline int equals(
const NumberOfEntries& other)
const;
2657 int element_counts_[NUMBER_OF_TYPES];
2665 final_section_(array->final_section()),
2666 current_section_(SMALL_SECTION),
2667 next_index_(array->first_index(type, SMALL_SECTION)) {
2674 final_section_(section),
2675 current_section_(section),
2676 next_index_(array->first_index(type, section)) {
2700 inline Type get_type(
int index);
2701 inline bool offset_is_type(
int offset,
Type type);
2704 inline Address get_code_ptr_entry(
int index);
2705 inline Object* get_heap_ptr_entry(
int index);
2706 inline int64_t get_int64_entry(
int index);
2707 inline int32_t get_int32_entry(
int index);
2708 inline double get_int64_entry_as_double(
int index);
2712 inline void set(
int index, int64_t
value);
2713 inline void set(
int index,
double value);
2718 inline void set_at_offset(
int offset, int64_t
value);
2719 inline void set_at_offset(
int offset,
double value);
2721 inline void set_at_offset(
int offset,
Object*
value);
2729 inline bool is_extended_layout();
2735 inline void Init(
const NumberOfEntries& small);
2738 inline void InitExtended(
const NumberOfEntries& small,
2739 const NumberOfEntries& extended);
2742 void ClearPtrEntries(
Isolate* isolate);
2745 inline int length();
2752 return kFirstEntryOffset + (number_of_int64 *
kInt64Size);
2755 inline static int SizeFor(
const NumberOfEntries& small) {
2756 int size = kFirstEntryOffset +
2765 const NumberOfEntries& extended) {
2766 int size = SizeFor(small);
2768 size += kExtendedFirstOffset +
2795 if (is_extended_layout() && index >= first_extended_section_index()) {
2796 section = EXTENDED_SECTION;
2797 offset = get_extended_section_header_offset() + kExtendedFirstOffset;
2799 section = SMALL_SECTION;
2800 offset = kFirstEntryOffset;
2806 type = next_type(type)) {
2807 offset += entry_size(type) * number_of_entries(type, section);
2811 Type type = get_type(index);
2812 offset += entry_size(type) * (index - first_index(type, section));
2825 static const int kSmallLayout2Offset = kSmallLayout1Offset +
kInt32Size;
2829 static const int kSmallLayoutCountBits = 10;
2830 static const int kMaxSmallEntriesPerType = (1 << kSmallLayoutCountBits) - 1;
2845 static const int kExtendedInt64CountOffset = 0;
2846 static const int kExtendedCodePtrCountOffset =
2848 static const int kExtendedHeapPtrCountOffset =
2850 static const int kExtendedInt32CountOffset =
2852 static const int kExtendedFirstOffset =
2862 inline int first_extended_section_index();
2863 inline int get_extended_section_header_offset();
2867 int type_int =
static_cast<int>(type);
2868 return static_cast<Type>(++type_int);
2888 inline bool IsEmpty();
2892 DCHECK(length() >= kFirstIndex || IsEmpty());
2894 return len == 0 ? 0 : Smi::cast(get(kDescriptorLengthIndex))->value();
2899 return len == 0 ? 0 : (len - kFirstIndex) / kDescriptorSize;
2903 return number_of_descriptors_storage() - number_of_descriptors();
2906 inline void SetNumberOfDescriptors(
int number_of_descriptors);
2910 return !IsEmpty() && !get(kEnumCacheIndex)->IsSmi();
2914 set(kEnumCacheIndex, array->
get(kEnumCacheIndex));
2919 FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex));
2920 return FixedArray::cast(bridge->
get(kEnumCacheBridgeCacheIndex));
2924 if (IsEmpty())
return false;
2925 Object*
object = get(kEnumCacheIndex);
2926 if (object->IsSmi())
return false;
2927 FixedArray* bridge = FixedArray::cast(
object);
2928 return !bridge->
get(kEnumCacheBridgeIndicesCacheIndex)->IsSmi();
2932 DCHECK(HasEnumIndicesCache());
2933 FixedArray* bridge = FixedArray::cast(get(kEnumCacheIndex));
2934 return FixedArray::cast(bridge->
get(kEnumCacheBridgeIndicesCacheIndex));
2943 void ClearEnumCache();
2947 void SetEnumCache(
FixedArray* bridge_storage,
2949 Object* new_index_cache);
2954 inline Name* GetKey(
int descriptor_number);
2955 inline Object** GetKeySlot(
int descriptor_number);
2956 inline Object* GetValue(
int descriptor_number);
2957 inline void SetValue(
int descriptor_number,
Object*
value);
2958 inline Object** GetValueSlot(
int descriptor_number);
2959 static inline int GetValueOffset(
int descriptor_number);
2960 inline Object** GetDescriptorStartSlot(
int descriptor_number);
2961 inline Object** GetDescriptorEndSlot(
int descriptor_number);
2962 inline PropertyDetails GetDetails(
int descriptor_number);
2964 inline int GetFieldIndex(
int descriptor_number);
2965 inline HeapType* GetFieldType(
int descriptor_number);
2966 inline Object* GetConstant(
int descriptor_number);
2967 inline Object* GetCallbacksObject(
int descriptor_number);
2970 inline Name* GetSortedKey(
int descriptor_number);
2971 inline int GetSortedKeyIndex(
int descriptor_number);
2972 inline void SetSortedKey(
int pointer,
int descriptor_number);
2973 inline void SetRepresentation(
int descriptor_number,
2977 inline void Get(
int descriptor_number,
Descriptor* desc);
2978 inline void Set(
int descriptor_number,
Descriptor* desc);
2979 void Replace(
int descriptor_number,
Descriptor* descriptor);
2987 int enumeration_index,
2992 int enumeration_index,
3009 int number_of_descriptors,
3015 static const
int kNotFound = -1;
3017 static const
int kDescriptorLengthIndex = 0;
3018 static const
int kEnumCacheIndex = 1;
3019 static const
int kFirstIndex = 2;
3022 static const
int kEnumCacheBridgeLength = 2;
3023 static const
int kEnumCacheBridgeCacheIndex = 0;
3024 static const
int kEnumCacheBridgeIndicesCacheIndex = 1;
3028 static const
int kEnumCacheOffset = kDescriptorLengthOffset +
kPointerSize;
3035 static const
int kDescriptorKey = 0;
3036 static const
int kDescriptorDetails = 1;
3037 static const
int kDescriptorValue = 2;
3038 static const
int kDescriptorSize = 3;
3042 void PrintDescriptors(
OStream& os);
3047 bool IsSortedNoDuplicates(
int valid_descriptors = -1);
3050 bool IsConsistentWithBackPointers(
Map* current_map);
3059 return ToKeyIndex(number_of_descriptors);
3084 descs_(descs), index_(index) { }
3096 return kFirstIndex +
3097 (descriptor_number * kDescriptorSize) +
3102 return kFirstIndex +
3103 (descriptor_number * kDescriptorSize) +
3108 return kFirstIndex +
3109 (descriptor_number * kDescriptorSize) +
3115 void CopyFrom(
int index,
3117 const WhitenessWitness&);
3119 inline void Set(
int descriptor_number,
3121 const WhitenessWitness&);
3124 inline void SwapSortedKeys(
int first,
int second);
3132 template<SearchMode search_mode,
typename T>
3136 template<SearchMode search_mode,
typename T>
3173 template<
typename Key>
3176 static const bool UsesSeed =
false;
3185 return HashForObject(key,
object);
3189 template<
typename Derived,
typename Shape,
typename Key>
3194 if (Shape::UsesSeed) {
3195 return Shape::SeededHash(key, GetHeap()->HashSeed());
3202 if (Shape::UsesSeed) {
3203 return Shape::SeededHashForObject(key, GetHeap()->HashSeed(),
object);
3205 return Shape::HashForObject(key,
object);
3211 return Smi::cast(get(kNumberOfElementsIndex))->value();
3216 return Smi::cast(get(kNumberOfDeletedElementsIndex))->value();
3221 return Smi::cast(get(kCapacityIndex))->value();
3231 SetNumberOfElements(NumberOfElements() - 1);
3232 SetNumberOfDeletedElements(NumberOfDeletedElements() + 1);
3235 SetNumberOfElements(NumberOfElements() - n);
3236 SetNumberOfDeletedElements(NumberOfDeletedElements() + n);
3242 int at_least_space_for,
3248 static int ComputeCapacity(
int at_least_space_for);
3256 return !k->IsTheHole() && !k->IsUndefined();
3267 return (n + n * n) >> 1;
3270 static const int kNumberOfElementsIndex = 0;
3271 static const int kNumberOfDeletedElementsIndex = 1;
3272 static const int kCapacityIndex = 2;
3273 static const int kPrefixStartIndex = 3;
3274 static const int kElementsStartIndex =
3275 kPrefixStartIndex + Shape::kPrefixSize;
3276 static const int kEntrySize = Shape::kEntrySize;
3277 static const int kElementsStartOffset =
3279 static const int kCapacityOffset =
3283 static const int kNotFound = -1;
3288 static const int kMaxCapacity =
3292 inline int FindEntry(Key key);
3293 int FindEntry(
Isolate* isolate, Key key);
3296 void Rehash(Key key);
3307 return (entry * kEntrySize) + kElementsStartIndex;
3326 DCHECK(capacity <= kMaxCapacity);
3334 return (hash + GetProbeOffset(number)) & (
size - 1);
3338 return hash & (
size - 1);
3343 return (last + number) & (
size - 1);
3401 static const int kPrefixSize = 0;
3402 static const int kEntrySize = 1;
3439 template <
bool seq_one_
byte>
3440 friend class JsonParser;
3462 static const int kPrefixSize = 0;
3463 static const int kEntrySize = 2;
3484 template <
typename Derived,
typename Shape,
typename Key>
3492 return this->get(DerivedHashTable::EntryToIndex(entry) + 1);
3497 this->set(DerivedHashTable::EntryToIndex(entry) + 1,
value);
3503 return PropertyDetails(
3504 Smi::cast(this->get(DerivedHashTable::EntryToIndex(entry) + 2)));
3509 this->set(DerivedHashTable::EntryToIndex(entry) + 2,
value.AsSmi());
3525 return DerivedHashTable::Shrink(dictionary, key);
3533 int NumberOfEnumElements();
3549 this->set(kNextEnumerationIndexIndex,
Smi::FromInt(index));
3553 return Smi::cast(this->get(kNextEnumerationIndexIndex))->value();
3559 int at_least_space_for,
3572 inline void SetEntry(
int entry,
3575 inline void SetEntry(
int entry,
3578 PropertyDetails details);
3584 PropertyDetails details);
3594 static void AddEntry(
3598 PropertyDetails details,
3602 static void GenerateNewEnumerationIndices(
Handle<Derived> dictionary);
3603 static const int kMaxNumberKeyIndex = DerivedHashTable::kPrefixStartIndex;
3604 static const int kNextEnumerationIndexIndex = kMaxNumberKeyIndex + 1;
3614 static const int kPrefixSize = 2;
3615 static const int kEntrySize = 3;
3616 static const bool kIsEnumerable =
true;
3621 NameDictionaryShape,
3631 inline static void DoGenerateNewEnumerationIndices(
3644 static const int kEntrySize = 3;
3645 static const bool kIsEnumerable =
false;
3651 static const bool UsesSeed =
true;
3652 static const int kPrefixSize = 2;
3663 static const int kPrefixSize = 0;
3672 SeededNumberDictionaryShape,
3686 PropertyDetails details);
3694 PropertyDetails details);
3696 void UpdateMaxNumberKey(
uint32_t key);
3703 inline bool requires_slow_elements();
3704 inline void set_requires_slow_elements();
3712 static const int kRequiresSlowElementsMask = 1;
3713 static const int kRequiresSlowElementsTagSize = 1;
3714 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1;
3719 :
public Dictionary<UnseededNumberDictionary,
3720 UnseededNumberDictionaryShape,
3750 static const int kPrefixSize = 0;
3751 static const int kEntrySize = 2;
3758 ObjectHashTableShape,
3788 void RemoveEntry(
int entry);
3792 return EntryToIndex(entry) + 1;
3833 template<
class Derived,
class Iterator,
int entrysize>
3864 return Smi::cast(get(kNumberOfElementsIndex))->value();
3868 return Smi::cast(get(kNumberOfDeletedElementsIndex))->value();
3871 int UsedCapacity() {
return NumberOfElements() + NumberOfDeletedElements(); }
3874 return Smi::cast(get(kNumberOfBucketsIndex))->value();
3880 int AddEntry(
int hash);
3884 void RemoveEntry(
int entry);
3888 return kHashTableStartIndex + NumberOfBuckets() + (entry * kEntrySize);
3894 return !get(kNextTableIndex)->IsSmi();
3899 return Derived::cast(get(kNextTableIndex));
3904 return Smi::cast(get(kRemovedHolesIndex + index))->value();
3907 static const int kNotFound = -1;
3908 static const int kMinCapacity = 4;
3926 return NumberOfBuckets() * kLoadFactor;
3931 return Smi::cast(get(EntryToIndex(entry) + kChainOffset))->value();
3935 return hash & (NumberOfBuckets() - 1);
3939 int bucket = HashToBucket(hash);
3940 return Smi::cast(get(kHashTableStartIndex + bucket))->value();
3944 set(kNextTableIndex, next_table);
3948 return set(kRemovedHolesIndex + index,
Smi::FromInt(removed_index));
3951 static const int kNumberOfBucketsIndex = 0;
3952 static const int kNumberOfElementsIndex = kNumberOfBucketsIndex + 1;
3953 static const int kNumberOfDeletedElementsIndex = kNumberOfElementsIndex + 1;
3954 static const int kHashTableStartIndex = kNumberOfDeletedElementsIndex + 1;
3956 static const int kNextTableIndex = kNumberOfElementsIndex;
3957 static const int kRemovedHolesIndex = kHashTableStartIndex;
3959 static const int kEntrySize = entrysize + 1;
3960 static const int kChainOffset = entrysize;
3962 static const int kLoadFactor = 2;
3963 static const int kMaxCapacity =
3965 / (1 + (kEntrySize * kLoadFactor));
3973 OrderedHashSet, JSSetIterator, 1> {
3987 OrderedHashMap, JSMapIterator, 2> {
3998 return get(EntryToIndex(entry) + kValueOffset);
4002 static const int kValueOffset = 1;
4006 template <
int entrysize>
4013 static const int kPrefixSize = 0;
4014 static const int kEntrySize = entrysize;
4022 WeakHashTableShape<2>,
4041 int capacity = Capacity();
4042 for (
int i = 0;
i < capacity;
i++) {
4043 set(EntryToIndex(
i),
value);
4044 set(EntryToValueIndex(
i),
value);
4055 return EntryToIndex(entry) + 1;
4069 static const int kFactoryIndex = 0;
4070 static const int kFingerIndex = kFactoryIndex + 1;
4071 static const int kCacheSizeIndex = kFingerIndex + 1;
4072 static const int kDummyIndex = kCacheSizeIndex + 1;
4073 static const int kEntriesIndex = kDummyIndex + 1;
4075 static const int kEntrySize = 2;
4081 inline void MakeZeroSize();
4082 inline void Clear();
4085 inline void set_size(
int size);
4086 inline int finger_index();
4087 inline void set_finger_index(
int finger_index);
4126 int StackSlotCount();
4135 int ContextLength();
4138 bool HasFunctionName();
4141 bool HasHeapAllocatedLocals();
4156 String* ParameterName(
int var);
4159 String* LocalName(
int var);
4162 String* StackLocalName(
int var);
4165 String* ContextLocalName(
int var);
4178 bool LocalIsSynthetic(
int var);
4230 #define FOR_EACH_NUMERIC_FIELD(V) \
4233 V(StackLocalCount) \
4234 V(ContextLocalCount)
4236 #define FIELD_ACCESSORS(name) \
4237 void Set##name(int value) { \
4238 set(k##name, Smi::FromInt(value)); \
4241 if (length() > 0) { \
4242 return Smi::cast(get(k##name))->value(); \
4248 #undef FIELD_ACCESSORS
4252 #define DECL_INDEX(name) k##name,
4255 #undef FOR_EACH_NUMERIC_FIELD
4286 int ParameterEntriesIndex();
4287 int StackLocalEntriesIndex();
4288 int ContextLocalNameEntriesIndex();
4289 int ContextLocalInfoEntriesIndex();
4290 int FunctionNameEntryIndex();
4314 :
public BitField<MaybeAssignedFlag, 4, 1> {};
4333 static inline bool IsNormalizedMapCache(
const Object* obj);
4337 static const int kEntries = 64;
4354 inline byte get(
int index);
4355 inline void set(
int index,
byte value);
4358 inline int get_int(
int index);
4374 inline Address GetDataStartAddress();
4382 inline
int ByteArraySize() {
4383 return SizeFor(this->length());
4392 static const
int kMaxSize = 512 *
MB;
4433 #define TYPED_ARRAYS(V) \
4434 V(Uint8, uint8, UINT8, uint8_t, 1) \
4435 V(Int8, int8, INT8, int8_t, 1) \
4436 V(Uint16, uint16, UINT16, uint16_t, 2) \
4437 V(Int16, int16, INT16, int16_t, 2) \
4438 V(Uint32, uint32, UINT32, uint32_t, 4) \
4439 V(Int32, int32, INT32, int32_t, 4) \
4440 V(Float32, float32, FLOAT32, float, 4) \
4441 V(Float64, float64, FLOAT64, double, 8) \
4442 V(Uint8Clamped, uint8_clamped, UINT8_CLAMPED, uint8_t, 1)
4468 static const int kMaxLength = 0x3fffffff;
4471 static const int kExternalPointerOffset =
4491 inline uint8_t* external_uint8_clamped_pointer();
4494 inline uint8_t get_scalar(
int index);
4497 inline void set(
int index, uint8_t
value);
4519 inline int8_t get_scalar(
int index);
4521 inline void set(
int index, int8_t
value);
4543 inline uint8_t get_scalar(
int index);
4545 inline void set(
int index, uint8_t
value);
4567 inline int16_t get_scalar(
int index);
4591 inline uint16_t get_scalar(
int index);
4616 inline int32_t get_scalar(
int index);
4640 inline uint32_t get_scalar(
int index);
4665 inline float get_scalar(
int index);
4668 inline void set(
int index,
float value);
4690 inline double get_scalar(
int index);
4693 inline void set(
int index,
double value);
4723 inline
void* DataPtr();
4725 inline
int DataSize();
4742 static inline
int ElementOffset(
int index) {
4747 return ElementOffset(length);
4750 inline ElementType get_scalar(
int index);
4752 inline void set(
int index, ElementType
value);
4754 static inline ElementType from_int(
int value);
4755 static inline ElementType from_double(
double value);
4770 #define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType, size) \
4771 class Type##ArrayTraits { \
4773 typedef elementType ElementType; \
4774 static const InstanceType kInstanceType = FIXED_##TYPE##_ARRAY_TYPE; \
4775 static const char* Designator() { return #type " array"; } \
4776 static inline Handle<Object> ToHandle(Isolate* isolate, \
4777 elementType scalar); \
4778 static inline elementType defaultValue(); \
4781 typedef FixedTypedArray<Type##ArrayTraits> Fixed##Type##Array;
4785 #undef FIXED_TYPED_ARRAY_TRAITS
4797 static const int kTranslationByteArrayIndex = 0;
4798 static const int kInlinedFunctionCountIndex = 1;
4799 static const int kLiteralArrayIndex = 2;
4800 static const int kOsrAstIdIndex = 3;
4801 static const int kOsrPcOffsetIndex = 4;
4802 static const int kOptimizationIdIndex = 5;
4803 static const int kSharedFunctionInfoIndex = 6;
4804 static const int kFirstDeoptEntryIndex = 7;
4807 static const int kAstIdRawOffset = 0;
4808 static const int kTranslationIndexOffset = 1;
4809 static const int kArgumentsStackHeightOffset = 2;
4810 static const int kPcOffset = 3;
4811 static const int kDeoptEntrySize = 4;
4814 #define DEFINE_ELEMENT_ACCESSORS(name, type) \
4816 return type::cast(get(k##name##Index)); \
4818 void Set##name(type* value) { \
4819 set(k##name##Index, value); \
4830 #undef DEFINE_ELEMENT_ACCESSORS
4833 #define DEFINE_ENTRY_ACCESSORS(name, type) \
4834 type* name(int i) { \
4835 return type::cast(get(IndexForEntry(i) + k##name##Offset)); \
4837 void Set##name(int i, type* value) { \
4838 set(IndexForEntry(i) + k##name##Offset, value); \
4846 #undef DEFINE_DEOPT_ENTRY_ACCESSORS
4857 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize;
4862 int deopt_entry_count,
4867 #ifdef ENABLE_DISASSEMBLER
4868 void DeoptimizationInputDataPrint(
OStream& os);
4873 return kFirstDeoptEntryIndex + (
i * kDeoptEntrySize);
4877 static int LengthFor(
int entry_count) {
return IndexForEntry(entry_count); }
4902 return deopt_points * 2;
4907 int number_of_deopt_points,
4912 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER)
4913 void DeoptimizationOutputDataPrint(
OStream& os);
4921 class SafepointEntry;
4922 class TypeFeedbackInfo;
4931 #define NON_IC_KIND_LIST(V) \
4933 V(OPTIMIZED_FUNCTION) \
4939 #define IC_KIND_LIST(V) \
4950 #define CODE_KIND_LIST(V) \
4951 NON_IC_KIND_LIST(V) \
4955 #define DEFINE_CODE_KIND_ENUM(name) name,
4957 #undef DEFINE_CODE_KIND_ENUM
4965 static const char* Kind2String(
Kind kind);
4973 static const int kPrologueOffsetNotSet = -1;
4975 #ifdef ENABLE_DISASSEMBLER
4978 static const char* StubType2String(
StubType type);
4979 static void PrintExtraICState(
OStream& os,
4990 void InvalidateRelocation();
4991 void InvalidateEmbeddedObjects();
5004 inline Object* type_feedback_info();
5005 inline void set_type_feedback_info(
5008 inline void set_stub_key(
uint32_t key);
5021 inline
void set_ic_age(
int count);
5022 inline
int ic_age() const;
5026 inline
int prologue_offset() const;
5027 inline
void set_prologue_offset(
int offset);
5030 inline
ByteArray* unchecked_relocation_info();
5032 inline
int relocation_size();
5046 inline
bool is_inline_cache_stub();
5047 inline
bool is_debug_stub();
5048 inline
bool is_handler() {
return kind() == HANDLER; }
5058 inline bool is_keyed_stub();
5060 inline bool is_weak_stub();
5061 inline void mark_as_weak_stub();
5062 inline bool is_invalidated_weak_stub();
5063 inline void mark_as_invalidated_weak_stub();
5067 return (k == LOAD_IC || k == STORE_IC || k == KEYED_LOAD_IC ||
5068 k == KEYED_STORE_IC || k == COMPARE_NIL_IC) &&
5072 inline bool IsCodeStubOrIC();
5074 inline void set_raw_kind_specific_flags1(
int value);
5075 inline void set_raw_kind_specific_flags2(
int value);
5080 inline bool is_crankshafted();
5081 inline bool is_hydrogen_stub();
5082 inline void set_is_crankshafted(
bool value);
5086 inline bool is_turbofanned();
5087 inline void set_is_turbofanned(
bool value);
5090 inline bool optimizable();
5091 inline void set_optimizable(
bool value);
5095 inline bool has_deoptimization_support();
5096 inline void set_has_deoptimization_support(
bool value);
5100 inline bool has_debug_break_slots();
5101 inline void set_has_debug_break_slots(
bool value);
5105 inline bool is_compiled_optimizable();
5106 inline void set_compiled_optimizable(
bool value);
5112 inline void set_allow_osr_at_loop_nesting_level(
int level);
5113 inline int allow_osr_at_loop_nesting_level();
5118 inline void set_profiler_ticks(
int ticks);
5121 inline int builtin_index();
5122 inline void set_builtin_index(
int id);
5126 inline unsigned stack_slots();
5127 inline void set_stack_slots(
unsigned slots);
5131 inline unsigned safepoint_table_offset();
5132 inline void set_safepoint_table_offset(
unsigned offset);
5136 inline unsigned back_edge_table_offset();
5137 inline void set_back_edge_table_offset(
unsigned offset);
5139 inline bool back_edges_patched_for_osr();
5142 inline byte to_boolean_state();
5146 inline bool has_function_cache();
5147 inline void set_has_function_cache(
bool flag);
5152 inline bool marked_for_deoptimization();
5153 inline void set_marked_for_deoptimization(
bool flag);
5157 inline void set_constant_pool(
Object* constant_pool);
5160 SafepointEntry GetSafepointEntry(
Address pc);
5163 Object* FindNthObject(
int n,
Map* match_map);
5169 Map* FindFirstMap();
5173 Code* FindFirstHandler();
5183 Name* FindFirstName();
5185 class FindAndReplacePattern;
5190 void FindAndReplace(
const FindAndReplacePattern& pattern);
5199 inline void WipeOutHeader();
5202 static inline Flags ComputeFlags(
5207 static inline Flags ComputeMonomorphicFlags(
5211 static inline Flags ComputeHandlerFlags(
5212 Kind handler_kind, StubType type =
NORMAL,
5216 static inline StubType ExtractTypeFromFlags(Flags
flags);
5218 static inline Kind ExtractKindFromFlags(Flags
flags);
5221 static inline Flags RemoveTypeFromFlags(Flags
flags);
5222 static inline Flags RemoveTypeAndHolderFromFlags(Flags
flags);
5225 static inline Code* GetCodeFromTargetAddress(
Address address);
5228 static inline Object* GetObjectFromEntryAddress(
Address location_of_address);
5231 inline byte* instruction_start();
5234 inline byte* instruction_end();
5237 inline int body_size();
5240 inline byte* relocation_start();
5243 inline byte* entry();
5246 inline bool contains(
byte*
pc);
5250 void Relocate(intptr_t delta);
5253 void CopyFrom(
const CodeDesc& desc);
5265 DCHECK_EQ(
static_cast<int>(instruction_start() - address()),
5272 int SourceStatementPosition(
Address pc);
5277 int CodeSize() {
return SizeFor(body_size()); }
5280 template<
typename StaticVisitor>
5281 inline void CodeIterateBody(
Heap* heap);
5286 void ClearInlineCaches();
5287 void ClearInlineCaches(Kind kind);
5292 #define DECLARE_CODE_AGE_ENUM(X) k##X##CodeAge,
5294 kNotExecutedCodeAge = -2,
5295 kExecutedOnceCodeAge = -1,
5299 kFirstCodeAge = kNotExecutedCodeAge,
5300 kLastCodeAge = kAfterLastCodeAge - 1,
5301 kCodeAgeCount = kAfterLastCodeAge - kNotExecutedCodeAge - 1,
5302 kIsOldCodeAge = kSexagenarianCodeAge,
5303 kPreAgedCodeAge = kIsOldCodeAge - 1
5305 #undef DECLARE_CODE_AGE_ENUM
5311 static void MakeCodeAgeSequenceYoung(
byte* sequence,
Isolate* isolate);
5312 static void MarkCodeAsExecuted(
byte* sequence,
Isolate* isolate);
5324 void PrintDeoptLocation(FILE* out,
int bailout_id);
5328 void VerifyEmbeddedObjectsDependency();
5332 return is_optimized_code() || is_weak_stub();
5336 return (is_optimized_code() && !is_turbofanned() &&
5337 IsWeakObjectInOptimizedCode(
object)) ||
5338 (is_weak_stub() && IsWeakObjectInIC(
object));
5341 static inline bool IsWeakObjectInOptimizedCode(
Object*
object);
5342 static inline bool IsWeakObjectInIC(
Object*
object);
5346 static const int kMaxLoopNestingMarker = 6;
5350 static const int kRelocationInfoOffset = kInstructionSizeOffset +
kIntSize;
5351 static const int kHandlerTableOffset = kRelocationInfoOffset +
kPointerSize;
5352 static const int kDeoptimizationDataOffset =
5355 static const int kTypeFeedbackInfoOffset =
5357 static const int kNextCodeLinkOffset = kTypeFeedbackInfoOffset +
kPointerSize;
5359 static const int kICAgeOffset =
5361 static const int kFlagsOffset = kICAgeOffset +
kIntSize;
5362 static const int kKindSpecificFlags1Offset = kFlagsOffset +
kIntSize;
5363 static const int kKindSpecificFlags2Offset =
5364 kKindSpecificFlags1Offset +
kIntSize;
5366 static const int kPrologueOffset = kKindSpecificFlags2Offset +
kIntSize;
5369 static const int kHeaderPaddingStart = kConstantPoolOffset +
kIntSize;
5377 static const int kOptimizableOffset = kKindSpecificFlags1Offset;
5379 static const int kFullCodeFlags = kOptimizableOffset + 1;
5385 static const int kProfilerTicksOffset = kFullCodeFlags + 1;
5393 PlatformSmiTagging::kSmiValueSize - 11 + 1> {};
5396 static const int kStackSlotsFirstBit = 0;
5397 static const int kStackSlotsBitCount = 24;
5398 static const int kHasFunctionCacheBit =
5399 kStackSlotsFirstBit + kStackSlotsBitCount;
5400 static const int kMarkedForDeoptimizationBit = kHasFunctionCacheBit + 1;
5401 static const int kWeakStubBit = kMarkedForDeoptimizationBit + 1;
5402 static const int kInvalidatedWeakStubBit = kWeakStubBit + 1;
5403 static const int kIsTurbofannedBit = kInvalidatedWeakStubBit + 1;
5409 kStackSlotsFirstBit, kStackSlotsBitCount> {};
5413 :
public BitField<bool, kMarkedForDeoptimizationBit, 1> {};
5416 :
public BitField<bool, kInvalidatedWeakStubBit, 1> {};
5421 static const int kIsCrankshaftedBit = 0;
5423 kIsCrankshaftedBit, 1> {};
5426 static const int kSafepointTableOffsetFirstBit = kIsCrankshaftedBit + 1;
5427 static const int kSafepointTableOffsetBitCount = 24;
5430 kSafepointTableOffsetBitCount <= 32);
5434 kSafepointTableOffsetFirstBit,
5435 kSafepointTableOffsetBitCount> {};
5439 kIsCrankshaftedBit + 1, 27> {};
5441 kIsCrankshaftedBit + 1 + 27, 4> {};
5444 static const int kArgumentsBits = 16;
5445 static const int kMaxArguments = (1 << kArgumentsBits) - 1;
5448 static const int kFlagsNotUsedInLookup =
5449 TypeField::kMask | CacheHolderField::kMask;
5455 void ClearInlineCaches(
Kind* kind);
5458 byte* FindCodeAgeSequence();
5459 static void GetCodeAgeAndParity(
Code* code,
Age* age,
5467 byte* sequence,
Age age,
5531 kAllocationSiteTransitionChangedGroup
5534 static const int kGroupCount = kAllocationSiteTransitionChangedGroup + 1;
5542 int at(
int i) {
return start_indexes_[
i]; }
5545 int start_indexes_[kGroupCount + 1];
5558 void DeoptimizeDependentCodeGroup(
Isolate* isolate,
5561 bool MarkCodeForDeoptimization(
Isolate* isolate,
5569 inline bool is_code_at(
int i);
5570 inline Code* code_at(
int i);
5572 inline void set_object_at(
int i,
Object*
object);
5573 inline Object** slot_at(
int i);
5574 inline Object* object_at(
int i);
5575 inline void clear_at(
int i);
5576 inline void copy(
int from,
int to);
5589 static const int kCodesStartIndex = kGroupCount;
5602 inline int instance_size();
5603 inline void set_instance_size(
int value);
5606 inline int inobject_properties();
5607 inline void set_inobject_properties(
int value);
5610 inline int pre_allocated_property_fields();
5611 inline void set_pre_allocated_property_fields(
int value);
5619 inline int unused_property_fields();
5620 inline void set_unused_property_fields(
int value);
5623 inline byte bit_field();
5624 inline void set_bit_field(
byte value);
5627 inline byte bit_field2();
5628 inline void set_bit_field2(
byte value);
5632 inline void set_bit_field3(
uint32_t bits);
5635 0, kDescriptorIndexBitCount> {};
5637 kDescriptorIndexBitCount, kDescriptorIndexBitCount> {};
5658 inline void set_non_instance_prototype(
bool value);
5659 inline bool has_non_instance_prototype();
5664 inline void set_function_with_prototype(
bool value);
5665 inline bool function_with_prototype();
5670 set_bit_field(bit_field() | (1 << kIsHiddenPrototype));
5674 return ((1 << kIsHiddenPrototype) & bit_field()) != 0;
5679 set_bit_field(bit_field() | (1 << kHasNamedInterceptor));
5683 return ((1 << kHasNamedInterceptor) & bit_field()) != 0;
5688 set_bit_field(bit_field() | (1 << kHasIndexedInterceptor));
5692 return ((1 << kHasIndexedInterceptor) & bit_field()) != 0;
5702 set_bit_field(bit_field() | (1 << kIsUndetectable));
5706 return ((1 << kIsUndetectable) & bit_field()) != 0;
5711 set_bit_field(bit_field() | (1 << kIsObserved));
5715 return ((1 << kIsObserved) & bit_field()) != 0;
5718 inline void set_is_extensible(
bool value);
5719 inline bool is_extensible();
5720 inline void set_is_prototype_map(
bool value);
5721 inline bool is_prototype_map();
5727 DCHECK(this->elements_kind() == elements_kind);
5777 static bool IsValidElementsTransition(
ElementsKind from_kind,
5782 bool DictionaryElementsInPrototypeChainOnly();
5784 inline bool HasTransitionArray()
const;
5785 inline bool HasElementsTransition();
5786 inline Map* elements_transition_map();
5788 inline Map* GetTransition(
int transition_index);
5789 inline int SearchTransition(
Name*
name);
5803 Map* FindFieldOwner(
int descriptor);
5805 inline int GetInObjectPropertyOffset(
int index);
5807 int NumberOfFields();
5810 bool InstancesNeedRewriting(
Map* target,
int target_number_of_fields,
5811 int target_inobject,
int target_unused,
5812 int* old_number_of_fields);
5828 static Handle<Map> CopyGeneralizeAllRepresentations(
5833 const char* reason);
5834 static Handle<Map> CopyGeneralizeAllRepresentations(
5838 const char* reason);
5841 int descriptor_number,
5848 String* constructor_name();
5854 inline void set_dictionary_map(
bool value);
5855 inline bool is_dictionary_map();
5859 inline void set_is_access_check_needed(
bool access_check_needed);
5860 inline bool is_access_check_needed();
5863 inline bool has_code_cache();
5885 inline Object* GetBackPointer();
5888 inline void init_back_pointer(
Object* undefined);
5898 inline FixedArray* GetPrototypeTransitions();
5899 inline bool HasPrototypeTransitions();
5901 static const int kProtoTransitionHeaderSize = 1;
5902 static const int kProtoTransitionNumberOfEntriesOffset = 0;
5903 static const int kProtoTransitionElementsPerEntry = 2;
5904 static const int kProtoTransitionPrototypeOffset = 0;
5905 static const int kProtoTransitionMapOffset = 1;
5908 FixedArray* cache = GetPrototypeTransitions();
5909 if (cache->
length() == 0)
return 0;
5911 Smi::cast(cache->
get(kProtoTransitionNumberOfEntriesOffset))->value();
5915 FixedArray* cache = GetPrototypeTransitions();
5923 inline void LookupDescriptor(
JSObject* holder,
5925 LookupResult* result);
5927 inline void LookupTransition(
JSObject* holder,
5929 LookupResult* result);
5931 inline PropertyDetails GetLastDescriptorDetails();
5936 inline bool CanHaveMoreTransitions();
5939 int number_of_own_descriptors = NumberOfOwnDescriptors();
5940 DCHECK(number_of_own_descriptors > 0);
5941 return number_of_own_descriptors - 1;
5945 return NumberOfOwnDescriptorsBits::decode(bit_field3());
5949 DCHECK(number <= instance_descriptors()->number_of_descriptors());
5950 set_bit_field3(NumberOfOwnDescriptorsBits::update(bit_field3(), number));
5956 return EnumLengthBits::decode(bit_field3());
5962 DCHECK(length == 0 || instance_descriptors()->HasEnumCache());
5963 DCHECK(length <= NumberOfOwnDescriptors());
5965 set_bit_field3(EnumLengthBits::update(bit_field3(), length));
5968 inline bool owns_descriptors();
5969 inline void set_owns_descriptors(
bool owns_descriptors);
5970 inline bool has_instance_call_handler();
5971 inline void set_has_instance_call_handler();
5972 inline void freeze();
5973 inline bool is_frozen();
5974 inline void mark_unstable();
5975 inline bool is_stable();
5976 inline void set_migration_target(
bool value);
5977 inline bool is_migration_target();
5978 inline void set_done_inobject_slack_tracking(
bool value);
5979 inline bool done_inobject_slack_tracking();
5980 inline void set_construction_count(
int value);
5981 inline int construction_count();
5982 inline void deprecate();
5983 inline bool is_deprecated();
5984 inline bool CanBeDeprecated();
6049 inline void AppendDescriptor(
Descriptor* desc);
6057 int NextFreePropertyIndex();
6067 return pre_allocated_property_fields() + unused_property_fields() -
6068 inobject_properties();
6076 inline void ClearCodeCache(
Heap* heap);
6098 void RemoveFromCodeCache(
Name*
name,
Code* code,
int index);
6143 inline bool CanOmitMapChecks();
6155 bool IsMapInArrayPrototypeChain();
6162 void DictionaryMapVerify();
6163 void VerifyOmittedMapChecks();
6166 inline int visitor_id();
6167 inline void set_visitor_id(
int visitor_id);
6169 typedef void (*TraverseCallback)(
Map*
map,
void* data);
6171 void TraverseTransitionTree(TraverseCallback callback,
void* data);
6180 static const int kMaxCachedPrototypeTransitions = 256;
6184 static const int kMaxPreAllocatedPropertyFields = 255;
6188 static const int kInstanceAttributesOffset = kInstanceSizesOffset +
kIntSize;
6189 static const int kBitField3Offset = kInstanceAttributesOffset +
kIntSize;
6196 static const int kTransitionsOrBackPointerOffset =
6198 static const int kDescriptorsOffset =
6207 static const int kPointerFieldsEndOffset = kSize;
6210 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0;
6211 static const int kInObjectPropertiesByte = 1;
6212 static const int kInObjectPropertiesOffset =
6213 kInstanceSizesOffset + kInObjectPropertiesByte;
6214 static const int kPreAllocatedPropertyFieldsByte = 2;
6215 static const int kPreAllocatedPropertyFieldsOffset =
6216 kInstanceSizesOffset + kPreAllocatedPropertyFieldsByte;
6217 static const int kVisitorIdByte = 3;
6218 static const int kVisitorIdOffset = kInstanceSizesOffset + kVisitorIdByte;
6221 #if V8_TARGET_LITTLE_ENDIAN
6225 static const int kInstanceTypeOffset = kInstanceAttributesOffset + 0;
6226 static const int kBitFieldOffset = kInstanceAttributesOffset + 1;
6228 static const int kBitFieldOffset = kInstanceAttributesOffset + 0;
6229 static const int kInstanceTypeOffset = kInstanceAttributesOffset + 1;
6231 static const int kInstanceTypeAndBitFieldOffset =
6232 kInstanceAttributesOffset + 0;
6233 static const int kBitField2Offset = kInstanceAttributesOffset + 2;
6234 static const int kUnusedPropertyFieldsOffset = kInstanceAttributesOffset + 3;
6240 static const int kHasNonInstancePrototype = 0;
6241 static const int kIsHiddenPrototype = 1;
6242 static const int kHasNamedInterceptor = 2;
6243 static const int kHasIndexedInterceptor = 3;
6244 static const int kIsUndetectable = 4;
6245 static const int kIsObserved = 5;
6246 static const int kIsAccessCheckNeeded = 6;
6250 static const int kIsExtensible = 0;
6251 static const int kStringWrapperSafeForDefaultValueOf = 1;
6256 static const int8_t kMaximumBitField2FastElementValue =
static_cast<int8_t
>(
6258 static const int8_t kMaximumBitField2FastSmiElementValue =
6261 static const int8_t kMaximumBitField2FastHoleyElementValue =
6264 static const int8_t kMaximumBitField2FastHoleySmiElementValue =
6269 kPointerFieldsEndOffset,
6283 bool EquivalentToForTransition(
Map* other);
6313 inline void NotifyLeafMapLayoutChange();
6324 void ZapPrototypeTransitions();
6325 void ZapTransitions();
6327 void DeprecateTransitionTree();
6335 void PrintGeneralization(FILE*
file,
6340 bool constant_to_field,
6346 static inline void SetPrototypeTransitions(
6356 static const int kFastPropertiesSoftLimit = 12;
6357 static const int kMaxFastProperties = 128;
6368 inline void InitializeBody(
int object_size);
6405 COMPILATION_TYPE_HOST = 0,
6406 COMPILATION_TYPE_EVAL = 1
6411 COMPILATION_STATE_INITIAL = 0,
6412 COMPILATION_STATE_COMPILED = 1
6480 inline
bool HasValidSource();
6483 static
int GetColumnNumber(
Handle<
Script> script,
int code_pos);
6487 static
int GetLineNumber(
Handle<
Script> script,
int code_pos);
6488 int GetLineNumber(
int code_pos);
6497 void ClearWrapperCache();
6513 static const
int kEvalFrominstructionsOffsetOffset =
6515 static const
int kFlagsOffset =
6518 static const
int kSourceMappingUrlOffset = kSourceUrlOffset +
kPointerSize;
6522 int GetLineNumberWithArray(
int code_pos);
6525 static const
int kCompilationTypeBit = 0;
6526 static const
int kCompilationStateBit = 1;
6527 static const
int kIsSharedCrossOriginBit = 2;
6542 #define FUNCTIONS_WITH_ID_LIST(V) \
6543 V(Array.prototype, indexOf, ArrayIndexOf) \
6544 V(Array.prototype, lastIndexOf, ArrayLastIndexOf) \
6545 V(Array.prototype, push, ArrayPush) \
6546 V(Array.prototype, pop, ArrayPop) \
6547 V(Array.prototype, shift, ArrayShift) \
6548 V(Function.prototype, apply, FunctionApply) \
6549 V(String.prototype, charCodeAt, StringCharCodeAt) \
6550 V(String.prototype, charAt, StringCharAt) \
6551 V(String, fromCharCode, StringFromCharCode) \
6552 V(Math, floor, MathFloor) \
6553 V(Math, round, MathRound) \
6554 V(Math, ceil, MathCeil) \
6555 V(Math, abs, MathAbs) \
6556 V(Math, log, MathLog) \
6557 V(Math, exp, MathExp) \
6558 V(Math, sqrt, MathSqrt) \
6559 V(Math, pow, MathPow) \
6560 V(Math, max, MathMax) \
6561 V(Math, min, MathMin) \
6562 V(Math, imul, MathImul) \
6563 V(Math, clz32, MathClz32) \
6564 V(Math, fround, MathFround)
6568 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \
6571 #undef DECLARE_FUNCTION_ID
6587 inline void ReplaceCode(
Code* code);
6600 FixedArray* GetLiteralsFromOptimizedCodeMap(
int index);
6605 void ClearOptimizedCodeMap();
6608 void EvictFromOptimizedCodeMap(
Code* optimized_code,
const char* reason);
6610 void ClearTypeFeedbackInfo();
6613 void TrimOptimizedCodeMap(
int shrink_by);
6623 static const int kNextMapIndex = 0;
6624 static const int kEntriesStart = 1;
6625 static const int kContextOffset = 0;
6626 static const int kCachedCodeOffset = 1;
6627 static const int kLiteralsOffset = 2;
6628 static const int kOsrAstIdOffset = 3;
6629 static const int kEntryLength = 4;
6630 static const int kInitialLength = kEntriesStart + kEntryLength;
6639 inline bool is_compiled();
6652 inline void DontAdaptArguments();
6674 inline bool IsApiFunction();
6676 inline bool HasBuiltinFunctionId();
6683 inline
int num_literals() const;
6684 inline
void set_num_literals(
int value);
6692 inline
void set_start_position_and_type(
int value);
6712 inline
int start_position() const;
6713 inline
void set_start_position(
int start_position);
6716 inline
int end_position() const;
6717 inline
void set_end_position(
int end_position);
6728 inline
void set_compiler_hints(
int value);
6730 inline
int ast_node_count() const;
6731 inline
void set_ast_node_count(
int count);
6734 inline
void set_profiler_ticks(
int ticks);
6738 inline
int ic_age();
6739 inline
void set_ic_age(
int age);
6760 inline
void set_strict_mode(
StrictMode strict_mode);
6817 inline
bool has_deoptimization_support();
6820 void EnableDeoptimizationSupport(
Code* recompiled);
6838 inline
int opt_count();
6839 inline
void set_opt_count(
int opt_count);
6842 inline
void set_deopt_count(
int value);
6843 inline
int deopt_count();
6844 inline
void increment_deopt_count();
6848 inline
void set_opt_reenable_tries(
int value);
6849 inline
int opt_reenable_tries();
6851 inline
void TryReenableOptimization();
6855 inline
int counters() const;
6858 inline
void set_opt_count_and_bailout_reason(
int value);
6862 set_opt_count_and_bailout_reason(
6868 bool IsInlineable();
6874 int CalculateInstanceSize();
6877 int CalculateInObjectProperties();
6883 void ResetForNewContext(
int new_ic_age);
6888 static const
int kDontAdaptArgumentsSentinel = -1;
6895 static const
int kScopeInfoOffset = kOptimizedCodeMapOffset +
kPointerSize;
6897 static const
int kInstanceClassNameOffset =
6899 static const
int kFunctionDataOffset =
6904 static const
int kFeedbackVectorOffset =
6906 #if V8_HOST_ARCH_32_BIT
6908 static const int kLengthOffset =
6910 static const int kFormalParameterCountOffset = kLengthOffset +
kPointerSize;
6911 static const int kExpectedNofPropertiesOffset =
6913 static const int kNumLiteralsOffset =
6915 static const int kStartPositionAndTypeOffset =
6917 static const int kEndPositionOffset =
6919 static const int kFunctionTokenPositionOffset =
6921 static const int kCompilerHintsOffset =
6923 static const int kOptCountAndBailoutReasonOffset =
6925 static const int kCountersOffset =
6927 static const int kAstNodeCountOffset =
6929 static const int kProfilerTicksOffset =
6933 static const int kSize = kProfilerTicksOffset +
kPointerSize;
6944 static const int kLengthOffset =
6946 static const int kFormalParameterCountOffset =
6949 static const int kExpectedNofPropertiesOffset =
6950 kFormalParameterCountOffset +
kIntSize;
6951 static const int kNumLiteralsOffset =
6952 kExpectedNofPropertiesOffset +
kIntSize;
6954 static const int kEndPositionOffset =
6956 static const int kStartPositionAndTypeOffset =
6959 static const int kFunctionTokenPositionOffset =
6960 kStartPositionAndTypeOffset +
kIntSize;
6961 static const int kCompilerHintsOffset =
6962 kFunctionTokenPositionOffset +
kIntSize;
6964 static const int kOptCountAndBailoutReasonOffset =
6966 static const int kCountersOffset =
6967 kOptCountAndBailoutReasonOffset +
kIntSize;
6969 static const int kAstNodeCountOffset =
6971 static const int kProfilerTicksOffset =
6975 static const int kSize = kProfilerTicksOffset +
kIntSize;
6988 static const int kIsExpressionBit = 0;
6989 static const int kIsTopLevelBit = 1;
6990 static const int kStartPositionShift = 2;
6991 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1);
7026 #if V8_HOST_ARCH_32_BIT
7028 static const int kCompilerHintsSmiTagSize =
kSmiTagSize;
7032 static const int kCompilerHintsSmiTagSize = 0;
7043 static const int kStrictModeBitWithinByte =
7044 (kStrictModeFunction + kCompilerHintsSmiTagSize) %
kBitsPerByte;
7046 static const int kNativeBitWithinByte =
7049 #if defined(V8_TARGET_LITTLE_ENDIAN)
7050 static const int kStrictModeByteOffset = kCompilerHintsOffset +
7051 (kStrictModeFunction + kCompilerHintsSmiTagSize) /
kBitsPerByte;
7052 static const int kNativeByteOffset = kCompilerHintsOffset +
7054 #elif defined(V8_TARGET_BIG_ENDIAN)
7055 static const int kStrictModeByteOffset = kCompilerHintsOffset +
7056 (kCompilerHintsSize - 1) -
7057 ((kStrictModeFunction + kCompilerHintsSmiTagSize) /
kBitsPerByte);
7058 static const int kNativeByteOffset = kCompilerHintsOffset +
7059 (kCompilerHintsSize - 1) -
7062 #error Unknown byte ordering
7073 :
value(v), max_length(max) {}
7098 inline
int continuation() const;
7099 inline
void set_continuation(
int continuation);
7100 inline
bool is_closed();
7101 inline
bool is_executing();
7102 inline
bool is_suspended();
7109 inline
int stack_handler_index() const;
7110 inline
void set_stack_handler_index(
int stack_handler_index);
7119 static const
int kGeneratorExecuting = -1;
7120 static const
int kGeneratorClosed = 0;
7128 static const
int kStackHandlerIndexOffset =
7137 static const int kResultValuePropertyIndex = 0;
7138 static const int kResultDonePropertyIndex = 1;
7139 static const int kResultPropertyCount = 2;
7142 static const int kResultDonePropertyOffset =
7188 inline void set_context(
Object* context);
7195 inline Code* code();
7196 inline void set_code(
Code* code);
7197 inline void set_code_no_write_barrier(
Code* code);
7198 inline void ReplaceCode(
Code* code);
7201 inline bool IsBuiltin();
7204 inline bool IsFromNativeScript();
7207 inline bool IsFromExtensionScript();
7210 inline bool NeedsArgumentsAdaption();
7213 inline bool IsOptimized();
7216 inline bool IsOptimizable();
7220 void MarkForOptimization();
7221 void MarkForConcurrentOptimization();
7222 void MarkInOptimizationQueue();
7226 inline bool IsMarkedForOptimization();
7227 inline bool IsMarkedForConcurrentOptimization();
7230 inline bool IsInOptimizationQueue();
7262 static const int kFinishSlackTracking = 1;
7263 static const int kNoSlackTracking = 0;
7267 inline bool IsInobjectSlackTrackingInProgress();
7274 void StartInobjectSlackTracking();
7278 void CompleteInobjectSlackTracking();
7300 inline void set_function_bindings(
FixedArray* bindings);
7306 inline bool has_initial_map();
7313 inline bool has_prototype();
7314 inline bool has_instance_prototype();
7315 inline Object* prototype();
7316 inline Object* instance_prototype();
7329 bool RemovePrototype();
7330 inline bool should_have_prototype();
7344 inline bool is_compiled();
7353 void PrintName(FILE* out = stdout);
7359 void JSFunctionIterateBody(
int object_size,
ObjectVisitor* v);
7366 inline int NumberOfLiterals();
7372 bool PassesFilter(
const char* raw_filter);
7377 static const int kPrototypeOrInitialMapOffset =
7379 static const int kSharedFunctionInfoOffset =
7381 static const int kContextOffset = kSharedFunctionInfoOffset +
kPointerSize;
7384 static const int kNextFunctionLinkOffset = kNonWeakFieldsEndOffset;
7388 static const int kLiteralsPrefixSize = 1;
7389 static const int kLiteralNativeContextIndex = 0;
7392 static const int kBoundFunctionIndex = 0;
7393 static const int kBoundThisIndex = 1;
7394 static const int kBoundArgumentsStartIndex = 2;
7420 inline bool IsDetachedFrom(
GlobalObject* global)
const;
7460 static const
int kGlobalContextOffset = kNativeContextOffset +
kPointerSize;
7478 inline bool IsDetached();
7513 static const
int kJSBuiltinsCount =
Builtins::id_count;
7515 static const
int kJSBuiltinsCodeOffset =
7517 static const
int kSize =
7518 kJSBuiltinsCodeOffset + (kJSBuiltinsCount *
kPointerSize);
7520 static
int OffsetOfFunctionWithId(
Builtins::JavaScript
id) {
7605 kMillisecond = kFirstUncachedField,
7609 kYearUTC = kFirstUTCField,
7640 inline void SetCachedFields(int64_t local_time_ms,
DateCache* date_cache);
7668 inline
int start_position() const;
7669 inline
void set_start_position(
int value);
7672 inline
int end_position() const;
7673 inline
void set_end_position(
int value);
7742 inline Type TypeTag();
7743 inline int CaptureCount();
7744 inline Flags GetFlags();
7745 inline String* Pattern();
7746 inline Object* DataAt(
int index);
7752 return kIrregexpLatin1CodeIndex;
7754 return kIrregexpUC16CodeIndex;
7760 return kIrregexpLatin1CodeSavedIndex;
7762 return kIrregexpUC16CodeSavedIndex;
7775 static const
int kTagIndex = 0;
7776 static const
int kSourceIndex = kTagIndex + 1;
7777 static const
int kFlagsIndex = kSourceIndex + 1;
7778 static const
int kDataIndex = kFlagsIndex + 1;
7782 static const
int kAtomPatternIndex = kDataIndex;
7784 static const
int kAtomDataSize = kAtomPatternIndex + 1;
7789 static const
int kIrregexpLatin1CodeIndex = kDataIndex;
7793 static const
int kIrregexpUC16CodeIndex = kDataIndex + 1;
7797 static const
int kIrregexpLatin1CodeSavedIndex = kDataIndex + 2;
7800 static const
int kIrregexpUC16CodeSavedIndex = kDataIndex + 3;
7804 static const
int kIrregexpMaxRegisterCountIndex = kDataIndex + 4;
7806 static const
int kIrregexpCaptureCountIndex = kDataIndex + 5;
7808 static const
int kIrregexpDataSize = kIrregexpCaptureCountIndex + 1;
7811 static const
int kDataTagOffset =
7813 static const
int kDataOneByteCodeOffset =
7815 static const
int kDataUC16CodeOffset =
7817 static const
int kIrregexpCaptureCountOffset =
7821 static const
int kSourceFieldIndex = 0;
7822 static const
int kGlobalFieldIndex = 1;
7823 static const
int kIgnoreCaseFieldIndex = 2;
7824 static const
int kMultilineFieldIndex = 3;
7825 static const
int kLastIndexFieldIndex = 4;
7826 static const
int kInObjectFieldCount = 5;
7829 static const
int kUninitializedValue = -1;
7833 static const
int kCompilationErrorValue = -2;
7838 static const
int kCodeAgeMask = 0xff;
7858 static const int kPrefixSize = 0;
7859 static const int kEntrySize = 2;
7864 CompilationCacheShape,
7878 int scope_position);
7920 static const
int kNormalTypeCacheOffset =
7925 static
void UpdateDefaultCache(
7927 static
void UpdateNormalTypeCache(
7934 static const
int kCodeCacheEntrySize = 2;
7935 static const
int kCodeCacheEntryNameOffset = 0;
7936 static const
int kCodeCacheEntryCodeOffset = 1;
7958 static const int kPrefixSize = 0;
7959 static const int kEntrySize = 2;
7964 CodeCacheHashTableShape,
7974 void RemoveByIndex(
int index);
7979 static const
int kInitialSize = 64;
8028 static const
int kInitialSize = 64;
8036 inline int ic_total_count();
8037 inline void set_ic_total_count(
int count);
8039 inline int ic_with_type_info_count();
8040 inline void change_ic_with_type_info_count(
int delta);
8042 inline int ic_generic_count();
8043 inline void change_ic_generic_count(
int delta);
8045 inline void initialize_storage();
8047 inline void change_own_type_change_checksum();
8048 inline int own_type_change_checksum();
8050 inline void set_inlined_type_change_checksum(
int checksum);
8051 inline bool matches_inlined_type_change_checksum(
int checksum);
8066 static const
int kTypeChangeChecksumBits = 7;
8071 kSmiValueSize - kTypeChangeChecksumBits,
8072 kTypeChangeChecksumBits> {};
8074 kSmiValueSize - kTypeChangeChecksumBits> {};
8076 kSmiValueSize - kTypeChangeChecksumBits,
8077 kTypeChangeChecksumBits> {};
8092 static const uint32_t kMaximumArrayBytesToPretransition = 8 * 1024;
8094 static const int kPretenureMinimumCreated = 100;
8103 kLastPretenureDecisionValue = kZombie
8106 const char* PretenureDecisionName(PretenureDecision decision);
8118 inline void Initialize();
8121 bool IsNestedSite();
8136 inline bool IncrementMementoFoundCount();
8138 inline void IncrementMementoCreateCount();
8142 void ResetPretenureDecision();
8145 int value = pretenure_data()->value();
8146 return PretenureDecisionBits::decode(
value);
8150 int value = pretenure_data()->value();
8157 int value = pretenure_data()->value();
8158 return DeoptDependentCodeBit::decode(
value);
8162 int value = pretenure_data()->value();
8169 int value = pretenure_data()->value();
8170 return MementoFoundCountBits::decode(
value);
8173 inline void set_memento_found_count(
int count);
8176 return pretenure_create_count()->value();
8188 return pretenure_decision() == kZombie;
8192 return pretenure_decision() == kMaybeTenure;
8195 inline void MarkZombie();
8197 inline bool MakePretenureDecision(PretenureDecision current_decision,
8199 bool maximum_size_scavenge);
8201 inline bool DigestPretenuringFeedback(
bool maximum_size_scavenge);
8204 DCHECK(!SitePointsToLiteral());
8205 int value = Smi::cast(transition_info())->value();
8206 return ElementsKindBits::decode(
value);
8210 int value = Smi::cast(transition_info())->value();
8216 int value = Smi::cast(transition_info())->value();
8217 return DoNotInlineBit::decode(
value) == 0;
8221 int value = Smi::cast(transition_info())->value();
8230 return transition_info()->IsJSArray() || transition_info()->IsJSObject();
8257 static const int kPretenureCreateCountOffset =
8259 static const int kDependentCodeOffset =
8266 static const int kPointerFieldsBeginOffset = kTransitionInfoOffset;
8267 static const int kPointerFieldsEndOffset = kDependentCodeOffset;
8277 return pretenure_decision() != kUndecided;
8292 return allocation_site()->IsAllocationSite() &&
8293 !AllocationSite::cast(allocation_site())->IsZombie();
8297 return AllocationSite::cast(allocation_site());
8345 template <
typename s
char>
8346 static inline uint32_t HashSequentialString(
const schar* chars,
8353 int* utf16_length_out);
8363 static const int kZeroHash = 27;
8375 inline bool has_trivial_hash();
8377 template<
typename Char>
8378 inline void AddCharacters(
const Char* chars,
int len);
8382 inline void AddCharacter(
uint16_t c);
8384 inline bool UpdateIndex(
uint16_t c);
8398 inline void VisitOneByteString(
const uint8_t* chars,
int length);
8399 inline void VisitTwoByteString(
const uint16_t* chars,
int length);
8439 inline uint32_t type() {
return type_; }
8440 inline void invalidate() { valid_ =
false; }
8441 inline bool valid() {
return valid_; }
8449 inline void set_valid() { valid_ =
true; }
8466 inline bool HasHashCode();
8476 inline bool AsArrayIndex(
uint32_t* index);
8479 inline bool IsOwn();
8494 static const
int kHashNotComputedMask = 1;
8495 static const
int kIsNotArrayIndexMask = 1 << 1;
8496 static const
int kNofHashBitFields = 2;
8499 static const
int kHashShift = kNofHashBitFields;
8503 static const
uint32_t kHashBitMask = 0xffffffffu >> kHashShift;
8506 static const
int kMaxCachedArrayIndexLength = 7;
8511 static const
int kArrayIndexValueBits = 24;
8512 static const
int kArrayIndexLengthBits =
8513 kBitsPerInt - kArrayIndexValueBits - kNofHashBitFields;
8518 kArrayIndexValueBits> {};
8520 kNofHashBitFields + kArrayIndexValueBits,
8521 kArrayIndexLengthBits> {};
8528 static const unsigned int kContainsCachedArrayIndexMask =
8529 (~static_cast<unsigned>(kMaxCachedArrayIndexLength)
8530 << ArrayIndexLengthBits::kShift) |
8531 kIsNotArrayIndexMask;
8534 static const int kEmptyHashField =
8535 kIsNotArrayIndexMask | kHashNotComputedMask;
8538 static inline bool IsHashFieldComputed(
uint32_t field);
8567 static const
int kNameOffset =
Name::kSize;
8574 static const
int kPrivateBit = 0;
8575 static const
int kOwnBit = 1;
8593 enum Encoding { ONE_BYTE_ENCODING, TWO_BYTE_ENCODING };
8596 static const int kMaxCachedArrayIndexLength = 7;
8601 static const int kArrayIndexValueBits = 24;
8602 static const int kArrayIndexLengthBits =
8603 kBitsPerInt - kArrayIndexValueBits - kNofHashBitFields;
8608 kArrayIndexValueBits> {};
8610 kNofHashBitFields + kArrayIndexValueBits,
8611 kArrayIndexLengthBits> {};
8618 static const unsigned int kContainsCachedArrayIndexMask =
8619 (~static_cast<unsigned>(kMaxCachedArrayIndexLength)
8620 << ArrayIndexLengthBits::kShift) |
8621 kIsNotArrayIndexMask;
8652 DCHECK(state_ != NON_FLAT);
8653 if (state_ == ONE_BYTE)
return onebyte_start[
i];
8654 return twobyte_start[
i];
8662 : onebyte_start(start), length_(length), state_(ONE_BYTE) {}
8664 : twobyte_start(start), length_(length), state_(TWO_BYTE) { }
8690 inline bool IsOneByteRepresentation()
const;
8691 inline bool IsTwoByteRepresentation()
const;
8696 inline bool IsOneByteRepresentationUnderneath();
8697 inline bool IsTwoByteRepresentationUnderneath();
8701 inline bool HasOnlyOneByteChars();
8734 inline String* GetUnderlying();
8738 bool MarkAsUndetectable();
8759 int* length_output = 0);
8763 int* length_output = 0);
8774 bool ComputeArrayIndex(
uint32_t* index);
8781 inline bool AsArrayIndex(
uint32_t* index);
8785 void PrintOn(FILE* out);
8791 void StringShortPrint(StringStream* accumulator);
8794 char* ToAsciiArray();
8799 inline bool IsFlat();
8807 static const int kMaxArrayIndexSize = 10;
8813 static const int kMaxUtf16CodeUnit = 0xffff;
8814 static const uint32_t kMaxUtf16CodeUnitU = kMaxUtf16CodeUnit;
8817 static const int kEmptyStringHash = kIsNotArrayIndexMask;
8820 static const int kMaxLength = (1 << 28) - 16;
8824 static const int kMaxHashCalcLength = 16383;
8827 static const int kMaxShortPrintLength = 1024;
8830 const uc16* GetTwoByteData(
unsigned start);
8833 template <
typename sink
char>
8834 static void WriteToFlat(
String* source,
8844 const char* start = chars;
8845 const char* limit = chars + length;
8851 return static_cast<int>(chars - start);
8858 while (chars +
sizeof(
uintptr_t) <= limit) {
8859 if (*
reinterpret_cast<const uintptr_t*
>(chars) & non_one_byte_mask) {
8860 return static_cast<int>(chars - start);
8866 while (chars < limit) {
8868 return static_cast<int>(chars - start);
8873 return static_cast<int>(chars - start);
8876 static inline bool IsAscii(
const char* chars,
int length) {
8877 return NonAsciiStart(chars, length) >= length;
8880 static inline bool IsAscii(
const uint8_t* chars,
int length) {
8882 NonAsciiStart(
reinterpret_cast<const char*
>(chars), length) >= length;
8886 const uc16* limit = chars + length;
8887 const uc16* start = chars;
8888 while (chars < limit) {
8889 if (*chars > kMaxOneByteCharCodeU)
return static_cast<int>(chars - start);
8892 return static_cast<int>(chars - start);
8896 return NonOneByteStart(chars, length) >= length;
8899 template<
class Visitor>
8900 static inline ConsString* VisitFlat(Visitor* visitor,
8905 bool include_ending_line);
8909 inline void SetForwardedInternalizedString(
String*
string);
8910 inline String* GetForwardedInternalizedString();
8921 bool SlowEquals(
String* other);
8926 bool SlowAsArrayIndex(
uint32_t* index);
8957 static const bool kHasOneByteEncoding =
true;
8960 inline uint16_t SeqOneByteStringGet(
int index);
8964 inline Address GetCharsAddress();
8966 inline uint8_t* GetChars();
8973 inline int SeqOneByteStringSize(
InstanceType instance_type);
8981 static const int kMaxSize = 512 *
MB - 1;
8993 static const bool kHasOneByteEncoding =
false;
8996 inline uint16_t SeqTwoByteStringGet(
int index);
9000 inline Address GetCharsAddress();
9002 inline uc16* GetChars();
9005 const uint16_t* SeqTwoByteStringGetData(
unsigned start);
9012 inline int SeqTwoByteStringSize(
InstanceType instance_type);
9020 static const int kMaxSize = 512 *
MB - 1;
9043 inline Object* unchecked_first();
9044 inline void set_first(
String* first,
9051 inline Object* unchecked_second();
9052 inline void set_second(
String* second,
9066 static const
int kMinLength = 13;
9093 inline void set_parent(
String* parent,
9099 uint16_t SlicedStringGet(
int index);
9109 static const
int kMinLength = 13;
9141 static const
int kMaxShortLength =
9145 inline
bool is_short();
9158 static const bool kHasOneByteEncoding =
true;
9164 inline void set_resource(
const Resource* buffer);
9170 inline void update_data_cache();
9172 inline const uint8_t* GetChars();
9175 inline uint16_t ExternalOneByteStringGet(
int index);
9180 inline void ExternalOneByteStringIterateBody(
ObjectVisitor* v);
9182 template <
typename StaticVisitor>
9183 inline void ExternalOneByteStringIterateBody();
9194 static const bool kHasOneByteEncoding =
false;
9200 inline void set_resource(
const Resource* buffer);
9206 inline void update_data_cache();
9211 inline uint16_t ExternalTwoByteStringGet(
int index);
9214 inline const uint16_t* ExternalTwoByteStringGetData(
unsigned start);
9219 inline void ExternalTwoByteStringIterateBody(
ObjectVisitor* v);
9221 template<
typename StaticVisitor>
9222 inline void ExternalTwoByteStringIterateBody();
9260 void PostGarbageCollection();
9261 inline uc32 Get(
int index);
9291 Reset(cons_string, offset);
9296 if (cons_string ==
NULL)
return;
9297 Initialize(cons_string, offset);
9302 if (depth_ == 0)
return NULL;
9303 return Continue(offset_out);
9307 static const int kStackSize = 32;
9309 static const int kDepthMask = kStackSize-1;
9311 static inline int OffsetForDepth(
int depth);
9315 inline void AdjustMaximumDepth();
9317 inline bool StackBlown() {
return maximum_depth_ - depth_ == kStackSize; }
9318 void Initialize(
ConsString* cons_string,
int offset);
9319 String* Continue(
int* offset_out);
9320 String* NextLeaf(
bool* blew_stack);
9340 inline bool HasMore();
9341 inline void Reset(
String*
string,
int offset = 0);
9342 inline void VisitOneByteString(
const uint8_t* chars,
int length);
9343 inline void VisitTwoByteString(
const uint16_t* chars,
int length);
9357 template <
typename T>
9379 inline byte kind()
const;
9380 inline void set_kind(
byte kind);
9388 static void Initialize(
Isolate* isolate,
9390 const char* to_string,
9400 static const byte kFalse = 0;
9401 static const byte kTrue = 1;
9402 static const byte kNotBooleanMask = ~1;
9403 static const byte kTheHole = 2;
9404 static const byte kNull = 3;
9405 static const byte kArgumentMarker = 4;
9406 static const byte kUndefined = 5;
9407 static const byte kUninitialized = 6;
9408 static const byte kOther = 7;
9409 static const byte kException = 8;
9432 Object* result = FromAddress(
value - kValueOffset);
9433 DCHECK(result->IsCell() || result->IsPropertyCell());
9434 return static_cast<Cell*
>(result);
9438 return address() + kValueOffset;
9486 return address() + kTypeOffset;
9498 static const
int kPointerFieldsBeginOffset = kValueOffset;
9499 static const
int kPointerFieldsEndOffset = kDependentCodeOffset;
9556 inline void InitializeBody(
int object_size,
Object*
value);
9579 static const
int kPaddingSize = kSize - kPaddingOffset;
9634 static const
int kCallTrapOffset =
JSProxy::kPaddingOffset;
9638 static const
int kPaddingSize = kSize - kPaddingOffset;
9704 template<
class Derived,
class TableType>
9717 void OrderedHashTableIteratorPrint(
OStream& os);
9747 inline Object* CurrentKey();
9769 inline void PopulateValueArray(
FixedArray* array);
9787 inline void PopulateValueArray(
FixedArray* array);
9792 inline Object* CurrentValue();
9855 inline bool is_external();
9856 inline void set_is_external(
bool value);
9858 inline bool should_be_freed();
9859 inline void set_should_be_freed(
bool value);
9883 static const
int kSizeWithInternalFields =
9888 static const
int kIsExternalBit = 0;
9889 static const
int kShouldBeFreed = 1;
9938 size_t element_size();
9949 static const
int kSizeWithInternalFields =
9971 static const
int kSize = kViewSize;
9973 static const
int kSizeWithInternalFields =
9987 inline Address foreign_address();
9995 template<
typename StaticVisitor>
9996 inline void ForeignIterateBody();
10026 inline void set_length(
Smi* length);
10032 static bool IsReadOnlyLengthDescriptor(
Handle<Map> jsarray_map);
10039 static void Initialize(
Handle<JSArray> array,
int capacity,
int length = 0);
10042 inline bool AllowsSetElementsLength();
10057 int minimum_size_of_backing_fixed_array);
10062 int minimum_size_of_backing_fixed_array);
10069 static const
int kPreallocatedArrayElements = 4;
10097 static const int kIndexIndex = 0;
10098 static const int kInputIndex = 1;
10110 inline bool all_can_read();
10111 inline void set_all_can_read(
bool value);
10113 inline bool all_can_write();
10114 inline void set_all_can_write(
bool value);
10120 static bool IsCompatibleReceiverType(
Isolate* isolate,
10123 inline bool IsCompatibleReceiver(
Object* receiver);
10134 int valid_descriptors);
10143 return expected_receiver_type()->IsFunctionTemplateInfo();
10146 static const int kAllCanReadBit = 0;
10147 static const int kAllCanWriteBit = 1;
10289 inline
void clear_setter();
10328 if (!getter->IsNull()) set_getter(getter);
10329 if (!setter->IsNull()) set_setter(setter);
10333 return IsJSAccessor(getter()) || IsJSAccessor(setter());
10351 return obj->IsSpecFunction() || obj->IsUndefined();
10438 static const
int kPropertyAccessorsOffset =
10462 inline
int length() const;
10483 static const
int kPrototypeTemplateOffset =
10485 static const
int kParentTemplateOffset =
10487 static const
int kNamedPropertyHandlerOffset =
10489 static const
int kIndexedPropertyHandlerOffset =
10491 static const
int kInstanceTemplateOffset =
10496 static const
int kAccessCheckInfoOffset =
10503 bool IsTemplateFor(
Object*
object);
10504 bool IsTemplateFor(
Map*
map);
10508 static const
int kHiddenPrototypeBit = 0;
10509 static const
int kUndetectableBit = 1;
10510 static const
int kNeedsAccessCheckBit = 2;
10511 static const
int kReadOnlyPrototypeBit = 3;
10512 static const
int kRemovePrototypeBit = 4;
10513 static const
int kDoNotCacheBit = 5;
10531 static const
int kInternalFieldCountOffset =
10587 bool HasBreakPoint(
int code_position);
10589 Object* GetBreakPointInfo(
int code_position);
10596 int source_position,
int statement_position,
10599 Object* GetBreakPointObjects(
int code_position);
10604 int GetBreakPointCount();
10615 static const
int kActiveBreakPointsCountIndex =
10617 static const
int kBreakPointsStateIndex =
10621 static const
int kEstimatedNofBreakPointsInFunction = 16;
10624 static const
int kNoBreakPointInfo = -1;
10627 int GetBreakPointInfoIndex(
int code_position);
10658 int GetBreakPointCount();
10668 static const
int kStatementPositionIndex =
10670 static const
int kBreakPointObjectsIndex =
10679 #undef DECL_BOOLEAN_ACCESSORS
10680 #undef DECL_ACCESSORS
10681 #undef DECLARE_CAST
10682 #undef DECLARE_VERIFIER
10684 #define VISITOR_SYNCHRONIZATION_TAGS_LIST(V) \
10685 V(kStringTable, "string_table", "(Internalized strings)") \
10686 V(kExternalStringsTable, "external_strings_table", "(External strings)") \
10687 V(kStrongRootList, "strong_root_list", "(Strong roots)") \
10688 V(kSmiRootList, "smi_root_list", "(Smi roots)") \
10689 V(kInternalizedString, "internalized_string", "(Internal string)") \
10690 V(kBootstrapper, "bootstrapper", "(Bootstrapper)") \
10691 V(kTop, "top", "(Isolate)") \
10692 V(kRelocatable, "relocatable", "(Relocatable)") \
10693 V(kDebug, "debug", "(Debugger)") \
10694 V(kCompilationCache, "compilationcache", "(Compilation cache)") \
10695 V(kHandleScope, "handlescope", "(Handle scope)") \
10696 V(kBuiltins, "builtins", "(Builtins)") \
10697 V(kGlobalHandles, "globalhandles", "(Global handles)") \
10698 V(kEternalHandles, "eternalhandles", "(Eternal handles)") \
10699 V(kThreadManager, "threadmanager", "(Thread manager)") \
10700 V(kExtensions, "Extensions", "(Extensions)")
10704 #define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item,
10709 #undef DECLARE_ENUM
10711 static const char*
const kTags[kNumberOfSyncTags];
10712 static const char*
const kTagNames[kNumberOfSyncTags];
10782 return map->instance_size();
10791 static inline bool get(
Smi* smi,
int bit_position) {
10792 return get(smi->
value(), bit_position);
10796 return (
value & (1 << bit_position)) != 0;
10803 static inline int set(
int value,
int bit_position,
bool v) {
10805 value |= (1 << bit_position);
10807 value &= ~(1 << bit_position);
#define DCHECK_SIZE_TAG_ALIGNED(size)
static const unsigned kMaxChar
static const unsigned kMaxOneByteChar
A base class for an instance of one of "views" over ArrayBuffer, including TypedArrays and DataView (...
An instance of the built-in ArrayBuffer constructor (ES6 draft 15.13.5).
A superclass for symbols and strings.
An ExternalOneByteStringResource is a wrapper around an one-byte string buffer that resides outside V...
An ExternalStringResource is a wrapper around a two-byte string buffer that resides outside V8's heap...
bool HasExpectedReceiverType()
DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorInfo)
void SetComponents(Object *getter, Object *setter)
Object * get(AccessorComponent component)
void set(AccessorComponent component, Object *value)
DISALLOW_IMPLICIT_CONSTRUCTORS(AccessorPair)
void set_aliased_context_slot(int count)
int aliased_context_slot() const
AllocationSite * GetAllocationSite()
DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationMemento)
int memento_found_count()
FixedBodyDescriptor< HeapObject::kHeaderSize, kDependentCodeOffset+kPointerSize, kSize > BodyDescriptor
void SetDoNotInlineCall()
void set_pretenure_decision(PretenureDecision decision)
static const double kPretenureRatio
void set_deopt_dependent_code(bool deopt)
PretenureDecision pretenure_decision()
int memento_create_count()
DISALLOW_IMPLICIT_CONSTRUCTORS(AllocationSite)
void set_memento_create_count(int count)
STATIC_ASSERT(PretenureDecisionBits::kMax >=kLastPretenureDecisionValue)
ElementsKind GetElementsKind()
bool deopt_dependent_code()
bool SitePointsToLiteral()
void SetElementsKind(ElementsKind kind)
bool PretenuringDecisionMade()
virtual void IterateInstance(ObjectVisitor *v)
virtual void VisitEmbedderReference(Object **p, uint16_t class_id)
virtual void VisitExternalReference(Address *p)
static MapWord FromRawValue(uintptr_t value)
bool IsSequentialOneByte()
virtual void PostGarbageCollection()
virtual void VisitCodeEntry(Address entry_address)
static void Iterate(Isolate *isolate, ObjectVisitor *v)
static char * RestoreState(Isolate *isolate, char *from)
StringRepresentationTag representation_tag()
static void PostGarbageCollectionProcessing(Isolate *isolate)
virtual void VisitExternalTwoByteString(v8::String::ExternalStringResource **resource)
static MapWord FromForwardingAddress(HeapObject *object)
StringShape(InstanceType t)
virtual void VisitPointer(Object **p)
virtual void VisitRuntimeEntry(RelocInfo *rinfo)
virtual void VisitCodeAgeSequence(RelocInfo *rinfo)
virtual void VisitCodeTarget(RelocInfo *rinfo)
virtual void Synchronize(VisitorSynchronization::SyncTag tag)
virtual void VisitExternalOneByteString(v8::String::ExternalOneByteStringResource **resource)
HeapObject * ToForwardingAddress()
virtual void VisitNextCodeLink(Object **p)
static char * ArchiveState(Isolate *isolate, char *to)
StringShape(const String *s)
static char * Iterate(ObjectVisitor *v, char *t)
bool IsSequentialTwoByte()
static MapWord FromMap(const Map *map)
virtual void VisitDebugTarget(RelocInfo *rinfo)
bool IsForwardingAddress()
static int ArchiveSpacePerThread()
virtual void VisitPointers(Object **start, Object **end)=0
static void Iterate(ObjectVisitor *v, Relocatable *top)
uint32_t full_representation_tag()
Relocatable(Isolate *isolate)
virtual void VisitCell(RelocInfo *rinfo)
virtual void VisitExternalReference(RelocInfo *rinfo)
virtual void VisitEmbeddedPointer(RelocInfo *rinfo)
static uint32_t SeededHash(Key key, uint32_t seed)
static uint32_t Hash(Key key)
static uint32_t HashForObject(Key key, Object *object)
static uint32_t SeededHashForObject(Key key, uint32_t seed, Object *object)
static U update(U previous, T value)
static bool get(int value, int bit_position)
static bool get(Smi *smi, int bit_position)
static Smi * set(Smi *smi, int bit_position, bool v)
static int set(int value, int bit_position, bool v)
static int SizeFor(int length)
static int LengthFor(int size_in_bytes)
static bool IsMatch(HashTableKey *key, Object *value)
static uint32_t Hash(HashTableKey *key)
static uint32_t HashForObject(HashTableKey *key, Object *object)
bool CanContainWeakObjects()
bool is_compare_ic_stub()
static void PatchPlatformCodeAge(Isolate *isolate, byte *sequence, Age age, MarkingParity parity)
static bool IsYoungSequence(Isolate *isolate, byte *sequence)
STATIC_ASSERT(kStackSlotsFirstBit+kStackSlotsBitCount<=32)
static void GetCodeAgeAndParity(Isolate *isolate, byte *sequence, Age *age, MarkingParity *parity)
STATIC_ASSERT(NUMBER_OF_KINDS<=16)
int instruction_size() const
bool is_keyed_store_stub()
STATIC_ASSERT(kSafepointTableOffsetFirstBit+kSafepointTableOffsetBitCount<=32)
bool is_keyed_load_stub()
bool IsWeakObject(Object *object)
DISALLOW_IMPLICIT_CONSTRUCTORS(Code)
STATIC_ASSERT(kIsTurbofannedBit+1<=32)
static const int kHeaderSize
bool is_to_boolean_ic_stub()
static int SizeFor(int body_size)
STATIC_ASSERT(1+kSafepointTableOffsetBitCount<=32)
static Code * GetPreAgedCodeAgeStub(Isolate *isolate)
void set_instruction_size(int value)
STATIC_ASSERT(AllowOSRAtLoopNestingLevelField::kMax >=kMaxLoopNestingMarker)
bool is_compare_nil_ic_stub()
static bool IsMatch(HashTableKey *key, Object *value)
static uint32_t HashForObject(HashTableKey *key, Object *object)
static uint32_t Hash(HashTableKey *key)
DISALLOW_IMPLICIT_CONSTRUCTORS(CompilationCacheTable)
DISALLOW_COPY_AND_ASSIGN(ConsStringIteratorOp)
void Reset(ConsString *cons_string, int offset=0)
STATIC_ASSERT(IS_POWER_OF_TWO(kStackSize))
String * Next(int *offset_out)
ConsStringIteratorOp(ConsString *cons_string, int offset=0)
static String * Operate(String *, unsigned *, int32_t *, unsigned *)
DISALLOW_COPY_AND_ASSIGN(ConsStringNullOp)
ConstantPoolArray * array_
NumberOfEntries(int int64_count, int code_ptr_count, int heap_ptr_count, int int32_count)
Iterator(ConstantPoolArray *array, Type type)
NumberOfEntries(ConstantPoolArray *array, LayoutSection section)
int are_in_range(int min, int max) const
void increment(Type type)
Iterator(ConstantPoolArray *array, Type type, LayoutSection section)
const LayoutSection final_section_
LayoutSection current_section_
int base_of(Type type) const
int count_of(Type type) const
int equals(const NumberOfEntries &other) const
static Type next_type(Type type)
@ WEAK_OBJECTS_IN_OPTIMIZED_CODE
DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantPoolArray)
static int MaxInt64Offset(int number_of_int64)
int OffsetOfElementAt(int index)
static int SizeFor(const NumberOfEntries &small)
int number_of_entries(Type type, LayoutSection layout_section)
static int entry_size(Type type)
static int SizeForExtended(const NumberOfEntries &small, const NumberOfEntries &extended)
DISALLOW_IMPLICIT_CONSTRUCTORS(DeclaredAccessorDescriptorIterator)
Smi * PcAndState(int index)
void SetAstId(int index, BailoutId id)
BailoutId AstId(int index)
static int LengthOfFixedArray(int deopt_points)
void SetPcAndState(int index, Smi *offset)
@ kElementsCantBeAddedGroup
@ kInitialMapChangedGroup
@ kPropertyCellChangedGroup
@ kAllocationSiteTenuringChangedGroup
Entry(DescriptorArray *descs, int index)
Object * GetCallbackObject()
IncrementalMarking * marking_
void CopyEnumCacheFrom(DescriptorArray *array)
static int LengthFor(int number_of_descriptors)
INLINE(int Search(Name *name, int number_of_own_descriptors))
static int ToValueIndex(int descriptor_number)
DISALLOW_IMPLICIT_CONSTRUCTORS(DescriptorArray)
FixedArray * GetEnumCache()
INLINE(int SearchWithCache(Name *name, Map *map))
static int ToDetailsIndex(int descriptor_number)
int number_of_descriptors_storage()
bool HasEnumIndicesCache()
int NumberOfSlackDescriptors()
static int ToKeyIndex(int descriptor_number)
FixedArray * GetEnumIndicesCache()
int number_of_descriptors()
Object ** GetEnumCacheSlot()
void CopyKeysTo(FixedArray *storage, int index, PropertyAttributes filter, SortMode sort_mode)
void CopyKeysTo(FixedArray *storage, PropertyAttributes filter, SortMode sort_mode)
Object * ValueAt(int entry)
void SetNextEnumerationIndex(int index)
HashTable< Derived, Shape, Key > DerivedHashTable
static MUST_USE_RESULT Handle< Derived > Shrink(Handle< Derived > dictionary, Key key)
PropertyDetails DetailsAt(int entry)
void ValueAtPut(int entry, Object *value)
void DetailsAtPut(int entry, PropertyDetails value)
int NextEnumerationIndex()
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalArray)
bool is_the_hole(int index)
DECL_ACCESSORS(external_pointer, void) static const int kMaxLength=0x3fffffff
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloat32Array)
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalFloat64Array)
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalInt16Array)
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalInt32Array)
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalInt8Array)
v8::String::ExternalOneByteStringResource Resource
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalOneByteString)
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalTwoByteString)
v8::String::ExternalStringResource Resource
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint16Array)
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint32Array)
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint8Array)
DISALLOW_IMPLICIT_CONSTRUCTORS(ExternalUint8ClampedArray)
static const int kLengthOffset
void set_length(int value)
int synchronized_length() const
void synchronized_set_length(int value)
static int SizeOf(Map *map, HeapObject *object)
Object ** RawFieldOfElementAt(int index)
static int OffsetOfElementAt(int index)
DISALLOW_IMPLICIT_CONSTRUCTORS(FixedArray)
static int SizeFor(int length)
void set(int index, Object *value)
STATIC_ASSERT(kHeaderSize==Internals::kFixedArrayHeaderSize)
static const int kMaxLength
static void IterateBody(HeapObject *obj)
static int SizeFor(int length)
static int OffsetOfElementAt(int index)
DISALLOW_IMPLICIT_CONSTRUCTORS(FixedTypedArray)
static int SizeFor(int length)
Traits::ElementType ElementType
static void IterateBody(HeapObject *obj, int object_size)
void nobarrier_set_size(int value)
int nobarrier_size() const
virtual uint32_t Hash()=0
virtual bool IsMatch(Object *other)=0
virtual MUST_USE_RESULT Handle< Object > AsHandle(Isolate *isolate)=0
virtual uint32_t HashForObject(Object *key)=0
void SetNumberOfElements(int nof)
static uint32_t NextProbe(uint32_t last, uint32_t number, uint32_t size)
Object * KeyAt(int entry)
static uint32_t GetProbe(uint32_t hash, uint32_t number, uint32_t size)
int NumberOfDeletedElements()
void SetNumberOfDeletedElements(int nod)
uint32_t HashForObject(Key key, Object *object)
static int EntryToIndex(int entry)
static uint32_t FirstProbe(uint32_t hash, uint32_t size)
void ElementsRemoved(int n)
void SetCapacity(int capacity)
DISALLOW_IMPLICIT_CONSTRUCTORS(HeapNumber)
STATIC_ASSERT(kMapOffset==Internals::kHeapObjectMapOffset)
static Object ** RawField(HeapObject *obj, int offset)
DISALLOW_IMPLICIT_CONSTRUCTORS(HeapObject)
static const int kHeaderSize
This class exports constants and functionality from within v8 that is necessary to implement inline f...
static const int kHeapObjectMapOffset
static const int kOddballType
static const int kForeignType
static const int kUndefinedOddballKind
static const int kJSObjectType
static const int kFirstNonstringType
static const int kFixedArrayHeaderSize
static const int kNullOddballKind
static const int kOddballKindOffset
static const int kMapInstanceTypeAndBitFieldOffset
static const int kJSObjectHeaderSize
DISALLOW_COPY_AND_ASSIGN(IteratingStringHasher)
IteratingStringHasher(int len, uint32_t seed)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSBuiltinsObject)
static int OffsetOfCodeWithId(Builtins::JavaScript id)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSDate)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSFunction)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSGeneratorObject)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSMapIterator)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSMap)
static Handle< JSObject > Copy(Handle< JSObject > object)
bool HasFixedUint8Elements()
bool HasFixedUint8ClampedElements()
bool HasExternalInt16Elements()
DISALLOW_IMPLICIT_CONSTRUCTORS(JSObject)
bool HasExternalFloat32Elements()
DECL_ACCESSORS(properties, FixedArray) inline void initialize_properties()
bool HasExternalInt8Elements()
bool HasFixedFloat32Elements()
static const int kHeaderSize
STATIC_ASSERT(kHeaderSize==Internals::kJSObjectHeaderSize)
bool HasFixedInt8Elements()
bool HasFixedFloat64Elements()
bool HasExternalUint8Elements()
ExecutableAccessorInfoHandling
static int NewElementsCapacity(int old_capacity)
bool HasExternalInt32Elements()
bool HasFixedUint32Elements()
static bool CanSetCallback(Handle< JSObject > object, Handle< Name > name)
SetFastElementsCapacitySmiMode
bool HasFixedInt32Elements()
bool HasFixedInt16Elements()
bool HasExternalUint16Elements()
bool HasFixedUint16Elements()
bool HasExternalUint8ClampedElements()
bool HasExternalUint32Elements()
bool HasExternalFloat64Elements()
bool HasFixedArrayElements()
DISALLOW_IMPLICIT_CONSTRUCTORS(JSReceiver)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSRegExpResult)
static int saved_code_index(bool is_latin1)
static int code_index(bool is_latin1)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSSetIterator)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSSet)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakMap)
DISALLOW_IMPLICIT_CONSTRUCTORS(JSWeakSet)
static uint32_t HashForObject(HashTableKey *key, Object *object)
static uint32_t Hash(HashTableKey *key)
static bool IsMatch(HashTableKey *key, Object *value)
DISALLOW_IMPLICIT_CONSTRUCTORS(MapCache)
bool has_external_array_elements()
ElementsKind elements_kind()
void SetEnumLength(int length)
int NumberOfOwnDescriptors()
Cell * RetrieveDescriptorsPointer()
bool IsJSGlobalProxyMap()
void set_is_hidden_prototype()
void set_is_undetectable()
STATIC_ASSERT(kDescriptorIndexBitCount+kDescriptorIndexBitCount==20)
bool has_fast_smi_or_object_elements()
FixedBodyDescriptor< kPointerFieldsBeginOffset, kPointerFieldsEndOffset, kSize > BodyDescriptor
void SetNumberOfProtoTransitions(int value)
bool has_named_interceptor()
bool is_hidden_prototype()
bool has_dictionary_elements()
void SetNumberOfOwnDescriptors(int number)
bool IsJSGlobalObjectMap()
bool has_fixed_typed_array_elements()
void ClearNonLiveTransitions(Heap *heap)
void set_elements_kind(ElementsKind elements_kind)
void set_has_named_interceptor()
bool has_fast_double_elements()
DISALLOW_IMPLICIT_CONSTRUCTORS(Map)
int InitialPropertiesLength()
bool has_sloppy_arguments_elements()
bool has_fast_smi_elements()
bool has_fast_object_elements()
int NumberOfProtoTransitions()
STATIC_ASSERT(kInstanceTypeAndBitFieldOffset==Internals::kMapInstanceTypeAndBitFieldOffset)
bool has_indexed_interceptor()
static const int kPrototypeOffset
void set_has_indexed_interceptor()
bool has_slow_elements_kind()
Dictionary< NameDictionary, NameDictionaryShape, Handle< Name > > DerivedDictionary
STATIC_ASSERT(IS_POWER_OF_TWO(kMaxCachedArrayIndexLength+1))
DISALLOW_IMPLICIT_CONSTRUCTORS(Name)
void set(int index, Object *value)
static int EntryToValueIndex(int entry)
HashTable< ObjectHashTable, ObjectHashTableShape, Handle< Object > > DerivedHashTable
INLINE(bool IsNameDictionary() const)
INLINE(bool IsException() const)
INLINE(bool IsTrue() const)
Handle< HeapType > OptimalType(Isolate *isolate, Representation representation)
static MUST_USE_RESULT MaybeHandle< Object > AddDataProperty(LookupIterator *it, Handle< Object > value, PropertyAttributes attributes, StrictMode strict_mode, StoreFromKeyed store_mode)
static MUST_USE_RESULT MaybeHandle< Object > GetPropertyOrElement(Handle< Object > object, Handle< Name > key)
static MUST_USE_RESULT MaybeHandle< Object > SetPropertyWithDefinedSetter(Handle< Object > receiver, Handle< JSReceiver > setter, Handle< Object > value)
INLINE(bool IsArgumentsMarker() const)
INLINE(bool IsOrderedHashMap() const)
static MUST_USE_RESULT MaybeHandle< Object > SetPropertyWithAccessor(Handle< Object > receiver, Handle< Name > name, Handle< Object > value, Handle< JSObject > holder, Handle< Object > structure, StrictMode strict_mode)
INLINE(bool IsExternal() const)
bool ToUint32(uint32_t *value)
INLINE(bool IsUndefined() const)
static MaybeHandle< JSReceiver > ToObject(Isolate *isolate, Handle< Object > object)
static MUST_USE_RESULT MaybeHandle< Object > GetElement(Isolate *isolate, Handle< Object > object, uint32_t index)
INLINE(bool IsFixedArrayBase() const)
INLINE(bool IsFalse() const)
INLINE(bool IsSeededNumberDictionary() const)
bool SameValue(Object *other)
friend class LookupIterator
static MUST_USE_RESULT MaybeHandle< Object > GetProperty(LookupIterator *it)
@ MAY_BE_STORE_FROM_KEYED
@ CERTAINLY_NOT_STORE_FROM_KEYED
Map * GetRootMap(Isolate *isolate)
bool SameValueZero(Object *other)
static Handle< Object > NewStorageFor(Isolate *isolate, Handle< Object > object, Representation representation)
INLINE(bool IsSpecFunction()) const
INLINE(bool IsUninitialized() const)
static MUST_USE_RESULT MaybeHandle< Object > WriteToReadOnlyProperty(LookupIterator *it, Handle< Object > value, StrictMode strict_mode)
void ShortPrint(FILE *out=stdout)
static MUST_USE_RESULT MaybeHandle< Object > GetPropertyWithDefinedGetter(Handle< Object > receiver, Handle< JSReceiver > getter)
INLINE(bool IsUnseededNumberDictionary() const)
static MUST_USE_RESULT MaybeHandle< Smi > ToSmi(Isolate *isolate, Handle< Object > object)
INLINE(bool IsFiller() const)
bool FitsRepresentation(Representation representation)
void VerifyApiCallResultType()
static Handle< Object > SetDataProperty(LookupIterator *it, Handle< Object > value)
INLINE(bool IsAccessorInfo() const)
bool IsStringObjectWithCharacterAt(uint32_t index)
INLINE(bool IsSpecObject()) const
INLINE(bool IsStruct() const)
bool ToInt32(int32_t *value)
Representation OptimalRepresentation()
INLINE(bool IsNaN() const)
bool ToArrayIndex(uint32_t *index)
INLINE(bool IsOrderedHashSet() const)
INLINE(bool IsTemplateInfo()) const
INLINE(bool IsMinusZero() const)
static Handle< Smi > GetOrCreateHash(Isolate *isolate, Handle< Object > object)
INLINE(bool IsNull() const)
INLINE(bool IsTheHole() const)
static Handle< Object > WrapForRead(Isolate *isolate, Handle< Object > object, Representation representation)
static const int kHeaderSize
static MUST_USE_RESULT MaybeHandle< Object > GetElementWithReceiver(Isolate *isolate, Handle< Object > object, Handle< Object > receiver, uint32_t index)
static MUST_USE_RESULT MaybeHandle< Object > GetPropertyWithAccessor(Handle< Object > receiver, Handle< Name > name, Handle< JSObject > holder, Handle< Object > structure)
bool HasSpecificClassOf(String *name)
DISALLOW_IMPLICIT_CONSTRUCTORS(Object)
static MUST_USE_RESULT MaybeHandle< Object > SetProperty(Handle< Object > object, Handle< Name > key, Handle< Object > value, StrictMode strict_mode, StoreFromKeyed store_mode=MAY_BE_STORE_FROM_KEYED)
STATIC_ASSERT(kNull==Internals::kNullOddballKind)
STATIC_ASSERT(kUndefined==Internals::kUndefinedOddballKind)
DISALLOW_IMPLICIT_CONSTRUCTORS(Oddball)
FixedBodyDescriptor< kToStringOffset, kToNumberOffset+kPointerSize, kSize > BodyDescriptor
STATIC_ASSERT(kKindOffset==Internals::kOddballKindOffset)
Object * ValueAt(int entry)
DISALLOW_IMPLICIT_CONSTRUCTORS(OrderedHashTableIterator)
void SetNextTable(Derived *next_table)
int RemovedIndexAt(int index)
void SetRemovedIndexAt(int index, int removed_index)
int HashToEntry(int hash)
int NumberOfDeletedElements()
int EntryToIndex(int entry)
void SetNumberOfBuckets(int num)
void SetNumberOfElements(int num)
int HashToBucket(int hash)
void SetNumberOfDeletedElements(int num)
Object * KeyAt(int entry)
A class to uniformly access the prototype of any Object and walk its prototype chain.
static Representation Double()
bool IsHeapObject() const
static Representation Smi()
static Representation HeapObject()
static Representation Tagged()
static Representation None()
DISALLOW_IMPLICIT_CONSTRUCTORS(SeqOneByteString)
static int SizeFor(int length)
STATIC_ASSERT((kMaxSize - kHeaderSize) >=String::kMaxLength)
static int SizeFor(int length)
STATIC_ASSERT(static_cast< int >((kMaxSize - kHeaderSize)/sizeof(uint16_t)) >=String::kMaxLength)
DISALLOW_IMPLICIT_CONSTRUCTORS(SeqTwoByteString)
FixedBodyDescriptor< kNameOffset, kFeedbackVectorOffset+kPointerSize, kSize > BodyDescriptor
void set_expected_nof_properties(int value)
static const int kCompilerHintsSize
void set_formal_parameter_count(int value)
@ kNameShouldPrintAsAnonymous
@ kHasDuplicateParameters
@ kAllowLazyCompilationWithoutContext
void set_length(int value)
int formal_parameter_count() const
DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo)
STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount<=SharedFunctionInfo::kCompilerHintsSize *kBitsPerByte)
int expected_nof_properties() const
void set_offset(int offset)
void SmiPrint(OStream &os) const
DISALLOW_IMPLICIT_CONSTRUCTORS(Smi)
static const int kMaxValue
static const int kMinValue
static Smi * FromInt(int value)
static Smi * FromIntptr(intptr_t value)
static bool IsValid(intptr_t value)
const uint16_t * buffer16_
ConsStringIteratorOp * op_
DISALLOW_COPY_AND_ASSIGN(StringCharacterStream)
INLINE(static uint32_t AddCharacterCore(uint32_t running_hash, uint16_t c))
DISALLOW_COPY_AND_ASSIGN(StringHasher)
uint32_t raw_running_hash_
INLINE(static uint32_t GetHashCore(uint32_t running_hash))
static bool IsMatch(HashTableKey *key, Object *value)
static uint32_t Hash(HashTableKey *key)
static uint32_t HashForObject(HashTableKey *key, Object *object)
DISALLOW_IMPLICIT_CONSTRUCTORS(StringTable)
const uc16 * twobyte_start
FlatContent(const uc16 *start, int length)
const uint8_t * onebyte_start
FlatContent(const uint8_t *start, int length)
Vector< const uint8_t > ToOneByteVector()
Vector< const uc16 > ToUC16Vector()
static int NonAsciiStart(const char *chars, int length)
STATIC_ASSERT((kArrayIndexLengthBits > 0))
int synchronized_length() const
static bool IsAscii(const uint8_t *chars, int length)
static const int kMaxLength
STATIC_ASSERT(IS_POWER_OF_TWO(kMaxCachedArrayIndexLength+1))
void synchronized_set_length(int value)
static int NonOneByteStart(const uc16 *chars, int length)
STATIC_ASSERT(kMaxArrayIndexSize<(1<< kArrayIndexLengthBits))
INLINE(uint16_t Get(int index))
DISALLOW_IMPLICIT_CONSTRUCTORS(String)
static bool IsOneByte(const uc16 *chars, int length)
void set_length(int value)
static bool IsAscii(const char *chars, int length)
static int SizeOf(Map *map, HeapObject *object)
DISALLOW_IMPLICIT_CONSTRUCTORS(TypeFeedbackInfo)
VectorIterator(Vector< const T > data)
VectorIterator(T *d, int l)
HashTable< WeakHashTable, WeakHashTableShape< 2 >, Handle< Object > > DerivedHashTable
static int EntryToValueIndex(int entry)
#define WARN_UNUSED_RESULT
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf map
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes to(mksnapshot only)") DEFINE_STRING(raw_context_file
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in name
enable harmony numeric literals(0o77, 0b11)") DEFINE_BOOL(harmony_object_literals
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long mode(MIPS only)") DEFINE_BOOL(enable_always_align_csp
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be expose gc extension under the specified name show built in functions in stack traces use random jit cookie to mask large constants minimum length for automatic enable preparsing CPU profiler sampling interval in microseconds trace out of bounds accesses to external arrays default size of stack region v8 is allowed to maximum length of function source code printed in a stack trace min size of a semi the new space consists of two semi spaces print one trace line following each garbage collection do not print trace line after scavenger collection print cumulative GC statistics in only print modified registers Trace simulator debug messages Implied by trace sim abort randomize hashes to avoid predictable hash Fixed seed to use to hash property Print the time it takes to deserialize the snapshot A filename with extra code to be included in the A file to write the raw snapshot bytes A file to write the raw context snapshot bytes Write V8 startup blob file(mksnapshot only)") DEFINE_BOOL(profile_hydrogen_code_stub_compilation
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
#define POINTER_SIZE_ALIGN(value)
#define OBJECT_POINTER_ALIGN(value)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define IS_POWER_OF_TWO(x)
bool IsPowerOfTwo32(uint32_t value)
bool Equals(Node *a, Node *b)
@ DONT_ALLOW_DOUBLE_ELEMENTS
@ ALLOW_CONVERTED_DOUBLE_ELEMENTS
@ ALLOW_COPIED_DOUBLE_ELEMENTS
const uint32_t kStringEncodingMask
static bool IterateElements(Isolate *isolate, Handle< JSArray > receiver, ArrayConcatVisitor *visitor)
A helper function that visits elements of a JSArray in numerical order.
kSerializedDataOffset kPrototypeTemplateOffset kIndexedPropertyHandlerOffset kInstanceCallHandlerOffset internal_field_count
kFeedbackVectorOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kDoNotCacheBit is_toplevel
@ LAST_ALLOCATION_SITE_MODE
@ DONT_TRACK_ALLOCATION_SITE
kFeedbackVectorOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kDoNotCacheBit kIsTopLevelBit kAllowLazyCompilationWithoutContext has_duplicate_parameters
kExpectedNofPropertiesOffset kFunctionTokenPositionOffset kOptCountAndBailoutReasonOffset profiler_ticks
const uintptr_t kUintptrAllBitsSet
bool IsExternalArrayElementsKind(ElementsKind kind)
kSerializedDataOffset kPrototypeTemplateOffset indexed_property_handler
FixedArraySubInstanceType
@ LAST_FIXED_ARRAY_SUB_TYPE
PrototypeOptimizationMode
static int min(int a, int b)
const intptr_t kCodeAlignment
bool IsFastSmiOrObjectElementsKind(ElementsKind kind)
static MUST_USE_RESULT MaybeHandle< Code > GetCodeFromOptimizedCodeMap(Handle< JSFunction > function, BailoutId osr_ast_id)
const uint32_t kTwoByteStringTag
const uint32_t kShortExternalStringTag
kExpectedNofPropertiesOffset function_token_position
Handle< Object > CacheInitialJSArrayMaps(Handle< Context > native_context, Handle< Map > initial_map)
const uint32_t kShortcutTypeMask
static const ExtraICState kNoExtraICState
name_should_print_as_anonymous
@ USE_DEFAULT_MINIMUM_CAPACITY
const uint32_t kNotStringTag
static KeyedAccessStoreMode GetNonTransitioningStoreMode(KeyedAccessStoreMode store_mode)
static const int kGrowICDelta
@ STORE_AND_GROW_TRANSITION_HOLEY_DOUBLE_TO_OBJECT
@ STORE_TRANSITION_HOLEY_SMI_TO_OBJECT
@ STORE_TRANSITION_DOUBLE_TO_OBJECT
@ STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_DOUBLE
@ STORE_AND_GROW_NO_TRANSITION
@ STORE_AND_GROW_TRANSITION_SMI_TO_DOUBLE
@ STORE_AND_GROW_TRANSITION_DOUBLE_TO_OBJECT
@ STORE_NO_TRANSITION_IGNORE_OUT_OF_BOUNDS
@ STORE_NO_TRANSITION_HANDLE_COW
@ STORE_TRANSITION_HOLEY_SMI_TO_DOUBLE
@ STORE_TRANSITION_HOLEY_DOUBLE_TO_OBJECT
@ STORE_AND_GROW_TRANSITION_SMI_TO_OBJECT
@ STORE_TRANSITION_SMI_TO_DOUBLE
@ STORE_TRANSITION_SMI_TO_OBJECT
@ STORE_AND_GROW_TRANSITION_HOLEY_SMI_TO_OBJECT
static bool IsTransitionStoreMode(KeyedAccessStoreMode store_mode)
const int kElementsKindCount
kSerializedDataOffset Object
const uint32_t kNotInternalizedTag
kSerializedDataOffset kPrototypeTemplateOffset kIndexedPropertyHandlerOffset instance_call_handler
const uint32_t kStringTag
TypeImpl< HeapTypeConfig > HeapType
@ OBJECT_TEMPLATE_INFO_TYPE
@ FIRST_FIXED_TYPED_ARRAY_TYPE
@ LAST_NONCALLABLE_SPEC_OBJECT_TYPE
@ SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE
@ SHORT_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE
@ NUM_OF_CALLABLE_SPEC_OBJECT_TYPES
@ DECLARED_ACCESSOR_INFO_TYPE
@ FIRST_NONCALLABLE_SPEC_OBJECT_TYPE
@ FIXED_DOUBLE_ARRAY_TYPE
@ DECLARED_ACCESSOR_DESCRIPTOR_TYPE
@ CONS_ONE_BYTE_STRING_TYPE
@ JS_GENERATOR_OBJECT_TYPE
@ EXTERNAL_FLOAT32_ARRAY_TYPE
@ EXTERNAL_UINT32_ARRAY_TYPE
@ EXTERNAL_FLOAT64_ARRAY_TYPE
@ EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE
@ EXTERNAL_UINT8_ARRAY_TYPE
@ FIXED_UINT16_ARRAY_TYPE
@ ALLOCATION_MEMENTO_TYPE
@ SLICED_ONE_BYTE_STRING_TYPE
@ JS_CONTEXT_EXTENSION_OBJECT_TYPE
@ MUTABLE_HEAP_NUMBER_TYPE
@ EXTERNAL_UINT8_CLAMPED_ARRAY_TYPE
@ EXECUTABLE_ACCESSOR_INFO_TYPE
@ FIRST_EXTERNAL_ARRAY_TYPE
@ SHARED_FUNCTION_INFO_TYPE
@ EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE
@ EXTERNAL_INT32_ARRAY_TYPE
@ INTERNALIZED_STRING_TYPE
@ FUNCTION_TEMPLATE_INFO_TYPE
@ ALIASED_ARGUMENTS_ENTRY_TYPE
@ FIXED_FLOAT32_ARRAY_TYPE
@ SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE
@ EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE
@ SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE
@ LAST_FIXED_TYPED_ARRAY_TYPE
@ EXTERNAL_INTERNALIZED_STRING_TYPE
@ EXTERNAL_INT8_ARRAY_TYPE
@ FIXED_UINT32_ARRAY_TYPE
@ EXTERNAL_ONE_BYTE_STRING_TYPE
@ SHORT_EXTERNAL_ONE_BYTE_STRING_TYPE
@ FIXED_UINT8_CLAMPED_ARRAY_TYPE
@ JS_BUILTINS_OBJECT_TYPE
@ CONSTANT_POOL_ARRAY_TYPE
@ ONE_BYTE_INTERNALIZED_STRING_TYPE
@ FIXED_FLOAT64_ARRAY_TYPE
@ POLYMORPHIC_CODE_CACHE_TYPE
@ EXTERNAL_INT16_ARRAY_TYPE
@ EXTERNAL_UINT16_ARRAY_TYPE
@ SHORT_EXTERNAL_STRING_TYPE
@ TYPE_FEEDBACK_INFO_TYPE
@ LAST_EXTERNAL_ARRAY_TYPE
@ SLOPPY_ARGUMENTS_ELEMENTS
@ FAST_HOLEY_SMI_ELEMENTS
bool IsFastDoubleElementsKind(ElementsKind kind)
int LinearSearch(T *array, Name *name, int len, int valid_entries)
const uint32_t kOneByteStringTag
kFeedbackVectorOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kDoNotCacheBit start_position_and_type
const int kVariableSizeSentinel
@ ROBUST_STRING_TRAVERSAL
static bool IsGrowStoreMode(KeyedAccessStoreMode store_mode)
kFeedbackVectorOffset kHiddenPrototypeBit read_only_prototype
const int kStubMinorKeyBits
const uint32_t kShortExternalStringMask
OStream & operator<<(OStream &os, const BasicBlockProfiler &p)
static bool IsShortcutCandidate(int type)
static OStream & PrintUC16(OStream &os, uint16_t c, bool(*pred)(uint16_t))
static const int kInvalidEnumCacheSentinel
kFeedbackVectorOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kDoNotCacheBit kIsTopLevelBit allows_lazy_compilation_without_context
const uint32_t kStringRepresentationMask
kFeedbackVectorOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kDoNotCacheBit kIsTopLevelBit compiler_hints
bool IsFastElementsKind(ElementsKind kind)
const intptr_t kCodeAlignmentMask
const uint32_t kSlicedNotConsMask
kSerializedDataOffset kPrototypeTemplateOffset kIndexedPropertyHandlerOffset kInstanceCallHandlerOffset kInternalFieldCountOffset dependent_code
static uint32_t Hash(RegisteredExtension *extension)
static bool HasSourceCode(Heap *heap, SharedFunctionInfo *info)
const uint32_t kShortcutTypeTag
kFeedbackVectorOffset hidden_prototype
bool IsDictionaryElementsKind(ElementsKind kind)
const uint32_t kOneByteDataHintMask
kExpectedNofPropertiesOffset kFunctionTokenPositionOffset opt_count_and_bailout_reason
const uint32_t kIsIndirectStringTag
kFeedbackVectorOffset flag
kFeedbackVectorOffset kHiddenPrototypeBit kReadOnlyPrototypeBit do_not_cache
const uint32_t kInternalizedTag
const int kStubMajorKeyBits
static void RoundUp(Vector< char > buffer, int *length, int *decimal_point)
STATIC_ASSERT(sizeof(CPURegister)==sizeof(Register))
@ kDescriptorBitmaskCompare
@ kDescriptorPointerDereference
@ kDescriptorPointerShift
@ kDescriptorObjectDereference
@ kDescriptorPrimitiveValue
@ kDescriptorReturnObject
@ kDescriptorPointerCompare
static const int kDescriptorIndexBitCount
const uint32_t kIsNotInternalizedMask
const uint32_t kOneByteDataHintTag
bool IsFixedTypedArrayElementsKind(ElementsKind kind)
kSerializedDataOffset prototype_template
static bool IsMinusZero(double value)
bool IsFastSmiElementsKind(ElementsKind kind)
const uint32_t kIsNotStringMask
static KeyedAccessStoreMode GetGrowStoreMode(KeyedAccessStoreMode store_mode)
const int kExternalArrayTypeCount
int Search(T *array, Name *name, int valid_entries)
bool IsAligned(T value, U alignment)
const uint32_t kIsIndirectStringMask
bool IsFastObjectElementsKind(ElementsKind kind)
PropertyNormalizationMode
@ KEEP_INOBJECT_PROPERTIES
@ CLEAR_INOBJECT_PROPERTIES
Debugger support for the V8 JavaScript engine.
DeclaredAccessorDescriptorDataType
#define DECLARE_FUNCTION_ID(ignored1, ignore2, name)
#define DECLARE_CODE_AGE_ENUM(X)
#define FOR_EACH_NUMERIC_FIELD(V)
#define HEAP_OBJECT_TYPE_LIST(V)
#define DEFINE_CODE_KIND_ENUM(name)
#define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name)
#define DECLARE_STRUCT_PREDICATE(NAME, Name, name)
#define DECL_BOOLEAN_ACCESSORS(name)
#define DECLARE_CAST(type)
#define DECLARE_PRINTER(Name)
#define CODE_KIND_LIST(V)
#define DEFINE_ELEMENT_ACCESSORS(name, type)
#define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V)
#define DEFINE_ENTRY_ACCESSORS(name, type)
#define FUNCTIONS_WITH_ID_LIST(V)
#define OBJECT_TYPE_LIST(V)
#define DECLARE_VERIFIER(Name)
#define IS_TYPE_FUNCTION_DECL(type_)
#define FIXED_TYPED_ARRAY_TRAITS(Type, type, TYPE, elementType, size)
#define FIELD_ACCESSORS(name)
#define VISITOR_SYNCHRONIZATION_TAGS_LIST(V)
#define DECLARE_ENUM(enum_item, ignore1, ignore2)
#define DECL_ACCESSORS(name, type)
A simple Maybe type, representing an object which may or may not have a value.
Brief(const Object *const v)
v8::DeclaredAccessorDescriptorDataType data_type
SourceCodeOf(SharedFunctionInfo *v, int max=-1)
const SharedFunctionInfo * value
#define T(name, string, precedence)