- Revision
- 255482
- Author
- [email protected]
- Date
- 2020-01-30 18:30:11 -0800 (Thu, 30 Jan 2020)
Log Message
Some improvements to DFG and FTL dumps to improve readability and searchability.
https://bugs.webkit.org/show_bug.cgi?id=207024
Reviewed by Saam Barati.
This patch applies the following changes:
1. Prefix Air and B2 dumps with a tierName prefix.
The tierName prefix strings are as follows:
"FTL ", "DFG ", "b3 ", "Air ", "asm "
The choice to use a lowercase "b3" and "asm" with upper case "Air" is
deliberate because I found this combination to be easier to read and scan as
prefixes of the dump lines. See dump samples below.
2. Make DFG node IDs consistently expressed as D@<node index> e.g. D@104.
The definition of the node will be the id followed by a colon e.g. D@104:
This makes it easy to search references to this node anywhere in the dump.
Make B3 nodes expressed as b@<node index> e.g. b@542.
This also makes it searchable since there's now no ambiguity between b@542 and
D@542.
The choice to use a lowercase "b" and an uppercase "D" is intentional because
"b@542" and "d@542" looks too similar, and I prefer to not use too much
uppercase. Plus this makes the node consistent in capitalization with the
tierName prefixes above of "b3 " and "DFG " respectively.
Here's a sample of what the dumps now look like:
DFG graph dump:
<code>
...
6 55: <-- foo#DFndCW:<0x62d0000b8140, bc#65, Call, known callee: Object: 0x62d000035920 with butterfly 0x0 (Structure %AN:Function), StructureID: 12711, numArgs+this = 1, numFixup = 0, stackOffset = -16 (loc0 maps to loc16)>
3 6 55: D@79:< 3:-> ArithAdd(Int32:Kill:D@95, Int32:D@42, Int32|PureNum|UseAsOther, Int32, CheckOverflow, Exits, bc#71, ExitValid)
4 6 55: D@3:<!0:-> KillStack(MustGen, loc7, W:Stack(loc7), ClobbersExit, bc#71, ExitInvalid)
5 6 55: D@85:<!0:-> MovHint(Check:Untyped:D@79, MustGen, loc7, W:SideState, ClobbersExit, bc#71, ExitInvalid)
6 6 55: D@102:< 1:-> CompareLess(Int32:D@79, Int32:D@89, Boolean|UseAsOther, Bool, Exits, bc#74, ExitValid)
7 6 55: D@104:<!0:-> Branch(KnownBoolean:Kill:D@102, MustGen, T:#1/w:10.000000, F:#7/w:1.000000, W:SideState, bc#74, ExitInvalid)
...
</code>
B3 graph dump:
<code>
...
b3 BB#14: ; frequency = 10.000000
b3 Predecessors: #13
b3 Int32 b@531 = CheckAdd(b@10:WarmAny, $1(b@1):WarmAny, b@64:ColdAny, b@10:ColdAny, generator = 0x606000022e80, earlyClobbered = [], lateClobbered = [], usedRegisters = [], ExitsSideways|Reads:Top, D@79)
b3 Int32 b@539 = LessThan(b@531, $100(b@578), D@102)
b3 Void b@542 = Branch(b@539, Terminal, D@104)
b3 Successors: Then:#2, Else:#15
...
</code>
Air graph dump:
<code>
...
Air BB#5: ; frequency = 10.000000
Air Predecessors: #4
Air Move -96(%rbp), %rax, b@531
Air Patch &BranchAdd32(3,ForceLateUseUnlessRecoverable)3, Overflow, $1, %rax, -104(%rbp), -96(%rbp), b@531
Air Branch32 LessThan, %rax, $100, b@542
Air Successors: #1, #6
...
</code>
FTL disassembly dump:
<code>
...
Air BB#5: ; frequency = 10.000000
Air Predecessors: #4
DFG D@42:< 2:-> JSConstant(JS|PureInt, Int32, Int32: 1, bc#0, ExitInvalid)
DFG D@79:< 3:-> ArithAdd(Int32:Kill:D@95, Int32:D@42, Int32|PureNum|UseAsOther, Int32, CheckOverflow, Exits, bc#71, ExitValid)
b3 Int32 b@1 = Const32(1)
b3 Int32 b@531 = CheckAdd(b@10:WarmAny, $1(b@1):WarmAny, b@64:ColdAny, b@10:ColdAny, generator = 0x606000022e80, earlyClobbered = [], lateClobbered = [], usedRegisters = [%rax, %rbx, %rbp, %r12], ExitsSideways|Reads:Top, D@79)
Air Move -96(%rbp), %rax, b@531
asm 0x4576b9c04712: mov -0x60(%rbp), %rax
Air Patch &BranchAdd32(3,ForceLateUseUnlessRecoverable)3, Overflow, $1, %rax, -104(%rbp), -96(%rbp), b@531
asm 0x4576b9c04716: inc %eax
asm 0x4576b9c04718: jo 0x4576b9c04861
DFG D@89:< 1:-> JSConstant(JS|PureNum|UseAsOther, NonBoolInt32, Int32: 100, bc#0, ExitInvalid)
DFG D@102:< 1:-> CompareLess(Int32:D@79, Int32:D@89, Boolean|UseAsOther, Bool, Exits, bc#74, ExitValid)
DFG D@104:<!0:-> Branch(KnownBoolean:Kill:D@102, MustGen, T:#1/w:10.000000, F:#7/w:1.000000, W:SideState, bc#74, ExitInvalid)
b3 Int32 b@578 = Const32(100, D@89)
b3 Int32 b@539 = LessThan(b@531, $100(b@578), D@102)
b3 Void b@542 = Branch(b@539, Terminal, D@104)
Air Branch32 LessThan, %rax, $100, b@542
asm 0x4576b9c0471e: cmp $0x64, %eax
asm 0x4576b9c04721: jl 0x4576b9c0462f
Air Successors: #1, #6
...
</code>
* b3/B3BasicBlock.cpp:
(JSC::B3::BasicBlock::deepDump const):
* b3/B3Common.cpp:
* b3/B3Common.h:
* b3/B3Generate.cpp:
(JSC::B3::generateToAir):
* b3/B3Procedure.cpp:
(JSC::B3::Procedure::dump const):
* b3/B3Value.cpp:
* b3/air/AirBasicBlock.cpp:
(JSC::B3::Air::BasicBlock::deepDump const):
(JSC::B3::Air::BasicBlock::dumpHeader const):
(JSC::B3::Air::BasicBlock::dumpFooter const):
* b3/air/AirCode.cpp:
(JSC::B3::Air::Code::dump const):
* b3/air/AirCode.h:
* b3/air/AirDisassembler.cpp:
(JSC::B3::Air::Disassembler::dump):
* b3/air/AirGenerate.cpp:
(JSC::B3::Air::prepareForGeneration):
* dfg/DFGCommon.cpp:
* dfg/DFGCommon.h:
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
(JSC::DFG::Graph::dumpBlockHeader):
* dfg/DFGNode.cpp:
(WTF::printInternal):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLCompile.h:
* ftl/FTLState.cpp:
(JSC::FTL::State::State):
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (255481 => 255482)
--- trunk/Source/_javascript_Core/ChangeLog 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,3 +1,132 @@
+2020-01-30 Mark Lam <[email protected]>
+
+ Some improvements to DFG and FTL dumps to improve readability and searchability.
+ https://bugs.webkit.org/show_bug.cgi?id=207024
+
+ Reviewed by Saam Barati.
+
+ This patch applies the following changes:
+
+ 1. Prefix Air and B2 dumps with a tierName prefix.
+ The tierName prefix strings are as follows:
+
+ "FTL ", "DFG ", "b3 ", "Air ", "asm "
+
+ The choice to use a lowercase "b3" and "asm" with upper case "Air" is
+ deliberate because I found this combination to be easier to read and scan as
+ prefixes of the dump lines. See dump samples below.
+
+ 2. Make DFG node IDs consistently expressed as D@<node index> e.g. D@104.
+ The definition of the node will be the id followed by a colon e.g. D@104:
+ This makes it easy to search references to this node anywhere in the dump.
+
+ Make B3 nodes expressed as b@<node index> e.g. b@542.
+ This also makes it searchable since there's now no ambiguity between b@542 and
+ D@542.
+
+ The choice to use a lowercase "b" and an uppercase "D" is intentional because
+ "b@542" and "d@542" looks too similar, and I prefer to not use too much
+ uppercase. Plus this makes the node consistent in capitalization with the
+ tierName prefixes above of "b3 " and "DFG " respectively.
+
+ Here's a sample of what the dumps now look like:
+
+ DFG graph dump:
+ <code>
+ ...
+ 6 55: <-- foo#DFndCW:<0x62d0000b8140, bc#65, Call, known callee: Object: 0x62d000035920 with butterfly 0x0 (Structure %AN:Function), StructureID: 12711, numArgs+this = 1, numFixup = 0, stackOffset = -16 (loc0 maps to loc16)>
+ 3 6 55: D@79:< 3:-> ArithAdd(Int32:Kill:D@95, Int32:D@42, Int32|PureNum|UseAsOther, Int32, CheckOverflow, Exits, bc#71, ExitValid)
+ 4 6 55: D@3:<!0:-> KillStack(MustGen, loc7, W:Stack(loc7), ClobbersExit, bc#71, ExitInvalid)
+ 5 6 55: D@85:<!0:-> MovHint(Check:Untyped:D@79, MustGen, loc7, W:SideState, ClobbersExit, bc#71, ExitInvalid)
+ 6 6 55: D@102:< 1:-> CompareLess(Int32:D@79, Int32:D@89, Boolean|UseAsOther, Bool, Exits, bc#74, ExitValid)
+ 7 6 55: D@104:<!0:-> Branch(KnownBoolean:Kill:D@102, MustGen, T:#1/w:10.000000, F:#7/w:1.000000, W:SideState, bc#74, ExitInvalid)
+ ...
+ </code>
+
+ B3 graph dump:
+ <code>
+ ...
+ b3 BB#14: ; frequency = 10.000000
+ b3 Predecessors: #13
+ b3 Int32 b@531 = CheckAdd(b@10:WarmAny, $1(b@1):WarmAny, b@64:ColdAny, b@10:ColdAny, generator = 0x606000022e80, earlyClobbered = [], lateClobbered = [], usedRegisters = [], ExitsSideways|Reads:Top, D@79)
+ b3 Int32 b@539 = LessThan(b@531, $100(b@578), D@102)
+ b3 Void b@542 = Branch(b@539, Terminal, D@104)
+ b3 Successors: Then:#2, Else:#15
+ ...
+ </code>
+
+ Air graph dump:
+ <code>
+ ...
+ Air BB#5: ; frequency = 10.000000
+ Air Predecessors: #4
+ Air Move -96(%rbp), %rax, b@531
+ Air Patch &BranchAdd32(3,ForceLateUseUnlessRecoverable)3, Overflow, $1, %rax, -104(%rbp), -96(%rbp), b@531
+ Air Branch32 LessThan, %rax, $100, b@542
+ Air Successors: #1, #6
+ ...
+ </code>
+
+ FTL disassembly dump:
+ <code>
+ ...
+ Air BB#5: ; frequency = 10.000000
+ Air Predecessors: #4
+ DFG D@42:< 2:-> JSConstant(JS|PureInt, Int32, Int32: 1, bc#0, ExitInvalid)
+ DFG D@79:< 3:-> ArithAdd(Int32:Kill:D@95, Int32:D@42, Int32|PureNum|UseAsOther, Int32, CheckOverflow, Exits, bc#71, ExitValid)
+ b3 Int32 b@1 = Const32(1)
+ b3 Int32 b@531 = CheckAdd(b@10:WarmAny, $1(b@1):WarmAny, b@64:ColdAny, b@10:ColdAny, generator = 0x606000022e80, earlyClobbered = [], lateClobbered = [], usedRegisters = [%rax, %rbx, %rbp, %r12], ExitsSideways|Reads:Top, D@79)
+ Air Move -96(%rbp), %rax, b@531
+ asm 0x4576b9c04712: mov -0x60(%rbp), %rax
+ Air Patch &BranchAdd32(3,ForceLateUseUnlessRecoverable)3, Overflow, $1, %rax, -104(%rbp), -96(%rbp), b@531
+ asm 0x4576b9c04716: inc %eax
+ asm 0x4576b9c04718: jo 0x4576b9c04861
+ DFG D@89:< 1:-> JSConstant(JS|PureNum|UseAsOther, NonBoolInt32, Int32: 100, bc#0, ExitInvalid)
+ DFG D@102:< 1:-> CompareLess(Int32:D@79, Int32:D@89, Boolean|UseAsOther, Bool, Exits, bc#74, ExitValid)
+ DFG D@104:<!0:-> Branch(KnownBoolean:Kill:D@102, MustGen, T:#1/w:10.000000, F:#7/w:1.000000, W:SideState, bc#74, ExitInvalid)
+ b3 Int32 b@578 = Const32(100, D@89)
+ b3 Int32 b@539 = LessThan(b@531, $100(b@578), D@102)
+ b3 Void b@542 = Branch(b@539, Terminal, D@104)
+ Air Branch32 LessThan, %rax, $100, b@542
+ asm 0x4576b9c0471e: cmp $0x64, %eax
+ asm 0x4576b9c04721: jl 0x4576b9c0462f
+ Air Successors: #1, #6
+ ...
+ </code>
+
+ * b3/B3BasicBlock.cpp:
+ (JSC::B3::BasicBlock::deepDump const):
+ * b3/B3Common.cpp:
+ * b3/B3Common.h:
+ * b3/B3Generate.cpp:
+ (JSC::B3::generateToAir):
+ * b3/B3Procedure.cpp:
+ (JSC::B3::Procedure::dump const):
+ * b3/B3Value.cpp:
+ * b3/air/AirBasicBlock.cpp:
+ (JSC::B3::Air::BasicBlock::deepDump const):
+ (JSC::B3::Air::BasicBlock::dumpHeader const):
+ (JSC::B3::Air::BasicBlock::dumpFooter const):
+ * b3/air/AirCode.cpp:
+ (JSC::B3::Air::Code::dump const):
+ * b3/air/AirCode.h:
+ * b3/air/AirDisassembler.cpp:
+ (JSC::B3::Air::Disassembler::dump):
+ * b3/air/AirGenerate.cpp:
+ (JSC::B3::Air::prepareForGeneration):
+ * dfg/DFGCommon.cpp:
+ * dfg/DFGCommon.h:
+ * dfg/DFGGraph.cpp:
+ (JSC::DFG::Graph::dump):
+ (JSC::DFG::Graph::dumpBlockHeader):
+ * dfg/DFGNode.cpp:
+ (WTF::printInternal):
+ * ftl/FTLCompile.cpp:
+ (JSC::FTL::compile):
+ * ftl/FTLCompile.h:
+ * ftl/FTLState.cpp:
+ (JSC::FTL::State::State):
+
2020-01-30 Yusuke Suzuki <[email protected]>
[WTF] Remove PackedIntVector
Modified: trunk/Source/_javascript_Core/b3/B3BasicBlock.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/B3BasicBlock.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/B3BasicBlock.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -154,13 +154,13 @@
void BasicBlock::deepDump(const Procedure& proc, PrintStream& out) const
{
- out.print("BB", *this, ": ; frequency = ", m_frequency, "\n");
+ out.print(tierName, "BB", *this, ": ; frequency = ", m_frequency, "\n");
if (predecessors().size())
- out.print(" Predecessors: ", pointerListDump(predecessors()), "\n");
+ out.print(tierName, " Predecessors: ", pointerListDump(predecessors()), "\n");
for (Value* value : *this)
- out.print(" ", B3::deepDump(proc, value), "\n");
+ out.print(tierName, " ", B3::deepDump(proc, value), "\n");
if (!successors().isEmpty()) {
- out.print(" Successors: ");
+ out.print(tierName, " Successors: ");
if (size())
last()->dumpSuccessors(this, out);
else
Modified: trunk/Source/_javascript_Core/b3/B3Common.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/B3Common.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/B3Common.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,6 +35,8 @@
namespace JSC { namespace B3 {
+const char* const tierName = "b3 ";
+
bool shouldDumpIR(B3CompilationMode mode)
{
#if ENABLE(FTL_JIT)
Modified: trunk/Source/_javascript_Core/b3/B3Common.h (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/B3Common.h 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/B3Common.h 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,6 +34,8 @@
namespace JSC { namespace B3 {
+extern const char* const tierName;
+
enum B3CompilationMode {
B3Mode,
AirMode
Modified: trunk/Source/_javascript_Core/b3/B3Generate.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/B3Generate.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/B3Generate.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -74,7 +74,7 @@
TimingScope timingScope("generateToAir");
if (shouldDumpIR(B3Mode) && !shouldDumpIRAtEachPhase(B3Mode)) {
- dataLog("Initial B3:\n");
+ dataLog(tierName, "Initial B3:\n");
dataLog(procedure);
}
Modified: trunk/Source/_javascript_Core/b3/B3Procedure.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/B3Procedure.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/B3Procedure.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -239,22 +239,22 @@
continue;
if (!didPrint) {
- dataLog("Orphaned values:\n");
+ dataLog(tierName, "Orphaned values:\n");
didPrint = true;
}
- dataLog(" ", deepDump(*this, value), "\n");
+ dataLog(tierName, " ", deepDump(*this, value), "\n");
}
if (hasQuirks())
- out.print("Has Quirks: True\n");
+ out.print(tierName, "Has Quirks: True\n");
if (variables().size()) {
- out.print("Variables:\n");
+ out.print(tierName, "Variables:\n");
for (Variable* variable : variables())
- out.print(" ", deepDump(variable), "\n");
+ out.print(tierName, " ", deepDump(variable), "\n");
}
if (stackSlots().size()) {
- out.print("Stack slots:\n");
+ out.print(tierName, "Stack slots:\n");
for (StackSlot* slot : stackSlots())
- out.print(" ", pointerDump(slot), ": ", deepDump(slot), "\n");
+ out.print(tierName, " ", pointerDump(slot), ": ", deepDump(slot), "\n");
}
if (m_byproducts->count())
out.print(*m_byproducts);
Modified: trunk/Source/_javascript_Core/b3/B3Value.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/B3Value.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/B3Value.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -51,7 +51,7 @@
namespace JSC { namespace B3 {
-const char* const Value::dumpPrefix = "@";
+const char* const Value::dumpPrefix = "b@";
void DeepValueDump::dump(PrintStream& out) const
{
if (m_value)
Modified: trunk/Source/_javascript_Core/b3/air/AirBasicBlock.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/air/AirBasicBlock.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/air/AirBasicBlock.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -72,21 +72,21 @@
{
dumpHeader(out);
for (const Inst& inst : *this)
- out.print(" ", inst, "\n");
+ out.print(tierName, " ", inst, "\n");
dumpFooter(out);
}
void BasicBlock::dumpHeader(PrintStream& out) const
{
- out.print("BB", *this, ": ; frequency = ", m_frequency, "\n");
+ out.print(tierName, "BB", *this, ": ; frequency = ", m_frequency, "\n");
if (predecessors().size())
- out.print(" Predecessors: ", pointerListDump(predecessors()), "\n");
+ out.print(tierName, " Predecessors: ", pointerListDump(predecessors()), "\n");
}
void BasicBlock::dumpFooter(PrintStream& out) const
{
if (successors().size())
- out.print(" Successors: ", listDump(successors()), "\n");
+ out.print(tierName, " Successors: ", listDump(successors()), "\n");
}
BasicBlock::BasicBlock(unsigned index, double frequency)
Modified: trunk/Source/_javascript_Core/b3/air/AirCode.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/air/AirCode.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/air/AirCode.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -40,6 +40,8 @@
namespace JSC { namespace B3 { namespace Air {
+const char* const tierName = "Air ";
+
static void defaultPrologueGenerator(CCallHelpers& jit, Code& code)
{
jit.emitFunctionPrologue();
@@ -248,26 +250,26 @@
void Code::dump(PrintStream& out) const
{
if (!m_entrypoints.isEmpty())
- out.print("Entrypoints: ", listDump(m_entrypoints), "\n");
+ out.print(tierName, "Entrypoints: ", listDump(m_entrypoints), "\n");
for (BasicBlock* block : *this)
out.print(deepDump(block));
if (stackSlots().size()) {
- out.print("Stack slots:\n");
+ out.print(tierName, "Stack slots:\n");
for (StackSlot* slot : stackSlots())
- out.print(" ", pointerDump(slot), ": ", deepDump(slot), "\n");
+ out.print(tierName, " ", pointerDump(slot), ": ", deepDump(slot), "\n");
}
if (specials().size()) {
- out.print("Specials:\n");
+ out.print(tierName, "Specials:\n");
for (Special* special : specials())
- out.print(" ", deepDump(special), "\n");
+ out.print(tierName, " ", deepDump(special), "\n");
}
if (m_frameSize || m_stackIsAllocated)
- out.print("Frame size: ", m_frameSize, m_stackIsAllocated ? " (Allocated)" : "", "\n");
+ out.print(tierName, "Frame size: ", m_frameSize, m_stackIsAllocated ? " (Allocated)" : "", "\n");
if (m_callArgAreaSize)
- out.print("Call arg area size: ", m_callArgAreaSize, "\n");
+ out.print(tierName, "Call arg area size: ", m_callArgAreaSize, "\n");
RegisterAtOffsetList calleeSaveRegisters = this->calleeSaveRegisterAtOffsetList();
if (calleeSaveRegisters.size())
- out.print("Callee saves: ", calleeSaveRegisters, "\n");
+ out.print(tierName, "Callee saves: ", calleeSaveRegisters, "\n");
}
unsigned Code::findFirstBlockIndex(unsigned index) const
Modified: trunk/Source/_javascript_Core/b3/air/AirCode.h (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/air/AirCode.h 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/air/AirCode.h 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -63,6 +63,8 @@
typedef void PrologueGeneratorFunction(CCallHelpers&, Code&);
typedef SharedTask<PrologueGeneratorFunction> PrologueGenerator;
+extern const char* const tierName;
+
// This is an IR that is very close to the bare metal. It requires about 40x more bytes than the
// generated machine code - for example if you're generating 1MB of machine code, you need about
// 40MB of Air.
Modified: trunk/Source/_javascript_Core/b3/air/AirDisassembler.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/air/AirDisassembler.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/air/AirDisassembler.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -105,7 +105,7 @@
// FIXME: We could be better about various late paths. We can implement
// this later if we find a strong use for it.
- out.print("# Late paths\n");
+ out.print(tierName, "# Late paths\n");
dumpAsmRange(m_latePathStart, m_latePathEnd);
}
Modified: trunk/Source/_javascript_Core/b3/air/AirGenerate.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/b3/air/AirGenerate.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/b3/air/AirGenerate.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -68,7 +68,7 @@
// If we're doing super verbose dumping, the phase scope of any phase will already do a dump.
if (shouldDumpIR(AirMode) && !shouldDumpIRAtEachPhase(AirMode)) {
- dataLog("Initial air:\n");
+ dataLog(tierName, "Initial air:\n");
dataLog(code);
}
Modified: trunk/Source/_javascript_Core/dfg/DFGCommon.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/dfg/DFGCommon.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/dfg/DFGCommon.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,6 +34,8 @@
namespace JSC { namespace DFG {
+const char* const tierName = "DFG ";
+
static Lock crashLock;
void startCrashing()
Modified: trunk/Source/_javascript_Core/dfg/DFGCommon.h (255481 => 255482)
--- trunk/Source/_javascript_Core/dfg/DFGCommon.h 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/dfg/DFGCommon.h 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -40,6 +40,8 @@
typedef uint32_t BlockIndex;
static constexpr BlockIndex NoBlock = UINT_MAX;
+extern const char* const tierName;
+
// Use RefChildren if the child ref counts haven't already been adjusted using
// other means and either of the following is true:
// - The node you're creating is MustGenerate.
Modified: trunk/Source/_javascript_Core/dfg/DFGGraph.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/dfg/DFGGraph.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/dfg/DFGGraph.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2019 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -185,8 +185,8 @@
// Example/explanation of dataflow dump output
//
- // 14: <!2:7> GetByVal(@3, @13)
- // ^1 ^2 ^3 ^4 ^5
+ // D@14: <!2:7> GetByVal(@3, @13)
+ // ^1 ^2 ^3 ^4 ^5
//
// (1) The nodeIndex of this operation.
// (2) The reference count. The number printed is the 'real' count,
@@ -195,11 +195,13 @@
// (3) The virtual register slot assigned to this node.
// (4) The name of the operation.
// (5) The arguments to the operation. The may be of the form:
- // @# - a NodeIndex referencing a prior node in the graph.
+ // D@# - a NodeIndex referencing a prior node in the graph.
// arg# - an argument number.
// id# - the index in the CodeBlock of an identifier { if codeBlock is passed to dump(), the string representation is displayed }.
// var# - the index of a var on the global object, used by GetGlobalVar/GetGlobalLexicalVariable/PutGlobalVariable operations.
- out.printf("% 4d:<%c%u:", (int)node->index(), mustGenerate ? '!' : ' ', refCount);
+ int nodeIndex = node->index();
+ const char* prefixPadding = nodeIndex < 10 ? " " : nodeIndex < 100 ? " " : " ";
+ out.printf("%sD@%d:<%c%u:", prefixPadding, nodeIndex, mustGenerate ? '!' : ' ', refCount);
if (node->hasResult() && node->hasVirtualRegister() && node->virtualRegister().isValid())
out.print(node->virtualRegister());
else
@@ -518,13 +520,13 @@
ASSERT(phiNode->op() == Phi);
if (!phiNode->shouldGenerate() && phiNodeDumpMode == DumpLivePhisOnly)
continue;
- out.print(" @", phiNode->index(), "<", phiNode->operand(), ",", phiNode->refCount(), ">->(");
+ out.print(" D@", phiNode->index(), "<", phiNode->operand(), ",", phiNode->refCount(), ">->(");
if (phiNode->child1()) {
- out.print("@", phiNode->child1()->index());
+ out.print("D@", phiNode->child1()->index());
if (phiNode->child2()) {
- out.print(", @", phiNode->child2()->index());
+ out.print(", D@", phiNode->child2()->index());
if (phiNode->child3())
- out.print(", @", phiNode->child3()->index());
+ out.print(", D@", phiNode->child3()->index());
}
}
out.print(")", i + 1 < block->phis.size() ? "," : "");
Modified: trunk/Source/_javascript_Core/dfg/DFGNode.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/dfg/DFGNode.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/dfg/DFGNode.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -349,7 +349,7 @@
out.print("-");
return;
}
- out.print("@", node->index());
+ out.print("D@", node->index());
if (node->hasDoubleResult())
out.print("<Double>");
else if (node->hasInt52Result())
Modified: trunk/Source/_javascript_Core/ftl/FTLCompile.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/ftl/FTLCompile.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/ftl/FTLCompile.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -53,6 +53,8 @@
namespace JSC { namespace FTL {
+const char* const tierName = "FTL ";
+
using namespace DFG;
void compile(State& state, Safepoint::Result& safepointResult)
@@ -80,7 +82,7 @@
std::unique_ptr<RegisterAtOffsetList> registerOffsets =
makeUnique<RegisterAtOffsetList>(state.proc->calleeSaveRegisterAtOffsetList());
if (shouldDumpDisassembly())
- dataLog("Unwind info for ", CodeBlockWithJITType(codeBlock, JITType::FTLJIT), ": ", *registerOffsets, "\n");
+ dataLog(tierName, "Unwind info for ", CodeBlockWithJITType(codeBlock, JITType::FTLJIT), ": ", *registerOffsets, "\n");
codeBlock->setCalleeSaveRegisters(WTFMove(registerOffsets));
ASSERT(!(state.proc->frameSize() % sizeof(EncodedJSValue)));
state.jitCode->common.frameRegisterCount = state.proc->frameSize() / sizeof(EncodedJSValue);
@@ -88,7 +90,7 @@
int localsOffset =
state.capturedValue->offsetFromFP() / sizeof(EncodedJSValue) + graph.m_nextMachineLocal;
if (shouldDumpDisassembly()) {
- dataLog(
+ dataLog(tierName,
"localsOffset = ", localsOffset, " for stack slot: ",
pointerDump(state.capturedValue), " at ", RawPointer(state.capturedValue), "\n");
}
@@ -176,10 +178,10 @@
HashSet<B3::Value*> printedValues;
HashSet<Node*> printedNodes;
- const char* dfgPrefix = " ";
- const char* b3Prefix = " ";
- const char* airPrefix = " ";
- const char* asmPrefix = " ";
+ const char* dfgPrefix = "DFG " " ";
+ const char* b3Prefix = "b3 " " ";
+ const char* airPrefix = "Air " " ";
+ const char* asmPrefix = "asm " " ";
auto printDFGNode = [&] (Node* node) {
if (currentDFGNode == node)
Modified: trunk/Source/_javascript_Core/ftl/FTLCompile.h (255481 => 255482)
--- trunk/Source/_javascript_Core/ftl/FTLCompile.h 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/ftl/FTLCompile.h 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,6 +32,8 @@
namespace JSC { namespace FTL {
+extern const char* const tierName;
+
void compile(State&, DFG::Safepoint::Result&);
} } // namespace JSC::FTL
Modified: trunk/Source/_javascript_Core/ftl/FTLState.cpp (255481 => 255482)
--- trunk/Source/_javascript_Core/ftl/FTLState.cpp 2020-01-31 02:27:04 UTC (rev 255481)
+++ trunk/Source/_javascript_Core/ftl/FTLState.cpp 2020-01-31 02:30:11 UTC (rev 255482)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2020 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -67,7 +67,7 @@
proc->setOriginPrinter(
[] (PrintStream& out, B3::Origin origin) {
- out.print("DFG:", bitwise_cast<Node*>(origin.data()));
+ out.print(bitwise_cast<Node*>(origin.data()));
});
proc->setFrontendData(&graph);