1 /* 2 * Copyright (c) 2021 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 #ifndef ECMASCRIPT_COMMON_ENUM_H 17 #define ECMASCRIPT_COMMON_ENUM_H 18 19 namespace panda { 20 namespace ecmascript { 21 enum BarrierMode { SKIP_BARRIER, WRITE_BARRIER, READ_BARRIER }; 22 23 /* 24 * TriggerGCType is categorized according to the scope the GC expects to cover. 25 * Different GC algorithms may be applied to different GC types. 26 * For example, SemiSpace GC for young generation GC, Mark-Sweep-Compact for full GC, etc. 27 */ 28 enum TriggerGCType { 29 EDEN_GC, 30 // GC is expected to cover young space only; 31 YOUNG_GC, 32 // GC is expected to cover young space and necessary old spaces; 33 OLD_GC, 34 // GC is expected to cover all valid heap spaces; 35 FULL_GC, 36 // GC is expected to compress objects into appspawn space; 37 APPSPAWN_FULL_GC, 38 SHARED_GC, 39 SHARED_FULL_GC, 40 APPSPAWN_SHARED_FULL_GC, 41 GC_TYPE_LAST 42 }; 43 44 enum class GCReason : uint8_t { 45 ALLOCATION_LIMIT, 46 ALLOCATION_FAILED, 47 IDLE, 48 SWITCH_BACKGROUND, 49 EXTERNAL_TRIGGER, 50 WORKER_DESTRUCTION, 51 TRIGGER_BY_JS, 52 TRIGGER_BY_ARKUI, 53 TRIGGER_BY_ABILITY, 54 TRIGGER_BY_MEM_TOOLS, 55 TRIGGER_BY_TASKPOOL, 56 OTHER 57 }; 58 59 enum class RequestAotMode : uint8_t { 60 RE_COMPILE_ON_IDLE = 0 61 }; 62 } // namespace ecmascript 63 } // namespace panda 64 65 #endif // ECMASCRIPT_COMMON_ENUM_H 66