// Copyright 2018 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_TORQUE_ASSEMBLER_H_ #define V8_TORQUE_ASSEMBLER_H_ #include #include #include "src/code-stub-assembler.h" #include "src/base/optional.h" namespace v8 { namespace internal { class TorqueAssembler : public CodeStubAssembler { public: using CodeStubAssembler::CodeStubAssembler; protected: template using PLabel = compiler::CodeAssemblerParameterizedLabel; template TNode Uninitialized() { return {}; } template void Goto(PLabel* label, Args... args) { label->AddInputs(args...); CodeStubAssembler::Goto(label->plain_label()); } using CodeStubAssembler::Goto; template void Bind(PLabel* label, TNode*... phis) { Bind(label->plain_label()); label->CreatePhis(phis...); } void Bind(Label* label) { CodeAssembler::Bind(label); } using CodeStubAssembler::Bind; template void Branch(TNode condition, PLabel* if_true, PLabel* if_false, Args... args) { if_true->AddInputs(args...); if_false->AddInputs(args...); CodeStubAssembler::Branch(condition, if_true->plain_label(), if_false->plain_label()); } using CodeStubAssembler::Branch; }; } // namespace internal } // namespace v8 #endif // V8_TORQUE_ASSEMBLER_H_