• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2021 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef V8_OBJECTS_OBJECT_TYPE_H_
6 #define V8_OBJECTS_OBJECT_TYPE_H_
7 
8 #include "src/base/macros.h"
9 #include "src/common/globals.h"
10 #include "src/objects/object-list-macros.h"
11 #include "src/objects/objects-definitions.h"
12 
13 namespace v8 {
14 namespace internal {
15 
16 #define ENUM_ELEMENT(Name) k##Name,
17 #define ENUM_STRUCT_ELEMENT(NAME, Name, name) k##Name,
18 enum class ObjectType {
19   ENUM_ELEMENT(Object)                 //
20   ENUM_ELEMENT(Smi)                    //
21   ENUM_ELEMENT(TaggedIndex)            //
22   ENUM_ELEMENT(HeapObject)             //
23   OBJECT_TYPE_LIST(ENUM_ELEMENT)       //
24   HEAP_OBJECT_TYPE_LIST(ENUM_ELEMENT)  //
25   STRUCT_LIST(ENUM_STRUCT_ELEMENT)     //
26 };
27 #undef ENUM_ELEMENT
28 #undef ENUM_STRUCT_ELEMENT
29 
30 // {raw_value} must be a tagged Object.
31 // {raw_type} must be a tagged Smi.
32 // {raw_location} must be a tagged String.
33 // Returns a tagged Smi.
34 V8_EXPORT_PRIVATE Address CheckObjectType(Address raw_value, Address raw_type,
35                                           Address raw_location);
36 
37 }  // namespace internal
38 }  // namespace v8
39 
40 #endif  // V8_OBJECTS_OBJECT_TYPE_H_
41