5#ifndef V8_TORQUE_TORQUE_CODE_GENERATOR_H_
6#define V8_TORQUE_TORQUE_CODE_GENERATOR_H_
34 if (location.
IsPhi()) {
35 std::stringstream stream;
36 stream <<
"phi_bb" << location.
GetPhiBlock()->id() <<
"_"
55 const std::string& str) {
65 bool always_emit =
false) = 0;
71 return "block" + std::to_string(block->id());
79 out() <<
" // " << instruction
80 <<
", starting stack size: " << stack->Size() <<
"\n";
83#define EMIT_INSTRUCTION_DECLARATION(T) \
84 void EmitInstruction(const T& instruction, Stack<std::string>* stack);
86#undef EMIT_INSTRUCTION_DECLARATION
88#define EMIT_INSTRUCTION_DECLARATION(T) \
89 virtual void EmitInstruction(const T& instruction, \
90 Stack<std::string>* stack) = 0;
92#undef EMIT_INSTRUCTION_DECLARATION
#define EMIT_INSTRUCTION_DECLARATION(T)
std::size_t GetPhiIndex() const
const Block * GetPhiBlock() const
bool IsInstruction() const
std::string FreshLabelName()
TorqueCodeGenerator(const ControlFlowGraph &cfg, std::ostream &out)
SourcePosition previous_position_
std::string FreshNodeName()
void SetDefinitionVariable(const DefinitionLocation &definition, const std::string &str)
const ControlFlowGraph & cfg_
std::map< DefinitionLocation, std::string > location_map_
static bool IsEmptyInstruction(const Instruction &instruction)
std::string DefinitionToVariable(const DefinitionLocation &location)
std::string BlockName(const Block *block)
void EmitIRAnnotation(const T &instruction, Stack< std::string > *stack)
void EmitInstruction(const Instruction &instruction, Stack< std::string > *stack)
std::string FreshCatchName()
std::ostream * out_decls_
virtual void EmitSourcePosition(SourcePosition pos, bool always_emit=false)=0
#define TORQUE_BACKEND_DEPENDENT_INSTRUCTION_LIST(V)
#define TORQUE_BACKEND_AGNOSTIC_INSTRUCTION_LIST(V)
#define DCHECK_NE(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)