14514f5e3Sopenharmony_ci/*
24514f5e3Sopenharmony_ci * Copyright (c) 2024 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_COMPILER_BASELINE_BASELINE_STUB_BUILDER_H
174514f5e3Sopenharmony_ci#define ECMASCRIPT_COMPILER_BASELINE_BASELINE_STUB_BUILDER_H
184514f5e3Sopenharmony_ci
194514f5e3Sopenharmony_ci#include "ecmascript/compiler/stub_builder.h"
204514f5e3Sopenharmony_ci#include "ecmascript/base/config.h"
214514f5e3Sopenharmony_ci#include "ecmascript/compiler/bc_call_signature.h"
224514f5e3Sopenharmony_ci#include "ecmascript/compiler/profiler_operation.h"
234514f5e3Sopenharmony_ci#include "ecmascript/compiler/rt_call_signature.h"
244514f5e3Sopenharmony_ci#include "ecmascript/compiler/circuit_builder_helper.h"
254514f5e3Sopenharmony_ci
264514f5e3Sopenharmony_cinamespace panda::ecmascript::kungfu {
274514f5e3Sopenharmony_ci
284514f5e3Sopenharmony_ciclass BaselineStubBuilder : public StubBuilder {
294514f5e3Sopenharmony_cipublic:
304514f5e3Sopenharmony_ci    static_assert(false);
314514f5e3Sopenharmony_ci    BaselineStubBuilder(CallSignature *callSignature, Environment *env)
324514f5e3Sopenharmony_ci        : StubBuilder(callSignature, env) {}
334514f5e3Sopenharmony_ci    ~BaselineStubBuilder() override = default;
344514f5e3Sopenharmony_ci    NO_MOVE_SEMANTIC(BaselineStubBuilder);
354514f5e3Sopenharmony_ci    NO_COPY_SEMANTIC(BaselineStubBuilder);
364514f5e3Sopenharmony_ci    virtual void GenerateCircuit() override = 0;
374514f5e3Sopenharmony_ci
384514f5e3Sopenharmony_ci    inline void SetEnvToFrame(GateRef glue, GateRef frame, GateRef value)
394514f5e3Sopenharmony_ci    {
404514f5e3Sopenharmony_ci        Store(VariableType::INT64(), glue, frame,
414514f5e3Sopenharmony_ci            IntPtr(AsmInterpretedFrame::GetEnvOffset(GetEnvironment()->IsArch32Bit())), value);
424514f5e3Sopenharmony_ci    }
434514f5e3Sopenharmony_ci
444514f5e3Sopenharmony_ci    void CheckExceptionWithVar(GateRef acc, GateRef res)
454514f5e3Sopenharmony_ci    {
464514f5e3Sopenharmony_ci        auto env = GetEnvironment();
474514f5e3Sopenharmony_ci        Label isException(env);
484514f5e3Sopenharmony_ci        Label notException(env);
494514f5e3Sopenharmony_ci        Branch(TaggedIsException(res), &isException, &notException);
504514f5e3Sopenharmony_ci        Bind(&isException);
514514f5e3Sopenharmony_ci        {
524514f5e3Sopenharmony_ci            Return();
534514f5e3Sopenharmony_ci        }
544514f5e3Sopenharmony_ci        Bind(&notException);
554514f5e3Sopenharmony_ci        {
564514f5e3Sopenharmony_ci            DEFVARIABLE(varAcc, VariableType::JS_ANY(), acc);
574514f5e3Sopenharmony_ci            varAcc = res;
584514f5e3Sopenharmony_ci            Return();
594514f5e3Sopenharmony_ci        }
604514f5e3Sopenharmony_ci    }
614514f5e3Sopenharmony_ci
624514f5e3Sopenharmony_ci    void CheckException(GateRef acc, GateRef res)
634514f5e3Sopenharmony_ci    {
644514f5e3Sopenharmony_ci        auto env = GetEnvironment();
654514f5e3Sopenharmony_ci        Label isException(env);
664514f5e3Sopenharmony_ci        Label notException(env);
674514f5e3Sopenharmony_ci        Branch(TaggedIsException(res), &isException, &notException);
684514f5e3Sopenharmony_ci        Bind(&isException);
694514f5e3Sopenharmony_ci        {
704514f5e3Sopenharmony_ci            (void) acc;
714514f5e3Sopenharmony_ci            Return();
724514f5e3Sopenharmony_ci        }
734514f5e3Sopenharmony_ci        Bind(&notException);
744514f5e3Sopenharmony_ci        {
754514f5e3Sopenharmony_ci            Return();
764514f5e3Sopenharmony_ci        }
774514f5e3Sopenharmony_ci    }
784514f5e3Sopenharmony_ci
794514f5e3Sopenharmony_ci    void CheckExceptionWithJump(GateRef acc, GateRef res, Label *jump)
804514f5e3Sopenharmony_ci    {
814514f5e3Sopenharmony_ci        auto env = GetEnvironment();
824514f5e3Sopenharmony_ci        Label isException(env);
834514f5e3Sopenharmony_ci        Label notException(env);
844514f5e3Sopenharmony_ci        Branch(TaggedIsException(res), &isException, &notException);
854514f5e3Sopenharmony_ci        Bind(&isException);
864514f5e3Sopenharmony_ci        {
874514f5e3Sopenharmony_ci            Return(acc);
884514f5e3Sopenharmony_ci        }
894514f5e3Sopenharmony_ci        Bind(&notException);
904514f5e3Sopenharmony_ci        {
914514f5e3Sopenharmony_ci            Jump(jump);
924514f5e3Sopenharmony_ci        }
934514f5e3Sopenharmony_ci    }
944514f5e3Sopenharmony_ci
954514f5e3Sopenharmony_ci    void CheckPendingException(GateRef glue, GateRef res, GateRef offset)
964514f5e3Sopenharmony_ci    {
974514f5e3Sopenharmony_ci        (void)offset;
984514f5e3Sopenharmony_ci        auto env = GetEnvironment();
994514f5e3Sopenharmony_ci        Label isException(env);
1004514f5e3Sopenharmony_ci        Label notException(env);
1014514f5e3Sopenharmony_ci        Branch(HasPendingException(glue), &isException, &notException);
1024514f5e3Sopenharmony_ci        Bind(&isException);
1034514f5e3Sopenharmony_ci        {
1044514f5e3Sopenharmony_ci            Return();
1054514f5e3Sopenharmony_ci        }
1064514f5e3Sopenharmony_ci        Bind(&notException);
1074514f5e3Sopenharmony_ci        {
1084514f5e3Sopenharmony_ci            (void)res;
1094514f5e3Sopenharmony_ci            Return();
1104514f5e3Sopenharmony_ci        }
1114514f5e3Sopenharmony_ci    }
1124514f5e3Sopenharmony_ci
1134514f5e3Sopenharmony_ci    template<typename... Args>
1144514f5e3Sopenharmony_ci    void DispatchBase(GateRef target, GateRef glue, Args... args)
1154514f5e3Sopenharmony_ci    {
1164514f5e3Sopenharmony_ci        GetEnvironment()->GetBuilder()->CallBCHandler(glue, target, {glue, args...});
1174514f5e3Sopenharmony_ci    }
1184514f5e3Sopenharmony_ci
1194514f5e3Sopenharmony_ci    inline void DispatchLast(GateRef glue, GateRef sp, GateRef pc, GateRef constpool,
1204514f5e3Sopenharmony_ci                             GateRef profileTypeInfo, GateRef acc, GateRef hotnessCounter)
1214514f5e3Sopenharmony_ci    {
1224514f5e3Sopenharmony_ci        GateRef target = PtrMul(IntPtr(BytecodeStubCSigns::ID_ExceptionHandler), IntPtrSize());
1234514f5e3Sopenharmony_ci        DispatchBase(target, glue, sp, pc, constpool, profileTypeInfo, acc, hotnessCounter);
1244514f5e3Sopenharmony_ci        Return();
1254514f5e3Sopenharmony_ci    }
1264514f5e3Sopenharmony_ci
1274514f5e3Sopenharmony_ci    void Dispatch(GateRef glue, GateRef sp, GateRef pc, GateRef constpool, GateRef profileTypeInfo,
1284514f5e3Sopenharmony_ci                  GateRef acc, GateRef hotnessCounter, GateRef format)
1294514f5e3Sopenharmony_ci    {
1304514f5e3Sopenharmony_ci        GateRef newPc = PtrAdd(pc, format);
1314514f5e3Sopenharmony_ci        GateRef opcode = Load(VariableType::INT8(), newPc);
1324514f5e3Sopenharmony_ci        GateRef target = PtrMul(ZExtInt32ToPtr(ZExtInt8ToInt32(opcode)), IntPtrSize());
1334514f5e3Sopenharmony_ci        DispatchBase(target, glue, sp, newPc, constpool, profileTypeInfo, acc, hotnessCounter);
1344514f5e3Sopenharmony_ci        Return();
1354514f5e3Sopenharmony_ci    }
1364514f5e3Sopenharmony_ci
1374514f5e3Sopenharmony_ci    inline GateRef GetFunctionFromFrame(GateRef frame)
1384514f5e3Sopenharmony_ci    {
1394514f5e3Sopenharmony_ci        return Load(VariableType::JS_POINTER(), frame,
1404514f5e3Sopenharmony_ci            IntPtr(AsmInterpretedFrame::GetFunctionOffset(GetEnvironment()->IsArch32Bit())));
1414514f5e3Sopenharmony_ci    }
1424514f5e3Sopenharmony_ci
1434514f5e3Sopenharmony_ci    inline GateRef GetEnvFromFrame(GateRef frame)
1444514f5e3Sopenharmony_ci    {
1454514f5e3Sopenharmony_ci        return Load(VariableType::JS_POINTER(), frame,
1464514f5e3Sopenharmony_ci            IntPtr(AsmInterpretedFrame::GetEnvOffset(GetEnvironment()->IsArch32Bit())));
1474514f5e3Sopenharmony_ci    }
1484514f5e3Sopenharmony_ci
1494514f5e3Sopenharmony_ci    inline GateRef GetAccFromFrame(GateRef frame)
1504514f5e3Sopenharmony_ci    {
1514514f5e3Sopenharmony_ci        return Load(VariableType::JS_ANY(), frame,
1524514f5e3Sopenharmony_ci            IntPtr(AsmInterpretedFrame::GetAccOffset(GetEnvironment()->IsArch32Bit())));
1534514f5e3Sopenharmony_ci    }
1544514f5e3Sopenharmony_ci
1554514f5e3Sopenharmony_ci    inline GateRef GetConstpoolFromMethod(GateRef method)
1564514f5e3Sopenharmony_ci    {
1574514f5e3Sopenharmony_ci        return Load(VariableType::JS_POINTER(), method, IntPtr(Method::CONSTANT_POOL_OFFSET));
1584514f5e3Sopenharmony_ci    }
1594514f5e3Sopenharmony_ci
1604514f5e3Sopenharmony_ci    GateRef GetProfileTypeInfoFromFunction(GateRef function);
1614514f5e3Sopenharmony_ci
1624514f5e3Sopenharmony_ci    inline GateRef GetHotnessCounterFromMethod(GateRef method)
1634514f5e3Sopenharmony_ci    {
1644514f5e3Sopenharmony_ci        GateRef x = Load(VariableType::INT16(), method, IntPtr(Method::LITERAL_INFO_OFFSET));
1654514f5e3Sopenharmony_ci        return GetEnvironment()->GetBuilder()->SExtInt1ToInt32(x);
1664514f5e3Sopenharmony_ci    }
1674514f5e3Sopenharmony_ci
1684514f5e3Sopenharmony_ci    GateRef GetModuleFromFunction(GateRef function);
1694514f5e3Sopenharmony_ci
1704514f5e3Sopenharmony_ci    GateRef GetHomeObjectFromFunction(GateRef function);
1714514f5e3Sopenharmony_ci
1724514f5e3Sopenharmony_ci    inline GateRef GetModule(GateRef sp)
1734514f5e3Sopenharmony_ci    {
1744514f5e3Sopenharmony_ci        GateRef currentFunc = GetFunctionFromFrame(GetFrame(sp));
1754514f5e3Sopenharmony_ci        return GetModuleFromFunction(currentFunc);
1764514f5e3Sopenharmony_ci    }
1774514f5e3Sopenharmony_ci
1784514f5e3Sopenharmony_ci    inline GateRef GetCurrentFrame(GateRef glue)
1794514f5e3Sopenharmony_ci    {
1804514f5e3Sopenharmony_ci        return GetLastLeaveFrame(glue);
1814514f5e3Sopenharmony_ci    }
1824514f5e3Sopenharmony_ci
1834514f5e3Sopenharmony_ci    inline GateRef GetFrame(GateRef CurrentSp)
1844514f5e3Sopenharmony_ci    {
1854514f5e3Sopenharmony_ci        return PtrSub(CurrentSp, IntPtr(AsmInterpretedFrame::GetSize(GetEnvironment()->IsArch32Bit())));
1864514f5e3Sopenharmony_ci    }
1874514f5e3Sopenharmony_ci
1884514f5e3Sopenharmony_ci    inline GateRef GetPcFromFrame(GateRef frame)
1894514f5e3Sopenharmony_ci    {
1904514f5e3Sopenharmony_ci        return Load(VariableType::NATIVE_POINTER(), frame,
1914514f5e3Sopenharmony_ci            IntPtr(AsmInterpretedFrame::GetPcOffset(GetEnvironment()->IsArch32Bit())));
1924514f5e3Sopenharmony_ci    }
1934514f5e3Sopenharmony_ci
1944514f5e3Sopenharmony_ci    inline GateRef GetCallSizeFromFrame(GateRef frame)
1954514f5e3Sopenharmony_ci    {
1964514f5e3Sopenharmony_ci        return Load(VariableType::NATIVE_POINTER(), frame,
1974514f5e3Sopenharmony_ci            IntPtr(AsmInterpretedFrame::GetCallSizeOffset(GetEnvironment()->IsArch32Bit())));
1984514f5e3Sopenharmony_ci    }
1994514f5e3Sopenharmony_ci
2004514f5e3Sopenharmony_ci    inline GateRef GetThisFromFrame(GateRef frame)
2014514f5e3Sopenharmony_ci    {
2024514f5e3Sopenharmony_ci        return Load(VariableType::JS_POINTER(), frame,
2034514f5e3Sopenharmony_ci            IntPtr(AsmInterpretedFrame::GetThisOffset(GetEnvironment()->IsArch32Bit())));
2044514f5e3Sopenharmony_ci    }
2054514f5e3Sopenharmony_ci
2064514f5e3Sopenharmony_ci    GateRef GetNewTarget(GateRef sp)
2074514f5e3Sopenharmony_ci    {
2084514f5e3Sopenharmony_ci        GateRef function = Load(VariableType::JS_POINTER(), GetFrame(sp),
2094514f5e3Sopenharmony_ci            IntPtr(AsmInterpretedFrame::GetFunctionOffset(GetEnvironment()->IsArch32Bit())));
2104514f5e3Sopenharmony_ci        GateRef method = GetMethodFromFunction(function);
2114514f5e3Sopenharmony_ci        GateRef callField = GetCallFieldFromMethod(method);
2124514f5e3Sopenharmony_ci        // ASSERT: callField has "extra" bit.
2134514f5e3Sopenharmony_ci        GateRef numVregs =
2144514f5e3Sopenharmony_ci            TruncInt64ToInt32(Int64And(Int64LSR(callField, Int64(MethodLiteral::NumVregsBits::START_BIT)),
2154514f5e3Sopenharmony_ci                                       Int64((1LLU << MethodLiteral::NumVregsBits::SIZE) - 1)));
2164514f5e3Sopenharmony_ci        GateRef haveFunc = ZExtInt1ToInt32(Int64NotEqual(Int64And(Int64LSR(callField,
2174514f5e3Sopenharmony_ci            Int64(MethodLiteral::HaveFuncBit::START_BIT)),
2184514f5e3Sopenharmony_ci            Int64((1LLU << MethodLiteral::HaveFuncBit::SIZE) - 1)), Int64(0)));
2194514f5e3Sopenharmony_ci        GateRef idx = ZExtInt32ToPtr(Int32Add(numVregs, haveFunc));
2204514f5e3Sopenharmony_ci        return Load(VariableType::JS_ANY(), sp, PtrMul(IntPtr(JSTaggedValue::TaggedTypeSize()), idx));
2214514f5e3Sopenharmony_ci    }
2224514f5e3Sopenharmony_ci
2234514f5e3Sopenharmony_ci    GateRef GetStartIdxAndNumArgs(GateRef sp, GateRef restIdx)
2244514f5e3Sopenharmony_ci    {
2254514f5e3Sopenharmony_ci        auto env = GetEnvironment();
2264514f5e3Sopenharmony_ci        Label subEntry(env);
2274514f5e3Sopenharmony_ci        env->SubCfgEntry(&subEntry);
2284514f5e3Sopenharmony_ci        DEFVARIABLE(numArgs, VariableType::INT32(), Int32(0));
2294514f5e3Sopenharmony_ci        GateRef state = PtrSub(sp, IntPtr(AsmInterpretedFrame::GetSize(env->IsArch32Bit())));
2304514f5e3Sopenharmony_ci        GateRef function = GetFunctionFromFrame(state);
2314514f5e3Sopenharmony_ci        GateRef method = GetMethodFromJSFunctionOrProxy(function);
2324514f5e3Sopenharmony_ci        GateRef callField = GetCallFieldFromMethod(method);
2334514f5e3Sopenharmony_ci        // ASSERT: callField has "extra" bit.
2344514f5e3Sopenharmony_ci        GateRef numVregs = TruncInt64ToInt32(Int64And(
2354514f5e3Sopenharmony_ci            Int64LSR(callField, Int64(MethodLiteral::NumVregsBits::START_BIT)),
2364514f5e3Sopenharmony_ci            Int64((1LLU << MethodLiteral::NumVregsBits::SIZE) - 1)));
2374514f5e3Sopenharmony_ci        GateRef haveFunc = Int64NotEqual(Int64And(Int64LSR(callField, Int64(MethodLiteral::HaveFuncBit::START_BIT)),
2384514f5e3Sopenharmony_ci            Int64((1LLU << MethodLiteral::HaveFuncBit::SIZE) - 1)), Int64(0));
2394514f5e3Sopenharmony_ci        GateRef haveNewTarget = Int64NotEqual(
2404514f5e3Sopenharmony_ci            Int64And(Int64LSR(callField, Int64(MethodLiteral::HaveNewTargetBit::START_BIT)),
2414514f5e3Sopenharmony_ci            Int64((1LLU << MethodLiteral::HaveNewTargetBit::SIZE) - 1)), Int64(0));
2424514f5e3Sopenharmony_ci        GateRef haveThis = Int64NotEqual(Int64And(Int64LSR(callField, Int64(MethodLiteral::HaveThisBit::START_BIT)),
2434514f5e3Sopenharmony_ci            Int64((1LLU << MethodLiteral::HaveThisBit::SIZE) - 1)), Int64(0));
2444514f5e3Sopenharmony_ci        GateRef copyArgs = Int32Add(Int32Add(ZExtInt1ToInt32(haveFunc), ZExtInt1ToInt32(haveNewTarget)),
2454514f5e3Sopenharmony_ci                                    ZExtInt1ToInt32(haveThis));
2464514f5e3Sopenharmony_ci        numArgs = TruncInt64ToInt32(Int64And(Int64LSR(callField, Int64(MethodLiteral::NumArgsBits::START_BIT)),
2474514f5e3Sopenharmony_ci                                             Int64((1LLU << MethodLiteral::NumArgsBits::SIZE) - 1)));
2484514f5e3Sopenharmony_ci        GateRef fp = Load(VariableType::NATIVE_POINTER(), state,
2494514f5e3Sopenharmony_ci                          IntPtr(AsmInterpretedFrame::GetFpOffset(env->IsArch32Bit())));
2504514f5e3Sopenharmony_ci        Label actualEqualDeclared(env);
2514514f5e3Sopenharmony_ci        Label actualNotEqualDeclared(env);
2524514f5e3Sopenharmony_ci        Branch(Int32UnsignedGreaterThan(ChangeIntPtrToInt32(PtrSub(fp, sp)),
2534514f5e3Sopenharmony_ci                                        Int32Mul(Int32Add(Int32Add(numVregs, copyArgs), *numArgs),
2544514f5e3Sopenharmony_ci                                                 Int32(sizeof(JSTaggedType)))),
2554514f5e3Sopenharmony_ci               &actualNotEqualDeclared, &actualEqualDeclared);
2564514f5e3Sopenharmony_ci        Bind(&actualNotEqualDeclared);
2574514f5e3Sopenharmony_ci        {
2584514f5e3Sopenharmony_ci            numArgs = GetInt32OfTInt(Load(VariableType::JS_ANY(), fp,
2594514f5e3Sopenharmony_ci                                          IntPtr(-static_cast<int64_t>(sizeof(JSTaggedType)))));
2604514f5e3Sopenharmony_ci            Jump(&actualEqualDeclared);
2614514f5e3Sopenharmony_ci        }
2624514f5e3Sopenharmony_ci        Bind(&actualEqualDeclared);
2634514f5e3Sopenharmony_ci        GateRef startIdx = Int32Add(Int32Add(numVregs, copyArgs), restIdx);
2644514f5e3Sopenharmony_ci        Label numArgsGreater(env);
2654514f5e3Sopenharmony_ci        Label numArgsNotGreater(env);
2664514f5e3Sopenharmony_ci        Label exit(env);
2674514f5e3Sopenharmony_ci        Branch(Int32UnsignedGreaterThan(*numArgs, restIdx), &numArgsGreater, &numArgsNotGreater);
2684514f5e3Sopenharmony_ci        Bind(&numArgsGreater);
2694514f5e3Sopenharmony_ci        {
2704514f5e3Sopenharmony_ci            numArgs = Int32Sub(*numArgs, restIdx);
2714514f5e3Sopenharmony_ci            Jump(&exit);
2724514f5e3Sopenharmony_ci        }
2734514f5e3Sopenharmony_ci        Bind(&numArgsNotGreater);
2744514f5e3Sopenharmony_ci        {
2754514f5e3Sopenharmony_ci            numArgs = Int32(0);
2764514f5e3Sopenharmony_ci            Jump(&exit);
2774514f5e3Sopenharmony_ci        }
2784514f5e3Sopenharmony_ci        Bind(&exit);
2794514f5e3Sopenharmony_ci        // 32: high 32 bits = startIdx, low 32 bits = numArgs
2804514f5e3Sopenharmony_ci        GateRef ret = Int64Or(Int64LSL(ZExtInt32ToInt64(startIdx), Int64(32)), ZExtInt32ToInt64(*numArgs));
2814514f5e3Sopenharmony_ci        env->SubCfgExit();
2824514f5e3Sopenharmony_ci        return ret;
2834514f5e3Sopenharmony_ci    }
2844514f5e3Sopenharmony_ci
2854514f5e3Sopenharmony_ci    inline void SetVregValue(GateRef glue, GateRef sp, GateRef idx, GateRef val)
2864514f5e3Sopenharmony_ci    {
2874514f5e3Sopenharmony_ci        Store(VariableType::INT64(), glue, sp, PtrMul(IntPtr(sizeof(JSTaggedType)), idx), val);
2884514f5e3Sopenharmony_ci    }
2894514f5e3Sopenharmony_ci
2904514f5e3Sopenharmony_ci    inline GateRef GetVregValue(GateRef sp, GateRef idx)
2914514f5e3Sopenharmony_ci    {
2924514f5e3Sopenharmony_ci        return Load(VariableType::JS_ANY(), sp, PtrMul(IntPtr(sizeof(JSTaggedType)), idx));
2934514f5e3Sopenharmony_ci    }
2944514f5e3Sopenharmony_ci
2954514f5e3Sopenharmony_ci    GateRef GetResumeModeFromGeneratorObject(GateRef obj);
2964514f5e3Sopenharmony_ci    GateRef GetResumeModeFromAsyncGeneratorObject(GateRef obj);
2974514f5e3Sopenharmony_ci    GateRef GetLastLeaveFrame(GateRef glue);
2984514f5e3Sopenharmony_ci}; // class BaselineStubBuilder
2994514f5e3Sopenharmony_ci}  // namespace panda::ecmascript::kungfu
3004514f5e3Sopenharmony_ci#endif  // ECMASCRIPT_COMPILER_BASELINE_BASELINE_STUB_BUILDER_H
301