14514f5e3Sopenharmony_ci/* 24514f5e3Sopenharmony_ci * Copyright (c) 2021 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#include "ecmascript/interpreter/slow_runtime_stub.h" 174514f5e3Sopenharmony_ci 184514f5e3Sopenharmony_ci#include "ecmascript/interpreter/interpreter-inl.h" 194514f5e3Sopenharmony_ci#include "ecmascript/stubs/runtime_stubs-inl.h" 204514f5e3Sopenharmony_ci 214514f5e3Sopenharmony_cinamespace panda::ecmascript { 224514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CallSpread(JSThread *thread, JSTaggedValue func, JSTaggedValue obj, 234514f5e3Sopenharmony_ci JSTaggedValue array) 244514f5e3Sopenharmony_ci{ 254514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CallSpread); 264514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 274514f5e3Sopenharmony_ci 284514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> jsFunc(thread, func); 294514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> jsArray(thread, array); 304514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> taggedObj(thread, obj); 314514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCallSpread(thread, jsFunc, taggedObj, jsArray); 324514f5e3Sopenharmony_ci} 334514f5e3Sopenharmony_ci 344514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Neg(JSThread *thread, JSTaggedValue value) 354514f5e3Sopenharmony_ci{ 364514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Neg); 374514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 384514f5e3Sopenharmony_ci 394514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> inputTag(thread, value); 404514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNeg(thread, inputTag); 414514f5e3Sopenharmony_ci} 424514f5e3Sopenharmony_ci 434514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::AsyncFunctionEnter(JSThread *thread) 444514f5e3Sopenharmony_ci{ 454514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, AsyncFunctionEnter); 464514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 474514f5e3Sopenharmony_ci 484514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeAsyncFunctionEnter(thread); 494514f5e3Sopenharmony_ci} 504514f5e3Sopenharmony_ci 514514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::ToNumber(JSThread *thread, JSTaggedValue value) 524514f5e3Sopenharmony_ci{ 534514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Tonumber); 544514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 554514f5e3Sopenharmony_ci 564514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> number(thread, value); 574514f5e3Sopenharmony_ci // may return exception 584514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeToNumber(thread, number); 594514f5e3Sopenharmony_ci} 604514f5e3Sopenharmony_ci 614514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::ToNumeric(JSThread *thread, JSTaggedValue value) 624514f5e3Sopenharmony_ci{ 634514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Tonumeric); 644514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 654514f5e3Sopenharmony_ci 664514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> numeric(thread, value); 674514f5e3Sopenharmony_ci // may return exception 684514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeToNumeric(thread, numeric); 694514f5e3Sopenharmony_ci} 704514f5e3Sopenharmony_ci 714514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Not(JSThread *thread, JSTaggedValue value) 724514f5e3Sopenharmony_ci{ 734514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Not); 744514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 754514f5e3Sopenharmony_ci 764514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> inputTag(thread, value); 774514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNot(thread, inputTag); 784514f5e3Sopenharmony_ci} 794514f5e3Sopenharmony_ci 804514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Inc(JSThread *thread, JSTaggedValue value) 814514f5e3Sopenharmony_ci{ 824514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Inc); 834514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 844514f5e3Sopenharmony_ci 854514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> inputTag(thread, value); 864514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeInc(thread, inputTag); 874514f5e3Sopenharmony_ci} 884514f5e3Sopenharmony_ci 894514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Dec(JSThread *thread, JSTaggedValue value) 904514f5e3Sopenharmony_ci{ 914514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Dec); 924514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 934514f5e3Sopenharmony_ci 944514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> inputTag(thread, value); 954514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeDec(thread, inputTag); 964514f5e3Sopenharmony_ci} 974514f5e3Sopenharmony_ci 984514f5e3Sopenharmony_civoid SlowRuntimeStub::Throw(JSThread *thread, JSTaggedValue value) 994514f5e3Sopenharmony_ci{ 1004514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Throw); 1014514f5e3Sopenharmony_ci RuntimeStubs::RuntimeThrow(thread, value); 1024514f5e3Sopenharmony_ci} 1034514f5e3Sopenharmony_ci 1044514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetPropIterator(JSThread *thread, JSTaggedValue value) 1054514f5e3Sopenharmony_ci{ 1064514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, GetPropIterator); 1074514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1084514f5e3Sopenharmony_ci 1094514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, value); 1104514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetPropIterator(thread, objHandle); 1114514f5e3Sopenharmony_ci} 1124514f5e3Sopenharmony_ci 1134514f5e3Sopenharmony_civoid SlowRuntimeStub::ThrowConstAssignment(JSThread *thread, JSTaggedValue value) 1144514f5e3Sopenharmony_ci{ 1154514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowConstAssignment); 1164514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1174514f5e3Sopenharmony_ci 1184514f5e3Sopenharmony_ci JSHandle<EcmaString> name(thread, value.GetTaggedObject()); 1194514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeThrowConstAssignment(thread, name); 1204514f5e3Sopenharmony_ci} 1214514f5e3Sopenharmony_ci 1224514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Add2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 1234514f5e3Sopenharmony_ci{ 1244514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Add2); 1254514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1264514f5e3Sopenharmony_ci 1274514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftValue(thread, left); 1284514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightValue(thread, right); 1294514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeAdd2(thread, leftValue, rightValue); 1304514f5e3Sopenharmony_ci} 1314514f5e3Sopenharmony_ci 1324514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Sub2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 1334514f5e3Sopenharmony_ci{ 1344514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Sub2); 1354514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1364514f5e3Sopenharmony_ci 1374514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 1384514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 1394514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeSub2(thread, leftTag, rightTag); 1404514f5e3Sopenharmony_ci} 1414514f5e3Sopenharmony_ci 1424514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Mul2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 1434514f5e3Sopenharmony_ci{ 1444514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Mul2); 1454514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1464514f5e3Sopenharmony_ci 1474514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 1484514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 1494514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeMul2(thread, leftTag, rightTag); 1504514f5e3Sopenharmony_ci} 1514514f5e3Sopenharmony_ci 1524514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Div2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 1534514f5e3Sopenharmony_ci{ 1544514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Div2); 1554514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1564514f5e3Sopenharmony_ci 1574514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 1584514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 1594514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeDiv2(thread, leftTag, rightTag); 1604514f5e3Sopenharmony_ci} 1614514f5e3Sopenharmony_ci 1624514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Mod2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 1634514f5e3Sopenharmony_ci{ 1644514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Mod2); 1654514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1664514f5e3Sopenharmony_ci 1674514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 1684514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 1694514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeMod2(thread, leftTag, rightTag); 1704514f5e3Sopenharmony_ci} 1714514f5e3Sopenharmony_ci 1724514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Eq(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 1734514f5e3Sopenharmony_ci{ 1744514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Eq); 1754514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1764514f5e3Sopenharmony_ci 1774514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftValue(thread, left); 1784514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightValue(thread, right); 1794514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeEq(thread, leftValue, rightValue); 1804514f5e3Sopenharmony_ci} 1814514f5e3Sopenharmony_ci 1824514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::NotEq(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 1834514f5e3Sopenharmony_ci{ 1844514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, NotEq); 1854514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1864514f5e3Sopenharmony_ci 1874514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftValue(thread, left); 1884514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightValue(thread, right); 1894514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNotEq(thread, leftValue, rightValue); 1904514f5e3Sopenharmony_ci} 1914514f5e3Sopenharmony_ci 1924514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Less(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 1934514f5e3Sopenharmony_ci{ 1944514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Less); 1954514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 1964514f5e3Sopenharmony_ci 1974514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftValue(thread, left); 1984514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightValue(thread, right); 1994514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLess(thread, leftValue, rightValue); 2004514f5e3Sopenharmony_ci} 2014514f5e3Sopenharmony_ci 2024514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LessEq(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 2034514f5e3Sopenharmony_ci{ 2044514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LessEq); 2054514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2064514f5e3Sopenharmony_ci 2074514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftValue(thread, left); 2084514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightValue(thread, right); 2094514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLessEq(thread, leftValue, rightValue); 2104514f5e3Sopenharmony_ci} 2114514f5e3Sopenharmony_ci 2124514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Greater(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 2134514f5e3Sopenharmony_ci{ 2144514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Greater); 2154514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2164514f5e3Sopenharmony_ci 2174514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftValue(thread, left); 2184514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightValue(thread, right); 2194514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGreater(thread, leftValue, rightValue); 2204514f5e3Sopenharmony_ci} 2214514f5e3Sopenharmony_ci 2224514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GreaterEq(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 2234514f5e3Sopenharmony_ci{ 2244514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, GreaterEq); 2254514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2264514f5e3Sopenharmony_ci 2274514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftValue(thread, left); 2284514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightValue(thread, right); 2294514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGreaterEq(thread, leftValue, rightValue); 2304514f5e3Sopenharmony_ci} 2314514f5e3Sopenharmony_ci 2324514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Shl2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 2334514f5e3Sopenharmony_ci{ 2344514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Shl2); 2354514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2364514f5e3Sopenharmony_ci 2374514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 2384514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 2394514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeShl2(thread, leftTag, rightTag); 2404514f5e3Sopenharmony_ci} 2414514f5e3Sopenharmony_ci 2424514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Shr2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 2434514f5e3Sopenharmony_ci{ 2444514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Shr2); 2454514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2464514f5e3Sopenharmony_ci 2474514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 2484514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 2494514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeShr2(thread, leftTag, rightTag); 2504514f5e3Sopenharmony_ci} 2514514f5e3Sopenharmony_ci 2524514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Ashr2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 2534514f5e3Sopenharmony_ci{ 2544514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Ashr2); 2554514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2564514f5e3Sopenharmony_ci 2574514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 2584514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 2594514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeAshr2(thread, leftTag, rightTag); 2604514f5e3Sopenharmony_ci} 2614514f5e3Sopenharmony_ci 2624514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::And2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 2634514f5e3Sopenharmony_ci{ 2644514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, And2); 2654514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2664514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 2674514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 2684514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeAnd2(thread, leftTag, rightTag); 2694514f5e3Sopenharmony_ci} 2704514f5e3Sopenharmony_ci 2714514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Or2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 2724514f5e3Sopenharmony_ci{ 2734514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Or2); 2744514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2754514f5e3Sopenharmony_ci 2764514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 2774514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 2784514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeOr2(thread, leftTag, rightTag); 2794514f5e3Sopenharmony_ci} 2804514f5e3Sopenharmony_ci 2814514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Xor2(JSThread *thread, JSTaggedValue left, JSTaggedValue right) 2824514f5e3Sopenharmony_ci{ 2834514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Xor2); 2844514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2854514f5e3Sopenharmony_ci 2864514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> leftTag(thread, left); 2874514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> rightTag(thread, right); 2884514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeXor2(thread, leftTag, rightTag); 2894514f5e3Sopenharmony_ci} 2904514f5e3Sopenharmony_ci 2914514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::ToJSTaggedValueWithInt32(JSThread *thread, JSTaggedValue value) 2924514f5e3Sopenharmony_ci{ 2934514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ToJSTaggedValueWithInt32); 2944514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 2954514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 2964514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeToJSTaggedValueWithInt32(thread, valueHandle); 2974514f5e3Sopenharmony_ci} 2984514f5e3Sopenharmony_ci 2994514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::ToJSTaggedValueWithUint32(JSThread *thread, JSTaggedValue value) 3004514f5e3Sopenharmony_ci{ 3014514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ToJSTaggedValueWithUint32); 3024514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3034514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 3044514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeToJSTaggedValueWithUint32(thread, valueHandle); 3054514f5e3Sopenharmony_ci} 3064514f5e3Sopenharmony_ci 3074514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::DelObjProp(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop) 3084514f5e3Sopenharmony_ci{ 3094514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Delobjprop); 3104514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3114514f5e3Sopenharmony_ci 3124514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 3134514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 3144514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeDelObjProp(thread, objHandle, propHandle); 3154514f5e3Sopenharmony_ci} 3164514f5e3Sopenharmony_ci 3174514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::NewObjRange(JSThread *thread, JSTaggedValue func, JSTaggedValue newTarget, 3184514f5e3Sopenharmony_ci uint16_t firstArgIdx, uint16_t length) 3194514f5e3Sopenharmony_ci{ 3204514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, NewobjRange); 3214514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3224514f5e3Sopenharmony_ci 3234514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> funcHandle(thread, func); 3244514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); 3254514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNewObjRange(thread, funcHandle, newTargetHandle, firstArgIdx, length); 3264514f5e3Sopenharmony_ci} 3274514f5e3Sopenharmony_ci 3284514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateObjectWithExcludedKeys(JSThread *thread, uint16_t numKeys, JSTaggedValue objVal, 3294514f5e3Sopenharmony_ci uint16_t firstArgRegIdx) 3304514f5e3Sopenharmony_ci{ 3314514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateObjectWithExcludedKeys); 3324514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3334514f5e3Sopenharmony_ci 3344514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> obj(thread, objVal); 3354514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateObjectWithExcludedKeys(thread, numKeys, obj, firstArgRegIdx); 3364514f5e3Sopenharmony_ci} 3374514f5e3Sopenharmony_ci 3384514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Exp(JSThread *thread, JSTaggedValue base, JSTaggedValue exponent) 3394514f5e3Sopenharmony_ci{ 3404514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Exp); 3414514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3424514f5e3Sopenharmony_ci 3434514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeExp(thread, base, exponent); 3444514f5e3Sopenharmony_ci} 3454514f5e3Sopenharmony_ci 3464514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::IsIn(JSThread *thread, JSTaggedValue prop, JSTaggedValue obj) 3474514f5e3Sopenharmony_ci{ 3484514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, IsIn); 3494514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3504514f5e3Sopenharmony_ci 3514514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 3524514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 3534514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeIsIn(thread, propHandle, objHandle); 3544514f5e3Sopenharmony_ci} 3554514f5e3Sopenharmony_ci 3564514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::Instanceof(JSThread *thread, JSTaggedValue obj, JSTaggedValue target) 3574514f5e3Sopenharmony_ci{ 3584514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Instanceof); 3594514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3604514f5e3Sopenharmony_ci 3614514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 3624514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> targetHandle(thread, target); 3634514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeInstanceof(thread, objHandle, targetHandle); 3644514f5e3Sopenharmony_ci} 3654514f5e3Sopenharmony_ci 3664514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::InstanceofByHandler(JSThread *thread, JSTaggedValue target, JSTaggedValue object, 3674514f5e3Sopenharmony_ci JSTaggedValue instOfHandler) 3684514f5e3Sopenharmony_ci{ 3694514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, InstanceofByHandler); 3704514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3714514f5e3Sopenharmony_ci 3724514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objectHandle(thread, object); 3734514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> targetHandle(thread, target); 3744514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> instOfHandle(thread, instOfHandler); 3754514f5e3Sopenharmony_ci 3764514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeInstanceofByHandler(thread, targetHandle, objectHandle, instOfHandle); 3774514f5e3Sopenharmony_ci} 3784514f5e3Sopenharmony_ci 3794514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::NewLexicalEnv(JSThread *thread, uint16_t numVars) 3804514f5e3Sopenharmony_ci{ 3814514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Newlexenv); 3824514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3834514f5e3Sopenharmony_ci 3844514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNewLexicalEnv(thread, numVars); 3854514f5e3Sopenharmony_ci} 3864514f5e3Sopenharmony_ci 3874514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::NewSendableEnv(JSThread *thread, uint16_t numVars) 3884514f5e3Sopenharmony_ci{ 3894514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, NewSendableEnv); 3904514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3914514f5e3Sopenharmony_ci 3924514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNewSendableEnv(thread, numVars); 3934514f5e3Sopenharmony_ci} 3944514f5e3Sopenharmony_ci 3954514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::NewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uint16_t scopeId) 3964514f5e3Sopenharmony_ci{ 3974514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, NewlexenvwithName); 3984514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 3994514f5e3Sopenharmony_ci 4004514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNewLexicalEnvWithName(thread, numVars, scopeId); 4014514f5e3Sopenharmony_ci} 4024514f5e3Sopenharmony_ci 4034514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateIterResultObj(JSThread *thread, JSTaggedValue value, JSTaggedValue flag) 4044514f5e3Sopenharmony_ci{ 4054514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateIterResultObj); 4064514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4074514f5e3Sopenharmony_ci 4084514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 4094514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateIterResultObj(thread, valueHandle, flag); 4104514f5e3Sopenharmony_ci} 4114514f5e3Sopenharmony_ci 4124514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateGeneratorObj(JSThread *thread, JSTaggedValue genFunc) 4134514f5e3Sopenharmony_ci{ 4144514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateGeneratorObj); 4154514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4164514f5e3Sopenharmony_ci 4174514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> generatorFunction(thread, genFunc); 4184514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateGeneratorObj(thread, generatorFunction); 4194514f5e3Sopenharmony_ci} 4204514f5e3Sopenharmony_ci 4214514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateAsyncGeneratorObj(JSThread *thread, JSTaggedValue genFunc) 4224514f5e3Sopenharmony_ci{ 4234514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateAsyncGeneratorObj); 4244514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4254514f5e3Sopenharmony_ci 4264514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> asyncGeneratorFunction(thread, genFunc); 4274514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateAsyncGeneratorObj(thread, asyncGeneratorFunction); 4284514f5e3Sopenharmony_ci} 4294514f5e3Sopenharmony_ci 4304514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::SuspendGenerator(JSThread *thread, JSTaggedValue genObj, JSTaggedValue value) 4314514f5e3Sopenharmony_ci{ 4324514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, SuspendGenerator); 4334514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4344514f5e3Sopenharmony_ci 4354514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> genObjHandle(thread, genObj); 4364514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 4374514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeSuspendGenerator(thread, genObjHandle, valueHandle); 4384514f5e3Sopenharmony_ci} 4394514f5e3Sopenharmony_ci 4404514f5e3Sopenharmony_civoid SlowRuntimeStub::SetGeneratorState(JSThread *thread, JSTaggedValue genObj, int32_t index) 4414514f5e3Sopenharmony_ci{ 4424514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, SetGeneratorState); 4434514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4444514f5e3Sopenharmony_ci 4454514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> genObjHandle(thread, genObj); 4464514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeSetGeneratorState(thread, genObjHandle, index); 4474514f5e3Sopenharmony_ci} 4484514f5e3Sopenharmony_ci 4494514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::AsyncFunctionAwaitUncaught(JSThread *thread, JSTaggedValue asyncFuncObj, 4504514f5e3Sopenharmony_ci JSTaggedValue value) 4514514f5e3Sopenharmony_ci{ 4524514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, AsyncFunctionAwaitUncaught); 4534514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4544514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> asyncFuncObjHandle(thread, asyncFuncObj); 4554514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 4564514f5e3Sopenharmony_ci 4574514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeAsyncFunctionAwaitUncaught(thread, asyncFuncObjHandle, valueHandle); 4584514f5e3Sopenharmony_ci} 4594514f5e3Sopenharmony_ci 4604514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::AsyncFunctionResolveOrReject(JSThread *thread, JSTaggedValue asyncFuncObj, 4614514f5e3Sopenharmony_ci JSTaggedValue value, bool is_resolve) 4624514f5e3Sopenharmony_ci{ 4634514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, AsyncFunctionResolveOrReject); 4644514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4654514f5e3Sopenharmony_ci 4664514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> asyncFuncObjHandle(thread, asyncFuncObj); 4674514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 4684514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeAsyncFunctionResolveOrReject(thread, asyncFuncObjHandle, valueHandle, is_resolve); 4694514f5e3Sopenharmony_ci} 4704514f5e3Sopenharmony_ci 4714514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::NewObjApply(JSThread *thread, JSTaggedValue func, JSTaggedValue array) 4724514f5e3Sopenharmony_ci{ 4734514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, NewObjApply); 4744514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4754514f5e3Sopenharmony_ci 4764514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> funcHandle(thread, func); 4774514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> jsArray(thread, array); 4784514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNewObjApply(thread, funcHandle, jsArray); 4794514f5e3Sopenharmony_ci} 4804514f5e3Sopenharmony_ci 4814514f5e3Sopenharmony_civoid SlowRuntimeStub::ThrowUndefinedIfHole(JSThread *thread, JSTaggedValue obj) 4824514f5e3Sopenharmony_ci{ 4834514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowUndefinedIfHole); 4844514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4854514f5e3Sopenharmony_ci 4864514f5e3Sopenharmony_ci JSHandle<EcmaString> name(thread, obj); 4874514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeThrowUndefinedIfHole(thread, name); 4884514f5e3Sopenharmony_ci} 4894514f5e3Sopenharmony_ci 4904514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::ThrowIfSuperNotCorrectCall(JSThread *thread, uint16_t index, JSTaggedValue thisValue) 4914514f5e3Sopenharmony_ci{ 4924514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowIfSuperNotCorrectCall); 4934514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 4944514f5e3Sopenharmony_ci 4954514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeThrowIfSuperNotCorrectCall(thread, index, thisValue); 4964514f5e3Sopenharmony_ci} 4974514f5e3Sopenharmony_ci 4984514f5e3Sopenharmony_civoid SlowRuntimeStub::ThrowIfNotObject(JSThread *thread) 4994514f5e3Sopenharmony_ci{ 5004514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowIfNotObject); 5014514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5024514f5e3Sopenharmony_ci 5034514f5e3Sopenharmony_ci THROW_TYPE_ERROR(thread, "Inner return result is not object"); 5044514f5e3Sopenharmony_ci} 5054514f5e3Sopenharmony_ci 5064514f5e3Sopenharmony_civoid SlowRuntimeStub::ThrowThrowNotExists(JSThread *thread) 5074514f5e3Sopenharmony_ci{ 5084514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowThrowNotExists); 5094514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5104514f5e3Sopenharmony_ci 5114514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeThrowIfNotObject(thread); 5124514f5e3Sopenharmony_ci} 5134514f5e3Sopenharmony_ci 5144514f5e3Sopenharmony_civoid SlowRuntimeStub::ThrowPatternNonCoercible(JSThread *thread) 5154514f5e3Sopenharmony_ci{ 5164514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowPatternNonCoercible); 5174514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5184514f5e3Sopenharmony_ci 5194514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeThrowPatternNonCoercible(thread); 5204514f5e3Sopenharmony_ci} 5214514f5e3Sopenharmony_ci 5224514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StOwnByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, JSTaggedValue value) 5234514f5e3Sopenharmony_ci{ 5244514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StOwnByName); 5254514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5264514f5e3Sopenharmony_ci 5274514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 5284514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 5294514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 5304514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStOwnByName(thread, objHandle, propHandle, valueHandle); 5314514f5e3Sopenharmony_ci} 5324514f5e3Sopenharmony_ci 5334514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StOwnByNameWithNameSet(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, 5344514f5e3Sopenharmony_ci JSTaggedValue value) 5354514f5e3Sopenharmony_ci{ 5364514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StOwnByName); 5374514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5384514f5e3Sopenharmony_ci 5394514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 5404514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 5414514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 5424514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStOwnByNameWithNameSet(thread, objHandle, propHandle, valueHandle); 5434514f5e3Sopenharmony_ci} 5444514f5e3Sopenharmony_ci 5454514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StOwnByIndex(JSThread *thread, JSTaggedValue obj, uint32_t idx, JSTaggedValue value) 5464514f5e3Sopenharmony_ci{ 5474514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StOwnById); 5484514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5494514f5e3Sopenharmony_ci 5504514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 5514514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> idxHandle(thread, JSTaggedValue(idx)); 5524514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 5534514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStOwnByIndex(thread, objHandle, idxHandle, valueHandle); 5544514f5e3Sopenharmony_ci} 5554514f5e3Sopenharmony_ci 5564514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StOwnByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue key, JSTaggedValue value) 5574514f5e3Sopenharmony_ci{ 5584514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StOwnByValue); 5594514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5604514f5e3Sopenharmony_ci 5614514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 5624514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> keyHandle(thread, key); 5634514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 5644514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStOwnByValue(thread, objHandle, keyHandle, valueHandle); 5654514f5e3Sopenharmony_ci} 5664514f5e3Sopenharmony_ci 5674514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StOwnByValueWithNameSet(JSThread *thread, JSTaggedValue obj, JSTaggedValue key, 5684514f5e3Sopenharmony_ci JSTaggedValue value) 5694514f5e3Sopenharmony_ci{ 5704514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StOwnByValue); 5714514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5724514f5e3Sopenharmony_ci 5734514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 5744514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> keyHandle(thread, key); 5754514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 5764514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStOwnByValueWithNameSet(thread, objHandle, keyHandle, valueHandle); 5774514f5e3Sopenharmony_ci} 5784514f5e3Sopenharmony_ci 5794514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateEmptyArray(JSThread *thread, ObjectFactory *factory, JSHandle<GlobalEnv> globalEnv) 5804514f5e3Sopenharmony_ci{ 5814514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateEmptyArray); 5824514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5834514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateEmptyArray(thread, factory, globalEnv); 5844514f5e3Sopenharmony_ci} 5854514f5e3Sopenharmony_ci 5864514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateEmptyObject(JSThread *thread, ObjectFactory *factory, 5874514f5e3Sopenharmony_ci JSHandle<GlobalEnv> globalEnv) 5884514f5e3Sopenharmony_ci{ 5894514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateEmptyObject); 5904514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5914514f5e3Sopenharmony_ci 5924514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateEmptyObject(thread, factory, globalEnv); 5934514f5e3Sopenharmony_ci} 5944514f5e3Sopenharmony_ci 5954514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateObjectWithBuffer(JSThread *thread, ObjectFactory *factory, JSObject *literal) 5964514f5e3Sopenharmony_ci{ 5974514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateObjectWithBuffer); 5984514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 5994514f5e3Sopenharmony_ci 6004514f5e3Sopenharmony_ci JSHandle<JSObject> obj(thread, literal); 6014514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateObjectWithBuffer(thread, factory, obj); 6024514f5e3Sopenharmony_ci} 6034514f5e3Sopenharmony_ci 6044514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateObjectHavingMethod(JSThread *thread, ObjectFactory *factory, JSObject *literal, 6054514f5e3Sopenharmony_ci JSTaggedValue env) 6064514f5e3Sopenharmony_ci{ 6074514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateObjectHavingMethod); 6084514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 6094514f5e3Sopenharmony_ci 6104514f5e3Sopenharmony_ci JSHandle<JSObject> obj(thread, literal); 6114514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> envi(thread, env); 6124514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateObjectHavingMethod(thread, factory, obj, envi); 6134514f5e3Sopenharmony_ci} 6144514f5e3Sopenharmony_ci 6154514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::SetObjectWithProto(JSThread *thread, JSTaggedValue proto, JSTaggedValue obj) 6164514f5e3Sopenharmony_ci{ 6174514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, SetObjectWithProto); 6184514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 6194514f5e3Sopenharmony_ci 6204514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> protoHandle(thread, proto); 6214514f5e3Sopenharmony_ci JSHandle<JSObject> objHandle(thread, obj); 6224514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeSetObjectWithProto(thread, protoHandle, objHandle); 6234514f5e3Sopenharmony_ci} 6244514f5e3Sopenharmony_ci 6254514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::IterNext(JSThread *thread, JSTaggedValue iter) 6264514f5e3Sopenharmony_ci{ 6274514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, IterNext); 6284514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 6294514f5e3Sopenharmony_ci 6304514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> iterHandle(thread, iter); 6314514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeIterNext(thread, iterHandle); 6324514f5e3Sopenharmony_ci} 6334514f5e3Sopenharmony_ci 6344514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CloseIterator(JSThread *thread, JSTaggedValue iter) 6354514f5e3Sopenharmony_ci{ 6364514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CloseIterator); 6374514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 6384514f5e3Sopenharmony_ci 6394514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> iterHandle(thread, iter); 6404514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCloseIterator(thread, iterHandle); 6414514f5e3Sopenharmony_ci} 6424514f5e3Sopenharmony_ci 6434514f5e3Sopenharmony_civoid SlowRuntimeStub::StModuleVar(JSThread *thread, int32_t index, JSTaggedValue value) 6444514f5e3Sopenharmony_ci{ 6454514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StModuleVar); 6464514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope scope(thread); 6474514f5e3Sopenharmony_ci 6484514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStModuleVar(thread, index, value); 6494514f5e3Sopenharmony_ci} 6504514f5e3Sopenharmony_ci 6514514f5e3Sopenharmony_civoid SlowRuntimeStub::StModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value) 6524514f5e3Sopenharmony_ci{ 6534514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StModuleVar); 6544514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope scope(thread); 6554514f5e3Sopenharmony_ci 6564514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStModuleVar(thread, key, value); 6574514f5e3Sopenharmony_ci} 6584514f5e3Sopenharmony_ci 6594514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdLocalModuleVar(JSThread *thread, int32_t index) 6604514f5e3Sopenharmony_ci{ 6614514f5e3Sopenharmony_ci RUNTIME_TRACE(thread, LdLocalModuleVarByIndex); 6624514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope scope(thread); 6634514f5e3Sopenharmony_ci 6644514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdLocalModuleVar(thread, index); 6654514f5e3Sopenharmony_ci} 6664514f5e3Sopenharmony_ci 6674514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdExternalModuleVar(JSThread *thread, int32_t index) 6684514f5e3Sopenharmony_ci{ 6694514f5e3Sopenharmony_ci RUNTIME_TRACE(thread, LdExternalModuleVarByIndex); 6704514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope scope(thread); 6714514f5e3Sopenharmony_ci 6724514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdExternalModuleVar(thread, index); 6734514f5e3Sopenharmony_ci} 6744514f5e3Sopenharmony_ci 6754514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdModuleVar(JSThread *thread, JSTaggedValue key, bool inner) 6764514f5e3Sopenharmony_ci{ 6774514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdModuleVar); 6784514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope scope(thread); 6794514f5e3Sopenharmony_ci 6804514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdModuleVar(thread, key, inner); 6814514f5e3Sopenharmony_ci} 6824514f5e3Sopenharmony_ci 6834514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateRegExpWithLiteral(JSThread *thread, JSTaggedValue pattern, uint8_t flags) 6844514f5e3Sopenharmony_ci{ 6854514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateRegExpWithLiteral); 6864514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 6874514f5e3Sopenharmony_ci 6884514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> patternHandle(thread, pattern); 6894514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateRegExpWithLiteral(thread, patternHandle, flags); 6904514f5e3Sopenharmony_ci} 6914514f5e3Sopenharmony_ci 6924514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateArrayWithBuffer(JSThread *thread, ObjectFactory *factory, JSArray *literal) 6934514f5e3Sopenharmony_ci{ 6944514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreateArrayWithBuffer); 6954514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 6964514f5e3Sopenharmony_ci 6974514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> array(thread, literal); 6984514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateArrayWithBuffer(thread, factory, array); 6994514f5e3Sopenharmony_ci} 7004514f5e3Sopenharmony_ci 7014514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetTemplateObject(JSThread *thread, JSTaggedValue literal) 7024514f5e3Sopenharmony_ci{ 7034514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, GetTemplateObject); 7044514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7054514f5e3Sopenharmony_ci 7064514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> templateLiteral(thread, literal); 7074514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetTemplateObject(thread, templateLiteral); 7084514f5e3Sopenharmony_ci} 7094514f5e3Sopenharmony_ci 7104514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetNextPropName(JSThread *thread, JSTaggedValue iter) 7114514f5e3Sopenharmony_ci{ 7124514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, GetNextPropName); 7134514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7144514f5e3Sopenharmony_ci 7154514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> iterator(thread, iter); 7164514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetNextPropName(thread, iterator); 7174514f5e3Sopenharmony_ci} 7184514f5e3Sopenharmony_ci 7194514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CopyDataProperties(JSThread *thread, JSTaggedValue dst, JSTaggedValue src) 7204514f5e3Sopenharmony_ci{ 7214514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CopyDataProperties); 7224514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7234514f5e3Sopenharmony_ci 7244514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> dstHandle(thread, dst); 7254514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> srcHandle(thread, src); 7264514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCopyDataProperties(thread, dstHandle, srcHandle); 7274514f5e3Sopenharmony_ci} 7284514f5e3Sopenharmony_ci 7294514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetIteratorNext(JSThread *thread, JSTaggedValue obj, JSTaggedValue method) 7304514f5e3Sopenharmony_ci{ 7314514f5e3Sopenharmony_ci RUNTIME_TRACE(thread, GetIteratorNext); 7324514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7334514f5e3Sopenharmony_ci 7344514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> iter(thread, obj); 7354514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> next(thread, method); 7364514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetIteratorNext(thread, iter, next); 7374514f5e3Sopenharmony_ci} 7384514f5e3Sopenharmony_ci 7394514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetUnmapedArgs(JSThread *thread, JSTaggedType *sp, uint32_t actualNumArgs, 7404514f5e3Sopenharmony_ci uint32_t startIdx) 7414514f5e3Sopenharmony_ci{ 7424514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, GetUnmapedArgs); 7434514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7444514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetUnmapedArgs(thread, sp, actualNumArgs, startIdx); 7454514f5e3Sopenharmony_ci} 7464514f5e3Sopenharmony_ci 7474514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CopyRestArgs(JSThread *thread, JSTaggedType *sp, uint32_t restNumArgs, uint32_t startIdx) 7484514f5e3Sopenharmony_ci{ 7494514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Copyrestargs); 7504514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7514514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCopyRestArgs(thread, sp, restNumArgs, startIdx); 7524514f5e3Sopenharmony_ci} 7534514f5e3Sopenharmony_ci 7544514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetIterator(JSThread *thread, JSTaggedValue obj) 7554514f5e3Sopenharmony_ci{ 7564514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, GetIterator); 7574514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7584514f5e3Sopenharmony_ci 7594514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 7604514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetIterator(thread, objHandle); 7614514f5e3Sopenharmony_ci} 7624514f5e3Sopenharmony_ci 7634514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetAsyncIterator(JSThread *thread, JSTaggedValue obj) 7644514f5e3Sopenharmony_ci{ 7654514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, GetAsyncIterator); 7664514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7674514f5e3Sopenharmony_ci 7684514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 7694514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetAsyncIterator(thread, objHandle); 7704514f5e3Sopenharmony_ci} 7714514f5e3Sopenharmony_ci 7724514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::DefineGetterSetterByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, 7734514f5e3Sopenharmony_ci JSTaggedValue getter, JSTaggedValue setter, bool flag) 7744514f5e3Sopenharmony_ci{ 7754514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, DefineGetterSetterByValue); 7764514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7774514f5e3Sopenharmony_ci 7784514f5e3Sopenharmony_ci JSHandle<JSObject> objHandle(thread, obj); 7794514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 7804514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> getterHandle(thread, getter); 7814514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> setterHandle(thread, setter); 7824514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> func(thread, JSTaggedValue::Undefined()); 7834514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeDefineGetterSetterByValue(thread, objHandle, propHandle, 7844514f5e3Sopenharmony_ci getterHandle, setterHandle, flag, 7854514f5e3Sopenharmony_ci func, 0); 7864514f5e3Sopenharmony_ci} 7874514f5e3Sopenharmony_ci 7884514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdObjByIndex(JSThread *thread, JSTaggedValue obj, uint32_t idx, bool callGetter, 7894514f5e3Sopenharmony_ci JSTaggedValue receiver) 7904514f5e3Sopenharmony_ci{ 7914514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdObjByIndex); 7924514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 7934514f5e3Sopenharmony_ci 7944514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 7954514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdObjByIndex(thread, objHandle, idx, callGetter, receiver); 7964514f5e3Sopenharmony_ci} 7974514f5e3Sopenharmony_ci 7984514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StObjByIndex(JSThread *thread, JSTaggedValue obj, uint32_t idx, JSTaggedValue value) 7994514f5e3Sopenharmony_ci{ 8004514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StObjByIndex); 8014514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 8024514f5e3Sopenharmony_ci 8034514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 8044514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 8054514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStObjByIndex(thread, objHandle, idx, valueHandle); 8064514f5e3Sopenharmony_ci} 8074514f5e3Sopenharmony_ci 8084514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, bool callGetter, 8094514f5e3Sopenharmony_ci JSTaggedValue receiver) 8104514f5e3Sopenharmony_ci{ 8114514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdObjByName); 8124514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 8134514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdObjByName(thread, obj, prop, callGetter, receiver); 8144514f5e3Sopenharmony_ci} 8154514f5e3Sopenharmony_ci 8164514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, JSTaggedValue value) 8174514f5e3Sopenharmony_ci{ 8184514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StObjByName); 8194514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 8204514f5e3Sopenharmony_ci 8214514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 8224514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 8234514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 8244514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStObjByName(thread, objHandle, propHandle, valueHandle); 8254514f5e3Sopenharmony_ci} 8264514f5e3Sopenharmony_ci 8274514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdObjByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, bool callGetter, 8284514f5e3Sopenharmony_ci JSTaggedValue receiver) 8294514f5e3Sopenharmony_ci{ 8304514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdObjByValue); 8314514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 8324514f5e3Sopenharmony_ci 8334514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 8344514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 8354514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdObjByValue(thread, objHandle, propHandle, callGetter, receiver); 8364514f5e3Sopenharmony_ci} 8374514f5e3Sopenharmony_ci 8384514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StObjByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, 8394514f5e3Sopenharmony_ci JSTaggedValue value) 8404514f5e3Sopenharmony_ci{ 8414514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StObjByValue); 8424514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 8434514f5e3Sopenharmony_ci 8444514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 8454514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 8464514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 8474514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStObjByValue(thread, objHandle, propHandle, valueHandle); 8484514f5e3Sopenharmony_ci} 8494514f5e3Sopenharmony_ci 8504514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::TryLdGlobalByNameFromGlobalProto(JSThread *thread, JSTaggedValue global, 8514514f5e3Sopenharmony_ci JSTaggedValue prop) 8524514f5e3Sopenharmony_ci{ 8534514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, Trygetobjprop); 8544514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 8554514f5e3Sopenharmony_ci 8564514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> obj(thread, global.GetTaggedObject()->GetClass()->GetPrototype()); 8574514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 8584514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeTryLdGlobalByName(thread, obj, propHandle); 8594514f5e3Sopenharmony_ci} 8604514f5e3Sopenharmony_ci 8614514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::TryStGlobalByName(JSThread *thread, JSTaggedValue prop) 8624514f5e3Sopenharmony_ci{ 8634514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, TryStGlobalByName); 8644514f5e3Sopenharmony_ci // If fast path is fail, not need slow path, just throw error. 8654514f5e3Sopenharmony_ci return ThrowReferenceError(thread, prop, " is not defined"); 8664514f5e3Sopenharmony_ci} 8674514f5e3Sopenharmony_ci 8684514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdGlobalVarFromGlobalProto(JSThread *thread, JSTaggedValue global, JSTaggedValue prop) 8694514f5e3Sopenharmony_ci{ 8704514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdGlobalVar); 8714514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 8724514f5e3Sopenharmony_ci 8734514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, global); 8744514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 8754514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdGlobalVarFromProto(thread, objHandle, propHandle); // After checked global itself. 8764514f5e3Sopenharmony_ci} 8774514f5e3Sopenharmony_ci 8784514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StGlobalVar(JSThread *thread, JSTaggedValue prop, JSTaggedValue value) 8794514f5e3Sopenharmony_ci{ 8804514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StGlobalVar); 8814514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 8824514f5e3Sopenharmony_ci 8834514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 8844514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 8854514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStGlobalVar(thread, propHandle, valueHandle); 8864514f5e3Sopenharmony_ci} 8874514f5e3Sopenharmony_ci 8884514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::TryUpdateGlobalRecord(JSThread *thread, JSTaggedValue prop, JSTaggedValue value) 8894514f5e3Sopenharmony_ci{ 8904514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, TryUpdateGlobalRecord); 8914514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 8924514f5e3Sopenharmony_ci 8934514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeTryUpdateGlobalRecord(thread, prop, value); 8944514f5e3Sopenharmony_ci} 8954514f5e3Sopenharmony_ci 8964514f5e3Sopenharmony_ci// return box 8974514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdGlobalRecord(JSThread *thread, JSTaggedValue key) 8984514f5e3Sopenharmony_ci{ 8994514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdGlobalRecord); 9004514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 9014514f5e3Sopenharmony_ci 9024514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdGlobalRecord(thread, key); 9034514f5e3Sopenharmony_ci} 9044514f5e3Sopenharmony_ci 9054514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StGlobalRecord(JSThread *thread, JSTaggedValue prop, JSTaggedValue value, bool isConst) 9064514f5e3Sopenharmony_ci{ 9074514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StGlobalRecord); 9084514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 9094514f5e3Sopenharmony_ci 9104514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 9114514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 9124514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStGlobalRecord(thread, propHandle, valueHandle, isConst); 9134514f5e3Sopenharmony_ci} 9144514f5e3Sopenharmony_ci 9154514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::ThrowReferenceError(JSThread *thread, JSTaggedValue prop, const char *desc) 9164514f5e3Sopenharmony_ci{ 9174514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowReferenceError); 9184514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 9194514f5e3Sopenharmony_ci 9204514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, prop); 9214514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeThrowReferenceError(thread, propHandle, desc); 9224514f5e3Sopenharmony_ci} 9234514f5e3Sopenharmony_ci 9244514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::ThrowTypeError(JSThread *thread, const char *message) 9254514f5e3Sopenharmony_ci{ 9264514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowTypeError); 9274514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 9284514f5e3Sopenharmony_ci 9294514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeThrowTypeError(thread, message); 9304514f5e3Sopenharmony_ci} 9314514f5e3Sopenharmony_ci 9324514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::ThrowSyntaxError(JSThread *thread, const char *message) 9334514f5e3Sopenharmony_ci{ 9344514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowSyntaxError); 9354514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 9364514f5e3Sopenharmony_ci 9374514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeThrowSyntaxError(thread, message); 9384514f5e3Sopenharmony_ci} 9394514f5e3Sopenharmony_ci 9404514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StArraySpread(JSThread *thread, JSTaggedValue dst, JSTaggedValue index, 9414514f5e3Sopenharmony_ci JSTaggedValue src) 9424514f5e3Sopenharmony_ci{ 9434514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StArraySpread); 9444514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 9454514f5e3Sopenharmony_ci 9464514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> dstHandle(thread, dst); 9474514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> srcHandle(thread, src); 9484514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStArraySpread(thread, dstHandle, index, srcHandle); 9494514f5e3Sopenharmony_ci} 9504514f5e3Sopenharmony_ci 9514514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::DefineFunc(JSThread *thread, JSTaggedValue constPool, uint16_t methodId, 9524514f5e3Sopenharmony_ci JSTaggedValue module, uint16_t length, JSTaggedValue env, 9534514f5e3Sopenharmony_ci JSTaggedValue homeObject) 9544514f5e3Sopenharmony_ci{ 9554514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, DefineFunc); 9564514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 9574514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> constpoolHandle(thread, constPool); 9584514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> moduleHandle(thread, module); 9594514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> envHandle(thread, env); 9604514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> homeObjectHandle(thread, homeObject); 9614514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeDefinefunc(thread, constpoolHandle, methodId, moduleHandle, 9624514f5e3Sopenharmony_ci length, envHandle, homeObjectHandle); 9634514f5e3Sopenharmony_ci} 9644514f5e3Sopenharmony_ci 9654514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetSuperConstructor(JSThread *thread, JSTaggedValue ctor) 9664514f5e3Sopenharmony_ci{ 9674514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, GetSuperConstructor); 9684514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> ctorHandle(thread, ctor); 9694514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> superConstructor(thread, JSTaggedValue::GetPrototype(thread, ctorHandle)); 9704514f5e3Sopenharmony_ci RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); 9714514f5e3Sopenharmony_ci return superConstructor.GetTaggedValue(); 9724514f5e3Sopenharmony_ci} 9734514f5e3Sopenharmony_ci 9744514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::SuperCall(JSThread *thread, JSTaggedValue func, JSTaggedValue newTarget, 9754514f5e3Sopenharmony_ci uint16_t firstVRegIdx, uint16_t length) 9764514f5e3Sopenharmony_ci{ 9774514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, SuperCall); 9784514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 9794514f5e3Sopenharmony_ci 9804514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> funcHandle(thread, func); 9814514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); 9824514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeSuperCall(thread, funcHandle, newTargetHandle, firstVRegIdx, length); 9834514f5e3Sopenharmony_ci} 9844514f5e3Sopenharmony_ci 9854514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::DynamicImport(JSThread *thread, JSTaggedValue specifier, JSTaggedValue currentFunc) 9864514f5e3Sopenharmony_ci{ 9874514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, DynamicImport); 9884514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 9894514f5e3Sopenharmony_ci 9904514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> specifierHandle(thread, specifier); 9914514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> currentFuncHandle(thread, currentFunc); 9924514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeDynamicImport(thread, specifierHandle, currentFuncHandle); 9934514f5e3Sopenharmony_ci} 9944514f5e3Sopenharmony_ci 9954514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::SuperCallSpread(JSThread *thread, JSTaggedValue func, JSTaggedValue newTarget, 9964514f5e3Sopenharmony_ci JSTaggedValue array) 9974514f5e3Sopenharmony_ci{ 9984514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, SuperCallSpread); 9994514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 10004514f5e3Sopenharmony_ci 10014514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> funcHandle(thread, func); 10024514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); 10034514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> jsArray(thread, array); 10044514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeSuperCallSpread(thread, funcHandle, newTargetHandle, jsArray); 10054514f5e3Sopenharmony_ci} 10064514f5e3Sopenharmony_ci 10074514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::SuperCallForwardAllArgs(JSThread *thread, JSTaggedType *sp, JSTaggedValue func, 10084514f5e3Sopenharmony_ci JSTaggedValue newTarget, uint32_t restNumArgs, uint32_t startIdx) 10094514f5e3Sopenharmony_ci{ 10104514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> superFunc(thread, GetSuperConstructor(thread, func)); 10114514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> newTargetHandle(thread, newTarget); 10124514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeSuperCallForwardAllArgs(thread, sp, superFunc, newTargetHandle, restNumArgs, startIdx); 10134514f5e3Sopenharmony_ci} 10144514f5e3Sopenharmony_ci 10154514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::DefineMethod(JSThread *thread, Method *method, JSTaggedValue homeObject, 10164514f5e3Sopenharmony_ci uint16_t length, JSTaggedValue env, JSTaggedValue module) 10174514f5e3Sopenharmony_ci{ 10184514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, DefineMethod); 10194514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 10204514f5e3Sopenharmony_ci JSHandle<Method> methodHandle(thread, method); 10214514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> homeObjectHandle(thread, homeObject); 10224514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> envHandle(thread, env); 10234514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> moduleHandle(thread, module); 10244514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeDefineMethod(thread, methodHandle, homeObjectHandle, length, envHandle, moduleHandle); 10254514f5e3Sopenharmony_ci} 10264514f5e3Sopenharmony_ci 10274514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdSendableClass(JSThread *thread, JSTaggedValue env, uint16_t level) 10284514f5e3Sopenharmony_ci{ 10294514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdSendableClass); 10304514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 10314514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> envHandle(thread, env); 10324514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdSendableClass(envHandle, level); 10334514f5e3Sopenharmony_ci} 10344514f5e3Sopenharmony_ci 10354514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdSendableExternalModuleVar(JSThread *thread, int32_t index, JSTaggedValue thisFunc) 10364514f5e3Sopenharmony_ci{ 10374514f5e3Sopenharmony_ci RUNTIME_TRACE(thread, LdSendableExternalModuleVarByIndex); 10384514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope scope(thread); 10394514f5e3Sopenharmony_ci 10404514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdSendableExternalModuleVar(thread, index, thisFunc); 10414514f5e3Sopenharmony_ci} 10424514f5e3Sopenharmony_ci 10434514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdLazyExternalModuleVar(JSThread *thread, int32_t index, JSTaggedValue thisFunc) 10444514f5e3Sopenharmony_ci{ 10454514f5e3Sopenharmony_ci RUNTIME_TRACE(thread, LdLazyExternalModuleVarByIndex); 10464514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope scope(thread); 10474514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdLazyExternalModuleVar(thread, index, thisFunc); 10484514f5e3Sopenharmony_ci} 10494514f5e3Sopenharmony_ci 10504514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdLazySendableExternalModuleVar(JSThread *thread, int32_t index, JSTaggedValue thisFunc) 10514514f5e3Sopenharmony_ci{ 10524514f5e3Sopenharmony_ci RUNTIME_TRACE(thread, LdLazySendableExternalModuleVarByIndex); 10534514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope scope(thread); 10544514f5e3Sopenharmony_ci 10554514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdLazySendableExternalModuleVar(thread, index, thisFunc); 10564514f5e3Sopenharmony_ci} 10574514f5e3Sopenharmony_ci 10584514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdSuperByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue key, 10594514f5e3Sopenharmony_ci JSTaggedValue thisFunc) 10604514f5e3Sopenharmony_ci{ 10614514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdSuperByValue); 10624514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 10634514f5e3Sopenharmony_ci 10644514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 10654514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, key); 10664514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdSuperByValue(thread, objHandle, propHandle, thisFunc); 10674514f5e3Sopenharmony_ci} 10684514f5e3Sopenharmony_ci 10694514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StSuperByValue(JSThread *thread, JSTaggedValue obj, JSTaggedValue key, 10704514f5e3Sopenharmony_ci JSTaggedValue value, JSTaggedValue thisFunc) 10714514f5e3Sopenharmony_ci{ 10724514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StSuperByValue); 10734514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 10744514f5e3Sopenharmony_ci 10754514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> objHandle(thread, obj); 10764514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> propHandle(thread, key); 10774514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 10784514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStSuperByValue(thread, objHandle, propHandle, valueHandle, thisFunc); 10794514f5e3Sopenharmony_ci} 10804514f5e3Sopenharmony_ci 10814514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetCallSpreadArgs(JSThread *thread, JSTaggedValue array) 10824514f5e3Sopenharmony_ci{ 10834514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, GetCallSpreadArgs); 10844514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 10854514f5e3Sopenharmony_ci 10864514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> jsArray(thread, array); 10874514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetCallSpreadArgs(thread, jsArray); 10884514f5e3Sopenharmony_ci} 10894514f5e3Sopenharmony_ci 10904514f5e3Sopenharmony_civoid SlowRuntimeStub::ThrowDeleteSuperProperty(JSThread *thread) 10914514f5e3Sopenharmony_ci{ 10924514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, ThrowDeleteSuperProperty); 10934514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 10944514f5e3Sopenharmony_ci 10954514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeThrowDeleteSuperProperty(thread); 10964514f5e3Sopenharmony_ci} 10974514f5e3Sopenharmony_ci 10984514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::NotifyInlineCache(JSThread *thread, JSFunction *function) 10994514f5e3Sopenharmony_ci{ 11004514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, NotifyInlineCache); 11014514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 11024514f5e3Sopenharmony_ci 11034514f5e3Sopenharmony_ci JSHandle<JSFunction> functionHandle(thread, function); 11044514f5e3Sopenharmony_ci uint32_t slotSize = functionHandle->GetCallTarget()->GetSlotSize(); 11054514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNotifyInlineCache(thread, functionHandle, slotSize); 11064514f5e3Sopenharmony_ci} 11074514f5e3Sopenharmony_ci 11084514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::ResolveClass(JSThread *thread, JSTaggedValue ctor, TaggedArray *literal, 11094514f5e3Sopenharmony_ci JSTaggedValue base, JSTaggedValue lexenv) 11104514f5e3Sopenharmony_ci{ 11114514f5e3Sopenharmony_ci JSHandle<JSFunction> cls(thread, ctor); 11124514f5e3Sopenharmony_ci JSHandle<TaggedArray> literalBuffer(thread, literal); 11134514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> baseHandle(thread, base); 11144514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> lexicalEnv(thread, lexenv); 11154514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeResolveClass(thread, cls, literalBuffer, baseHandle, lexicalEnv); 11164514f5e3Sopenharmony_ci} 11174514f5e3Sopenharmony_ci 11184514f5e3Sopenharmony_ci// clone class may need re-set inheritance relationship due to extends may be a variable. 11194514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CloneClassFromTemplate(JSThread *thread, JSTaggedValue ctor, JSTaggedValue base, 11204514f5e3Sopenharmony_ci JSTaggedValue lexenv) 11214514f5e3Sopenharmony_ci{ 11224514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 11234514f5e3Sopenharmony_ci 11244514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> lexenvHandle(thread, lexenv); 11254514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> baseHandle(thread, base); 11264514f5e3Sopenharmony_ci JSHandle<JSFunction> cls(thread, ctor); 11274514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCloneClassFromTemplate(thread, cls, baseHandle, lexenvHandle); 11284514f5e3Sopenharmony_ci} 11294514f5e3Sopenharmony_ci 11304514f5e3Sopenharmony_ci// clone class may need re-set inheritance relationship due to extends may be a variable. 11314514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateClassWithBuffer(JSThread *thread, JSTaggedValue base, 11324514f5e3Sopenharmony_ci JSTaggedValue lexenv, JSTaggedValue constpool, 11334514f5e3Sopenharmony_ci uint16_t methodId, uint16_t literalId, JSTaggedValue module, 11344514f5e3Sopenharmony_ci JSTaggedValue length) 11354514f5e3Sopenharmony_ci{ 11364514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 11374514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> baseHandle(thread, base); 11384514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> lexenvHandle(thread, lexenv); 11394514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> constpoolHandle(thread, constpool); 11404514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> moduleHandle(thread, module); 11414514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> lengthHandle(thread, length); 11424514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateClassWithBuffer(thread, baseHandle, lexenvHandle, 11434514f5e3Sopenharmony_ci constpoolHandle, methodId, literalId, 11444514f5e3Sopenharmony_ci moduleHandle, lengthHandle); 11454514f5e3Sopenharmony_ci} 11464514f5e3Sopenharmony_ci 11474514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreateSharedClass(JSThread *thread, JSTaggedValue base, 11484514f5e3Sopenharmony_ci JSTaggedValue constpool, uint16_t methodId, uint16_t literalId, 11494514f5e3Sopenharmony_ci uint16_t length, JSTaggedValue module) 11504514f5e3Sopenharmony_ci{ 11514514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 11524514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> baseHandle(thread, base); 11534514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> constpoolHandle(thread, constpool); 11544514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> moduleHandle(thread, module); 11554514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreateSharedClass(thread, baseHandle, constpoolHandle, methodId, 11564514f5e3Sopenharmony_ci literalId, length, moduleHandle); 11574514f5e3Sopenharmony_ci} 11584514f5e3Sopenharmony_ci 11594514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::SetClassInheritanceRelationship(JSThread *thread, JSTaggedValue ctor, JSTaggedValue base) 11604514f5e3Sopenharmony_ci{ 11614514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 11624514f5e3Sopenharmony_ci 11634514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> cls(thread, ctor); 11644514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> parent(thread, base); 11654514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeSetClassInheritanceRelationship(thread, cls, parent); 11664514f5e3Sopenharmony_ci} 11674514f5e3Sopenharmony_ci 11684514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::SetClassConstructorLength(JSThread *thread, JSTaggedValue ctor, JSTaggedValue length) 11694514f5e3Sopenharmony_ci{ 11704514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeSetClassConstructorLength(thread, ctor, length); 11714514f5e3Sopenharmony_ci} 11724514f5e3Sopenharmony_ci 11734514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetModuleNamespace(JSThread *thread, int32_t index) 11744514f5e3Sopenharmony_ci{ 11754514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetModuleNamespace(thread, index); 11764514f5e3Sopenharmony_ci} 11774514f5e3Sopenharmony_ci 11784514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::GetModuleNamespace(JSThread *thread, JSTaggedValue localName) 11794514f5e3Sopenharmony_ci{ 11804514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeGetModuleNamespace(thread, localName); 11814514f5e3Sopenharmony_ci} 11824514f5e3Sopenharmony_ci 11834514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdBigInt(JSThread *thread, JSTaggedValue numberBigInt) 11844514f5e3Sopenharmony_ci{ 11854514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdBigInt); 11864514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 11874514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> bigint(thread, numberBigInt); 11884514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdBigInt(thread, bigint); 11894514f5e3Sopenharmony_ci} 11904514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::AsyncGeneratorResolve(JSThread *thread, JSTaggedValue asyncFuncObj, 11914514f5e3Sopenharmony_ci const JSTaggedValue value, JSTaggedValue flag) 11924514f5e3Sopenharmony_ci{ 11934514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, AsyncGeneratorResolve); 11944514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 11954514f5e3Sopenharmony_ci 11964514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> genObjHandle(thread, asyncFuncObj); 11974514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 11984514f5e3Sopenharmony_ci 11994514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeAsyncGeneratorResolve(thread, genObjHandle, valueHandle, flag); 12004514f5e3Sopenharmony_ci} 12014514f5e3Sopenharmony_ci 12024514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::AsyncGeneratorReject(JSThread *thread, JSTaggedValue asyncFuncObj, 12034514f5e3Sopenharmony_ci const JSTaggedValue value) 12044514f5e3Sopenharmony_ci{ 12054514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, AsyncGeneratorReject); 12064514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 12074514f5e3Sopenharmony_ci 12084514f5e3Sopenharmony_ci JSHandle<JSAsyncGeneratorObject> asyncFuncObjHandle(thread, asyncFuncObj); 12094514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 12104514f5e3Sopenharmony_ci 12114514f5e3Sopenharmony_ci return JSAsyncGeneratorObject::AsyncGeneratorReject(thread, asyncFuncObjHandle, valueHandle); 12124514f5e3Sopenharmony_ci} 12134514f5e3Sopenharmony_ci 12144514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdPatchVar(JSThread *thread, uint32_t index) 12154514f5e3Sopenharmony_ci{ 12164514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdPatchVar); 12174514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 12184514f5e3Sopenharmony_ci 12194514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdPatchVar(thread, index); 12204514f5e3Sopenharmony_ci} 12214514f5e3Sopenharmony_ci 12224514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StPatchVar(JSThread *thread, uint32_t index, JSTaggedValue value) 12234514f5e3Sopenharmony_ci{ 12244514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StPatchVar); 12254514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 12264514f5e3Sopenharmony_ci 12274514f5e3Sopenharmony_ci JSHandle<JSTaggedValue> valueHandle(thread, value); 12284514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStPatchVar(thread, index, valueHandle); 12294514f5e3Sopenharmony_ci} 12304514f5e3Sopenharmony_ci 12314514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::NotifyConcurrentResult(JSThread *thread, JSTaggedValue result, JSTaggedValue hint) 12324514f5e3Sopenharmony_ci{ 12334514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, NotifyConcurrentResult); 12344514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeNotifyConcurrentResult(thread, result, hint); 12354514f5e3Sopenharmony_ci} 12364514f5e3Sopenharmony_ci 12374514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::UpdateAOTHClass(JSThread *thread, JSTaggedValue jshclass, 12384514f5e3Sopenharmony_ci JSTaggedValue newjshclass, JSTaggedValue key) 12394514f5e3Sopenharmony_ci{ 12404514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, UpdateAOTHClass); 12414514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 12424514f5e3Sopenharmony_ci JSHandle<JSHClass> oldhclass(thread, jshclass); 12434514f5e3Sopenharmony_ci JSHandle<JSHClass> newhclass(thread, newjshclass); 12444514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeUpdateAOTHClass(thread, oldhclass, newhclass, key); 12454514f5e3Sopenharmony_ci} 12464514f5e3Sopenharmony_ci 12474514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::DefineField(JSThread *thread, JSTaggedValue obj, 12484514f5e3Sopenharmony_ci JSTaggedValue propKey, JSTaggedValue value) 12494514f5e3Sopenharmony_ci{ 12504514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, DefineField); 12514514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeDefineField(thread, obj, propKey, value); 12524514f5e3Sopenharmony_ci} 12534514f5e3Sopenharmony_ci 12544514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::CreatePrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, 12554514f5e3Sopenharmony_ci uint32_t count, JSTaggedValue constpool, uint32_t literalId, JSTaggedValue module) 12564514f5e3Sopenharmony_ci{ 12574514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, CreatePrivateProperty); 12584514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeCreatePrivateProperty(thread, lexicalEnv, count, constpool, literalId, module); 12594514f5e3Sopenharmony_ci} 12604514f5e3Sopenharmony_ci 12614514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::DefinePrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, 12624514f5e3Sopenharmony_ci uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj, JSTaggedValue value) 12634514f5e3Sopenharmony_ci{ 12644514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, DefinePrivateProperty); 12654514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeDefinePrivateProperty(thread, lexicalEnv, levelIndex, slotIndex, obj, value); 12664514f5e3Sopenharmony_ci} 12674514f5e3Sopenharmony_ci 12684514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::LdPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, 12694514f5e3Sopenharmony_ci uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj) 12704514f5e3Sopenharmony_ci{ 12714514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, LdPrivateProperty); 12724514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 12734514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeLdPrivateProperty(thread, lexicalEnv, levelIndex, slotIndex, obj); 12744514f5e3Sopenharmony_ci} 12754514f5e3Sopenharmony_ci 12764514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::StPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, 12774514f5e3Sopenharmony_ci uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj, JSTaggedValue value) 12784514f5e3Sopenharmony_ci{ 12794514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, StPrivateProperty); 12804514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 12814514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeStPrivateProperty(thread, lexicalEnv, levelIndex, slotIndex, obj, value); 12824514f5e3Sopenharmony_ci} 12834514f5e3Sopenharmony_ci 12844514f5e3Sopenharmony_ciJSTaggedValue SlowRuntimeStub::TestIn(JSThread *thread, JSTaggedValue lexicalEnv, 12854514f5e3Sopenharmony_ci uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj) 12864514f5e3Sopenharmony_ci{ 12874514f5e3Sopenharmony_ci INTERPRETER_TRACE(thread, TestIn); 12884514f5e3Sopenharmony_ci [[maybe_unused]] EcmaHandleScope handleScope(thread); 12894514f5e3Sopenharmony_ci return RuntimeStubs::RuntimeTestIn(thread, lexicalEnv, levelIndex, slotIndex, obj); 12904514f5e3Sopenharmony_ci} 12914514f5e3Sopenharmony_ci} // namespace panda::ecmascript 1292