1 /** 2 * Copyright (c) 2021-2025 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 <cstdint> 17 #include "libpandafile/file.h" 18 #include "runtime/include/class.h" 19 #include "runtime/include/coretypes/array.h" 20 #include "runtime/include/coretypes/native_pointer.h" 21 #include "runtime/include/coretypes/string.h" 22 #include "runtime/include/field.h" 23 #include "runtime/include/hclass.h" 24 #include "runtime/include/method.h" 25 #include "runtime/include/mtmanaged_thread.h" 26 #include "runtime/mem/tlab.h" 27 #include "utils/cframe_layout.h" 28 29 #include "plugins_defines.h" 30 31 namespace ark { 32 // NOLINTBEGIN(hicpp-no-assembler) 33 34 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 35 #define DEFINE_VALUE(name, value) \ 36 void AsmDefinition_##name() \ 37 { \ 38 asm volatile("\n.ascii \"^^" #name " %0^^\"" ::"i"(static_cast<int64_t>(value))); \ 39 } 40 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 41 #define DEFINE_VALUE_WITH_TYPE(name, value, type) \ 42 void AsmDefinition_##name() \ 43 { \ 44 asm volatile("\n.ascii \"^^" #name " %0 " #type "^^\"" ::"i"(static_cast<int64_t>(value))); \ 45 } 46 #include "asm_defines.def" 47 // NOLINTEND(hicpp-no-assembler) 48 49 } // namespace ark 50