• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2022-2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "libpandabase/macros.h"
17 #include "runtime/mem/gc/gc_root_type.h"
18 
19 namespace ark::mem {
operator <<(std::ostream & os,RootType rootType)20 std::ostream &operator<<(std::ostream &os, RootType rootType)
21 {
22     switch (rootType) {
23         case RootType::ROOT_UNKNOWN:
24             os << "ROOT_UNKNOWN";
25             break;
26         case RootType::ROOT_CLASS:
27             os << "ROOT_CLASS";
28             break;
29         case RootType::ROOT_FRAME:
30             os << "ROOT_FRAME";
31             break;
32         case RootType::ROOT_THREAD:
33             os << "ROOT_THREAD";
34             break;
35         case RootType::ROOT_CLASS_LINKER:
36             os << "ROOT_CLASS_LINKER";
37             break;
38         case RootType::ROOT_TENURED:
39             os << "ROOT_TENURED";
40             break;
41         case RootType::ROOT_VM:
42             os << "ROOT_VM";
43             break;
44         case RootType::ROOT_NATIVE_GLOBAL:
45             os << "ROOT_NATIVE_GLOBAL";
46             break;
47         case RootType::ROOT_NATIVE_LOCAL:
48             os << "ROOT_NATIVE_LOCAL";
49             break;
50         case RootType::ROOT_PT_LOCAL:
51             os << "ROOT_PT_LOCAL";
52             break;
53         case RootType::ROOT_AOT_STRING_SLOT:
54             os << "ROOT_AOT_STRING_SLOT";
55             break;
56         case RootType::SATB_BUFFER:
57             os << "SATB_BUFFER";
58             break;
59         case RootType::STRING_TABLE:
60             os << "STRING_TABLE";
61             break;
62         case RootType::CARD_TABLE:
63             os << "CARD_TABLE";
64             break;
65         default:
66             UNREACHABLE();
67     }
68     return os;
69 }
70 }  // namespace ark::mem
71