1 /*
2 * Copyright (c) 2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #ifndef ECMASCRIPT_COMPILER_BUILTINS_REFLECT_STUB_BUILDER_H
17 #define ECMASCRIPT_COMPILER_BUILTINS_REFLECT_STUB_BUILDER_H
18 #include "ecmascript/compiler/builtins/builtins_stubs.h"
19
20 namespace panda::ecmascript::kungfu {
21 class BuiltinsReflectStubBuilder : public BuiltinsStubBuilder {
22 public:
BuiltinsReflectStubBuilder(StubBuilder * parent,GateRef globalEnv)23 explicit BuiltinsReflectStubBuilder(StubBuilder *parent, GateRef globalEnv)
24 : BuiltinsStubBuilder(parent, globalEnv) {}
BuiltinsReflectStubBuilder(BuiltinsStubBuilder * parent,GateRef glue,GateRef thisValue,GateRef numArgs,GateRef globalEnv)25 BuiltinsReflectStubBuilder(BuiltinsStubBuilder* parent, GateRef glue, GateRef thisValue, GateRef numArgs,
26 GateRef globalEnv)
27 : BuiltinsStubBuilder(parent, globalEnv), glue_(glue), thisValue_(thisValue), numArgs_(numArgs) {}
28 ~BuiltinsReflectStubBuilder() override = default;
29 NO_MOVE_SEMANTIC(BuiltinsReflectStubBuilder);
30 NO_COPY_SEMANTIC(BuiltinsReflectStubBuilder);
GenerateCircuit()31 void GenerateCircuit() override {}
32 #define DECLARE_BUILTINS_REFLECT_STUB_BUILDER(method, ...) \
33 void method(Variable *result, Label *exit, Label *slowPath);
BUILTINS_WITH_REFLECT_STUB_BUILDER(DECLARE_BUILTINS_REFLECT_STUB_BUILDER)34 BUILTINS_WITH_REFLECT_STUB_BUILDER(DECLARE_BUILTINS_REFLECT_STUB_BUILDER)
35 #undef DECLARE_BUILTINS_REFLECT_STUB_BUILDER
36
37 private:
38 GateRef glue_ { Circuit::NullGate() };
39 GateRef thisValue_ { Circuit::NullGate() };
40 GateRef numArgs_ { Circuit::NullGate() };
41 };
42 } // namespace panda::ecmascript::kungfu
43 #endif // ECMASCRIPT_COMPILER_BUILTINS_REFLECT_STUB_BUILDER_H
44