14514f5e3Sopenharmony_ci/* 24514f5e3Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 34514f5e3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 44514f5e3Sopenharmony_ci * you may not use this file except in compliance with the License. 54514f5e3Sopenharmony_ci * You may obtain a copy of the License at 64514f5e3Sopenharmony_ci * 74514f5e3Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 84514f5e3Sopenharmony_ci * 94514f5e3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 104514f5e3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 114514f5e3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 124514f5e3Sopenharmony_ci * See the License for the specific language governing permissions and 134514f5e3Sopenharmony_ci * limitations under the License. 144514f5e3Sopenharmony_ci */ 154514f5e3Sopenharmony_ci 164514f5e3Sopenharmony_ci#ifndef ECMASCRIPT_BUILTINS_BUILTINS_LAZY_CALLBACK_H 174514f5e3Sopenharmony_ci#define ECMASCRIPT_BUILTINS_BUILTINS_LAZY_CALLBACK_H 184514f5e3Sopenharmony_ci 194514f5e3Sopenharmony_ci#include "ecmascript/global_env.h" 204514f5e3Sopenharmony_ci#include "ecmascript/js_function.h" 214514f5e3Sopenharmony_ci#include "ecmascript/js_handle.h" 224514f5e3Sopenharmony_ci#include "ecmascript/js_tagged_value.h" 234514f5e3Sopenharmony_ci#include "ecmascript/js_thread.h" 244514f5e3Sopenharmony_ci#include "ecmascript/object_factory.h" 254514f5e3Sopenharmony_ci 264514f5e3Sopenharmony_ci// NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 274514f5e3Sopenharmony_ci#define ITERATE_TYPED_ARRAY(V) \ 284514f5e3Sopenharmony_ci V(Int8Array) \ 294514f5e3Sopenharmony_ci V(Uint8Array) \ 304514f5e3Sopenharmony_ci V(Uint8ClampedArray) \ 314514f5e3Sopenharmony_ci V(Int16Array) \ 324514f5e3Sopenharmony_ci V(Uint16Array) \ 334514f5e3Sopenharmony_ci V(Int32Array) \ 344514f5e3Sopenharmony_ci V(Uint32Array) \ 354514f5e3Sopenharmony_ci V(Float32Array) \ 364514f5e3Sopenharmony_ci V(Float64Array) \ 374514f5e3Sopenharmony_ci V(BigInt64Array) \ 384514f5e3Sopenharmony_ci V(BigUint64Array) 394514f5e3Sopenharmony_ci 404514f5e3Sopenharmony_ci#define ITERATE_INTL(V) \ 414514f5e3Sopenharmony_ci V(Locale) \ 424514f5e3Sopenharmony_ci V(DateTimeFormat) \ 434514f5e3Sopenharmony_ci V(NumberFormat) \ 444514f5e3Sopenharmony_ci V(RelativeTimeFormat) \ 454514f5e3Sopenharmony_ci V(Collator) \ 464514f5e3Sopenharmony_ci V(PluralRules) \ 474514f5e3Sopenharmony_ci V(DisplayNames) \ 484514f5e3Sopenharmony_ci V(Segmenter) \ 494514f5e3Sopenharmony_ci V(Segments) \ 504514f5e3Sopenharmony_ci V(ListFormat) \ 514514f5e3Sopenharmony_ci 524514f5e3Sopenharmony_cinamespace panda::ecmascript::builtins { 534514f5e3Sopenharmony_ciclass BuiltinsLazyCallback { 544514f5e3Sopenharmony_cipublic: 554514f5e3Sopenharmony_ci static JSTaggedValue Date(JSThread *thread, const JSHandle<JSObject> &obj); 564514f5e3Sopenharmony_ci static JSTaggedValue Set(JSThread *thread, const JSHandle<JSObject> &obj); 574514f5e3Sopenharmony_ci static JSTaggedValue Map(JSThread *thread, const JSHandle<JSObject> &obj); 584514f5e3Sopenharmony_ci static JSTaggedValue WeakMap(JSThread *thread, const JSHandle<JSObject> &obj); 594514f5e3Sopenharmony_ci static JSTaggedValue WeakSet(JSThread *thread, const JSHandle<JSObject> &obj); 604514f5e3Sopenharmony_ci static JSTaggedValue WeakRef(JSThread *thread, const JSHandle<JSObject> &obj); 614514f5e3Sopenharmony_ci static JSTaggedValue FinalizationRegistry(JSThread *thread, const JSHandle<JSObject> &obj); 624514f5e3Sopenharmony_ci static JSTaggedValue TypedArray(JSThread *thread, const JSHandle<JSObject> &obj); 634514f5e3Sopenharmony_ci static JSTaggedValue Int8Array(JSThread *thread, const JSHandle<JSObject> &obj); 644514f5e3Sopenharmony_ci static JSTaggedValue Uint8Array(JSThread *thread, const JSHandle<JSObject> &obj); 654514f5e3Sopenharmony_ci static JSTaggedValue Uint8ClampedArray(JSThread *thread, const JSHandle<JSObject> &obj); 664514f5e3Sopenharmony_ci static JSTaggedValue Int16Array(JSThread *thread, const JSHandle<JSObject> &obj); 674514f5e3Sopenharmony_ci static JSTaggedValue Uint16Array(JSThread *thread, const JSHandle<JSObject> &obj); 684514f5e3Sopenharmony_ci static JSTaggedValue Int32Array(JSThread *thread, const JSHandle<JSObject> &obj); 694514f5e3Sopenharmony_ci static JSTaggedValue Uint32Array(JSThread *thread, const JSHandle<JSObject> &obj); 704514f5e3Sopenharmony_ci static JSTaggedValue Float32Array(JSThread *thread, const JSHandle<JSObject> &obj); 714514f5e3Sopenharmony_ci static JSTaggedValue Float64Array(JSThread *thread, const JSHandle<JSObject> &obj); 724514f5e3Sopenharmony_ci static JSTaggedValue BigInt64Array(JSThread *thread, const JSHandle<JSObject> &obj); 734514f5e3Sopenharmony_ci static JSTaggedValue BigUint64Array(JSThread *thread, const JSHandle<JSObject> &obj); 744514f5e3Sopenharmony_ci static JSTaggedValue ArrayBuffer(JSThread *thread, const JSHandle<JSObject> &obj); 754514f5e3Sopenharmony_ci static JSTaggedValue DataView(JSThread *thread, const JSHandle<JSObject> &obj); 764514f5e3Sopenharmony_ci static JSTaggedValue SharedArrayBuffer(JSThread *thread, const JSHandle<JSObject> &obj); 774514f5e3Sopenharmony_ci#ifdef ARK_SUPPORT_INTL 784514f5e3Sopenharmony_ci static JSTaggedValue Locale(JSThread *thread, const JSHandle<JSObject> &obj); 794514f5e3Sopenharmony_ci static JSTaggedValue DateTimeFormat(JSThread *thread, const JSHandle<JSObject> &obj); 804514f5e3Sopenharmony_ci static JSTaggedValue NumberFormat(JSThread *thread, const JSHandle<JSObject> &obj); 814514f5e3Sopenharmony_ci static JSTaggedValue RelativeTimeFormat(JSThread *thread, const JSHandle<JSObject> &obj); 824514f5e3Sopenharmony_ci static JSTaggedValue Collator(JSThread *thread, const JSHandle<JSObject> &obj); 834514f5e3Sopenharmony_ci static JSTaggedValue PluralRules(JSThread *thread, const JSHandle<JSObject> &obj); 844514f5e3Sopenharmony_ci static JSTaggedValue DisplayNames(JSThread *thread, const JSHandle<JSObject> &obj); 854514f5e3Sopenharmony_ci static JSTaggedValue Segmenter(JSThread *thread, const JSHandle<JSObject> &obj); 864514f5e3Sopenharmony_ci static JSTaggedValue Segments(JSThread *thread, const JSHandle<JSObject> &obj); 874514f5e3Sopenharmony_ci static JSTaggedValue ListFormat(JSThread *thread, const JSHandle<JSObject> &obj); 884514f5e3Sopenharmony_ci#endif 894514f5e3Sopenharmony_ci 904514f5e3Sopenharmony_ciprivate: 914514f5e3Sopenharmony_ci static void ResetLazyInternalAttr(JSThread *thread, const JSHandle<JSObject> &object, const char *key); 924514f5e3Sopenharmony_ci}; 934514f5e3Sopenharmony_ci} // namespace panda::ecmascript::builtins 944514f5e3Sopenharmony_ci#endif // ECMASCRIPT_BUILTINS_BUILTINS_LAZY_CALLBACK_H