1 /* 2 * Copyright (c) 2023 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_NUMBER_STUB_BUILDER_H 17 #define ECMASCRIPT_COMPILER_BUILTINS_NUMBER_STUB_BUILDER_H 18 #include "ecmascript/compiler/builtins/builtins_stubs.h" 19 20 namespace panda::ecmascript::kungfu { 21 class BuiltinsNumberStubBuilder : public BuiltinsStubBuilder { 22 public: BuiltinsNumberStubBuilder(StubBuilder * parent)23 explicit BuiltinsNumberStubBuilder(StubBuilder *parent) 24 : BuiltinsStubBuilder(parent) {} BuiltinsNumberStubBuilder(BuiltinsStubBuilder * parent,GateRef glue,GateRef thisValue,GateRef numArgs)25 BuiltinsNumberStubBuilder(BuiltinsStubBuilder *parent, GateRef glue, GateRef thisValue, GateRef numArgs) 26 : BuiltinsStubBuilder(parent), glue_(glue), thisValue_(thisValue), numArgs_(numArgs) {} 27 ~BuiltinsNumberStubBuilder() override = default; 28 NO_MOVE_SEMANTIC(BuiltinsNumberStubBuilder); 29 NO_COPY_SEMANTIC(BuiltinsNumberStubBuilder); GenerateCircuit()30 void GenerateCircuit() override {} 31 void ParseFloat(Variable *result, Label *exit, Label *slowPath); 32 33 private: 34 GateRef glue_ { Circuit::NullGate() }; 35 GateRef thisValue_ { Circuit::NullGate() }; 36 GateRef numArgs_ { Circuit::NullGate() }; 37 }; 38 } // namespace panda::ecmascript::kungfu 39 #endif // ECMASCRIPT_COMPILER_BUILTINS_NUMBER_STUB_BUILDER_H 40