32#if V8_ENABLE_WEBASSEMBLY
41 if (!info->trace_turbo_filename()) {
43 info,
v8_flags.trace_turbo_path,
nullptr,
"json"));
45 return info->trace_turbo_filename();
49 std::ios_base::openmode mode)
55 :
std::ofstream(
Isolate::GetTurboCfgFileName(isolate).c_str(),
56 std::ios_base::app) {}
62 asJSON.
sp.PrintJson(out);
67 asJSON.
no.PrintJson(out);
72 std::unique_ptr<
char[]> function_name,
75 os <<
"\"" << source_id <<
"\" : {";
76 os <<
"\"sourceId\": " << source_id;
77 os <<
", \"functionName\": \"" << function_name.get() <<
"\"";
78 os <<
", \"bytecodeSource\": ";
79 bytecode_array->PrintJson(os);
80 os <<
", \"feedbackVector\": \"";
81 if (!feedback_vector.
is_null()) {
82 std::stringstream stream;
83 FeedbackVector::Print(feedback_vector, stream);
84 std::regex newlines_re(
"\n+");
85 os << std::regex_replace(stream.str(), newlines_re,
"\\n");
91 std::unique_ptr<
char[]> function_name,
95 if (with_key) os <<
"\"" << source_id <<
"\" : ";
98 os <<
"\"sourceId\": " << source_id;
99 os <<
", \"functionName\": \"" << function_name.get() <<
"\" ";
103 if (!script.is_null() && !IsUndefined(*script, isolate) &&
106 os <<
", \"sourceName\": \"";
107 if (IsString(source_name)) {
108 std::ostringstream escaped_name;
109 escaped_name << Cast<String>(source_name)->ToCString().get();
114 start = shared->StartPosition();
115 end = shared->EndPosition();
116 os <<
", \"sourceText\": \"";
117 if (!IsUndefined(script->source())) {
119 int len = shared->EndPosition() -
start;
122 for (
auto c : source) {
125#if V8_ENABLE_WEBASSEMBLY
126 }
else if (shared->HasWasmExportedFunctionData()) {
128 shared->wasm_exported_function_data();
130 function_data->instance_data()->native_module();
132 std::ostringstream str;
142 os <<
", \"sourceName\": \"\"";
143 os <<
", \"sourceText\": \"\"";
145 os <<
", \"startPosition\": " <<
start;
146 os <<
", \"endPosition\": " <<
end;
152 if (
printed_.at(
i).is_identical_to(shared)) {
157 const int source_id =
static_cast<int>(
printed_.size());
165void JsonPrintInlinedFunctionInfo(
166 std::ostream& os,
int source_id,
int inlining_id,
168 os <<
"\"" << inlining_id <<
"\" : ";
169 os <<
"{ \"inliningId\" : " << inlining_id;
170 os <<
", \"sourceId\" : " << source_id;
182 os <<
"\"bytecodeSources\" : {";
185 info->bytecode_array(),
186 info->closure()->feedback_vector());
188 const auto& inlined = info->inlined_functions();
191 for (
unsigned id = 0;
id < inlined.size();
id++) {
193#if V8_ENABLE_WEBASSEMBLY
194 if (shared_info->HasWasmFunctionData()) {
199 const int source_id = id_assigner.
GetIdFor(shared_info);
203 inlined[
id].bytecode_array);
212 os <<
"\"sources\" : {";
214 (info->shared_info().is_null() ||
219 info->shared_info().is_null()
220 ? std::unique_ptr<
char[]>(
new char[1]{0})
221 : info->shared_info()->DebugNameCStr(),
222 script, isolate, info->shared_info(),
true);
223 const auto& inlined = info->inlined_functions();
225 for (
unsigned id = 0;
id < inlined.size();
id++) {
228 const int source_id = id_assigner.
GetIdFor(shared);
230 os, source_id, shared->DebugNameCStr(),
235 os <<
"\"inlinings\" : {";
236 bool need_comma =
false;
237 for (
unsigned id = 0;
id < inlined.size();
id++) {
238 if (need_comma) os <<
", ";
239 const int source_id = id_assigner.
GetIdAt(
id);
240 JsonPrintInlinedFunctionInfo(os, source_id,
id, inlined[
id]);
246#if V8_ENABLE_WEBASSEMBLY
247void JsonPrintAllSourceWithPositionsWasm(
253 std::vector<
int > sources;
254 std::unordered_map<
int ,
size_t > source_map;
257 source_map.emplace(
pos.inlinee_func_index, sources.size());
261 sources.push_back(
pos.inlinee_func_index);
267 os <<
"\"sources\": {";
268 for (
size_t i = 0;
i < sources.
size(); ++
i) {
269 if (
i != 0) os <<
", ";
270 int function_id = sources[
i];
271 const wasm::WasmFunction& fct =
module->functions[function_id];
272 os <<
'"' <<
i <<
"\": {\"sourceId\": " <<
i <<
", \"functionName\": \""
273 << fct.func_index <<
"\", \"sourceName\": \"\", \"sourceText\": \"";
274 base::Vector<const uint8_t> module_bytes{
nullptr, 0};
275 std::optional<wasm::ModuleWireBytes> maybe_wire_bytes =
277 if (maybe_wire_bytes) module_bytes = maybe_wire_bytes->module_bytes();
278 std::ostringstream wasm_str;
280 wire_bytes->
GetCode(fct.code), module_bytes,
281 fct.code.offset(), wasm_str);
282 os << JSONEscaped(wasm_str) <<
"\"}";
288 os <<
"\"inlinings\": {";
289 for (
size_t i = 0;
i < positions.
size(); ++
i) {
290 if (
i != 0) os <<
", ";
291 DCHECK(source_map.contains(positions[
i].inlinee_func_index));
292 size_t source_id = source_map.find(positions[
i].inlinee_func_index)->second;
293 SourcePosition inlining_pos = positions[
i].caller_pos;
294 os <<
'"' <<
i <<
"\": {\"inliningId\": " <<
i
295 <<
", \"sourceId\": " << source_id
296 <<
", \"inliningPosition\": " <<
AsJSON(inlining_pos) <<
"}";
302 const char* optional_base_dir,
304 const char* suffix) {
306 std::unique_ptr<char[]> debug_name = info->GetDebugName();
307 const char* file_prefix =
v8_flags.trace_turbo_file_prefix.value();
308 int optimization_id = info->IsOptimizing() ? info->optimization_id() : 0;
309 if (strlen(debug_name.get()) > 0) {
310 if (strcmp(debug_name.get(),
"WasmJSFastApiCall") == 0) {
312 static int fast_call_wrappers_count = 0;
313 optimization_id = ++fast_call_wrappers_count;
315 SNPrintF(
filename,
"%s-%s-%i", file_prefix, debug_name.get(),
317 }
else if (info->has_shared_info()) {
318 SNPrintF(
filename,
"%s-%p-%i", file_prefix,
319 reinterpret_cast<void*
>(info->shared_info()->address()),
322 SNPrintF(
filename,
"%s-none-%i", file_prefix, optimization_id);
325 bool source_available =
false;
326 if (
v8_flags.trace_file_names && info->has_shared_info() &&
327 IsScript(info->shared_info()->script())) {
330 if (IsString(source_name)) {
332 if (str->length() > 0) {
333 SNPrintF(source_file,
"%s", str->ToCString().get());
334 std::replace(source_file.
begin(),
335 source_file.
begin() + source_file.
length(),
'/',
'_');
336 source_available =
true;
346 if (optional_base_dir !=
nullptr) {
347 SNPrintF(base_dir,
"%s%c", optional_base_dir,
354 if (phase ==
nullptr && !source_available) {
355 SNPrintF(full_filename,
"%s%s.%s", base_dir.
begin(),
filename.begin(),
357 }
else if (phase !=
nullptr && !source_available) {
358 SNPrintF(full_filename,
"%s%s-%s.%s", base_dir.
begin(),
filename.begin(),
360 }
else if (phase ==
nullptr && source_available) {
361 SNPrintF(full_filename,
"%s%s_%s.%s", base_dir.
begin(),
filename.begin(),
362 source_file.
begin(), suffix);
364 SNPrintF(full_filename,
"%s%s_%s-%s.%s", base_dir.
begin(),
filename.begin(),
365 source_file.
begin(), phase, suffix);
368 char* buffer =
new char[full_filename.
length() + 1];
369 memcpy(buffer, full_filename.
begin(), full_filename.
length());
370 buffer[full_filename.
length()] =
'\0';
371 return std::unique_ptr<char[]>(buffer);
374static int SafeId(
Node* node) {
return node ==
nullptr ? -1 : node->id(); }
376 return node ==
nullptr ?
"null" : node->op()->mnemonic();
385 positions_(positions),
391 os_ <<
"{\"name\":\"" << phase_name <<
"\",\"type\":\"graph\",\"data\":";
404 os_ <<
"{\n\"nodes\":[";
405 for (
Node*
const node : all.reachable)
PrintNode(node, live.IsLive(node));
407 os_ <<
"],\n\"edges\":[";
420 std::ostringstream
label, title, properties;
423 node->op()->PrintPropsTo(properties);
425 <<
"\"" <<
",\"title\":\"" <<
JSONEscaped(title) <<
"\""
426 <<
",\"live\": " << (is_live ?
"true" :
"false") <<
",\"properties\":\""
434 }
else if (opcode == IrOpcode::kIfTrue || opcode == IrOpcode::kIfFalse ||
435 opcode == IrOpcode::kLoop) {
439 if (opcode == IrOpcode::kBranch) {
440 os_ <<
",\"rankInputs\":[0]";
451 os_ <<
", \"origin\" : " <<
AsJSON(origin);
455 os_ <<
",\"control\":"
457 os_ <<
",\"opinfo\":\"" << node->op()->ValueInputCount() <<
" v "
458 << node->op()->EffectInputCount() <<
" eff "
459 << node->op()->ControlInputCount() <<
" ctrl in, "
460 << node->op()->ValueOutputCount() <<
" v "
461 << node->op()->EffectOutputCount() <<
" eff "
462 << node->op()->ControlOutputCount() <<
" ctrl out\"";
463 if (
auto type_opt =
GetType(node)) {
464 std::ostringstream type_out;
465 type_opt->PrintTo(type_out);
472 for (
int i = 0;
i < node->InputCount();
i++) {
474 if (input ==
nullptr)
continue;
485 const char* edge_type =
nullptr;
487 edge_type =
"unknown";
491 edge_type =
"context";
493 edge_type =
"frame-state";
495 edge_type =
"effect";
497 edge_type =
"control";
500 <<
",\"index\":" << index <<
",\"type\":\"" << edge_type <<
"\"}";
536 template <
typename InputIterator>
577 :
os_(os), indent_(0),
zone_(zone) {}
582 os_ << name <<
" \"" << value <<
"\"\n";
587 os_ << name <<
" " <<
static_cast<int>(value / 1000) <<
"\n";
592 os_ << name <<
" \"B" << rpo_number <<
"\"\n";
597 os_ << name <<
" " << value <<
"\n";
601 Tag tag(
this,
"compilation");
602 std::unique_ptr<char[]> name = info->GetDebugName();
603 if (info->IsOptimizing()) {
606 os_ <<
"method \"" << name.get() <<
":" << info->optimization_id()
620 os_ <<
" " << *n->op() <<
" ";
624template <
typename InputIterator>
626 const char* prefix) {
639 auto i = node->inputs().begin();
645 PrintInputs(&
i, node->op()->EffectInputCount(),
" Eff:");
646 PrintInputs(&
i, node->op()->ControlInputCount(),
" Ctrl:");
660 Tag tag(
this,
"cfg");
663 for (
size_t i = 0;
i < rpo->
size();
i++) {
665 Tag block_tag(
this,
"block");
671 os_ <<
"predecessors";
673 os_ <<
" \"B" << predecessor->rpo_number() <<
"\"";
680 os_ <<
" \"B" << successor->rpo_number() <<
"\"";
685 os_ <<
"xhandlers\n";
690 if (current->dominator() !=
nullptr) {
697 instructions->InstructionBlockAt(
712 Tag states_tag(
this,
"states");
713 Tag locals_tag(
this,
"locals");
716 it != current->end(); ++it) {
717 if ((*it)->opcode() == IrOpcode::kPhi) total++;
723 it != current->end(); ++it) {
724 if ((*it)->opcode() != IrOpcode::kPhi)
continue;
736 Tag HIR_tag(
this,
"HIR");
738 it != current->end(); ++it) {
740 if (node->opcode() == IrOpcode::kPhi)
continue;
743 os_ <<
"0 " << uses <<
" ";
749 if (positions !=
nullptr) {
754 os_ <<
"inlining(" <<
position.InliningId() <<
"),";
766 if (current->control_input() !=
nullptr) {
769 os_ << -1 - current->rpo_number() <<
" Goto";
773 os_ <<
" B" << successor->rpo_number();
775 if (
v8_flags.trace_turbo_types && current->control_input() !=
nullptr) {
783 if (instructions !=
nullptr) {
784 Tag LIR_tag(
this,
"LIR");
786 j <= instruction_block->last_instruction_index(); j++) {
788 os_ << j <<
" " << *instructions->InstructionAt(j) <<
" <|@\n";
796 Tag tag(
this,
"intervals");
814 if (range ==
nullptr || range->IsEmpty())
return;
815 int vreg = range->vreg();
816 for (
const LiveRange* child = range; child !=
nullptr;
817 child = child->
next()) {
824 if (range !=
nullptr && !range->IsEmpty()) {
826 os_ << vreg <<
":" << range->relative_id() <<
" " <<
type;
827 if (range->HasRegisterAssigned()) {
835#if defined(V8_TARGET_ARCH_X64)
843 }
else if (range->spilled()) {
846 if (top->HasSpillRange()) {
848 }
else if (top->GetSpillOperand()->IsConstant()) {
849 os_ <<
" \"const(nostack):"
850 << ConstantOperand::cast(top->GetSpillOperand())->virtual_register()
855 os_ <<
" \"fp_stack:" << index <<
"\"";
857 os_ <<
" \"stack:" << index <<
"\"";
872 for (
const UseInterval& interval : range->intervals()) {
873 os_ <<
" [" << interval.start().value() <<
", " << interval.end().value()
878 if (
pos->RegisterIsBeneficial() ||
v8_flags.trace_all_uses) {
879 os_ <<
" " <<
pos->pos().value() <<
" M";
934 stack.push(ar.
graph.end());
936 while (!stack.empty()) {
937 Node* n = stack.top();
939 for (
Node*
const i : n->inputs()) {
950 os <<
"#" << n->id() <<
":" << *n->op() <<
"(";
953 for (
Node*
const i : n->inputs()) {
954 if (j++ > 0) os <<
", ";
970void PrintIndent(std::ostream& os,
int indent) {
972 for (
int i = 0;
i < indent;
i++) {
977void PrintScheduledNode(std::ostream& os,
int indent, Node* n) {
978 PrintIndent(os, indent);
979 os <<
"#" << n->id() <<
":" << *n->op() <<
"(";
982 for (Node*
const i : n->inputs()) {
983 if (j++ > 0) os <<
", ";
993void PrintScheduledGraph(std::ostream& os,
const Schedule*
schedule) {
995 for (
size_t i = 0;
i < rpo->
size();
i++) {
996 BasicBlock* current = (*rpo)[
i];
997 int indent = current->loop_depth();
999 os <<
" + Block B" << current->rpo_number() <<
" (pred:";
1000 for (BasicBlock* predecessor : current->predecessors()) {
1001 os <<
" B" << predecessor->rpo_number();
1003 if (current->IsLoopHeader()) {
1004 os <<
", loop until B" << current->loop_end()->rpo_number();
1005 }
else if (current->loop_header()) {
1006 os <<
", in loop B" << current->loop_header()->rpo_number();
1008 os <<
")" << std::endl;
1013 PrintScheduledNode(os, indent, node);
1017 if (current->SuccessorCount() > 0) {
1018 if (current->control_input() !=
nullptr) {
1019 PrintScheduledNode(os, indent, current->control_input());
1021 PrintIndent(os, indent);
1026 bool isFirst =
true;
1027 for (BasicBlock* successor : current->successors()) {
1033 os <<
" B" << successor->rpo_number();
1047 os <<
"{\"id\":" << range.relative_id() <<
",\"type\":";
1048 if (range.HasRegisterAssigned()) {
1050 os <<
"\"assigned\",\"op\":"
1052 }
else if (range.spilled() && !range.TopLevel()->HasNoSpillType()) {
1054 if (top->HasSpillOperand()) {
1055 os <<
"\"assigned\",\"op\":"
1057 &(live_range_json.
code_)};
1059 int index = top->GetSpillRange()->assigned_slot();
1060 os <<
"\"spilled\",\"op\":";
1062 os <<
"\"fp_stack:" << index <<
"\"";
1064 os <<
"\"stack:" << index <<
"\"";
1071 os <<
",\"intervals\":[";
1073 for (
const UseInterval& interval : range.intervals()) {
1079 os <<
"[" << interval.start().value() <<
"," << interval.end().value()
1083 os <<
"],\"uses\":[";
1091 os <<
pos->pos().value();
1101 int vreg = top_level_live_range_json.
range_.vreg();
1103 int instruction_range[2] = {INT32_MAX, -1};
1104 os <<
"\"" << (vreg > 0 ? vreg : -vreg) <<
"\":{ \"child_ranges\":[";
1106 child !=
nullptr; child = child->
next()) {
1107 if (!top_level_live_range_json.
range_.IsEmpty()) {
1116 for (
const UseInterval& interval : child->intervals()) {
1117 if (interval.start().value() < instruction_range[0])
1118 instruction_range[0] = interval.start().value();
1119 if (interval.end().value() > instruction_range[1])
1120 instruction_range[1] = interval.end().value();
1125 if (top_level_live_range_json.
range_.IsFixed()) {
1126 os <<
", \"is_deferred\": "
1127 << (top_level_live_range_json.
range_.IsDeferredFixed() ?
"true"
1130 os <<
", \"instruction_range\": [" << instruction_range[0] <<
","
1131 << instruction_range[1] <<
"]}";
1141 if (range !=
nullptr && !range->IsEmpty()) {
1155 os <<
"\"fixed_double_live_ranges\": ";
1157 os <<
",\"fixed_live_ranges\": ";
1159 os <<
",\"live_ranges\": ";
1165 PrintScheduledGraph(os, scheduled.
schedule);
1173 switch (op->
kind()) {
1176 os <<
"\"type\": \"unallocated\", ";
1187 os <<
",\"tooltip\": \"FIXED_REGISTER: "
1192 os <<
",\"tooltip\": \"FIXED_FP_REGISTER: "
1198 os <<
",\"tooltip\": \"MUST_HAVE_REGISTER\"";
1202 os <<
",\"tooltip\": \"MUST_HAVE_SLOT\"";
1206 os <<
",\"tooltip\": \"SAME_AS_INPUT: " << unalloc->
input_index()
1211 os <<
",\"tooltip\": \"REGISTER_OR_SLOT\"";
1215 os <<
",\"tooltip\": \"REGISTER_OR_SLOT_OR_CONSTANT\"";
1222 int vreg = ConstantOperand::cast(op)->virtual_register();
1223 os <<
"\"type\": \"constant\", ";
1224 os <<
"\"text\": \"v" << vreg <<
"\",";
1225 os <<
"\"tooltip\": \"";
1226 std::stringstream tooltip;
1227 tooltip << code->GetConstant(vreg);
1228 for (
const auto& c : tooltip.str()) {
1235 os <<
"\"type\": \"immediate\", ";
1237 switch (imm->
type()) {
1249 os <<
"\"text\": \"imm:" << index <<
"\",";
1250 os <<
"\"tooltip\": \"";
1251 std::stringstream tooltip;
1252 tooltip << code->GetImmediate(imm);
1253 for (
const auto& c : tooltip.str()) {
1264 os <<
"\"type\": \"allocated\", ";
1265 os <<
"\"text\": \"";
1267 os <<
"stack:" << allocated->index();
1269 os <<
"fp_stack:" << allocated->index();
1280#if defined(V8_TARGET_ARCH_X64)
1289 os <<
"\"tooltip\": \""
1305 os <<
"\"id\": " << i_json.
index_ <<
",";
1307 os <<
"\"flags\": \"";
1310 if (am != kMode_None) {
1314 os <<
" && " << fm <<
" if "
1319 os <<
"\"gaps\": [";
1325 if (pm ==
nullptr) {
1331 if (move->IsEliminated())
continue;
1345 os <<
"\"outputs\": [";
1346 bool need_comma =
false;
1348 if (need_comma) os <<
",";
1354 os <<
"\"inputs\": [";
1357 if (need_comma) os <<
",";
1363 os <<
"\"temps\": [";
1366 if (need_comma) os <<
",";
1380 os <<
"\"id\": " << block->rpo_number() <<
",";
1381 os <<
"\"deferred\": " << (block->IsDeferred() ?
"true" :
"false");
1383 os <<
"\"loop_header\": " << block->IsLoopHeader() <<
",";
1384 if (block->IsLoopHeader()) {
1385 os <<
"\"loop_end\": " << block->loop_end() <<
",";
1387 os <<
"\"predecessors\": [";
1388 bool need_comma =
false;
1389 for (
RpoNumber pred : block->predecessors()) {
1390 if (need_comma) os <<
",";
1395 os <<
"\"successors\": [";
1397 for (
RpoNumber succ : block->successors()) {
1398 if (need_comma) os <<
",";
1403 os <<
"\"phis\": [";
1404 bool needs_comma =
false;
1407 if (needs_comma) os <<
",";
1409 json_op.
op_ = &phi->output();
1410 os <<
"{\"output\" : " << json_op <<
",";
1411 os <<
"\"operands\": [";
1412 bool op_needs_comma =
false;
1413 for (
int input : phi->operands()) {
1414 if (op_needs_comma) os <<
",";
1415 op_needs_comma =
true;
1416 os <<
"\"v" << input <<
"\"";
1422 os <<
"\"instructions\": [";
1425 for (
int j = block->first_instruction_index();
1426 j <= block->last_instruction_index(); j++) {
1427 if (need_comma) os <<
",";
1430 json_instr.
instr_ = code->InstructionAt(j);
1444 bool need_comma =
false;
1445 for (
int i = 0;
i < code->InstructionBlockCount();
i++) {
1446 if (need_comma) os <<
",";
static constexpr T decode(U value)
static char DirectorySeparator()
constexpr T * begin() const
static constexpr int8_t kNumRegisters
static constexpr DwVfpRegister from_code(int8_t code)
static constexpr Register from_code(int code)
static const char * GetSpecialRegisterName(int code)
V8_INLINE constexpr bool is_null() const
static V8_EXPORT_PRIVATE v8::Platform * GetCurrentPlatform()
static constexpr YMMRegister from_code(int code)
NodeVector::const_iterator const_iterator
BasicBlockVector & successors()
BasicBlockVector & predecessors()
GraphC1Visualizer * visualizer_
Tag(GraphC1Visualizer *visualizer, const char *name)
void PrintIntProperty(const char *name, int value)
GraphC1Visualizer & operator=(const GraphC1Visualizer &)=delete
void PrintBlockProperty(const char *name, int rpo_number)
void PrintCompilation(const OptimizedCompilationInfo *info)
void PrintLiveRange(const LiveRange *range, const char *type, int vreg)
void PrintNodeId(Node *n)
void PrintSchedule(const char *phase, const Schedule *schedule, const SourcePositionTable *positions, const InstructionSequence *instructions)
void PrintStringProperty(const char *name, const char *value)
void PrintLiveRanges(const char *phase, const RegisterAllocationData *data)
GraphC1Visualizer(std::ostream &os, Zone *zone)
GraphC1Visualizer(const GraphC1Visualizer &)=delete
void PrintLiveRangeChain(const TopLevelLiveRange *range, const char *type)
void PrintType(Node *node)
void PrintInputs(Node *n)
void PrintLongProperty(const char *name, int64_t value)
int32_t code_start() const
int last_instruction_index() const
int first_instruction_index() const
bool IsSimd256Register() const
bool IsFloatRegister() const
bool IsDoubleRegister() const
bool IsSimd128Register() const
bool IsFPStackSlot() const
const InstructionOperand * OutputAt(size_t i) const
InstructionCode opcode() const
const InstructionOperand * InputAt(size_t i) const
size_t OutputCount() const
ParallelMove *const * parallel_moves() const
size_t InputCount() const
const InstructionOperand * TempAt(size_t i) const
static char const * Mnemonic(Value value)
static bool IsPhiOpcode(Value value)
void PrintPhase(const char *phase_name)
JSONGraphWriter(std::ostream &os, const TFGraph *graph, const SourcePositionTable *positions, const NodeOriginTable *origins)
virtual std::optional< Type > GetType(Node *node)
void PrintEdge(Node *from, int index, Node *to)
const SourcePositionTable * positions_
const NodeOriginTable * origins_
void PrintEdges(Node *node)
void PrintNode(Node *node, bool is_live)
static LifetimePosition InstructionFromInstructionIndex(int index)
static LifetimePosition GapFromInstructionIndex(int index)
TopLevelLiveRange * TopLevel()
static LocationOperand * cast(InstructionOperand *op)
int register_code() const
static int FirstEffectIndex(Node *node)
static Type GetType(const Node *node)
static bool IsControl(Node *node)
static bool IsTyped(const Node *node)
static int FirstFrameStateIndex(Node *node)
static int FirstContextIndex(Node *node)
static int FirstControlIndex(Node *node)
static int FirstValueIndex(const Node *node)
Node * InputAt(int index) const
static int GetContextInputCount(const Operator *op)
static int GetFrameStateInputCount(const Operator *op)
static RpoNumber FromInt(int index)
BasicBlockVector * rpo_order()
int GetIdFor(Handle< SharedFunctionInfo > shared)
std::vector< Handle< SharedFunctionInfo > > printed_
int GetIdAt(size_t pos) const
std::vector< int > source_ids_
LiveRangeBundle * get_bundle() const
int32_t virtual_register() const
@ REGISTER_OR_SLOT_OR_CONSTANT
BasicPolicy basic_policy() const
ExtendedPolicy extended_policy() const
int fixed_register_index() const
int fixed_slot_index() const
const WasmModule * module() const
base::Vector< const uint8_t > wire_bytes() const
NamesProvider * GetNamesProvider()
virtual std::optional< ModuleWireBytes > GetModuleBytes() const =0
virtual base::Vector< const uint8_t > GetCode(WireBytesRef) const =0
NodeOriginTable * origins
ZoneStack< RpoNumber > & stack
LiftoffAssembler::CacheState state
InstructionOperand source
void JsonPrintBytecodeSource(std::ostream &os, int source_id, std::unique_ptr< char[]> function_name, DirectHandle< BytecodeArray > bytecode_array, Tagged< FeedbackVector > feedback_vector)
static const char * SafeMnemonic(Node *node)
static int SafeId(Node *node)
void JsonPrintAllBytecodeSources(std::ostream &os, OptimizedCompilationInfo *info)
void JsonPrintAllSourceWithPositions(std::ostream &os, OptimizedCompilationInfo *info, Isolate *isolate)
void JsonPrintFunctionSource(std::ostream &os, int source_id, std::unique_ptr< char[]> function_name, DirectHandle< Script > script, Isolate *isolate, DirectHandle< SharedFunctionInfo > shared, bool with_key)
ZoneVector< BasicBlock * > BasicBlockVector
std::unique_ptr< char[]> GetVisualizerLogFileName(OptimizedCompilationInfo *info, const char *optional_base_dir, const char *phase, const char *suffix)
V8_INLINE V8_EXPORT_PRIVATE SourcePositionAsJSON AsJSON(const SourcePosition &sp)
const char * get_cached_trace_turbo_filename(OptimizedCompilationInfo *info)
std::ostream & operator<<(std::ostream &os, AccessMode access_mode)
void PrintTopLevelLiveRanges(std::ostream &os, const ZoneVector< TopLevelLiveRange * > ranges, const InstructionSequence &code)
void DisassembleFunction(const WasmModule *module, int func_index, base::Vector< const uint8_t > wire_bytes, NamesProvider *names, std::ostream &os)
V8_INLINE DirectHandle< T > direct_handle(Tagged< T > object, Isolate *isolate)
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in name
constexpr bool IsFloatingPoint(MachineRepresentation rep)
const char * MachineReprToString(MachineRepresentation rep)
V8_EXPORT_PRIVATE FlagValues v8_flags
Tagged< To > Cast(Tagged< From > value, const v8::SourceLocation &loc=INIT_SOURCE_LOCATION_IN_DEBUG)
#define DCHECK_LE(v1, v2)
#define DCHECK(condition)
InliningPosition position
const OptimizedCompilationInfo * info_
const RegisterAllocationData * data_
const SourcePositionTable * positions_
const Schedule * schedule_
const InstructionSequence * instructions_
const Schedule * schedule
const NodeOriginTable * origins
const SourcePositionTable * positions
const InstructionSequence * code_
const Instruction * instr_
const InstructionSequence * code_
const InstructionBlock * block_
const InstructionSequence * code_
const InstructionOperand * op_
const InstructionSequence & code_
const InstructionSequence & code_
const RegisterAllocationData & data_
const SourcePosition & sp
const TopLevelLiveRange & range_
const InstructionSequence & code_
TurboCfgFile(Isolate *isolate=nullptr)
~TurboJsonFile() override
TurboJsonFile(OptimizedCompilationInfo *info, std::ios_base::openmode mode)