38 #if V8_TARGET_ARCH_ARM
40 #elif V8_TARGET_ARCH_MIPS
227 #define INSTANCE_TYPE_LIST_ALL(V) \
229 V(ASCII_SYMBOL_TYPE) \
230 V(CONS_SYMBOL_TYPE) \
231 V(CONS_ASCII_SYMBOL_TYPE) \
232 V(EXTERNAL_SYMBOL_TYPE) \
233 V(EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE) \
234 V(EXTERNAL_ASCII_SYMBOL_TYPE) \
235 V(SHORT_EXTERNAL_SYMBOL_TYPE) \
236 V(SHORT_EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE) \
237 V(SHORT_EXTERNAL_ASCII_SYMBOL_TYPE) \
239 V(ASCII_STRING_TYPE) \
240 V(CONS_STRING_TYPE) \
241 V(CONS_ASCII_STRING_TYPE) \
242 V(SLICED_STRING_TYPE) \
243 V(EXTERNAL_STRING_TYPE) \
244 V(EXTERNAL_STRING_WITH_ASCII_DATA_TYPE) \
245 V(EXTERNAL_ASCII_STRING_TYPE) \
246 V(SHORT_EXTERNAL_STRING_TYPE) \
247 V(SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE) \
248 V(SHORT_EXTERNAL_ASCII_STRING_TYPE) \
249 V(PRIVATE_EXTERNAL_ASCII_STRING_TYPE) \
254 V(JS_GLOBAL_PROPERTY_CELL_TYPE) \
256 V(HEAP_NUMBER_TYPE) \
263 V(EXTERNAL_BYTE_ARRAY_TYPE) \
264 V(EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE) \
265 V(EXTERNAL_SHORT_ARRAY_TYPE) \
266 V(EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE) \
267 V(EXTERNAL_INT_ARRAY_TYPE) \
268 V(EXTERNAL_UNSIGNED_INT_ARRAY_TYPE) \
269 V(EXTERNAL_FLOAT_ARRAY_TYPE) \
270 V(EXTERNAL_PIXEL_ARRAY_TYPE) \
273 V(ACCESSOR_INFO_TYPE) \
274 V(ACCESSOR_PAIR_TYPE) \
275 V(ACCESS_CHECK_INFO_TYPE) \
276 V(INTERCEPTOR_INFO_TYPE) \
277 V(CALL_HANDLER_INFO_TYPE) \
278 V(FUNCTION_TEMPLATE_INFO_TYPE) \
279 V(OBJECT_TEMPLATE_INFO_TYPE) \
280 V(SIGNATURE_INFO_TYPE) \
281 V(TYPE_SWITCH_INFO_TYPE) \
284 V(POLYMORPHIC_CODE_CACHE_TYPE) \
285 V(TYPE_FEEDBACK_INFO_TYPE) \
286 V(ALIASED_ARGUMENTS_ENTRY_TYPE) \
288 V(FIXED_ARRAY_TYPE) \
289 V(FIXED_DOUBLE_ARRAY_TYPE) \
290 V(SHARED_FUNCTION_INFO_TYPE) \
292 V(JS_MESSAGE_OBJECT_TYPE) \
297 V(JS_CONTEXT_EXTENSION_OBJECT_TYPE) \
299 V(JS_GLOBAL_OBJECT_TYPE) \
300 V(JS_BUILTINS_OBJECT_TYPE) \
301 V(JS_GLOBAL_PROXY_TYPE) \
304 V(JS_WEAK_MAP_TYPE) \
307 V(JS_FUNCTION_TYPE) \
308 V(JS_FUNCTION_PROXY_TYPE) \
310 #ifdef ENABLE_DEBUGGER_SUPPORT
311 #define INSTANCE_TYPE_LIST_DEBUGGER(V) \
313 V(BREAK_POINT_INFO_TYPE)
315 #define INSTANCE_TYPE_LIST_DEBUGGER(V)
318 #define INSTANCE_TYPE_LIST(V) \
319 INSTANCE_TYPE_LIST_ALL(V) \
320 INSTANCE_TYPE_LIST_DEBUGGER(V)
325 #define STRING_TYPE_LIST(V) \
327 kVariableSizeSentinel, \
330 V(ASCII_SYMBOL_TYPE, \
331 kVariableSizeSentinel, \
334 V(CONS_SYMBOL_TYPE, \
338 V(CONS_ASCII_SYMBOL_TYPE, \
342 V(EXTERNAL_SYMBOL_TYPE, \
343 ExternalTwoByteString::kSize, \
346 V(EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE, \
347 ExternalTwoByteString::kSize, \
348 external_symbol_with_ascii_data, \
349 ExternalSymbolWithAsciiData) \
350 V(EXTERNAL_ASCII_SYMBOL_TYPE, \
351 ExternalAsciiString::kSize, \
352 external_ascii_symbol, \
353 ExternalAsciiSymbol) \
354 V(SHORT_EXTERNAL_SYMBOL_TYPE, \
355 ExternalTwoByteString::kShortSize, \
356 short_external_symbol, \
357 ShortExternalSymbol) \
358 V(SHORT_EXTERNAL_SYMBOL_WITH_ASCII_DATA_TYPE, \
359 ExternalTwoByteString::kShortSize, \
360 short_external_symbol_with_ascii_data, \
361 ShortExternalSymbolWithAsciiData) \
362 V(SHORT_EXTERNAL_ASCII_SYMBOL_TYPE, \
363 ExternalAsciiString::kShortSize, \
364 short_external_ascii_symbol, \
365 ShortExternalAsciiSymbol) \
367 kVariableSizeSentinel, \
370 V(ASCII_STRING_TYPE, \
371 kVariableSizeSentinel, \
374 V(CONS_STRING_TYPE, \
378 V(CONS_ASCII_STRING_TYPE, \
382 V(SLICED_STRING_TYPE, \
383 SlicedString::kSize, \
386 V(SLICED_ASCII_STRING_TYPE, \
387 SlicedString::kSize, \
388 sliced_ascii_string, \
390 V(EXTERNAL_STRING_TYPE, \
391 ExternalTwoByteString::kSize, \
394 V(EXTERNAL_STRING_WITH_ASCII_DATA_TYPE, \
395 ExternalTwoByteString::kSize, \
396 external_string_with_ascii_data, \
397 ExternalStringWithAsciiData) \
398 V(EXTERNAL_ASCII_STRING_TYPE, \
399 ExternalAsciiString::kSize, \
400 external_ascii_string, \
401 ExternalAsciiString) \
402 V(SHORT_EXTERNAL_STRING_TYPE, \
403 ExternalTwoByteString::kShortSize, \
404 short_external_string, \
405 ShortExternalString) \
406 V(SHORT_EXTERNAL_STRING_WITH_ASCII_DATA_TYPE, \
407 ExternalTwoByteString::kShortSize, \
408 short_external_string_with_ascii_data, \
409 ShortExternalStringWithAsciiData) \
410 V(SHORT_EXTERNAL_ASCII_STRING_TYPE, \
411 ExternalAsciiString::kShortSize, \
412 short_external_ascii_string, \
413 ShortExternalAsciiString)
424 #define STRUCT_LIST_ALL(V) \
425 V(ACCESSOR_INFO, AccessorInfo, accessor_info) \
426 V(ACCESSOR_PAIR, AccessorPair, accessor_pair) \
427 V(ACCESS_CHECK_INFO, AccessCheckInfo, access_check_info) \
428 V(INTERCEPTOR_INFO, InterceptorInfo, interceptor_info) \
429 V(CALL_HANDLER_INFO, CallHandlerInfo, call_handler_info) \
430 V(FUNCTION_TEMPLATE_INFO, FunctionTemplateInfo, function_template_info) \
431 V(OBJECT_TEMPLATE_INFO, ObjectTemplateInfo, object_template_info) \
432 V(SIGNATURE_INFO, SignatureInfo, signature_info) \
433 V(TYPE_SWITCH_INFO, TypeSwitchInfo, type_switch_info) \
434 V(SCRIPT, Script, script) \
435 V(CODE_CACHE, CodeCache, code_cache) \
436 V(POLYMORPHIC_CODE_CACHE, PolymorphicCodeCache, polymorphic_code_cache) \
437 V(TYPE_FEEDBACK_INFO, TypeFeedbackInfo, type_feedback_info) \
438 V(ALIASED_ARGUMENTS_ENTRY, AliasedArgumentsEntry, aliased_arguments_entry)
440 #ifdef ENABLE_DEBUGGER_SUPPORT
441 #define STRUCT_LIST_DEBUGGER(V) \
442 V(DEBUG_INFO, DebugInfo, debug_info) \
443 V(BREAK_POINT_INFO, BreakPointInfo, break_point_info)
445 #define STRUCT_LIST_DEBUGGER(V)
448 #define STRUCT_LIST(V) \
450 STRUCT_LIST_DEBUGGER(V)
675 #define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V) \
676 V(FAST_ELEMENTS_SUB_TYPE) \
677 V(DICTIONARY_ELEMENTS_SUB_TYPE) \
678 V(FAST_PROPERTIES_SUB_TYPE) \
679 V(DICTIONARY_PROPERTIES_SUB_TYPE) \
680 V(MAP_CODE_CACHE_SUB_TYPE) \
681 V(SCOPE_INFO_SUB_TYPE) \
682 V(SYMBOL_TABLE_SUB_TYPE) \
683 V(DESCRIPTOR_ARRAY_SUB_TYPE) \
684 V(TRANSITION_ARRAY_SUB_TYPE)
687 #define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name) name,
689 #undef DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE
703 #define DECL_BOOLEAN_ACCESSORS(name) \
704 inline bool name(); \
705 inline void set_##name(bool value); \
708 #define DECL_ACCESSORS(name, type) \
709 inline type* name(); \
710 inline void set_##name(type* value, \
711 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); \
715 class DictionaryElementsAccessor;
716 class ElementsAccessor;
718 class FixedArrayBase;
732 template <
class C>
static inline bool Is(
Object* obj);
735 #define DECLARE_VERIFIER(Name) void Name##Verify();
737 #define DECLARE_VERIFIER(Name)
742 inline bool IsFailure();
743 inline bool IsRetryAfterGC();
744 inline bool IsOutOfMemory();
745 inline bool IsException();
748 if (IsFailure())
return false;
749 *obj =
reinterpret_cast<Object*
>(
this);
754 return reinterpret_cast<Failure*
>(
this);
758 return reinterpret_cast<Object*
>(
this);
762 return reinterpret_cast<Object*
>(
this);
767 if (IsFailure())
return false;
768 *obj = T::cast(reinterpret_cast<Object*>(
this));
774 inline void Print() {
777 inline void PrintLn() {
780 void Print(FILE* out);
781 void PrintLn(FILE* out);
790 #define OBJECT_TYPE_LIST(V) \
795 #define HEAP_OBJECT_TYPE_LIST(V) \
803 V(ExternalTwoByteString) \
804 V(ExternalAsciiString) \
805 V(SeqTwoByteString) \
809 V(ExternalByteArray) \
810 V(ExternalUnsignedByteArray) \
811 V(ExternalShortArray) \
812 V(ExternalUnsignedShortArray) \
813 V(ExternalIntArray) \
814 V(ExternalUnsignedIntArray) \
815 V(ExternalFloatArray) \
816 V(ExternalDoubleArray) \
817 V(ExternalPixelArray) \
822 V(JSContextExtensionObject) \
827 V(DeoptimizationInputData) \
828 V(DeoptimizationOutputData) \
829 V(TypeFeedbackCells) \
831 V(FixedDoubleArray) \
838 V(SharedFunctionInfo) \
855 V(JSFunctionResultCache) \
856 V(NormalizedMapCache) \
857 V(CompilationCacheTable) \
858 V(CodeCacheHashTable) \
859 V(PolymorphicCodeCacheHashTable) \
864 V(JSBuiltinsObject) \
866 V(UndetectableObject) \
867 V(AccessCheckNeeded) \
868 V(JSGlobalPropertyCell) \
884 #define IS_TYPE_FUNCTION_DECL(type_) inline bool Is##type_();
887 #undef IS_TYPE_FUNCTION_DECL
896 #define DECLARE_STRUCT_PREDICATE(NAME, Name, name) inline bool Is##Name();
898 #undef DECLARE_STRUCT_PREDICATE
900 INLINE(
bool IsSpecObject());
901 INLINE(
bool IsSpecFunction());
904 INLINE(
bool IsUndefined());
936 void Lookup(String* name, LookupResult* result);
948 static Handle<Object>
GetProperty(Handle<Object>
object,
949 Handle<Object> receiver,
950 LookupResult* result,
955 LookupResult* result,
962 static Handle<Object>
GetElement(Handle<Object>
object, uint32_t index);
992 static void VerifyPointer(
Object* p);
1013 DISALLOW_IMPLICIT_CONSTRUCTORS(
Object);
1034 static inline bool IsValid(intptr_t value);
1053 DISALLOW_IMPLICIT_CONSTRUCTORS(
Smi);
1092 OUT_OF_MEMORY_EXCEPTION = 3
1095 inline Type type()
const;
1100 inline bool IsInternalError()
const;
1101 inline bool IsOutOfMemoryException()
const;
1104 static inline Failure* RetryAfterGC();
1106 static inline Failure* InternalError();
1107 static inline Failure* OutOfMemoryException();
1113 FailurePrint(stdout);
1115 void FailurePrint(FILE* out);
1121 inline intptr_t value() const;
1122 static inline
Failure* Construct(Type type, intptr_t value = 0);
1124 DISALLOW_IMPLICIT_CONSTRUCTORS(
Failure);
1137 static inline MapWord FromMap(
Map* map);
1140 inline Map* ToMap();
1149 inline bool IsForwardingAddress();
1152 static inline MapWord FromForwardingAddress(
HeapObject*
object);
1158 return MapWord(value);
1169 explicit MapWord(uintptr_t value) : value_(value) {}
1182 inline void set_map(
Map* value);
1186 inline void set_map_no_write_barrier(
Map* value);
1190 inline MapWord map_word();
1191 inline void set_map_word(MapWord map_word);
1194 inline Heap* GetHeap();
1208 void Iterate(ObjectVisitor* v);
1214 void IterateBody(
InstanceType type,
int object_size, ObjectVisitor* v);
1222 inline int SizeFromMap(
Map* map);
1243 inline void HeapObjectPrint() {
1244 HeapObjectPrint(stdout);
1246 void HeapObjectPrint(FILE* out);
1247 void PrintHeader(FILE* out,
const char*
id);
1251 inline void VerifyObjectField(
int offset);
1252 inline void VerifySmiField(
int offset);
1256 static void VerifyHeapPointer(
Object* p);
1269 inline void IteratePointers(ObjectVisitor* v,
int start,
int end);
1271 inline void IteratePointer(ObjectVisitor* v,
int offset);
1281 template<
int start_offset,
int end_offset,
int size>
1284 static const int kStartOffset = start_offset;
1285 static const int kEndOffset = end_offset;
1286 static const int kSize = size;
1288 static inline void IterateBody(
HeapObject* obj, ObjectVisitor* v);
1290 template<
typename StaticVisitor>
1301 template<
int start_offset>
1304 static const int kStartOffset = start_offset;
1306 static inline void IterateBody(
HeapObject* obj,
1310 template<
typename StaticVisitor>
1323 inline double value();
1324 inline void set_value(
double value);
1330 Object* HeapNumberToBoolean();
1332 HeapNumberPrint(stdout);
1334 void HeapNumberPrint(FILE* out);
1338 inline
int get_exponent();
1339 inline
int get_sign();
1347 static const
int kMantissaOffset = kValueOffset;
1348 static const
int kExponentOffset = kValueOffset + 4;
1352 static const uint32_t kExponentMask = 0x7ff00000u;
1353 static const uint32_t kMantissaMask = 0xfffffu;
1354 static const
int kMantissaBits = 52;
1355 static const
int kExponentBits = 11;
1356 static const
int kExponentBias = 1023;
1357 static const
int kExponentShift = 20;
1358 static const
int kMantissaBitsInTopWord = 20;
1359 static const
int kNonMantissaBitsInTopWord = 12;
1404 CERTAINLY_NOT_STORE_FROM_KEYED
1411 OMIT_EXTENSIBILITY_CHECK
1428 StoreFromKeyed store_from_keyed = MAY_BE_STORE_FROM_KEYED);
1430 LookupResult* result,
1435 StoreFromKeyed store_from_keyed = MAY_BE_STORE_FROM_KEYED);
1440 MUST_USE_RESULT MaybeObject* DeleteElement(uint32_t index, DeleteMode mode);
1448 bool check_prototype);
1451 bool IsSimpleEnum();
1458 String* constructor_name();
1466 inline bool HasProperty(
String* name);
1467 inline bool HasLocalProperty(
String* name);
1468 inline bool HasElement(uint32_t index);
1474 inline Object* GetConstructor();
1478 bool skip_hidden_prototypes);
1486 void LocalLookup(
String* name, LookupResult* result);
1490 Smi* GenerateIdentityHash();
1494 LookupResult* result,
1496 bool continue_search);
1511 inline void initialize_properties();
1512 inline bool HasFastProperties();
1534 inline void initialize_elements();
1539 inline bool HasFastSmiElements();
1541 inline bool HasFastObjectElements();
1544 inline bool HasFastSmiOrObjectElements();
1547 inline bool HasFastDoubleElements();
1550 inline bool HasFastHoleyElements();
1551 inline bool HasNonStrictArgumentsElements();
1552 inline bool HasDictionaryElements();
1553 inline bool HasExternalPixelElements();
1554 inline bool HasExternalArrayElements();
1555 inline bool HasExternalByteElements();
1556 inline bool HasExternalUnsignedByteElements();
1557 inline bool HasExternalShortElements();
1558 inline bool HasExternalUnsignedShortElements();
1559 inline bool HasExternalIntElements();
1560 inline bool HasExternalUnsignedIntElements();
1561 inline bool HasExternalFloatElements();
1562 inline bool HasExternalDoubleElements();
1563 bool HasFastArgumentsElements();
1564 bool HasDictionaryArgumentsElements();
1567 inline void set_map_and_elements(
1581 MUST_USE_RESULT MaybeObject* PrepareSlowElementsForSort(uint32_t limit);
1588 MUST_USE_RESULT MaybeObject* SetPropertyForResult(LookupResult* result,
1595 LookupResult* result,
1598 bool check_prototype,
1629 inline int LastAddedFieldIndex();
1644 Object* GetNormalizedProperty(LookupResult* result);
1648 Object* SetNormalizedProperty(LookupResult* result,
Object* value);
1655 PropertyDetails details);
1659 PropertyDetails details);
1674 bool continue_search);
1677 bool continue_search);
1680 LookupResult* result,
1682 bool continue_search);
1708 LookupResult* result,
1730 inline Object* BypassGlobalProxy();
1754 void DeleteHiddenProperty(
String* key);
1756 bool HasHiddenProperties();
1769 inline void ValidateElements();
1772 MUST_USE_RESULT inline MaybeObject* EnsureCanContainHeapObjectElements();
1791 bool ShouldConvertToSlowElements(
int new_capacity);
1796 bool ShouldConvertToFastElements();
1800 bool ShouldConvertToFastDoubleElements(
bool* has_smi_only_elements);
1803 bool HasElementWithReceiver(
JSReceiver* receiver, uint32_t index);
1808 return old_capacity + (old_capacity >> 1) + 16;
1829 LocalElementType HasLocalElement(uint32_t index);
1831 bool HasElementWithInterceptor(
JSReceiver* receiver, uint32_t index);
1836 bool check_prototype);
1843 bool check_prototype,
1850 bool check_prototype =
true);
1872 bool check_prototype =
true,
1883 kDontAllowSmiElements
1892 SetFastElementsCapacitySmiMode smi_mode);
1899 inline bool HasNamedInterceptor();
1900 inline bool HasIndexedInterceptor();
1903 bool HasRealNamedProperty(
String* key);
1904 bool HasRealElementProperty(uint32_t index);
1905 bool HasRealNamedCallbackProperty(
String* key);
1909 inline int GetHeaderSize();
1911 inline int GetInternalFieldCount();
1912 inline int GetInternalFieldOffset(
int index);
1913 inline Object* GetInternalField(
int index);
1914 inline void SetInternalField(
int index,
Object* value);
1915 inline void SetInternalField(
int index, Smi* value);
1918 void LocalLookupRealNamedProperty(
String* name, LookupResult* result);
1919 void LookupRealNamedProperty(
String* name, LookupResult* result);
1920 void LookupRealNamedPropertyInPrototypes(
String* name, LookupResult* result);
1921 MUST_USE_RESULT MaybeObject* SetElementWithCallbackSetterInPrototypes(
1923 void LookupCallbackProperty(
String* name, LookupResult* result);
1930 void GetLocalPropertyNames(
FixedArray* storage,
int index);
1936 int NumberOfEnumElements();
1987 int transition_index,
2004 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED);
2017 StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED,
2018 ExtensibilityCheck extensibility_check = PERFORM_EXTENSIBILITY_CHECK);
2026 int expected_additional_properties);
2030 int expected_additional_properties);
2048 int unused_property_fields);
2051 int unused_property_fields);
2054 inline Object* FastPropertyAt(
int index);
2055 inline Object* FastPropertyAtPut(
int index,
Object* value);
2058 inline int GetInObjectPropertyOffset(
int index);
2059 inline Object* InObjectPropertyAt(
int index);
2060 inline Object* InObjectPropertyAtPut(
int index,
2070 inline void InitializeBody(
Map* map,
2071 Object* pre_allocated_value,
2075 bool ReferencesObject(
Object* obj);
2088 inline void JSObjectPrint() {
2089 JSObjectPrint(stdout);
2091 void JSObjectPrint(FILE* out);
2095 inline void PrintProperties() {
2096 PrintProperties(stdout);
2098 void PrintProperties(FILE* out);
2100 inline void PrintElements() {
2101 PrintElements(stdout);
2103 void PrintElements(FILE* out);
2104 inline void PrintTransitions() {
2105 PrintTransitions(stdout);
2107 void PrintTransitions(FILE* out);
2110 void PrintElementsTransition(
2111 FILE* file,
ElementsKind from_kind, FixedArrayBase* from_elements,
2116 class SpillInformation {
2120 int number_of_objects_;
2121 int number_of_objects_with_fast_properties_;
2122 int number_of_objects_with_fast_elements_;
2123 int number_of_fast_used_fields_;
2124 int number_of_fast_unused_fields_;
2125 int number_of_slow_used_properties_;
2126 int number_of_slow_unused_properties_;
2127 int number_of_fast_used_elements_;
2128 int number_of_fast_unused_elements_;
2129 int number_of_slow_used_elements_;
2130 int number_of_slow_unused_elements_;
2133 void IncrementSpillStatistics(SpillInformation* info);
2140 inline bool TooManyFastProperties(
int properties, StoreFromKeyed store_mode);
2144 static const uint32_t kMaxElementCount = 0xffffffffu;
2151 static const uint32_t kMaxGap = 1024;
2155 static const int kMaxUncheckedFastElementsLength = 5000;
2159 static const int kMaxUncheckedOldFastElementsLength = 500;
2161 static const int kInitialMaxFastElementArray = 100000;
2162 static const int kFastPropertiesSoftLimit = 12;
2163 static const int kMaxFastProperties = 64;
2168 static const int kFieldsAdded = 3;
2200 bool check_prototype,
2207 bool check_prototype,
2225 MUST_USE_RESULT MaybeObject* DeleteElementWithInterceptor(uint32_t index);
2231 bool ReferencesObjectFromElements(
FixedArray* elements,
2236 bool HasDenseElements();
2239 void GetElementsCapacityAndUsage(
int* capacity,
int* used);
2241 bool CanSetCallback(
String* name);
2263 enum InitializeHiddenProperties {
2264 CREATE_NEW_IF_ABSENT,
2265 ONLY_RETURN_INLINE_VALUE
2273 InitializeHiddenProperties init_option);
2288 inline int length();
2289 inline void set_length(
int value);
2308 inline Object*
get(
int index);
2310 inline void set(
int index,
Object* value);
2311 inline bool is_the_hole(
int index);
2314 inline void set(
int index, Smi* value);
2319 inline void set_undefined(
int index);
2321 inline void set_undefined(
Heap* heap,
int index);
2322 inline void set_null(
int index);
2324 inline void set_null(
Heap* heap,
int index);
2325 inline void set_the_hole(
int index);
2328 inline void set_unchecked(
int index, Smi* value);
2329 inline void set_null_unchecked(
Heap* heap,
int index);
2330 inline void set_unchecked(
Heap* heap,
int index,
Object* value,
2334 inline Object** data_start();
2336 inline Object** GetFirstElementAddress();
2337 inline bool ContainsOnlySmisOrHoles();
2350 void CopyTo(
int pos,
FixedArray* dest,
int dest_pos,
int len);
2370 inline void FixedArrayPrint() {
2371 FixedArrayPrint(stdout);
2373 void FixedArrayPrint(FILE* out);
2384 void SwapPairs(
FixedArray* numbers,
int i,
int j);
2389 void SortPairs(
FixedArray* numbers, uint32_t len);
2394 return SizeFor(reinterpret_cast<FixedArray*>(
object)->length());
2401 static inline void NoWriteBarrierSet(
FixedArray* array,
2408 static inline void NoIncrementalWriteBarrierSet(
FixedArray* array,
2421 inline double get_scalar(
int index);
2422 inline int64_t get_representation(
int index);
2424 inline void set(
int index,
double value);
2425 inline void set_the_hole(
int index);
2428 inline bool is_the_hole(
int index);
2441 inline static bool is_the_hole_nan(
double value);
2442 inline static double hole_nan_as_double();
2443 inline static double canonical_not_the_hole_nan_as_double();
2451 static const int kMaxSize = 512 *
MB;
2457 inline void FixedDoubleArrayPrint() {
2458 FixedDoubleArrayPrint(stdout);
2460 void FixedDoubleArrayPrint(FILE* out);
2499 inline bool IsEmpty();
2503 ASSERT(length() >= kFirstIndex || IsEmpty());
2505 return len == 0 ? 0 :
Smi::cast(
get(kDescriptorLengthIndex))->
value();
2510 return len == 0 ? 0 : (len - kFirstIndex) / kDescriptorSize;
2514 return number_of_descriptors_storage() - number_of_descriptors();
2517 inline void SetNumberOfDescriptors(
int number_of_descriptors);
2521 return !IsEmpty() && !
get(kEnumCacheIndex)->IsSmi();
2525 set(kEnumCacheIndex, array->
get(kEnumCacheIndex));
2535 if (IsEmpty())
return false;
2536 Object*
object =
get(kEnumCacheIndex);
2537 if (object->IsSmi())
return false;
2539 return !bridge->
get(kEnumCacheBridgeIndicesCacheIndex)->IsSmi();
2543 ASSERT(HasEnumIndicesCache());
2554 void ClearEnumCache();
2558 void SetEnumCache(FixedArray* bridge_storage,
2559 FixedArray* new_cache,
2560 Object* new_index_cache);
2563 inline String* GetKey(
int descriptor_number);
2564 inline Object** GetKeySlot(
int descriptor_number);
2565 inline Object* GetValue(
int descriptor_number);
2566 inline Object** GetValueSlot(
int descriptor_number);
2567 inline PropertyDetails GetDetails(
int descriptor_number);
2569 inline int GetFieldIndex(
int descriptor_number);
2570 inline JSFunction* GetConstantFunction(
int descriptor_number);
2571 inline Object* GetCallbacksObject(
int descriptor_number);
2574 inline String* GetSortedKey(
int descriptor_number);
2575 inline int GetSortedKeyIndex(
int descriptor_number);
2576 inline void SetSortedKey(
int pointer,
int descriptor_number);
2579 inline void Get(
int descriptor_number, Descriptor* desc);
2580 inline void Set(
int descriptor_number,
2582 const WhitenessWitness&);
2583 inline void Set(
int descriptor_number, Descriptor* desc);
2588 inline void Append(Descriptor* desc,
const WhitenessWitness&);
2589 inline void Append(Descriptor* desc);
2593 void CopyFrom(
int dst_index,
2596 const WhitenessWitness&);
2612 MUST_USE_RESULT static MaybeObject* Allocate(
int number_of_descriptors,
2619 static const int kNotFound = -1;
2621 static const int kDescriptorLengthIndex = 0;
2622 static const int kEnumCacheIndex = 1;
2623 static const int kFirstIndex = 2;
2626 static const int kEnumCacheBridgeLength = 2;
2627 static const int kEnumCacheBridgeCacheIndex = 0;
2628 static const int kEnumCacheBridgeIndicesCacheIndex = 1;
2632 static const int kEnumCacheOffset = kDescriptorLengthOffset +
kPointerSize;
2639 static const int kDescriptorKey = 0;
2640 static const int kDescriptorDetails = 1;
2641 static const int kDescriptorValue = 2;
2642 static const int kDescriptorSize = 3;
2646 inline void PrintDescriptors() {
2647 PrintDescriptors(stdout);
2649 void PrintDescriptors(FILE* out);
2654 bool IsSortedNoDuplicates(
int valid_descriptors = -1);
2657 bool IsConsistentWithBackPointers(
Map* current_map);
2665 static const int kMaxNumberOfDescriptors = 1024 + 512;
2670 return ToKeyIndex(number_of_descriptors);
2678 descs_(descs), index_(index) { }
2680 inline PropertyType type() {
return descs_->GetType(index_); }
2681 inline Object* GetCallbackObject() {
return descs_->GetValue(index_); }
2684 DescriptorArray* descs_;
2689 static int ToKeyIndex(
int descriptor_number) {
2690 return kFirstIndex +
2691 (descriptor_number * kDescriptorSize) +
2695 static int ToDetailsIndex(
int descriptor_number) {
2696 return kFirstIndex +
2697 (descriptor_number * kDescriptorSize) +
2701 static int ToValueIndex(
int descriptor_number) {
2702 return kFirstIndex +
2703 (descriptor_number * kDescriptorSize) +
2708 inline void SwapSortedKeys(
int first,
int second);
2716 template<SearchMode search_mode,
typename T>
2720 template<SearchMode search_mode,
typename T>
2721 inline int Search(
T* array,
String* name,
int valid_entries = 0);
2757 template<
typename Key>
2760 static const bool UsesSeed =
false;
2761 static uint32_t
Hash(Key key) {
return 0; }
2769 return HashForObject(key,
object);
2773 template<
typename Shape,
typename Key>
2778 USE_CUSTOM_MINIMUM_CAPACITY
2783 if (Shape::UsesSeed) {
2784 return Shape::SeededHash(key,
2785 GetHeap()->HashSeed());
2787 return Shape::Hash(key);
2792 if (Shape::UsesSeed) {
2793 return Shape::SeededHashForObject(key,
2794 GetHeap()->HashSeed(),
object);
2796 return Shape::HashForObject(key,
object);
2822 SetNumberOfElements(NumberOfElements() - 1);
2823 SetNumberOfDeletedElements(NumberOfDeletedElements() + 1);
2826 SetNumberOfElements(NumberOfElements() - n);
2827 SetNumberOfDeletedElements(NumberOfDeletedElements() + n);
2832 int at_least_space_for,
2833 MinimumCapacity capacity_option = USE_DEFAULT_MINIMUM_CAPACITY,
2838 static int ComputeCapacity(
int at_least_space_for);
2846 return !k->IsTheHole() && !k->IsUndefined();
2850 void IteratePrefix(ObjectVisitor* visitor);
2851 void IterateElements(ObjectVisitor* visitor);
2857 INLINE(
static uint32_t GetProbeOffset(uint32_t n)) {
2858 return (n + n * n) >> 1;
2861 static const int kNumberOfElementsIndex = 0;
2862 static const int kNumberOfDeletedElementsIndex = 1;
2863 static const int kCapacityIndex = 2;
2864 static const int kPrefixStartIndex = 3;
2865 static const int kElementsStartIndex =
2866 kPrefixStartIndex + Shape::kPrefixSize;
2867 static const int kEntrySize = Shape::kEntrySize;
2868 static const int kElementsStartOffset =
2870 static const int kCapacityOffset =
2874 static const int kNotFound = -1;
2879 static const int kMaxCapacity =
2883 inline int FindEntry(Key key);
2884 int FindEntry(
Isolate* isolate, Key key);
2889 uint32_t FindInsertionEntry(uint32_t hash);
2893 return (entry * kEntrySize) + kElementsStartIndex;
2912 ASSERT(capacity <= kMaxCapacity);
2918 static uint32_t
GetProbe(uint32_t hash, uint32_t number, uint32_t size) {
2920 return (hash + GetProbeOffset(number)) & (size - 1);
2923 inline static uint32_t
FirstProbe(uint32_t hash, uint32_t size) {
2924 return hash & (size - 1);
2928 uint32_t last, uint32_t number, uint32_t size) {
2929 return (last + number) & (size - 1);
2947 virtual bool IsMatch(
Object* other) = 0;
2949 virtual uint32_t Hash() = 0;
2951 virtual uint32_t HashForObject(
Object* key) = 0;
2975 static const int kPrefixSize = 0;
2976 static const int kEntrySize = 1;
3006 bool LookupSymbolIfExists(
String* str,
String** symbol);
3007 bool LookupTwoCharsSymbolIfExists(uint32_t c1, uint32_t c2,
String** symbol);
3015 template <
bool seq_ascii>
friend class JsonParser;
3038 static const int kPrefixSize = 0;
3039 static const int kEntrySize = 2;
3059 template <
typename Shape,
typename Key>
3079 return PropertyDetails(
3089 void CopyValuesTo(FixedArray* elements);
3102 int NumberOfEnumElements();
3106 void CopyKeysTo(FixedArray* storage,
3108 SortMode sort_mode);
3110 void CopyKeysTo(FixedArray* storage,
int index, SortMode sort_mode);
3115 this->set(kNextEnumerationIndexIndex,
Smi::FromInt(index));
3129 inline void Print() {
3132 void Print(FILE* out);
3138 inline void SetEntry(
int entry,
3141 inline void SetEntry(
int entry,
3144 PropertyDetails details);
3148 PropertyDetails details);
3157 PropertyDetails details,
3162 static const int kMaxNumberKeyIndex =
3164 static const int kNextEnumerationIndexIndex = kMaxNumberKeyIndex + 1;
3170 static inline bool IsMatch(
String* key,
Object* other);
3171 static inline uint32_t Hash(
String* key);
3172 static inline uint32_t HashForObject(
String* key,
Object*
object);
3174 static const int kPrefixSize = 2;
3175 static const int kEntrySize = 3;
3176 static const bool kIsEnumerable =
true;
3183 ASSERT(obj->IsDictionary());
3188 FixedArray* CopyEnumKeysTo(FixedArray* storage);
3189 static void DoGenerateNewEnumerationIndices(
3195 int unused_property_fields);
3199 int FindEntry(
String* key);
3205 static inline bool IsMatch(uint32_t key,
Object* other);
3207 static const int kEntrySize = 3;
3208 static const bool kIsEnumerable =
false;
3214 static const bool UsesSeed =
true;
3215 static const int kPrefixSize = 2;
3217 static inline uint32_t SeededHash(uint32_t key, uint32_t
seed);
3218 static inline uint32_t SeededHashForObject(uint32_t key,
3226 static const int kPrefixSize = 0;
3228 static inline uint32_t Hash(uint32_t key);
3229 static inline uint32_t HashForObject(uint32_t key,
Object*
object);
3234 :
public Dictionary<SeededNumberDictionaryShape, uint32_t> {
3237 ASSERT(obj->IsDictionary());
3245 PropertyDetails details);
3253 PropertyDetails details);
3257 PropertyDetails details);
3259 void UpdateMaxNumberKey(uint32_t key);
3266 inline bool requires_slow_elements();
3267 inline void set_requires_slow_elements();
3272 inline uint32_t max_number_key();
3275 static const int kRequiresSlowElementsMask = 1;
3276 static const int kRequiresSlowElementsTagSize = 1;
3277 static const uint32_t kRequiresSlowElementsLimit = (1 << 29) - 1;
3282 :
public Dictionary<UnseededNumberDictionaryShape, uint32_t> {
3285 ASSERT(obj->IsDictionary());
3304 template <
int entrysize>
3307 static inline bool IsMatch(
Object* key,
Object* other);
3308 static inline uint32_t Hash(
Object* key);
3309 static inline uint32_t HashForObject(
Object* key,
Object*
object);
3311 static const int kPrefixSize = 0;
3312 static const int kEntrySize = entrysize;
3321 ASSERT(obj->IsHashTable());
3326 bool Contains(
Object* key);
3341 ASSERT(obj->IsHashTable());
3357 void RemoveEntry(
int entry);
3360 static inline int EntryToValueIndex(
int entry) {
3361 return EntryToIndex(entry) + 1;
3375 static const int kFactoryIndex = 0;
3376 static const int kFingerIndex = kFactoryIndex + 1;
3377 static const int kCacheSizeIndex = kFingerIndex + 1;
3378 static const int kDummyIndex = kCacheSizeIndex + 1;
3379 static const int kEntriesIndex = kDummyIndex + 1;
3381 static const int kEntrySize = 2;
3387 inline void MakeZeroSize();
3388 inline void Clear();
3391 inline void set_size(
int size);
3392 inline int finger_index();
3393 inline void set_finger_index(
int finger_index);
3424 return CallsEval() && (language_mode() ==
CLASSIC_MODE);
3435 int StackSlotCount();
3444 int ContextLength();
3447 bool HasFunctionName();
3450 bool HasHeapAllocatedLocals();
3459 String* ParameterName(
int var);
3462 String* LocalName(
int var);
3465 String* StackLocalName(
int var);
3468 String* ContextLocalName(
int var);
3480 int StackSlotIndex(
String* name);
3487 int ContextSlotIndex(
String* name,
3494 int ParameterIndex(
String* name);
3519 #define FOR_EACH_NUMERIC_FIELD(V) \
3522 V(StackLocalCount) \
3523 V(ContextLocalCount)
3525 #define FIELD_ACCESSORS(name) \
3526 void Set##name(int value) { \
3527 set(k##name, Smi::FromInt(value)); \
3530 if (length() > 0) { \
3531 return Smi::cast(get(k##name))->value(); \
3537 #undef FIELD_ACCESSORS
3541 #define DECL_INDEX(name) k##name,
3544 #undef FOR_EACH_NUMERIC_FIELD
3575 int ParameterEntriesIndex();
3576 int StackLocalEntriesIndex();
3577 int ContextLocalNameEntriesIndex();
3578 int ContextLocalInfoEntriesIndex();
3579 int FunctionNameEntryIndex();
3582 enum FunctionVariableInfo {
3590 class TypeField:
public BitField<ScopeType, 0, 3> {};
3591 class CallsEvalField:
public BitField<bool, 3, 1> {};
3592 class LanguageModeField:
public BitField<LanguageMode, 4, 2> {};
3593 class FunctionVariableField:
public BitField<FunctionVariableInfo, 6, 2> {};
3594 class FunctionVariableMode:
public BitField<VariableMode, 8, 3> {};
3598 class ContextLocalMode:
public BitField<VariableMode, 0, 3> {};
3599 class ContextLocalInitFlag:
public BitField<InitializationFlag, 3, 1> {};
3608 static const int kEntries = 64;
3629 inline byte get(
int index);
3630 inline void set(
int index,
byte value);
3633 inline int get_int(
int index);
3649 inline Address GetDataStartAddress();
3659 return SizeFor(this->length());
3662 inline void ByteArrayPrint() {
3663 ByteArrayPrint(stdout);
3665 void ByteArrayPrint(FILE* out);
3673 static const
int kMaxSize = 512 *
MB;
3675 static const
int kMaxLength = kMaxSize - kHeaderSize;
3678 DISALLOW_IMPLICIT_CONSTRUCTORS(
ByteArray);
3688 inline void set_size(
int value);
3690 inline int Size() {
return size(); }
3696 inline void FreeSpacePrint() {
3697 FreeSpacePrint(stdout);
3699 void FreeSpacePrint(FILE* out);
3705 static const
int kSizeOffset = HeapObject::kHeaderSize;
3706 static const
int kHeaderSize = kSizeOffset + kPointerSize;
3711 DISALLOW_IMPLICIT_CONSTRUCTORS(
FreeSpace);
3738 static const
int kMaxLength = 0x3fffffff;
3741 static const
int kExternalPointerOffset =
3743 static const
int kHeaderSize = kExternalPointerOffset + kPointerSize;
3761 inline uint8_t* external_pixel_pointer();
3764 inline uint8_t get_scalar(
int index);
3766 inline void set(
int index, uint8_t value);
3776 inline void ExternalPixelArrayPrint() {
3777 ExternalPixelArrayPrint(stdout);
3779 void ExternalPixelArrayPrint(FILE* out);
3791 inline int8_t get_scalar(
int index);
3793 inline void set(
int index, int8_t value);
3803 inline void ExternalByteArrayPrint() {
3804 ExternalByteArrayPrint(stdout);
3806 void ExternalByteArrayPrint(FILE* out);
3818 inline uint8_t get_scalar(
int index);
3820 inline void set(
int index, uint8_t value);
3830 inline void ExternalUnsignedByteArrayPrint() {
3831 ExternalUnsignedByteArrayPrint(stdout);
3833 void ExternalUnsignedByteArrayPrint(FILE* out);
3845 inline int16_t get_scalar(
int index);
3847 inline void set(
int index,
int16_t value);
3857 inline void ExternalShortArrayPrint() {
3858 ExternalShortArrayPrint(stdout);
3860 void ExternalShortArrayPrint(FILE* out);
3872 inline uint16_t get_scalar(
int index);
3874 inline void set(
int index,
uint16_t value);
3884 inline void ExternalUnsignedShortArrayPrint() {
3885 ExternalUnsignedShortArrayPrint(stdout);
3887 void ExternalUnsignedShortArrayPrint(FILE* out);
3899 inline int32_t get_scalar(
int index);
3901 inline void set(
int index,
int32_t value);
3911 inline void ExternalIntArrayPrint() {
3912 ExternalIntArrayPrint(stdout);
3914 void ExternalIntArrayPrint(FILE* out);
3926 inline uint32_t get_scalar(
int index);
3928 inline void set(
int index, uint32_t value);
3938 inline void ExternalUnsignedIntArrayPrint() {
3939 ExternalUnsignedIntArrayPrint(stdout);
3941 void ExternalUnsignedIntArrayPrint(FILE* out);
3953 inline float get_scalar(
int index);
3955 inline void set(
int index,
float value);
3965 inline void ExternalFloatArrayPrint() {
3966 ExternalFloatArrayPrint(stdout);
3968 void ExternalFloatArrayPrint(FILE* out);
3980 inline double get_scalar(
int index);
3982 inline void set(
int index,
double value);
3992 inline void ExternalDoubleArrayPrint() {
3993 ExternalDoubleArrayPrint(stdout);
3995 void ExternalDoubleArrayPrint(FILE* out);
3996 #endif // OBJECT_PRINT
4014 static const int kTranslationByteArrayIndex = 0;
4015 static const int kInlinedFunctionCountIndex = 1;
4016 static const int kLiteralArrayIndex = 2;
4017 static const int kOsrAstIdIndex = 3;
4018 static const int kOsrPcOffsetIndex = 4;
4019 static const int kFirstDeoptEntryIndex = 5;
4022 static const int kAstIdRawOffset = 0;
4023 static const int kTranslationIndexOffset = 1;
4024 static const int kArgumentsStackHeightOffset = 2;
4025 static const int kPcOffset = 3;
4026 static const int kDeoptEntrySize = 4;
4029 #define DEFINE_ELEMENT_ACCESSORS(name, type) \
4031 return type::cast(get(k##name##Index)); \
4033 void Set##name(type* value) { \
4034 set(k##name##Index, value); \
4043 #undef DEFINE_ELEMENT_ACCESSORS
4046 #define DEFINE_ENTRY_ACCESSORS(name, type) \
4047 type* name(int i) { \
4048 return type::cast(get(IndexForEntry(i) + k##name##Offset)); \
4050 void Set##name(int i, type* value) { \
4051 set(IndexForEntry(i) + k##name##Offset, value); \
4059 #undef DEFINE_ENTRY_ACCESSORS
4070 return (length() - kFirstDeoptEntryIndex) / kDeoptEntrySize;
4080 #ifdef ENABLE_DISASSEMBLER
4081 void DeoptimizationInputDataPrint(FILE* out);
4085 static int IndexForEntry(
int i) {
4086 return kFirstDeoptEntryIndex + (i * kDeoptEntrySize);
4089 static int LengthFor(
int entry_count) {
4090 return IndexForEntry(entry_count);
4116 return deopt_points * 2;
4120 MUST_USE_RESULT static MaybeObject* Allocate(
int number_of_deopt_points,
4126 #if defined(OBJECT_PRINT) || defined(ENABLE_DISASSEMBLER)
4127 void DeoptimizationOutputDataPrint(FILE* out);
4133 class JSGlobalPropertyCell;
4161 static inline Object* RawUninitializedSentinel(
Heap* heap);
4166 static const int kForInFastCaseMarker = 0;
4167 static const int kForInSlowCaseMarker = 1;
4172 class SafepointEntry;
4187 #define CODE_KIND_LIST(V) \
4189 V(OPTIMIZED_FUNCTION) \
4204 #define DEFINE_CODE_KIND_ENUM(name) name,
4206 #undef DEFINE_CODE_KIND_ENUM
4209 LAST_CODE_KIND = TO_BOOLEAN_IC,
4211 FIRST_IC_KIND = LOAD_IC,
4212 LAST_IC_KIND = TO_BOOLEAN_IC
4231 NUMBER_OF_KINDS = LAST_IC_KIND + 1
4238 #ifdef ENABLE_DISASSEMBLER
4240 static const char* Kind2String(
Kind kind);
4242 static const char* StubType2String(
StubType type);
4244 inline void Disassemble(
const char* name) {
4245 Disassemble(name, stdout);
4247 void Disassemble(
const char* name, FILE* out);
4248 #endif // ENABLE_DISASSEMBLER
4251 inline int instruction_size();
4252 inline void set_instruction_size(
int value);
4256 void InvalidateRelocation();
4275 inline
void set_ic_age(
int count);
4276 inline
int ic_age();
4279 inline ByteArray* unchecked_relocation_info();
4280 inline FixedArray* unchecked_deoptimization_data();
4282 inline
int relocation_size();
4285 inline Flags
flags();
4286 inline
void set_flags(Flags flags);
4291 inline ExtraICState extra_ic_state();
4292 inline StubType type();
4293 inline
int arguments_count();
4296 inline
bool is_inline_cache_stub();
4297 inline
bool is_load_stub() {
return kind() == LOAD_IC; }
4309 inline int major_key();
4310 inline void set_major_key(
int value);
4314 inline bool is_pregenerated();
4315 inline void set_is_pregenerated(
bool value);
4318 inline bool optimizable();
4319 inline void set_optimizable(
bool value);
4323 inline bool has_deoptimization_support();
4324 inline void set_has_deoptimization_support(
bool value);
4328 inline bool has_debug_break_slots();
4329 inline void set_has_debug_break_slots(
bool value);
4333 inline bool is_compiled_optimizable();
4334 inline void set_compiled_optimizable(
bool value);
4340 inline void set_allow_osr_at_loop_nesting_level(
int level);
4341 inline int allow_osr_at_loop_nesting_level();
4345 inline int profiler_ticks();
4346 inline void set_profiler_ticks(
int ticks);
4350 inline unsigned stack_slots();
4351 inline void set_stack_slots(
unsigned slots);
4355 inline unsigned safepoint_table_offset();
4356 inline void set_safepoint_table_offset(
unsigned offset);
4360 inline unsigned stack_check_table_offset();
4361 inline void set_stack_check_table_offset(
unsigned offset);
4366 inline void set_check_type(
CheckType value);
4369 inline byte unary_op_type();
4370 inline void set_unary_op_type(
byte value);
4373 inline byte binary_op_type();
4374 inline void set_binary_op_type(
byte value);
4375 inline byte binary_op_result_type();
4376 inline void set_binary_op_result_type(
byte value);
4379 inline byte compare_state();
4380 inline void set_compare_state(
byte value);
4384 inline byte compare_operation();
4385 inline void set_compare_operation(
byte value);
4388 inline byte to_boolean_state();
4389 inline void set_to_boolean_state(
byte value);
4393 inline bool has_function_cache();
4394 inline void set_has_function_cache(
bool flag);
4396 bool allowed_in_shared_map_code_cache();
4399 SafepointEntry GetSafepointEntry(
Address pc);
4403 void SetNoStackCheckTable();
4406 Map* FindFirstMap();
4410 public BitField<KeyedAccessGrowMode, 1, 1> {};
4412 static const int kExtraICStateGrowModeShift = 1;
4415 return ExtraICStateStrictMode::decode(extra_ic_state);
4420 return ExtraICStateKeyedAccessGrowMode::decode(extra_ic_state);
4426 return ExtraICStateKeyedAccessGrowMode::encode(grow_mode) |
4427 ExtraICStateStrictMode::encode(strict_mode);
4431 static inline Flags ComputeFlags(
4434 ExtraICState extra_ic_state = kNoExtraICState,
4439 static inline Flags ComputeMonomorphicFlags(
4442 ExtraICState extra_ic_state = kNoExtraICState,
4447 static inline StubType ExtractTypeFromFlags(Flags
flags);
4448 static inline Kind ExtractKindFromFlags(Flags
flags);
4450 static inline ExtraICState ExtractExtraICStateFromFlags(Flags
flags);
4451 static inline int ExtractArgumentsCountFromFlags(Flags
flags);
4453 static inline Flags RemoveTypeFromFlags(Flags
flags);
4456 static inline Code* GetCodeFromTargetAddress(
Address address);
4459 static inline Object* GetObjectFromEntryAddress(
Address location_of_address);
4462 inline byte* instruction_start();
4465 inline byte* instruction_end();
4468 inline int body_size();
4471 inline byte* relocation_start();
4474 inline byte* entry();
4477 inline bool contains(
byte*
pc);
4481 void Relocate(intptr_t delta);
4484 void CopyFrom(
const CodeDesc& desc);
4496 ASSERT_EQ(static_cast<int>(instruction_start() - address()),
4503 int SourceStatementPosition(
Address pc);
4510 inline void CodeIterateBody(ObjectVisitor* v);
4512 template<
typename StaticVisitor>
4513 inline void CodeIterateBody(
Heap* heap);
4515 inline void CodePrint() {
4518 void CodePrint(FILE* out);
4522 void ClearInlineCaches();
4523 void ClearTypeFeedbackCells(Heap* heap);
4527 static const
int kMaxLoopNestingMarker = 6;
4530 static const
int kInstructionSizeOffset = HeapObject::kHeaderSize;
4531 static const
int kRelocationInfoOffset = kInstructionSizeOffset +
kIntSize;
4532 static const
int kHandlerTableOffset = kRelocationInfoOffset + kPointerSize;
4533 static const
int kDeoptimizationDataOffset =
4534 kHandlerTableOffset + kPointerSize;
4535 static const
int kTypeFeedbackInfoOffset =
4536 kDeoptimizationDataOffset + kPointerSize;
4537 static const
int kGCMetadataOffset = kTypeFeedbackInfoOffset + kPointerSize;
4538 static const
int kICAgeOffset =
4539 kGCMetadataOffset + kPointerSize;
4540 static const
int kFlagsOffset = kICAgeOffset + kIntSize;
4541 static const
int kKindSpecificFlags1Offset = kFlagsOffset + kIntSize;
4542 static const
int kKindSpecificFlags2Offset =
4543 kKindSpecificFlags1Offset + kIntSize;
4545 static const
int kHeaderPaddingStart = kKindSpecificFlags2Offset + kIntSize;
4549 static const
int kHeaderSize =
4553 static const
int kOptimizableOffset = kKindSpecificFlags1Offset;
4554 static const
int kCheckTypeOffset = kKindSpecificFlags1Offset;
4556 static const
int kFullCodeFlags = kOptimizableOffset + 1;
4562 static const int kAllowOSRAtLoopNestingLevelOffset = kFullCodeFlags + 1;
4563 static const int kProfilerTicksOffset = kAllowOSRAtLoopNestingLevelOffset + 1;
4574 static const int kStackSlotsFirstBit = 0;
4575 static const int kStackSlotsBitCount = 24;
4576 static const int kUnaryOpTypeFirstBit =
4577 kStackSlotsFirstBit + kStackSlotsBitCount;
4578 static const int kUnaryOpTypeBitCount = 3;
4579 static const int kBinaryOpTypeFirstBit =
4580 kStackSlotsFirstBit + kStackSlotsBitCount;
4581 static const int kBinaryOpTypeBitCount = 3;
4582 static const int kBinaryOpResultTypeFirstBit =
4583 kBinaryOpTypeFirstBit + kBinaryOpTypeBitCount;
4584 static const int kBinaryOpResultTypeBitCount = 3;
4585 static const int kCompareStateFirstBit =
4586 kStackSlotsFirstBit + kStackSlotsBitCount;
4587 static const int kCompareStateBitCount = 3;
4588 static const int kCompareOperationFirstBit =
4589 kCompareStateFirstBit + kCompareStateBitCount;
4590 static const int kCompareOperationBitCount = 4;
4591 static const int kToBooleanStateFirstBit =
4592 kStackSlotsFirstBit + kStackSlotsBitCount;
4593 static const int kToBooleanStateBitCount = 8;
4594 static const int kHasFunctionCacheFirstBit =
4595 kStackSlotsFirstBit + kStackSlotsBitCount;
4596 static const int kHasFunctionCacheBitCount = 1;
4598 STATIC_ASSERT(kStackSlotsFirstBit + kStackSlotsBitCount <= 32);
4599 STATIC_ASSERT(kUnaryOpTypeFirstBit + kUnaryOpTypeBitCount <= 32);
4600 STATIC_ASSERT(kBinaryOpTypeFirstBit + kBinaryOpTypeBitCount <= 32);
4602 kBinaryOpResultTypeBitCount <= 32);
4603 STATIC_ASSERT(kCompareStateFirstBit + kCompareStateBitCount <= 32);
4604 STATIC_ASSERT(kCompareOperationFirstBit + kCompareOperationBitCount <= 32);
4605 STATIC_ASSERT(kToBooleanStateFirstBit + kToBooleanStateBitCount <= 32);
4606 STATIC_ASSERT(kHasFunctionCacheFirstBit + kHasFunctionCacheBitCount <= 32);
4609 kStackSlotsFirstBit, kStackSlotsBitCount> {};
4611 kUnaryOpTypeFirstBit, kUnaryOpTypeBitCount> {};
4613 kBinaryOpTypeFirstBit, kBinaryOpTypeBitCount> {};
4615 kBinaryOpResultTypeFirstBit, kBinaryOpResultTypeBitCount> {};
4617 kCompareStateFirstBit, kCompareStateBitCount> {};
4619 kCompareOperationFirstBit, kCompareOperationBitCount> {};
4621 kToBooleanStateFirstBit, kToBooleanStateBitCount> {};
4623 kHasFunctionCacheFirstBit, kHasFunctionCacheBitCount> {};
4626 static const int kStubMajorKeyFirstBit = 0;
4627 static const int kSafepointTableOffsetFirstBit =
4629 static const int kSafepointTableOffsetBitCount = 26;
4633 kSafepointTableOffsetBitCount <= 32);
4636 kSafepointTableOffsetFirstBit,
4637 kSafepointTableOffsetBitCount> {};
4639 kStubMajorKeyFirstBit, kStubMajorKeyBits> {};
4645 static const int kArgumentsCountShift = 14;
4646 static const int kArgumentsCountMask = ~((1 << kArgumentsCountShift) - 1);
4649 static const int kFlagsNotUsedInLookup =
4650 TypeField::kMask | CacheHolderField::kMask;
4661 class Map:
public HeapObject {
4666 inline int instance_size();
4667 inline void set_instance_size(
int value);
4670 inline int inobject_properties();
4671 inline void set_inobject_properties(
int value);
4674 inline int pre_allocated_property_fields();
4675 inline void set_pre_allocated_property_fields(
int value);
4683 inline int unused_property_fields();
4684 inline void set_unused_property_fields(
int value);
4687 inline byte bit_field();
4688 inline void set_bit_field(
byte value);
4691 inline byte bit_field2();
4692 inline void set_bit_field2(
byte value);
4695 inline int bit_field3();
4696 inline void set_bit_field3(
int value);
4710 inline void set_non_instance_prototype(
bool value);
4711 inline bool has_non_instance_prototype();
4716 inline void set_function_with_prototype(
bool value);
4717 inline bool function_with_prototype();
4722 set_bit_field(bit_field() | (1 << kIsHiddenPrototype));
4726 return ((1 << kIsHiddenPrototype) & bit_field()) != 0;
4731 set_bit_field(bit_field() | (1 << kHasNamedInterceptor));
4735 return ((1 << kHasNamedInterceptor) & bit_field()) != 0;
4740 set_bit_field(bit_field() | (1 << kHasIndexedInterceptor));
4744 return ((1 << kHasIndexedInterceptor) & bit_field()) != 0;
4754 set_bit_field(bit_field() | (1 << kIsUndetectable));
4758 return ((1 << kIsUndetectable) & bit_field()) != 0;
4763 set_bit_field(bit_field() | (1 << kHasInstanceCallHandler));
4767 return ((1 << kHasInstanceCallHandler) & bit_field()) != 0;
4770 inline void set_is_extensible(
bool value);
4771 inline bool is_extensible();
4776 set_bit_field2((bit_field2() & ~kElementsKindMask) |
4777 (elements_kind << kElementsKindShift));
4778 ASSERT(this->elements_kind() == elements_kind);
4783 (bit_field2() & kElementsKindMask) >> kElementsKindShift);
4821 static bool IsValidElementsTransition(
ElementsKind from_kind,
4824 inline bool HasTransitionArray();
4825 inline bool HasElementsTransition();
4826 inline Map* elements_transition_map();
4828 Map* transitioned_map);
4829 inline void SetTransition(
int transition_index,
Map* target);
4830 inline Map* GetTransition(
int transition_index);
4835 inline
void ClearTransitions(
Heap* heap,
4840 inline
void set_attached_to_shared_function_info(
bool value);
4842 inline
bool attached_to_shared_function_info();
4847 inline
void set_is_shared(
bool value);
4848 inline
bool is_shared();
4854 inline
void set_dictionary_map(
bool value);
4855 inline
bool is_dictionary_map();
4859 inline
void set_is_access_check_needed(
bool access_check_needed);
4860 inline
bool is_access_check_needed();
4881 inline
Object* GetBackPointer();
4882 inline
void SetBackPointer(
Object* value,
4884 inline
void init_back_pointer(
Object* undefined);
4894 inline FixedArray* GetPrototypeTransitions();
4896 FixedArray* prototype_transitions);
4897 inline
bool HasPrototypeTransitions();
4899 inline HeapObject* UncheckedPrototypeTransitions();
4902 static const
int kProtoTransitionHeaderSize = 1;
4903 static const
int kProtoTransitionNumberOfEntriesOffset = 0;
4904 static const
int kProtoTransitionElementsPerEntry = 2;
4905 static const
int kProtoTransitionPrototypeOffset = 0;
4906 static const
int kProtoTransitionMapOffset = 1;
4908 inline
int NumberOfProtoTransitions() {
4909 FixedArray* cache = GetPrototypeTransitions();
4910 if (cache->
length() == 0)
return 0;
4916 FixedArray* cache = GetPrototypeTransitions();
4925 inline void LookupDescriptor(
JSObject* holder,
4927 LookupResult* result);
4929 inline void LookupTransition(
JSObject* holder,
4931 LookupResult* result);
4936 inline bool CanHaveMoreTransitions();
4939 int number_of_own_descriptors = NumberOfOwnDescriptors();
4940 ASSERT(number_of_own_descriptors > 0);
4941 return number_of_own_descriptors - 1;
4945 return NumberOfOwnDescriptorsBits::decode(bit_field3());
4949 ASSERT(number <= instance_descriptors()->number_of_descriptors());
4950 set_bit_field3(NumberOfOwnDescriptorsBits::update(bit_field3(), number));
4956 return EnumLengthBits::decode(bit_field3());
4960 if (length != kInvalidEnumCache) {
4962 ASSERT(length == 0 || instance_descriptors()->HasEnumCache());
4963 ASSERT(length <= NumberOfOwnDescriptors());
4965 set_bit_field3(EnumLengthBits::update(bit_field3(), length));
4969 inline bool owns_descriptors();
4970 inline void set_owns_descriptors(
bool is_shared);
4979 int descriptor_index);
4981 Descriptor* descriptor);
4982 MUST_USE_RESULT MaybeObject* CopyAddDescriptor(Descriptor* descriptor,
4984 MUST_USE_RESULT MaybeObject* CopyInsertDescriptor(Descriptor* descriptor,
4988 Descriptor* descriptor,
4997 inline void AppendDescriptor(Descriptor* desc,
5005 int PropertyIndexFor(
String* name);
5008 int NextFreePropertyIndex();
5024 inline void ClearCodeCache(
Heap* heap);
5034 static void AppendCallbackDescriptors(
Handle<Map> map,
5037 static void EnsureDescriptorSlack(
Handle<Map> map,
int slack);
5052 void ClearNonLiveTransitions(
Heap* heap);
5073 Map* FindTransitionedMap(
MapList* candidates);
5081 void ZapPrototypeTransitions();
5082 void ZapTransitions();
5086 inline void MapPrint() {
5089 void MapPrint(FILE* out);
5094 void SharedMapVerify();
5097 inline int visitor_id();
5098 inline void set_visitor_id(
int visitor_id);
5100 typedef void (*TraverseCallback)(
Map* map,
void* data);
5102 void TraverseTransitionTree(TraverseCallback callback,
void* data);
5111 static const int kMaxCachedPrototypeTransitions = 256;
5113 Map* GetPrototypeTransition(
Object* prototype);
5118 static const int kMaxPreAllocatedPropertyFields = 255;
5121 static const int kInvalidEnumCache = EnumLengthBits::kMax;
5125 static const int kInstanceAttributesOffset = kInstanceSizesOffset +
kIntSize;
5126 static const int kPrototypeOffset = kInstanceAttributesOffset +
kIntSize;
5132 static const int kTransitionsOrBackPointerOffset =
5134 static const int kDescriptorsOffset =
5136 static const int kCodeCacheOffset =
5144 static const int kPointerFieldsEndOffset = kBitField3Offset +
kPointerSize;
5147 static const int kInstanceSizeOffset = kInstanceSizesOffset + 0;
5148 static const int kInObjectPropertiesByte = 1;
5149 static const int kInObjectPropertiesOffset =
5150 kInstanceSizesOffset + kInObjectPropertiesByte;
5151 static const int kPreAllocatedPropertyFieldsByte = 2;
5152 static const int kPreAllocatedPropertyFieldsOffset =
5153 kInstanceSizesOffset + kPreAllocatedPropertyFieldsByte;
5154 static const int kVisitorIdByte = 3;
5155 static const int kVisitorIdOffset = kInstanceSizesOffset + kVisitorIdByte;
5158 static const int kInstanceTypeOffset = kInstanceAttributesOffset + 0;
5159 static const int kUnusedPropertyFieldsOffset = kInstanceAttributesOffset + 1;
5160 static const int kBitFieldOffset = kInstanceAttributesOffset + 2;
5161 static const int kBitField2Offset = kInstanceAttributesOffset + 3;
5166 static const int kUnused = 0;
5167 static const int kHasNonInstancePrototype = 1;
5168 static const int kIsHiddenPrototype = 2;
5169 static const int kHasNamedInterceptor = 3;
5170 static const int kHasIndexedInterceptor = 4;
5171 static const int kIsUndetectable = 5;
5172 static const int kHasInstanceCallHandler = 6;
5173 static const int kIsAccessCheckNeeded = 7;
5176 static const int kIsExtensible = 0;
5177 static const int kStringWrapperSafeForDefaultValueOf = 1;
5178 static const int kAttachedToSharedFunctionInfo = 2;
5181 static const int kElementsKindShift = 3;
5182 static const int kElementsKindBitCount = 5;
5185 static const int kElementsKindMask = (-1 << kElementsKindShift) &
5186 ((1 << (kElementsKindShift + kElementsKindBitCount)) - 1);
5187 static const int8_t kMaximumBitField2FastElementValue =
static_cast<int8_t
>(
5189 static const int8_t kMaximumBitField2FastSmiElementValue =
5192 static const int8_t kMaximumBitField2FastHoleyElementValue =
5195 static const int8_t kMaximumBitField2FastHoleySmiElementValue =
5200 kPointerFieldsEndOffset,
5213 inline void InitializeBody(
int object_size);
5230 COMPILATION_TYPE_HOST = 0,
5231 COMPILATION_TYPE_EVAL = 1
5236 COMPILATION_STATE_INITIAL = 0,
5237 COMPILATION_STATE_COMPILED = 1
5289 inline
bool HasValidSource();
5292 inline void ScriptPrint() {
5293 ScriptPrint(stdout);
5295 void ScriptPrint(FILE* out);
5299 static const
int kSourceOffset = HeapObject::kHeaderSize;
5300 static const
int kNameOffset = kSourceOffset + kPointerSize;
5301 static const
int kLineOffsetOffset = kNameOffset + kPointerSize;
5302 static const
int kColumnOffsetOffset = kLineOffsetOffset + kPointerSize;
5303 static const
int kDataOffset = kColumnOffsetOffset + kPointerSize;
5304 static const
int kContextOffset = kDataOffset + kPointerSize;
5305 static const
int kWrapperOffset = kContextOffset + kPointerSize;
5306 static const
int kTypeOffset = kWrapperOffset + kPointerSize;
5307 static const
int kCompilationTypeOffset = kTypeOffset + kPointerSize;
5308 static const
int kCompilationStateOffset =
5309 kCompilationTypeOffset + kPointerSize;
5310 static const
int kLineEndsOffset = kCompilationStateOffset + kPointerSize;
5311 static const
int kIdOffset = kLineEndsOffset + kPointerSize;
5312 static const
int kEvalFromSharedOffset = kIdOffset + kPointerSize;
5313 static const
int kEvalFrominstructionsOffsetOffset =
5314 kEvalFromSharedOffset + kPointerSize;
5315 static const
int kSize = kEvalFrominstructionsOffsetOffset + kPointerSize;
5318 DISALLOW_IMPLICIT_CONSTRUCTORS(
Script);
5334 #define FUNCTIONS_WITH_ID_LIST(V) \
5335 V(Array.prototype, push, ArrayPush) \
5336 V(Array.prototype, pop, ArrayPop) \
5337 V(Function.prototype, apply, FunctionApply) \
5338 V(String.prototype, charCodeAt, StringCharCodeAt) \
5339 V(String.prototype, charAt, StringCharAt) \
5340 V(String, fromCharCode, StringFromCharCode) \
5341 V(Math, floor, MathFloor) \
5342 V(Math, round, MathRound) \
5343 V(Math, ceil, MathCeil) \
5344 V(Math, abs, MathAbs) \
5345 V(Math, log, MathLog) \
5346 V(Math, sin, MathSin) \
5347 V(Math, cos, MathCos) \
5348 V(Math, tan, MathTan) \
5349 V(Math, asin, MathASin) \
5350 V(Math, acos, MathACos) \
5351 V(Math, atan, MathATan) \
5352 V(Math, exp, MathExp) \
5353 V(Math, sqrt, MathSqrt) \
5354 V(Math, pow, MathPow) \
5355 V(Math, random, MathRandom) \
5356 V(Math, max, MathMax) \
5357 V(Math, min, MathMin)
5361 #define DECLARE_FUNCTION_ID(ignored1, ignore2, name) \
5364 #undef DECLARE_FUNCTION_ID
5389 int SearchOptimizedCodeMap(
Context* native_context);
5393 void InstallFromOptimizedCodeMap(
JSFunction*
function,
int index);
5396 void ClearOptimizedCodeMap();
5403 static const int kEntryLength = 3;
5411 inline
Code* unchecked_code();
5414 inline
bool is_compiled();
5418 inline
int length();
5419 inline
void set_length(
int value);
5423 inline
void set_formal_parameter_count(
int value);
5427 inline
void DontAdaptArguments();
5430 inline
int expected_nof_properties();
5431 inline
void set_expected_nof_properties(
int value);
5484 static const
int kGenerousAllocationCount = 8;
5488 inline
int construction_count();
5489 inline
void set_construction_count(
int value);
5499 inline
bool IsInobjectSlackTrackingInProgress();
5506 void StartInobjectSlackTracking(
Map* map);
5510 void CompleteInobjectSlackTracking();
5514 inline
void BeforeVisitingPointers();
5518 void DetachInitialMap();
5522 void AttachInitialMap(
Map* map);
5540 inline
bool IsApiFunction();
5542 inline
bool HasBuiltinFunctionId();
5549 inline
int num_literals();
5550 inline
void set_num_literals(
int value);
5558 inline
void set_start_position_and_type(
int value);
5574 inline
int function_token_position();
5575 inline
void set_function_token_position(
int function_token_position);
5578 inline
int start_position();
5579 inline
void set_start_position(
int start_position);
5582 inline
int end_position();
5583 inline
void set_end_position(
int end_position);
5594 inline
void set_compiler_hints(
int value);
5596 inline
int ast_node_count();
5597 inline
void set_ast_node_count(
int count);
5602 inline
void set_stress_deopt_counter(
int counter);
5604 inline
int profiler_ticks();
5608 inline
int ic_age();
5609 inline
void set_ic_age(
int age);
5612 void SetThisPropertyAssignmentsInfo(
5613 bool has_only_simple_this_property_assignments,
5614 FixedArray* this_property_assignments);
5617 void ClearThisPropertyAssignmentsInfo();
5621 inline
bool has_only_simple_this_property_assignments();
5639 inline
int code_age();
5640 inline
void set_code_age(
int age);
5655 inline
void set_language_mode(
LanguageMode language_mode);
5658 inline
bool is_classic_mode();
5661 inline
bool is_extended_mode();
5703 inline
bool has_deoptimization_support();
5706 void EnableDeoptimizationSupport(
Code* recompiled);
5710 void DisableOptimization(const
char* reason);
5719 bool CanGenerateInlineConstructor(
Object* prototype);
5723 void ForbidInlineConstructor();
5728 inline
int this_property_assignments_count();
5729 inline
void set_this_property_assignments_count(
int value);
5730 String* GetThisPropertyAssignmentName(
int index);
5731 bool IsThisPropertyAssignmentArgument(
int index);
5732 int GetThisPropertyAssignmentArgument(
int index);
5733 Object* GetThisPropertyAssignmentConstant(
int index);
5736 bool HasSourceCode();
5740 inline
int opt_count();
5741 inline
void set_opt_count(
int opt_count);
5744 inline
void set_deopt_count(
int value);
5745 inline
int deopt_count();
5746 inline
void increment_deopt_count();
5750 inline
void set_opt_reenable_tries(
int value);
5751 inline
int opt_reenable_tries();
5753 inline
void TryReenableOptimization();
5756 inline
void set_counters(
int value);
5757 inline
int counters();
5763 int CalculateInstanceSize();
5766 int CalculateInObjectProperties();
5770 void SourceCodePrint(
StringStream* accumulator,
int max_length);
5772 inline void SharedFunctionInfoPrint() {
5773 SharedFunctionInfoPrint(stdout);
5775 void SharedFunctionInfoPrint(FILE* out);
5779 void ResetForNewContext(
int new_ic_age);
5791 static const
int kDontAdaptArgumentsSentinel = -1;
5795 static const
int kNameOffset = HeapObject::kHeaderSize;
5796 static const
int kCodeOffset = kNameOffset + kPointerSize;
5797 static const
int kOptimizedCodeMapOffset = kCodeOffset + kPointerSize;
5798 static const
int kScopeInfoOffset = kOptimizedCodeMapOffset + kPointerSize;
5799 static const
int kConstructStubOffset = kScopeInfoOffset + kPointerSize;
5800 static const
int kInstanceClassNameOffset =
5801 kConstructStubOffset + kPointerSize;
5802 static const
int kFunctionDataOffset =
5803 kInstanceClassNameOffset + kPointerSize;
5804 static const
int kScriptOffset = kFunctionDataOffset + kPointerSize;
5805 static const
int kDebugInfoOffset = kScriptOffset + kPointerSize;
5806 static const
int kInferredNameOffset = kDebugInfoOffset + kPointerSize;
5807 static const
int kInitialMapOffset =
5808 kInferredNameOffset + kPointerSize;
5809 static const
int kThisPropertyAssignmentsOffset =
5810 kInitialMapOffset + kPointerSize;
5813 static const
int kAstNodeCountOffset =
5814 kThisPropertyAssignmentsOffset + kPointerSize;
5815 #if V8_HOST_ARCH_32_BIT
5817 static const int kLengthOffset =
5819 static const int kFormalParameterCountOffset = kLengthOffset +
kPointerSize;
5820 static const int kExpectedNofPropertiesOffset =
5822 static const int kNumLiteralsOffset =
5824 static const int kStartPositionAndTypeOffset =
5826 static const int kEndPositionOffset =
5828 static const int kFunctionTokenPositionOffset =
5830 static const int kCompilerHintsOffset =
5832 static const int kThisPropertyAssignmentsCountOffset =
5834 static const int kOptCountOffset =
5836 static const int kCountersOffset = kOptCountOffset +
kPointerSize;
5837 static const int kStressDeoptCounterOffset = kCountersOffset +
kPointerSize;
5840 static const int kSize = kStressDeoptCounterOffset +
kPointerSize;
5851 static const int kLengthOffset =
5853 static const int kFormalParameterCountOffset =
5856 static const int kExpectedNofPropertiesOffset =
5857 kFormalParameterCountOffset +
kIntSize;
5858 static const int kNumLiteralsOffset =
5859 kExpectedNofPropertiesOffset +
kIntSize;
5861 static const int kEndPositionOffset =
5863 static const int kStartPositionAndTypeOffset =
5866 static const int kFunctionTokenPositionOffset =
5867 kStartPositionAndTypeOffset +
kIntSize;
5868 static const int kCompilerHintsOffset =
5869 kFunctionTokenPositionOffset +
kIntSize;
5871 static const int kThisPropertyAssignmentsCountOffset =
5873 static const int kOptCountOffset =
5874 kThisPropertyAssignmentsCountOffset +
kIntSize;
5876 static const int kCountersOffset = kOptCountOffset +
kIntSize;
5877 static const int kStressDeoptCounterOffset = kCountersOffset +
kIntSize;
5880 static const int kSize = kStressDeoptCounterOffset +
kIntSize;
5887 #if __BYTE_ORDER == __LITTLE_ENDIAN
5888 static const int kConstructionCountOffset = kCompilerHintsOffset + 3;
5889 #elif __BYTE_ORDER == __BIG_ENDIAN
5890 static const int kConstructionCountOffset = kCompilerHintsOffset + 0;
5892 #error Unknown byte ordering
5904 static const int kIsExpressionBit = 0;
5905 static const int kIsTopLevelBit = 1;
5906 static const int kStartPositionShift = 2;
5907 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1);
5910 static const int kCodeAgeSize = 3;
5911 static const int kCodeAgeMask = (1 << kCodeAgeSize) - 1;
5919 kOptimizationDisabled = kCodeAgeShift + kCodeAgeSize,
5940 #if V8_HOST_ARCH_32_BIT
5942 static const int kCompilerHintsSmiTagSize =
kSmiTagSize;
5946 static const int kCompilerHintsSmiTagSize = 0;
5947 static const int kCompilerHintsSize =
kIntSize;
5951 SharedFunctionInfo::kCompilerHintsSize *
kBitsPerByte);
5957 static const int kStrictModeBitWithinByte =
5958 (kStrictModeFunction + kCompilerHintsSmiTagSize) %
kBitsPerByte;
5960 static const int kExtendedModeBitWithinByte =
5961 (kExtendedModeFunction + kCompilerHintsSmiTagSize) %
kBitsPerByte;
5963 static const int kNativeBitWithinByte =
5966 #if __BYTE_ORDER == __LITTLE_ENDIAN
5967 static const int kStrictModeByteOffset = kCompilerHintsOffset +
5968 (kStrictModeFunction + kCompilerHintsSmiTagSize) /
kBitsPerByte;
5969 static const int kExtendedModeByteOffset = kCompilerHintsOffset +
5970 (kExtendedModeFunction + kCompilerHintsSmiTagSize) /
kBitsPerByte;
5971 static const int kNativeByteOffset = kCompilerHintsOffset +
5973 #elif __BYTE_ORDER == __BIG_ENDIAN
5974 static const int kStrictModeByteOffset = kCompilerHintsOffset +
5975 (kCompilerHintsSize - 1) -
5976 ((kStrictModeFunction + kCompilerHintsSmiTagSize) /
kBitsPerByte);
5977 static const int kExtendedModeByteOffset = kCompilerHintsOffset +
5978 (kCompilerHintsSize - 1) -
5979 ((kExtendedModeFunction + kCompilerHintsSmiTagSize) /
kBitsPerByte);
5980 static const int kNativeByteOffset = kCompilerHintsOffset +
5981 (kCompilerHintsSize - 1) -
5984 #error Unknown byte ordering
6006 inline void JSModulePrint() {
6007 JSModulePrint(stdout);
6009 void JSModulePrint(FILE* out);
6014 static const
int kContextOffset =
JSObject::kHeaderSize;
6015 static const
int kScopeInfoOffset = kContextOffset + kPointerSize;
6016 static const
int kSize = kScopeInfoOffset + kPointerSize;
6019 DISALLOW_IMPLICIT_CONSTRUCTORS(
JSModule);
6037 inline Object* unchecked_context();
6038 inline void set_context(
Object* context);
6045 inline void set_code(
Code* code);
6046 inline void ReplaceCode(
Code* code);
6048 inline Code* unchecked_code();
6051 inline bool IsBuiltin();
6054 inline bool NeedsArgumentsAdaption();
6057 inline bool IsOptimized();
6060 inline bool IsOptimizable();
6064 void MarkForLazyRecompilation();
6065 void MarkForParallelRecompilation();
6079 inline bool IsMarkedForLazyRecompilation();
6080 inline bool IsMarkedForParallelRecompilation();
6084 inline bool IsInRecompileQueue();
6087 bool IsInlineable();
6105 inline FixedArray* literals();
6106 inline void set_literals(FixedArray* literals);
6108 inline FixedArray* function_bindings();
6109 inline void set_function_bindings(FixedArray* bindings);
6112 inline Map* initial_map();
6113 inline void set_initial_map(
Map* value);
6114 MUST_USE_RESULT inline MaybeObject* set_initial_map_and_cache_transitions(
6116 inline bool has_initial_map();
6122 inline bool has_prototype();
6123 inline bool has_instance_prototype();
6124 inline Object* prototype();
6125 inline Object* instance_prototype();
6131 void RemovePrototype();
6132 inline bool should_have_prototype();
6143 void SetInstanceClassName(
String* name);
6146 inline bool is_compiled();
6153 inline
void PrintName() {
6156 void PrintName(FILE* out);
6163 void JSFunctionIterateBody(
int object_size, ObjectVisitor* v);
6167 inline void JSFunctionPrint() {
6168 JSFunctionPrint(stdout);
6170 void JSFunctionPrint(FILE* out);
6175 inline
int NumberOfLiterals();
6178 static
Context* NativeContextFromLiterals(FixedArray* literals);
6182 static const
int kCodeEntryOffset =
JSObject::kHeaderSize;
6183 static const
int kPrototypeOrInitialMapOffset =
6184 kCodeEntryOffset + kPointerSize;
6185 static const
int kSharedFunctionInfoOffset =
6186 kPrototypeOrInitialMapOffset + kPointerSize;
6187 static const
int kContextOffset = kSharedFunctionInfoOffset + kPointerSize;
6188 static const
int kLiteralsOffset = kContextOffset + kPointerSize;
6189 static const
int kNonWeakFieldsEndOffset = kLiteralsOffset + kPointerSize;
6190 static const
int kNextFunctionLinkOffset = kNonWeakFieldsEndOffset;
6191 static const
int kSize = kNextFunctionLinkOffset + kPointerSize;
6194 static const
int kLiteralsPrefixSize = 1;
6195 static const
int kLiteralNativeContextIndex = 0;
6198 static const
int kBoundFunctionIndex = 0;
6199 static const
int kBoundThisIndex = 1;
6200 static const
int kBoundArgumentsStartIndex = 2;
6226 inline void JSGlobalProxyPrint() {
6227 JSGlobalProxyPrint(stdout);
6229 void JSGlobalProxyPrint(FILE* out);
6234 static const
int kNativeContextOffset = JSObject::kHeaderSize;
6235 static const
int kSize = kNativeContextOffset + kPointerSize;
6287 static const int kGlobalContextOffset = kNativeContextOffset +
kPointerSize;
6288 static const int kGlobalReceiverOffset = kGlobalContextOffset +
kPointerSize;
6304 inline void JSGlobalObjectPrint() {
6305 JSGlobalObjectPrint(stdout);
6307 void JSGlobalObjectPrint(FILE* out);
6336 inline void JSBuiltinsObjectPrint() {
6337 JSBuiltinsObjectPrint(stdout);
6339 void JSBuiltinsObjectPrint(FILE* out);
6346 static const
int kJSBuiltinsCount =
Builtins::id_count;
6347 static const
int kJSBuiltinsOffset = GlobalObject::kHeaderSize;
6348 static const
int kJSBuiltinsCodeOffset =
6349 GlobalObject::kHeaderSize + (kJSBuiltinsCount * kPointerSize);
6350 static const
int kSize =
6351 kJSBuiltinsCodeOffset + (kJSBuiltinsCount * kPointerSize);
6353 static
int OffsetOfFunctionWithId(
Builtins::JavaScript
id) {
6377 inline void JSValuePrint() {
6378 JSValuePrint(stdout);
6380 void JSValuePrint(FILE* out);
6386 static const
int kSize = kValueOffset + kPointerSize;
6389 DISALLOW_IMPLICIT_CONSTRUCTORS(
JSValue);
6426 void SetValue(
Object* value,
bool is_value_nan);
6431 inline void JSDatePrint() {
6432 JSDatePrint(stdout);
6434 void JSDatePrint(FILE* out);
6450 kMillisecond = kFirstUncachedField,
6454 kYearUTC = kFirstUTCField,
6485 inline void SetLocalFields(int64_t local_time_ms,
DateCache* date_cache);
6516 inline int start_position();
6517 inline void set_start_position(
int value);
6520 inline int end_position();
6521 inline void set_end_position(
int value);
6528 inline void JSMessageObjectPrint() {
6529 JSMessageObjectPrint(stdout);
6531 void JSMessageObjectPrint(FILE* out);
6537 static const
int kArgumentsOffset = kTypeOffset + kPointerSize;
6538 static const
int kScriptOffset = kArgumentsOffset + kPointerSize;
6539 static const
int kStackTraceOffset = kScriptOffset + kPointerSize;
6540 static const
int kStackFramesOffset = kStackTraceOffset + kPointerSize;
6541 static const
int kStartPositionOffset = kStackFramesOffset + kPointerSize;
6542 static const
int kEndPositionOffset = kStartPositionOffset + kPointerSize;
6543 static const
int kSize = kEndPositionOffset + kPointerSize;
6546 kStackFramesOffset + kPointerSize,
6574 enum Type { NOT_COMPILED, ATOM, IRREGEXP };
6575 enum Flag {
NONE = 0, GLOBAL = 1, IGNORE_CASE = 2, MULTILINE = 4 };
6579 explicit Flags(uint32_t value) : value_(value) { }
6590 inline Type TypeTag();
6591 inline
int CaptureCount();
6592 inline Flags GetFlags();
6593 inline
String* Pattern();
6594 inline
Object* DataAt(
int index);
6596 inline
void SetDataAt(
int index,
Object* value);
6599 inline
Object* DataAtUnchecked(
int index);
6600 inline
void SetDataAtUnchecked(
int index,
Object* value,
Heap* heap);
6601 inline Type TypeTagUnchecked();
6603 static
int code_index(
bool is_ascii) {
6605 return kIrregexpASCIICodeIndex;
6607 return kIrregexpUC16CodeIndex;
6613 return kIrregexpASCIICodeSavedIndex;
6615 return kIrregexpUC16CodeSavedIndex;
6624 static const
int kDataOffset = JSObject::kHeaderSize;
6625 static const
int kSize = kDataOffset + kPointerSize;
6628 static const
int kTagIndex = 0;
6629 static const
int kSourceIndex = kTagIndex + 1;
6630 static const
int kFlagsIndex = kSourceIndex + 1;
6631 static const
int kDataIndex = kFlagsIndex + 1;
6635 static const
int kAtomPatternIndex = kDataIndex;
6637 static const
int kAtomDataSize = kAtomPatternIndex + 1;
6642 static const
int kIrregexpASCIICodeIndex = kDataIndex;
6646 static const
int kIrregexpUC16CodeIndex = kDataIndex + 1;
6650 static const
int kIrregexpASCIICodeSavedIndex = kDataIndex + 2;
6653 static const
int kIrregexpUC16CodeSavedIndex = kDataIndex + 3;
6657 static const
int kIrregexpMaxRegisterCountIndex = kDataIndex + 4;
6659 static const
int kIrregexpCaptureCountIndex = kDataIndex + 5;
6661 static const
int kIrregexpDataSize = kIrregexpCaptureCountIndex + 1;
6664 static const
int kDataTagOffset =
6665 FixedArray::kHeaderSize + kTagIndex * kPointerSize;
6666 static const
int kDataAsciiCodeOffset =
6667 FixedArray::kHeaderSize + kIrregexpASCIICodeIndex * kPointerSize;
6668 static const
int kDataUC16CodeOffset =
6669 FixedArray::kHeaderSize + kIrregexpUC16CodeIndex * kPointerSize;
6670 static const
int kIrregexpCaptureCountOffset =
6671 FixedArray::kHeaderSize + kIrregexpCaptureCountIndex * kPointerSize;
6674 static const
int kSourceFieldIndex = 0;
6675 static const
int kGlobalFieldIndex = 1;
6676 static const
int kIgnoreCaseFieldIndex = 2;
6677 static const
int kMultilineFieldIndex = 3;
6678 static const
int kLastIndexFieldIndex = 4;
6679 static const
int kInObjectFieldCount = 5;
6682 static const
int kUninitializedValue = -1;
6686 static const
int kCompilationErrorValue = -2;
6691 static const
int kCodeAgeMask = 0xff;
6701 static inline uint32_t
Hash(HashTableKey* key) {
6713 static const int kPrefixSize = 0;
6714 static const int kEntrySize = 2;
6726 int scope_position);
6734 int scope_position);
6740 void Remove(
Object* value);
6768 void RemoveByIndex(
Object* name,
Code* code,
int index);
6773 inline void CodeCachePrint() {
6774 CodeCachePrint(stdout);
6776 void CodeCachePrint(FILE* out);
6780 static const
int kDefaultCacheOffset = HeapObject::kHeaderSize;
6781 static const
int kNormalTypeCacheOffset =
6782 kDefaultCacheOffset + kPointerSize;
6783 static const
int kSize = kNormalTypeCacheOffset + kPointerSize;
6793 static const
int kCodeCacheEntrySize = 2;
6794 static const
int kCodeCacheEntryNameOffset = 0;
6795 static const
int kCodeCacheEntryCodeOffset = 1;
6797 DISALLOW_IMPLICIT_CONSTRUCTORS(
CodeCache);
6807 static inline uint32_t
Hash(HashTableKey* key) {
6819 static const int kPrefixSize = 0;
6820 static const int kEntrySize = 2;
6831 void RemoveByIndex(
int index);
6836 static const int kInitialSize = 64;
6862 inline void PolymorphicCodeCachePrint() {
6863 PolymorphicCodeCachePrint(stdout);
6865 void PolymorphicCodeCachePrint(FILE* out);
6869 static const
int kCacheOffset = HeapObject::kHeaderSize;
6870 static const
int kSize = kCacheOffset + kPointerSize;
6888 static const int kInitialSize = 64;
6896 inline int ic_total_count();
6897 inline void set_ic_total_count(
int count);
6899 inline int ic_with_type_info_count();
6900 inline void change_ic_with_type_info_count(
int count);
6902 inline void initialize_storage();
6904 inline void change_own_type_change_checksum();
6905 inline int own_type_change_checksum();
6907 inline void set_inlined_type_change_checksum(
int checksum);
6908 inline bool matches_inlined_type_change_checksum(
int checksum);
6915 inline void TypeFeedbackInfoPrint() {
6916 TypeFeedbackInfoPrint(stdout);
6918 void TypeFeedbackInfoPrint(FILE* out);
6922 static const
int kStorage1Offset = HeapObject::kHeaderSize;
6923 static const
int kStorage2Offset = kStorage1Offset + kPointerSize;
6924 static const
int kTypeFeedbackCellsOffset = kStorage2Offset + kPointerSize;
6925 static const
int kSize = kTypeFeedbackCellsOffset + kPointerSize;
6928 static const
int kTypeChangeChecksumBits = 7;
6930 class ICTotalCountField: public
BitField<
int, 0,
6931 kSmiValueSize - kTypeChangeChecksumBits> {};
6932 class OwnTypeChangeChecksum:
public BitField<int,
6933 kSmiValueSize - kTypeChangeChecksumBits,
6934 kTypeChangeChecksumBits> {};
6935 class ICsWithTypeInfoCountField:
public BitField<int, 0,
6936 kSmiValueSize - kTypeChangeChecksumBits> {};
6937 class InlinedTypeChangeChecksum:
public BitField<int,
6938 kSmiValueSize - kTypeChangeChecksumBits,
6939 kTypeChangeChecksumBits> {};
6955 inline int aliased_context_slot();
6956 inline void set_aliased_context_slot(
int count);
6961 inline void AliasedArgumentsEntryPrint() {
6962 AliasedArgumentsEntryPrint(stdout);
6964 void AliasedArgumentsEntryPrint(FILE* out);
6968 static const
int kAliasedContextSlot = HeapObject::kHeaderSize;
6969 static const
int kSize = kAliasedContextSlot + kPointerSize;
6986 inline bool has_trivial_hash();
6989 inline void AddCharacter(uint32_t c);
6994 inline void AddCharacterNoIndex(uint32_t c);
6998 void AddSurrogatePair(
uc32 c);
6999 void AddSurrogatePairNoIndex(
uc32 c);
7003 uint32_t GetHashField();
7012 static uint32_t MakeArrayIndexHash(uint32_t value,
int length);
7017 static const int kZeroHash = 27;
7020 uint32_t array_index() {
7021 ASSERT(is_array_index());
7022 return array_index_;
7028 INLINE(
static uint32_t AddCharacterCore(uint32_t running_hash, uint32_t c));
7029 INLINE(
static uint32_t GetHashCore(uint32_t running_hash));
7032 uint32_t raw_running_hash_;
7033 uint32_t array_index_;
7034 bool is_array_index_;
7035 bool is_first_char_;
7038 template <
bool seq_ascii>
friend class JsonParser;
7045 inline void AddCharacter(
uc32 c);
7050 uint32_t raw_running_hash_;
7051 uint32_t array_index_;
7052 bool is_array_index_;
7058 template <
typename s
char>
7077 inline explicit StringShape(
String* s);
7078 inline explicit StringShape(
Map* s);
7080 inline bool IsSequential();
7081 inline bool IsExternal();
7082 inline bool IsCons();
7083 inline bool IsSliced();
7084 inline bool IsIndirect();
7085 inline bool IsExternalAscii();
7086 inline bool IsExternalTwoByte();
7087 inline bool IsSequentialAscii();
7088 inline bool IsSequentialTwoByte();
7089 inline bool IsSymbol();
7091 inline uint32_t encoding_tag();
7092 inline uint32_t full_representation_tag();
7093 inline uint32_t size_tag();
7095 inline uint32_t type() {
return type_; }
7096 inline void invalidate() { valid_ =
false; }
7097 inline bool valid() {
return valid_; }
7105 inline void set_valid() { valid_ =
true; }
7108 inline void set_valid() { }
7151 enum State { NON_FLAT, ASCII, TWO_BYTE };
7157 explicit FlatContent(Vector<const uc16> chars)
7159 state_(TWO_BYTE) { }
7160 FlatContent() :
buffer_(), state_(NON_FLAT) { }
7169 inline int length();
7170 inline void set_length(
int value);
7173 inline uint32_t hash_field();
7174 inline void set_hash_field(uint32_t value);
7180 inline bool IsAsciiRepresentation();
7181 inline bool IsTwoByteRepresentation();
7186 inline bool IsAsciiRepresentationUnderneath();
7187 inline bool IsTwoByteRepresentationUnderneath();
7191 inline bool HasOnlyAsciiChars();
7194 inline void Set(
int index,
uint16_t value);
7230 inline String* GetUnderlying();
7234 bool MarkAsUndetectable();
7242 inline bool Equals(
String* other);
7259 int* length_output = 0);
7263 int* length_output = 0);
7275 inline bool HasHashCode();
7278 inline uint32_t Hash();
7293 inline bool AsArrayIndex(uint32_t* index);
7298 void PrintOn(FILE* out);
7306 inline void StringPrint() {
7307 StringPrint(stdout);
7309 void StringPrint(FILE* out);
7311 char* ToAsciiArray();
7315 inline
bool IsFlat();
7318 static const
int kLengthOffset = HeapObject::kHeaderSize;
7319 static const
int kHashFieldOffset = kLengthOffset + kPointerSize;
7320 static const
int kSize = kHashFieldOffset + kPointerSize;
7324 static const
int kMaxArrayIndexSize = 10;
7329 static const
int kMaxUtf16CodeUnit = 0xffff;
7336 static const
int kHashNotComputedMask = 1;
7337 static const
int kIsNotArrayIndexMask = 1 << 1;
7338 static const
int kNofHashBitFields = 2;
7341 static const
int kHashShift = kNofHashBitFields;
7345 static const uint32_t kHashBitMask = 0xffffffffu >> kHashShift;
7349 static const
int kMaxCachedArrayIndexLength = 7;
7354 static const
int kArrayIndexValueBits = 24;
7355 static const
int kArrayIndexLengthBits =
7356 kBitsPerInt - kArrayIndexValueBits - kNofHashBitFields;
7359 STATIC_CHECK(kMaxArrayIndexSize < (1 << kArrayIndexLengthBits));
7361 static const
int kArrayIndexHashLengthShift =
7362 kArrayIndexValueBits + kNofHashBitFields;
7364 static const
int kArrayIndexHashMask = (1 << kArrayIndexHashLengthShift) - 1;
7366 static const
int kArrayIndexValueMask =
7367 ((1 << kArrayIndexValueBits) - 1) << kHashShift;
7374 static const
int kContainsCachedArrayIndexMask =
7375 (~kMaxCachedArrayIndexLength << kArrayIndexHashLengthShift) |
7376 kIsNotArrayIndexMask;
7379 static const
int kEmptyHashField =
7380 kIsNotArrayIndexMask | kHashNotComputedMask;
7383 static const
int kEmptyStringHash = kIsNotArrayIndexMask;
7386 static const
int kMaxLength = (1 << (32 - 2)) - 1;
7390 static const
int kMaxHashCalcLength = 16383;
7393 static const
int kMaxShortPrintLength = 1024;
7396 const
uc16* GetTwoByteData();
7397 const
uc16* GetTwoByteData(
unsigned start);
7400 static const unibrow::
byte* ReadBlock(
String* input,
7401 unibrow::
byte* util_buffer,
7403 unsigned* remaining,
7405 static const unibrow::
byte* ReadBlock(
String** input,
7406 unibrow::
byte* util_buffer,
7408 unsigned* remaining,
7412 template <typename sinkchar>
7413 static
void WriteToFlat(
String* source,
7421 static inline
int NonAsciiStart(const
char* chars,
int length) {
7422 const char* start = chars;
7423 const char* limit = chars + length;
7424 #ifdef V8_HOST_CAN_READ_UNALIGNED
7427 while (chars +
sizeof(uintptr_t) <= limit) {
7428 if (*reinterpret_cast<const uintptr_t*>(chars) & non_ascii_mask) {
7429 return static_cast<int>(chars - start);
7431 chars +=
sizeof(uintptr_t);
7434 while (chars < limit) {
7436 return static_cast<int>(chars - start);
7440 return static_cast<int>(chars - start);
7443 static inline bool IsAscii(
const char* chars,
int length) {
7444 return NonAsciiStart(chars, length) >= length;
7448 const uc16* limit = chars + length;
7449 const uc16* start = chars;
7450 while (chars < limit) {
7454 return static_cast<int>(chars - start);
7458 return NonAsciiStart(chars, length) >= length;
7467 unsigned remaining_) :
7468 util_buffer(util_buffer_),
7470 capacity(capacity_),
7471 remaining(remaining_) {
7482 unsigned max_chars);
7483 static void ReadBlockIntoBuffer(
String* input,
7485 unsigned* offset_ptr,
7486 unsigned max_chars);
7494 static inline bool IsHashFieldComputed(uint32_t field);
7498 bool SlowEquals(
String* other);
7501 bool SlowAsArrayIndex(uint32_t* index);
7504 uint32_t ComputeAndSetHash();
7528 static const bool kHasAsciiEncoding =
true;
7531 inline uint16_t SeqAsciiStringGet(
int index);
7532 inline void SeqAsciiStringSet(
int index,
uint16_t value);
7535 inline Address GetCharsAddress();
7537 inline char* GetChars();
7545 inline int SeqAsciiStringSize(
InstanceType instance_type);
7553 static const int kMaxSize = 512 * MB - 1;
7559 inline void SeqAsciiStringReadBlockIntoBuffer(
ReadBlockBuffer* buffer,
7562 inline const unibrow::byte* SeqAsciiStringReadBlock(
unsigned* remaining,
7577 static const bool kHasAsciiEncoding =
false;
7580 inline uint16_t SeqTwoByteStringGet(
int index);
7581 inline void SeqTwoByteStringSet(
int index,
uint16_t value);
7584 inline Address GetCharsAddress();
7586 inline uc16* GetChars();
7589 const uint16_t* SeqTwoByteStringGetData(
unsigned start);
7597 inline int SeqTwoByteStringSize(
InstanceType instance_type);
7605 static const int kMaxSize = 512 * MB - 1;
7611 inline void SeqTwoByteStringReadBlockIntoBuffer(
ReadBlockBuffer* buffer,
7612 unsigned* offset_ptr,
7634 inline Object* unchecked_first();
7635 inline void set_first(
String* first,
7642 inline Object* unchecked_second();
7643 inline void set_second(
String* second,
7659 unsigned* offset_ptr,
7662 unsigned* offset_ptr,
7666 static const int kMinLength = 13;
7692 inline String* parent();
7693 inline void set_parent(String* parent,
7695 inline int offset();
7696 inline void set_offset(
int offset);
7699 uint16_t SlicedStringGet(
int index);
7711 unsigned* offset_ptr,
7714 unsigned* offset_ptr,
7717 static const int kMinLength = 13;
7751 inline bool is_short();
7764 static const bool kHasAsciiEncoding =
true;
7770 inline void set_resource(
const Resource* buffer);
7776 inline void update_data_cache();
7778 inline const char* GetChars();
7781 inline uint16_t ExternalAsciiStringGet(
int index);
7787 inline void ExternalAsciiStringIterateBody(ObjectVisitor* v);
7789 template<
typename StaticVisitor>
7790 inline void ExternalAsciiStringIterateBody();
7793 const unibrow::byte* ExternalAsciiStringReadBlock(
unsigned* remaining,
7796 inline void ExternalAsciiStringReadBlockIntoBuffer(
ReadBlockBuffer* buffer,
7809 static const bool kHasAsciiEncoding =
false;
7815 inline void set_resource(
const Resource* buffer);
7821 inline void update_data_cache();
7826 inline uint16_t ExternalTwoByteStringGet(
int index);
7829 inline const uint16_t* ExternalTwoByteStringGetData(
unsigned start);
7835 inline void ExternalTwoByteStringIterateBody(ObjectVisitor* v);
7837 template<
typename StaticVisitor>
7838 inline void ExternalTwoByteStringIterateBody();
7842 void ExternalTwoByteStringReadBlockIntoBuffer(
ReadBlockBuffer* buffer,
7843 unsigned* offset_ptr,
7856 explicit inline Relocatable(
Isolate* isolate);
7857 inline virtual ~Relocatable();
7861 static void PostGarbageCollectionProcessing();
7862 static int ArchiveSpacePerThread();
7863 static char* ArchiveState(
Isolate* isolate,
char* to);
7864 static char* RestoreState(
Isolate* isolate,
char* from);
7865 static void Iterate(ObjectVisitor* v);
7866 static void Iterate(ObjectVisitor* v, Relocatable* top);
7867 static char* Iterate(ObjectVisitor* v,
char* t);
7881 void PostGarbageCollection();
7882 inline uc32 Get(
int index);
7903 virtual void Seek(
unsigned pos);
7906 unibrow::InputBuffer<String, String*, 1024>(backing) {}
7913 virtual void Seek(
unsigned pos);
7915 : unibrow::InputBuffer<String, String**, 256>() {}
7917 : unibrow::InputBuffer<String, String**, 256>(backing) {}
7921 template <
typename T>
7944 inline void set_kind(
byte kind);
7965 static const byte kNotBooleanMask = ~1;
7968 static const byte kArgumentMarker = 4;
7994 return cast(FromAddress(value - kValueOffset));
7998 return address() + kValueOffset;
8004 inline void JSGlobalPropertyCellPrint() {
8005 JSGlobalPropertyCellPrint(stdout);
8007 void JSGlobalPropertyCellPrint(FILE* out);
8035 bool HasPropertyWithHandler(String* name);
8036 bool HasElementWithHandler(uint32_t index);
8089 inline void InitializeBody(
int object_size,
Object* value);
8100 inline void JSProxyPrint() {
8101 JSProxyPrint(stdout);
8103 void JSProxyPrint(FILE* out);
8110 static const
int kHandlerOffset = HeapObject::kHeaderSize;
8111 static const
int kHashOffset = kHandlerOffset + kPointerSize;
8112 static const
int kPaddingOffset = kHashOffset + kPointerSize;
8114 static const
int kHeaderSize = kPaddingOffset;
8115 static const
int kPaddingSize = kSize - kPaddingOffset;
8124 DISALLOW_IMPLICIT_CONSTRUCTORS(
JSProxy);
8141 inline void JSFunctionProxyPrint() {
8142 JSFunctionProxyPrint(stdout);
8144 void JSFunctionProxyPrint(FILE* out);
8149 static const
int kCallTrapOffset = JSProxy::kPaddingOffset;
8150 static const
int kConstructTrapOffset = kCallTrapOffset + kPointerSize;
8151 static const
int kPaddingOffset = kConstructTrapOffset + kPointerSize;
8153 static const
int kPaddingSize = kSize - kPaddingOffset;
8158 kConstructTrapOffset + kPointerSize,
8159 kSize> BodyDescriptor;
8176 inline void JSSetPrint() {
8179 void JSSetPrint(FILE* out);
8183 static const
int kTableOffset = JSObject::kHeaderSize;
8184 static const
int kSize = kTableOffset + kPointerSize;
8187 DISALLOW_IMPLICIT_CONSTRUCTORS(
JSSet);
8201 inline void JSMapPrint() {
8204 void JSMapPrint(FILE* out);
8208 static const
int kTableOffset = JSObject::kHeaderSize;
8209 static const
int kSize = kTableOffset + kPointerSize;
8212 DISALLOW_IMPLICIT_CONSTRUCTORS(
JSMap);
8229 inline void JSWeakMapPrint() {
8230 JSWeakMapPrint(stdout);
8232 void JSWeakMapPrint(FILE* out);
8236 static const
int kTableOffset = JSObject::kHeaderSize;
8237 static const
int kNextOffset = kTableOffset + kPointerSize;
8238 static const
int kSize = kNextOffset + kPointerSize;
8241 DISALLOW_IMPLICIT_CONSTRUCTORS(
JSWeakMap);
8251 inline Address foreign_address();
8252 inline void set_foreign_address(
Address value);
8258 inline void ForeignIterateBody(ObjectVisitor* v);
8260 template<
typename StaticVisitor>
8261 inline void ForeignIterateBody();
8264 inline void ForeignPrint() {
8265 ForeignPrint(stdout);
8267 void ForeignPrint(FILE* out);
8273 static const
int kForeignAddressOffset = HeapObject::kHeaderSize;
8274 static const
int kSize = kForeignAddressOffset + kPointerSize;
8279 DISALLOW_IMPLICIT_CONSTRUCTORS(
Foreign);
8295 inline void set_length(Smi* length);
8297 MUST_USE_RESULT MaybeObject* JSArrayUpdateLengthFromIndex(uint32_t index,
8306 inline bool AllowsSetElementsLength();
8310 MUST_USE_RESULT inline MaybeObject* SetContent(FixedArrayBase* storage);
8317 inline void EnsureSize(
int minimum_size_of_backing_fixed_array);
8321 inline void JSArrayPrint() {
8322 JSArrayPrint(stdout);
8324 void JSArrayPrint(FILE* out);
8329 static const
int kPreallocatedArrayElements = 4;
8332 static const
int kLengthOffset = JSObject::kHeaderSize;
8333 static const
int kSize = kLengthOffset + kPointerSize;
8338 void Expand(
int minimum_size_of_backing_fixed_array);
8340 DISALLOW_IMPLICIT_CONSTRUCTORS(
JSArray);
8357 static const int kIndexIndex = 0;
8358 static const int kInputIndex = 1;
8382 inline bool all_can_read();
8383 inline void set_all_can_read(
bool value);
8385 inline bool all_can_write();
8386 inline void set_all_can_write(
bool value);
8388 inline bool prohibits_overwriting();
8389 inline void set_prohibits_overwriting(
bool value);
8395 inline bool IsCompatibleReceiver(
Object* receiver);
8400 inline void AccessorInfoPrint() {
8401 AccessorInfoPrint(stdout);
8403 void AccessorInfoPrint(FILE* out);
8407 static const
int kGetterOffset = HeapObject::kHeaderSize;
8408 static const
int kSetterOffset = kGetterOffset + kPointerSize;
8409 static const
int kDataOffset = kSetterOffset + kPointerSize;
8410 static const
int kNameOffset = kDataOffset + kPointerSize;
8411 static const
int kFlagOffset = kNameOffset + kPointerSize;
8412 static const
int kExpectedReceiverTypeOffset = kFlagOffset + kPointerSize;
8413 static const
int kSize = kExpectedReceiverTypeOffset + kPointerSize;
8417 static const
int kAllCanReadBit = 0;
8418 static const
int kAllCanWriteBit = 1;
8419 static const
int kProhibitsOverwritingBit = 2;
8458 if (!getter->IsNull()) set_getter(getter);
8459 if (!setter->IsNull()) set_setter(setter);
8463 return IsJSAccessor(getter()) || IsJSAccessor(setter());
8467 void AccessorPairPrint(FILE* out = stdout);
8471 static const
int kGetterOffset = HeapObject::kHeaderSize;
8472 static const
int kSetterOffset = kGetterOffset + kPointerSize;
8473 static const
int kSize = kSetterOffset + kPointerSize;
8481 bool IsJSAccessor(
Object* obj) {
8482 return obj->IsSpecFunction() || obj->IsUndefined();
8498 inline void AccessCheckInfoPrint() {
8499 AccessCheckInfoPrint(stdout);
8501 void AccessCheckInfoPrint(FILE* out);
8505 static const
int kNamedCallbackOffset = HeapObject::kHeaderSize;
8506 static const
int kIndexedCallbackOffset = kNamedCallbackOffset + kPointerSize;
8507 static const
int kDataOffset = kIndexedCallbackOffset + kPointerSize;
8508 static const
int kSize = kDataOffset + kPointerSize;
8527 inline void InterceptorInfoPrint() {
8528 InterceptorInfoPrint(stdout);
8530 void InterceptorInfoPrint(FILE* out);
8534 static const
int kGetterOffset = HeapObject::kHeaderSize;
8535 static const
int kSetterOffset = kGetterOffset + kPointerSize;
8536 static const
int kQueryOffset = kSetterOffset + kPointerSize;
8537 static const
int kDeleterOffset = kQueryOffset + kPointerSize;
8538 static const
int kEnumeratorOffset = kDeleterOffset + kPointerSize;
8539 static const
int kDataOffset = kEnumeratorOffset + kPointerSize;
8540 static const
int kSize = kDataOffset + kPointerSize;
8555 inline void CallHandlerInfoPrint() {
8556 CallHandlerInfoPrint(stdout);
8558 void CallHandlerInfoPrint(FILE* out);
8562 static const
int kCallbackOffset = HeapObject::kHeaderSize;
8563 static const
int kDataOffset = kCallbackOffset + kPointerSize;
8564 static const
int kSize = kDataOffset + kPointerSize;
8578 static const
int kTagOffset = HeapObject::kHeaderSize;
8579 static const
int kPropertyListOffset = kTagOffset + kPointerSize;
8580 static const
int kHeaderSize = kPropertyListOffset + kPointerSize;
8614 inline void FunctionTemplateInfoPrint() {
8615 FunctionTemplateInfoPrint(stdout);
8617 void FunctionTemplateInfoPrint(FILE* out);
8621 static const
int kSerialNumberOffset = TemplateInfo::kHeaderSize;
8622 static const
int kCallCodeOffset = kSerialNumberOffset + kPointerSize;
8623 static const
int kPropertyAccessorsOffset = kCallCodeOffset + kPointerSize;
8624 static const
int kPrototypeTemplateOffset =
8625 kPropertyAccessorsOffset + kPointerSize;
8626 static const
int kParentTemplateOffset =
8627 kPrototypeTemplateOffset + kPointerSize;
8628 static const
int kNamedPropertyHandlerOffset =
8629 kParentTemplateOffset + kPointerSize;
8630 static const
int kIndexedPropertyHandlerOffset =
8631 kNamedPropertyHandlerOffset + kPointerSize;
8632 static const
int kInstanceTemplateOffset =
8633 kIndexedPropertyHandlerOffset + kPointerSize;
8634 static const
int kClassNameOffset = kInstanceTemplateOffset + kPointerSize;
8635 static const
int kSignatureOffset = kClassNameOffset + kPointerSize;
8636 static const
int kInstanceCallHandlerOffset = kSignatureOffset + kPointerSize;
8637 static const
int kAccessCheckInfoOffset =
8638 kInstanceCallHandlerOffset + kPointerSize;
8639 static const
int kFlagOffset = kAccessCheckInfoOffset + kPointerSize;
8640 static const
int kSize = kFlagOffset + kPointerSize;
8644 static const
int kHiddenPrototypeBit = 0;
8645 static const
int kUndetectableBit = 1;
8646 static const
int kNeedsAccessCheckBit = 2;
8647 static const
int kReadOnlyPrototypeBit = 3;
8661 inline void ObjectTemplateInfoPrint() {
8662 ObjectTemplateInfoPrint(stdout);
8664 void ObjectTemplateInfoPrint(FILE* out);
8668 static const
int kConstructorOffset = TemplateInfo::kHeaderSize;
8669 static const
int kInternalFieldCountOffset =
8670 kConstructorOffset + kPointerSize;
8671 static const
int kSize = kInternalFieldCountOffset + kPointerSize;
8683 inline void SignatureInfoPrint() {
8684 SignatureInfoPrint(stdout);
8686 void SignatureInfoPrint(FILE* out);
8690 static const
int kReceiverOffset = Struct::kHeaderSize;
8691 static const
int kArgsOffset = kReceiverOffset + kPointerSize;
8692 static const
int kSize = kArgsOffset + kPointerSize;
8706 inline void TypeSwitchInfoPrint() {
8707 TypeSwitchInfoPrint(stdout);
8709 void TypeSwitchInfoPrint(FILE* out);
8713 static const
int kTypesOffset = Struct::kHeaderSize;
8714 static const
int kSize = kTypesOffset + kPointerSize;
8718 #ifdef ENABLE_DEBUGGER_SUPPORT
8721 class DebugInfo:
public Struct {
8734 bool HasBreakPoint(
int code_position);
8736 Object* GetBreakPointInfo(
int code_position);
8743 int source_position,
int statement_position,
8746 Object* GetBreakPointObjects(
int code_position);
8751 int GetBreakPointCount();
8756 inline void DebugInfoPrint() {
8757 DebugInfoPrint(stdout);
8759 void DebugInfoPrint(FILE* out);
8764 static const int kOriginalCodeIndex = kSharedFunctionInfoIndex +
kPointerSize;
8765 static const int kPatchedCodeIndex = kOriginalCodeIndex +
kPointerSize;
8766 static const int kActiveBreakPointsCountIndex =
8768 static const int kBreakPointsStateIndex =
8770 static const int kSize = kBreakPointsStateIndex +
kPointerSize;
8773 static const int kNoBreakPointInfo = -1;
8776 int GetBreakPointInfoIndex(
int code_position);
8785 class BreakPointInfo:
public Struct {
8798 static
void ClearBreakPoint(
Handle<BreakPointInfo> info,
8801 static
void SetBreakPoint(
Handle<BreakPointInfo> info,
8804 static
bool HasBreakPointObject(
Handle<BreakPointInfo> info,
8807 int GetBreakPointCount();
8809 static inline BreakPointInfo* cast(
Object* obj);
8812 inline void BreakPointInfoPrint() {
8813 BreakPointInfoPrint(stdout);
8815 void BreakPointInfoPrint(FILE* out);
8819 static const
int kCodePositionIndex = Struct::kHeaderSize;
8820 static const
int kSourcePositionIndex = kCodePositionIndex + kPointerSize;
8821 static const
int kStatementPositionIndex =
8822 kSourcePositionIndex + kPointerSize;
8823 static const
int kBreakPointObjectsIndex =
8824 kStatementPositionIndex + kPointerSize;
8825 static const
int kSize = kBreakPointObjectsIndex + kPointerSize;
8828 DISALLOW_IMPLICIT_CONSTRUCTORS(BreakPointInfo);
8830 #endif // ENABLE_DEBUGGER_SUPPORT
8833 #undef DECL_BOOLEAN_ACCESSORS
8834 #undef DECL_ACCESSORS
8835 #undef DECLARE_VERIFIER
8837 #define VISITOR_SYNCHRONIZATION_TAGS_LIST(V) \
8838 V(kSymbolTable, "symbol_table", "(Symbols)") \
8839 V(kExternalStringsTable, "external_strings_table", "(External strings)") \
8840 V(kStrongRootList, "strong_root_list", "(Strong roots)") \
8841 V(kSymbol, "symbol", "(Symbol)") \
8842 V(kBootstrapper, "bootstrapper", "(Bootstrapper)") \
8843 V(kTop, "top", "(Isolate)") \
8844 V(kRelocatable, "relocatable", "(Relocatable)") \
8845 V(kDebug, "debug", "(Debugger)") \
8846 V(kCompilationCache, "compilationcache", "(Compilation cache)") \
8847 V(kHandleScope, "handlescope", "(Handle scope)") \
8848 V(kBuiltins, "builtins", "(Builtins)") \
8849 V(kGlobalHandles, "globalhandles", "(Global handles)") \
8850 V(kThreadManager, "threadmanager", "(Thread manager)") \
8851 V(kExtensions, "Extensions", "(Extensions)")
8855 #define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item,
8862 static const char*
const kTags[kNumberOfSyncTags];
8863 static const char*
const kTagNames[kNumberOfSyncTags];
8874 virtual void VisitPointers(
Object** start,
Object** end) = 0;
8880 virtual void VisitCodeTarget(RelocInfo* rinfo);
8883 virtual void VisitCodeEntry(
Address entry_address);
8886 virtual void VisitGlobalPropertyCell(RelocInfo* rinfo);
8898 virtual void VisitDebugTarget(RelocInfo* rinfo);
8904 virtual void VisitEmbeddedPointer(RelocInfo* rinfo);
8911 virtual void VisitExternalReference(RelocInfo* rinfo);
8914 VisitExternalReferences(p, p + 1);
8940 static inline bool get(Smi* smi,
int bit_position) {
8941 return get(smi->value(), bit_position);
8944 static inline bool get(
int value,
int bit_position) {
8945 return (value & (1 << bit_position)) != 0;
8948 static inline Smi*
set(Smi* smi,
int bit_position,
bool v) {
8952 static inline int set(
int value,
int bit_position,
bool v) {
8954 value |= (1 << bit_position);
8956 value &= ~(1 << bit_position);
8964 #endif // V8_OBJECTS_H_
MUST_USE_RESULT MaybeObject * GetElementWithReceiver(Object *receiver, uint32_t index)
static MapWord FromRawValue(uintptr_t value)
const uint32_t kShortcutTypeTag
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset eval_from_instructions_offset
void set_elements_kind(ElementsKind elements_kind)
virtual void VisitExternalAsciiString(v8::String::ExternalAsciiStringResource **resource)
FixedArraySubInstanceType
Object * KeyAt(int entry)
STATIC_CHECK((kStringRepresentationMask|kStringEncodingMask)==Internals::kFullStringRepresentationMask)
static const int kMaxLength
#define FOR_EACH_NUMERIC_FIELD(V)
virtual void VisitExternalTwoByteString(v8::String::ExternalStringResource **resource)
bool IsExternalArrayElementsKind(ElementsKind kind)
static uint32_t SeededHash(Key key, uint32_t seed)
bool has_external_array_elements()
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset kHiddenPrototypeBit read_only_prototype
static int EntryToIndex(int entry)
const char * ToCString(const v8::String::Utf8Value &value)
FixedBodyDescriptor< kNameOffset, kThisPropertyAssignmentsOffset+kPointerSize, kSize > BodyDescriptor
virtual uint32_t Hash()=0
virtual void Synchronize(VisitorSynchronization::SyncTag tag)
FixedBodyDescriptor< kParentOffset, kOffsetOffset+kPointerSize, kSize > BodyDescriptor
bool has_non_strict_arguments_elements()
bool is_hidden_prototype()
static uint32_t Hash(HashTableKey *key)
void SetAstId(int index, BailoutId id)
#define DECLARE_FUNCTION_ID(ignored1, ignore2, name)
void DetailsAtPut(int entry, PropertyDetails value)
const uint32_t kNotSymbolTag
FixedBodyDescriptor< kToStringOffset, kToNumberOffset+kPointerSize, kSize > BodyDescriptor
const uint32_t kTwoByteStringTag
Handle< FixedArray > AddKeysFromJSArray(Handle< FixedArray > content, Handle< JSArray > array)
const int kFailureTypeTagSize
Handle< Object > SetPropertyWithInterceptor(Handle< JSObject > object, Handle< String > key, Handle< Object > value, PropertyAttributes attributes, StrictModeFlag strict_mode)
BailoutId AstId(int index)
virtual uint32_t HashForObject(Object *key)=0
const int kStubMajorKeyBits
int number_of_descriptors_storage()
static int SizeOf(Map *map, HeapObject *object)
virtual void VisitRuntimeEntry(RelocInfo *rinfo)
static Smi * FromInt(int value)
bool IsFastObjectElementsKind(ElementsKind kind)
static const int kOddballKindOffset
bool CallsNonStrictEval()
MUST_USE_RESULT MaybeObject * ToSmi()
const intptr_t kCodeAlignmentMask
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kIsTopLevelBit allows_lazy_compilation
int NumberOfOwnDescriptors()
virtual void VisitPointer(Object **p)
static uint32_t Hash(HashTableKey *key)
MUST_USE_RESULT MaybeObject * GetPropertyWithDefinedGetter(Object *receiver, JSReceiver *getter)
void VerifyApiCallResultType()
static const int kFirstNonstringType
static bool IsAscii(const uc16 *chars, int length)
void set_has_named_interceptor()
bool is_the_hole(int index)
const int kVariableSizeSentinel
Vector< const char > ToAsciiVector()
static KeyedAccessGrowMode GetKeyedAccessGrowMode(ExtraICState extra_ic_state)
MUST_USE_RESULT MaybeObject * GetPropertyWithReceiver(Object *receiver, String *key, PropertyAttributes *attributes)
bool has_fast_object_elements()
const uint32_t kMaxAsciiCharCodeU
bool SameValue(Object *other)
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset kHiddenPrototypeBit kReadOnlyPrototypeBit is_toplevel
static bool IsMatch(HashTableKey *key, Object *value)
MUST_USE_RESULT MaybeObject * ToObject()
bool has_fast_double_elements()
static Smi * FromIntptr(intptr_t value)
void SetEnumLength(int length)
Handle< FixedArray > UnionOfKeys(Handle< FixedArray > first, Handle< FixedArray > second)
virtual void PostGarbageCollection()
#define ASSERT(condition)
v8::Handle< v8::Value > Print(const v8::Arguments &args)
unibrow::byte * util_buffer
static int NonAsciiStart(const uc16 *chars, int length)
#define OBJECT_TYPE_LIST(V)
#define VISITOR_SYNCHRONIZATION_TAGS_LIST(V)
VectorIterator(Vector< const T > data)
static Dictionary< Shape, Key > * cast(Object *obj)
const intptr_t kCodeAlignment
kPropertyAccessorsOffset kNamedPropertyHandlerOffset instance_template
#define POINTER_SIZE_ALIGN(value)
#define IS_TYPE_FUNCTION_DECL(type_)
const uint32_t kStringRepresentationMask
bool NonFailureIsHeapObject()
static uint32_t Hash(HashTableKey *key)
const int kExternalArrayTypeCount
void set_is_undetectable()
Handle< Object > GetPropertyWithInterceptor(Handle< JSObject > receiver, Handle< JSObject > holder, Handle< String > name, PropertyAttributes *attributes)
static const int kStringResourceOffset
#define DEFINE_FIXED_ARRAY_SUB_INSTANCE_TYPE(name)
bool HasSpecificClassOf(String *name)
StringInputBuffer *const buffer_
v8::String::ExternalStringResource Resource
#define DEFINE_ELEMENT_ACCESSORS(name, type)
static const int kJSObjectHeaderSize
const uint32_t kAsciiDataHintTag
static uint32_t Hash(HashTableKey *key)
const uint32_t kShortExternalStringMask
static Object ** RawField(HeapObject *obj, int offset)
static Smi * cast(Object *object)
Handle< String > SubString(Handle< String > str, int start, int end, PretenureFlag pretenure)
static const int kHeaderSize
void Lookup(String *name, LookupResult *result)
static bool IsAscii(const char *chars, int length)
bool has_instance_call_handler()
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kIsTopLevelBit kAllowLazyCompilation kUsesArguments kFormalParameterCountOffset kStartPositionAndTypeOffset kCompilerHintsOffset stress_deopt_counter
void set_has_instance_call_handler()
bool has_slow_elements_kind()
virtual MUST_USE_RESULT MaybeObject * AsObject()=0
static int set(int value, int bit_position, bool v)
Object * ValueAt(int entry)
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kIsTopLevelBit compiler_hints
static const int kHeaderSize
const uint32_t kNotStringTag
void CopyEnumCacheFrom(DescriptorArray *array)
void SetPcAndState(int index, Smi *offset)
Object * GetElementNoExceptionThrown(uint32_t index)
static int SizeOf(Map *map, HeapObject *object)
virtual void IterateInstance(ObjectVisitor *v)
static int LengthFor(int size_in_bytes)
STATIC_ASSERT((FixedDoubleArray::kHeaderSize &kDoubleAlignmentMask)==0)
static SeededNumberDictionary * cast(Object *obj)
bool has_fast_smi_elements()
static bool IsMatch(HashTableKey *key, Object *value)
const uint32_t kIsSymbolMask
void set_unchecked(int index, Smi *value)
Object ** GetEnumCacheSlot()
bool IsStringObjectWithCharacterAt(uint32_t index)
#define DECLARE_ENUM(enum_item, ignore1, ignore2)
void SetNumberOfProtoTransitions(int value)
void SetNumberOfElements(int nof)
static const int kMapInstanceTypeOffset
int LinearSearch(T *array, String *name, int len, int valid_entries)
static MUST_USE_RESULT MaybeObject * AsObject(HashTableKey *key)
static bool IsValid(intptr_t value)
const uint32_t kIsIndirectStringMask
static const int kMinValue
bool ToArrayIndex(uint32_t *index)
Smi * PcAndState(int index)
static StrictModeFlag GetStrictMode(ExtraICState extra_ic_state)
#define DECLARE_VERIFIER(Name)
Handle< Object > SetProperty(Handle< Object > object, Handle< Object > key, Handle< Object > value, PropertyAttributes attributes, StrictModeFlag strict_mode)
uint32_t HashForObject(Key key, Object *object)
FixedBodyDescriptor< kPointerFieldsBeginOffset, kPointerFieldsEndOffset, kSize > BodyDescriptor
static UnseededNumberDictionary * cast(Object *obj)
bool IsAligned(T value, U alignment)
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
const uint32_t kAsciiDataHintMask
const uintptr_t kUintptrAllBitsSet
INLINE(static uint32_t GetProbeOffset(uint32_t n))
static ExtraICState ComputeExtraICState(KeyedAccessGrowMode grow_mode, StrictModeFlag strict_mode)
void SetCapacity(int capacity)
const uint32_t kShortcutTypeMask
Vector< const uc16 > ToUC16Vector()
static void IterateBody(HeapObject *obj, int object_size)
kPropertyAccessorsOffset named_property_handler
SetFastElementsCapacitySmiMode
T RoundUp(T x, intptr_t m)
bool IsFastSmiElementsKind(ElementsKind kind)
static int OffsetOfElementAt(int index)
#define FIELD_ACCESSORS(name)
const uint32_t kShortExternalStringTag
void SetNumberOfOwnDescriptors(int number)
FixedArray * GetEnumIndicesCache()
static const int kOddballType
static int SizeFor(int length)
#define DEFINE_CODE_KIND_ENUM(name)
void SetNumberOfDeletedElements(int nod)
const uint32_t kStringTag
Object * ToObjectUnchecked()
void set_has_indexed_interceptor()
VectorIterator(T *d, int l)
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kIsTopLevelBit kAllowLazyCompilation kUsesArguments formal_parameter_count
static int OffsetOfElementAt(int index)
static uint32_t HashForObject(HashTableKey *key, Object *object)
static int SizeFor(int length)
#define T(name, string, precedence)
bool HasEnumIndicesCache()
bool IsFastSmiOrObjectElementsKind(ElementsKind kind)
void SetNextEnumerationIndex(int index)
static uint32_t SeededHashForObject(Key key, uint32_t seed, Object *object)
const int kElementsKindCount
static const int kHeaderSize
PropertyNormalizationMode
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset kHiddenPrototypeBit kReadOnlyPrototypeBit start_position_and_type
static int SizeFor(int length)
bool has_named_interceptor()
#define FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(V)
const uint32_t kIsNotStringMask
static StringDictionary * cast(Object *obj)
const uint32_t kSlicedNotConsMask
static uint32_t HashForObject(HashTableKey *key, Object *object)
bool is_compare_ic_stub()
static uint32_t HashForObject(Key key, Object *object)
static ObjectHashTable * cast(Object *obj)
FixedBodyDescriptor< kFirstOffset, kSecondOffset+kPointerSize, kSize > BodyDescriptor
static const int kHeapObjectMapOffset
const int kStubMinorKeyBits
#define CODE_KIND_LIST(V)
static int SizeFor(int length)
#define OBJECT_POINTER_ALIGN(value)
#define IS_POWER_OF_TWO(x)
Object * ToObjectChecked()
bool has_fast_smi_or_object_elements()
static JSGlobalPropertyCell * FromValueAddress(Address value)
INLINE(static HeapObject *EnsureDoubleAligned(Heap *heap, HeapObject *object, int size))
static Vector< T > cast(Vector< S > input)
static Object * cast(Object *value)
name_should_print_as_anonymous
bool has_indexed_interceptor()
FixedBodyDescriptor< kValueOffset, kValueOffset+kPointerSize, kSize > BodyDescriptor
static bool IsMatch(HashTableKey *key, Object *value)
v8::String::ExternalAsciiStringResource Resource
PropertyDetails DetailsAt(int entry)
static int SizeFor(int length)
static const int kHeaderSize
uint32_t HashSequentialString(const schar *chars, int length, uint32_t seed)
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset hidden_prototype
void ValueAtPut(int entry, Object *value)
int number_of_descriptors()
bool is_keyed_store_stub()
static uint32_t HashForObject(HashTableKey *key, Object *object)
int Search(T *array, String *name, int valid_entries)
MUST_USE_RESULT MaybeObject * GetProperty(String *key)
#define ASSERT_EQ(v1, v2)
static MUST_USE_RESULT MaybeObject * AsObject(HashTableKey *key)
static bool IsMatch(HashTableKey *key, Object *value)
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset instance_class_name
Failure * ToFailureUnchecked()
static const int kElementsKindShift
bool is_to_boolean_ic_stub()
static void IterateBody(HeapObject *obj)
static MUST_USE_RESULT MaybeObject * AsObject(HashTableKey *key)
static uint32_t NextProbe(uint32_t last, uint32_t number, uint32_t size)
#define DECL_ACCESSORS(name, type)
virtual bool IsMatch(Object *other)=0
static FixedArray * cast(Object *obj)
static const int kUndefinedOddballKind
#define HEAP_OBJECT_TYPE_LIST(V)
static const int kHeaderSize
static Smi * set(Smi *smi, int bit_position, bool v)
bool ToObject(Object **obj)
int NumberOfSlackDescriptors()
ElementsKind elements_kind()
static int LengthOfFixedArray(int cell_count)
static Handle< Object > GetElement(Handle< Object > object, uint32_t index)
FixedArray * GetEnumCache()
const uint32_t kIsIndirectStringTag
virtual void VisitEmbedderReference(Object **p, uint16_t class_id)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
static const int kPrototypeOffset
bool IsInstanceOf(FunctionTemplateInfo *type)
static uint32_t HashForObject(HashTableKey *key, Object *object)
static uint32_t GetProbe(uint32_t hash, uint32_t number, uint32_t size)
void set(AccessorComponent component, Object *value)
static int LengthOfFixedArray(int deopt_points)
static uint32_t Hash(Key key)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
static int SizeFor(int body_size)
static int LengthFor(int number_of_descriptors)
const uint32_t kSymbolTag
const int kFailureTypeTagMask
bool is_keyed_call_stub()
Handle< Object > SetPrototype(Handle< JSFunction > function, Handle< Object > prototype)
static const int kForeignType
int NextEnumerationIndex()
const uint32_t kAsciiStringTag
int NumberOfDeletedElements()
virtual void VisitExternalReferences(Address *start, Address *end)
#define FUNCTIONS_WITH_ID_LIST(V)
MUST_USE_RESULT MaybeObject * GetHash(CreationFlag flag)
static uint32_t FirstProbe(uint32_t hash, uint32_t size)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if expose natives in global object expose gc extension number of stack frames to capture disable builtin natives files print a stack trace if an assertion failure occurs use random jit cookie to mask large constants trace lazy optimization use adaptive optimizations prepare for turning on always opt minimum length for automatic enable preparsing maximum number of optimization attempts before giving up cache prototype transitions automatically set the debug break flag when debugger commands are in the queue always cause a debug break before aborting maximum length of function source code printed in a stack trace max size of the new max size of the old max size of executable always perform global GCs print one trace line following each garbage collection do not print trace line after scavenger collection print more details following each garbage collection print amount of external allocated memory after each time it is adjusted flush code that we expect not to use again before full gc do incremental marking steps track object counts and memory usage use caching Perform compaction on every full GC Never perform compaction on full GC testing only Compact code space on full incremental collections Default seed for initializing random allows verbose printing trace parsing and preparsing Check icache flushes in ARM and MIPS simulator Stack alingment in bytes in print stack trace when throwing exceptions randomize hashes to avoid predictable hash Fixed seed to use to hash property activate a timer that switches between V8 threads testing_bool_flag float flag Seed used for threading test randomness A filename with extra code to be included in the Print usage including flags
static int NewElementsCapacity(int old_capacity)
#define DEFINE_ENTRY_ACCESSORS(name, type)
ReadBlockBuffer(unibrow::byte *util_buffer_, unsigned cursor_, unsigned capacity_, unsigned remaining_)
static const int kMaxValue
bool has_dictionary_elements()
const uc32 kMaxAsciiCharCode
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset kHiddenPrototypeBit kReadOnlyPrototypeBit kIsTopLevelBit kAllowLazyCompilation uses_arguments
static const int kNullOddballKind
INLINE(bool IsSpecObject())
static int saved_code_index(bool is_ascii)
#define ASSERT_SIZE_TAG_ALIGNED(size)
void ElementsRemoved(int n)
static ObjectHashSet * cast(Object *obj)
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset access_check_info
bool IsDictionaryElementsKind(ElementsKind kind)
static int OffsetOfCodeWithId(Builtins::JavaScript id)
void VisitExternalReference(Address *p)
bool IsFastDoubleElementsKind(ElementsKind kind)
bool is_keyed_load_stub()
const uint32_t kStringEncodingMask
static MUST_USE_RESULT MaybeObject * AsObject(HashTableKey *key)
static const int kJSObjectType
void SetComponents(Object *getter, Object *setter)
#define DECLARE_STRUCT_PREDICATE(NAME, Name, name)
void set_is_hidden_prototype()
#define DECL_BOOLEAN_ACCESSORS(name)
Handle< JSObject > Copy(Handle< JSObject > obj)
kPropertyAccessorsOffset kNamedPropertyHandlerOffset kInstanceTemplateOffset kAccessCheckInfoOffset kEvalFrominstructionsOffsetOffset kInstanceClassNameOffset flag
Object * GetPropertyNoExceptionThrown(String *key)