1 /* 2 * Copyright (c) 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 #ifndef ECMASCRIPT_CROSS_VM_JS_THREAD_HYBRID_H 16 #define ECMASCRIPT_CROSS_VM_JS_THREAD_HYBRID_H 17 18 #define JSTHREAD_PUBLIC_HYBRID_EXTENSION() \ 19 inline uintptr_t NewXRefGlobalHandle(JSTaggedType value) \ 20 { \ 21 return newXRefGlobalHandle_(value); \ 22 } \ 23 inline void DisposeXRefGlobalHandle(uintptr_t nodeAddr) \ 24 { \ 25 disposeXRefGlobalHandle_(nodeAddr); \ 26 } \ 27 inline void SetNodeKind(NodeKind nodeKind) \ 28 { \ 29 setNodeKind_(nodeKind); \ 30 } \ 31 void SetStackStart(uint64_t stackStart) \ 32 { \ 33 glueData_.stackStart_ = stackStart; \ 34 } \ 35 void SetStackLimit(uint64_t stackLimit) \ 36 { \ 37 glueData_.stackLimit_ = stackLimit; \ 38 } \ 39 void SetupXRefFields() 40 41 #define JSTHREAD_PRIVATE_HYBRID_EXTENSION() \ 42 std::function<uintptr_t(JSTaggedType value)> newXRefGlobalHandle_; \ 43 std::function<void(uintptr_t nodeAddr)> disposeXRefGlobalHandle_; \ 44 std::function<void(NodeKind nodeKind)> setNodeKind_ 45 #endif // ECMASCRIPT_CROSS_VM_JS_THREAD_HYBRID_H