v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
cc-generator.h
Go to the documentation of this file.
1// Copyright 2020 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_TORQUE_CC_GENERATOR_H_
6#define V8_TORQUE_CC_GENERATOR_H_
7
8#include <optional>
9
11
12namespace v8::internal::torque {
13
15 public:
16 CCGenerator(const ControlFlowGraph& cfg, std::ostream& out,
17 bool is_cc_debug = false)
18 : TorqueCodeGenerator(cfg, out), is_cc_debug_(is_cc_debug) {}
19 std::optional<Stack<std::string>> EmitGraph(Stack<std::string> parameters);
20
21 static void EmitCCValue(VisitResult result, const Stack<std::string>& values,
22 std::ostream& out);
23
24 private:
26
28 bool always_emit = false) override;
29
30 void EmitGoto(const Block* destination, Stack<std::string>* stack,
31 std::string indentation);
32
33 std::vector<std::string> ProcessArgumentsCommon(
34 const TypeVector& parameter_types,
35 std::vector<std::string> constexpr_arguments, Stack<std::string>* stack);
36
38#define EMIT_INSTRUCTION_DECLARATION(T) \
39 void EmitInstruction(const T& instruction, Stack<std::string>* stack) \
40 override;
42#undef EMIT_INSTRUCTION_DECLARATION
43};
44
45} // namespace v8::internal::torque
46
47#endif // V8_TORQUE_CC_GENERATOR_H_
#define EMIT_INSTRUCTION_DECLARATION(T)
SourcePosition pos
std::optional< Stack< std::string > > EmitGraph(Stack< std::string > parameters)
void EmitGoto(const Block *destination, Stack< std::string > *stack, std::string indentation)
Stack< std::string > EmitBlock(const Block *block)
void EmitSourcePosition(SourcePosition pos, bool always_emit=false) override
CCGenerator(const ControlFlowGraph &cfg, std::ostream &out, bool is_cc_debug=false)
std::vector< std::string > ProcessArgumentsCommon(const TypeVector &parameter_types, std::vector< std::string > constexpr_arguments, Stack< std::string > *stack)
static void EmitCCValue(VisitResult result, const Stack< std::string > &values, std::ostream &out)
#define TORQUE_BACKEND_DEPENDENT_INSTRUCTION_LIST(V)
ZoneVector< RpoNumber > & result
InstructionOperand destination
std::vector< const Type * > TypeVector
Definition types.h:85