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_BASE_CONFIG_H 17 #define ECMASCRIPT_BASE_CONFIG_H 18 19 namespace panda::ecmascript { 20 #define ARK_INLINE __attribute__((always_inline)) 21 #define ARK_NOINLINE __attribute__((noinline)) 22 23 #define ECMASCRIPT_ENABLE_DEBUG_MODE 0 24 #define ECMASCRIPT_ENABLE_ARK_CONTAINER 1 25 #define ECMASCRIPT_ENABLE_TS_AOT_PRINT 1 26 #define ECMASCRIPT_COMPILE_INTERPRETER_ASM 0 27 #define ECMASCRIPT_ENABLE_INTERPRETER_ASM (0 && ECMASCRIPT_COMPILE_INTERPRETER_ASM) 28 29 #define ECMASCRIPT_ENABLE_RUNTIME_STAT 0 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 30 #define ECMASCRIPT_ENABLE_INTERPRETER_TRUNTIME_STAT 0 31 #define ECMASCRIPT_ENABLE_BUILTINS_RUNTIME_STAT 0 32 #define ECMASCRIPT_ENABLE_ALLOCATE_AND_GC_RUNTIME_STAT 0 33 34 /* 35 * 1. close ic 36 * 2. close parallel gc 37 * 3. enable gc logs 38 * 4. enable handle-scope zap, zap reclaimed regions 39 * 5. switch gc mode to full gc 40 * 6. enable Cast() check 41 * 7. enable verify heap 42 * 9. enable Proactively interrogating and collecting information in the call stack 43 */ 44 #if ECMASCRIPT_ENABLE_DEBUG_MODE 45 #define ECMASCRIPT_ENABLE_IC 0 46 #define ECMASCRIPT_DISABLE_PARALLEL_GC 1 47 #define ECMASCRIPT_ENABLE_GC_LOG 1 48 #define ECMASCRIPT_ENABLE_ZAP_MEM 1 49 #define ECMASCRIPT_SWITCH_GC_MODE_TO_FULL_GC 1 50 #define ECMASCRIPT_ENABLE_CAST_CHECK 1 51 #define ECMASCRIPT_ENABLE_HEAP_VERIFY 1 52 #define ECMASCRIPT_ENABLE_THREAD_CHECK 1 53 #define ECMASCRIPT_ENABLE_ACTIVE_CPUPROFILER 0 54 #else 55 #define ECMASCRIPT_ENABLE_IC 1 56 #define ECMASCRIPT_DISABLE_PARALLEL_GC 0 57 #define ECMASCRIPT_ENABLE_GC_LOG 0 58 #define ECMASCRIPT_ENABLE_ZAP_MEM 0 59 #define ECMASCRIPT_SWITCH_GC_MODE_TO_FULL_GC 0 60 #define ECMASCRIPT_ENABLE_CAST_CHECK 0 61 #define ECMASCRIPT_ENABLE_HEAP_VERIFY 0 62 #define ECMASCRIPT_ENABLE_THREAD_CHECK 1 63 #define ECMASCRIPT_ENABLE_ACTIVE_CPUPROFILER 0 64 #endif 65 } // namespace panda::ecmascript 66 67 #endif // ECMASCRIPT_BASE_CONFIG_H 68