5 #ifndef V8_OBJECTS_INSTANCE_TYPE_INL_H_ 6 #define V8_OBJECTS_INSTANCE_TYPE_INL_H_ 8 #include "src/objects/map-inl.h" 12 #include "src/objects/object-macros.h" 17 namespace InstanceTypeChecker {
20 INSTANCE_TYPE_CHECKERS_SINGLE(INSTANCE_TYPE_CHECKER);
22 #define TYPED_ARRAY_INSTANCE_TYPE_CHECKER(Type, type, TYPE, ctype) \ 23 INSTANCE_TYPE_CHECKER(Fixed##Type##Array, FIXED_##TYPE##_ARRAY_TYPE) 24 TYPED_ARRAYS(TYPED_ARRAY_INSTANCE_TYPE_CHECKER)
25 #undef TYPED_ARRAY_INSTANCE_TYPE_CHECKER 27 #define STRUCT_INSTANCE_TYPE_CHECKER(TYPE, Name, name) \ 28 INSTANCE_TYPE_CHECKER(Name, TYPE) 29 STRUCT_LIST(STRUCT_INSTANCE_TYPE_CHECKER)
30 #undef STRUCT_INSTANCE_TYPE_CHECKER 33 #define INSTANCE_TYPE_CHECKER_RANGE(type, first_instance_type, \ 35 V8_INLINE bool Is##type(InstanceType instance_type) { \ 36 return IsInRange(instance_type, first_instance_type, last_instance_type); \ 38 INSTANCE_TYPE_CHECKERS_RANGE(INSTANCE_TYPE_CHECKER_RANGE);
39 #undef INSTANCE_TYPE_CHECKER_RANGE 41 V8_INLINE
bool IsFixedArrayBase(InstanceType instance_type) {
42 return IsFixedArray(instance_type) || IsFixedDoubleArray(instance_type) ||
43 IsFixedTypedArrayBase(instance_type) || IsByteArray(instance_type) ||
44 IsBytecodeArray(instance_type);
47 V8_INLINE
bool IsHeapObject(InstanceType instance_type) {
return true; }
49 V8_INLINE
bool IsInternalizedString(InstanceType instance_type) {
50 STATIC_ASSERT(kNotInternalizedTag != 0);
51 return (instance_type & (kIsNotStringMask | kIsNotInternalizedMask)) ==
52 (kStringTag | kInternalizedTag);
55 V8_INLINE
bool IsJSObject(InstanceType instance_type) {
56 STATIC_ASSERT(LAST_TYPE == LAST_JS_OBJECT_TYPE);
57 return instance_type >= FIRST_JS_OBJECT_TYPE;
60 V8_INLINE
bool IsJSReceiver(InstanceType instance_type) {
61 STATIC_ASSERT(LAST_TYPE == LAST_JS_RECEIVER_TYPE);
62 return instance_type >= FIRST_JS_RECEIVER_TYPE;
70 INSTANCE_TYPE_CHECKERS(TYPE_CHECKER);
72 #define TYPED_ARRAY_TYPE_CHECKER(Type, type, TYPE, ctype) \ 73 TYPE_CHECKER(Fixed##Type##Array) 74 TYPED_ARRAYS(TYPED_ARRAY_TYPE_CHECKER)
75 #undef TYPED_ARRAY_TYPE_CHECKER 80 #include "src/objects/object-macros-undef.h" 82 #endif // V8_OBJECTS_INSTANCE_TYPE_INL_H_