- Revision
- 194493
- Author
- [email protected]
- Date
- 2016-01-01 22:03:17 -0800 (Fri, 01 Jan 2016)
Log Message
FTL B3 should be able to run all of the old V8v7 tests
https://bugs.webkit.org/show_bug.cgi?id=152579
Reviewed by Saam Barati.
Fixes some silly bugs that were preventing us from running all of the old V8v7 tests.
IRC's analysis of when to turn a Move into a Move32 when spilling is based on the premise
that if the dst has a 32-bit def width, then the src must also have a 32-bit def width. But
that doesn't happen if the src is an immediate.
This changes that condition in IRC to use the combined use/def width of both src and dst
rather than being clever. This is great because it's the combined width that determines the
size of the spill slot.
Also added some more debug support to TmpWidth.
This also fixes Air's description of DivDouble; previously it claimed to be a 32-bit
operation. Also implements Output::unsignedToDouble(), since we already had everything we
needed to implement this optimally.
* b3/air/AirIteratedRegisterCoalescing.cpp:
* b3/air/AirOpcode.opcodes:
* b3/air/AirTmpWidth.cpp:
(JSC::B3::Air::TmpWidth::recompute):
(JSC::B3::Air::TmpWidth::Widths::dump):
* b3/air/AirTmpWidth.h:
(JSC::B3::Air::TmpWidth::Widths::Widths):
* ftl/FTLB3Output.cpp:
(JSC::FTL::Output::doubleToUInt):
(JSC::FTL::Output::unsignedToDouble):
* ftl/FTLB3Output.h:
(JSC::FTL::Output::zeroExt):
(JSC::FTL::Output::zeroExtPtr):
(JSC::FTL::Output::intToDouble):
(JSC::FTL::Output::castToInt32):
(JSC::FTL::Output::unsignedToDouble): Deleted.
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (194492 => 194493)
--- trunk/Source/_javascript_Core/ChangeLog 2016-01-02 05:56:29 UTC (rev 194492)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-01-02 06:03:17 UTC (rev 194493)
@@ -1,3 +1,43 @@
+2015-12-28 Filip Pizlo <[email protected]>
+
+ FTL B3 should be able to run all of the old V8v7 tests
+ https://bugs.webkit.org/show_bug.cgi?id=152579
+
+ Reviewed by Saam Barati.
+
+ Fixes some silly bugs that were preventing us from running all of the old V8v7 tests.
+
+ IRC's analysis of when to turn a Move into a Move32 when spilling is based on the premise
+ that if the dst has a 32-bit def width, then the src must also have a 32-bit def width. But
+ that doesn't happen if the src is an immediate.
+
+ This changes that condition in IRC to use the combined use/def width of both src and dst
+ rather than being clever. This is great because it's the combined width that determines the
+ size of the spill slot.
+
+ Also added some more debug support to TmpWidth.
+
+ This also fixes Air's description of DivDouble; previously it claimed to be a 32-bit
+ operation. Also implements Output::unsignedToDouble(), since we already had everything we
+ needed to implement this optimally.
+
+ * b3/air/AirIteratedRegisterCoalescing.cpp:
+ * b3/air/AirOpcode.opcodes:
+ * b3/air/AirTmpWidth.cpp:
+ (JSC::B3::Air::TmpWidth::recompute):
+ (JSC::B3::Air::TmpWidth::Widths::dump):
+ * b3/air/AirTmpWidth.h:
+ (JSC::B3::Air::TmpWidth::Widths::Widths):
+ * ftl/FTLB3Output.cpp:
+ (JSC::FTL::Output::doubleToUInt):
+ (JSC::FTL::Output::unsignedToDouble):
+ * ftl/FTLB3Output.h:
+ (JSC::FTL::Output::zeroExt):
+ (JSC::FTL::Output::zeroExtPtr):
+ (JSC::FTL::Output::intToDouble):
+ (JSC::FTL::Output::castToInt32):
+ (JSC::FTL::Output::unsignedToDouble): Deleted.
+
2016-01-01 Jeff Miller <[email protected]>
Update user-visible copyright strings to include 2016
Modified: trunk/Source/_javascript_Core/b3/air/AirIteratedRegisterCoalescing.cpp (194492 => 194493)
--- trunk/Source/_javascript_Core/b3/air/AirIteratedRegisterCoalescing.cpp 2016-01-02 05:56:29 UTC (rev 194492)
+++ trunk/Source/_javascript_Core/b3/air/AirIteratedRegisterCoalescing.cpp 2016-01-02 06:03:17 UTC (rev 194493)
@@ -1193,8 +1193,8 @@
bool forceMove32IfDidSpill = false;
bool didSpill = false;
if (type == Arg::GP && inst.opcode == Move) {
- if ((inst.args[0].isTmp() && m_tmpWidth.defWidth(inst.args[0].tmp()) <= Arg::Width32)
- || (inst.args[1].isTmp() && m_tmpWidth.useWidth(inst.args[1].tmp()) <= Arg::Width32))
+ if ((inst.args[0].isTmp() && m_tmpWidth.width(inst.args[0].tmp()) <= Arg::Width32)
+ || (inst.args[1].isTmp() && m_tmpWidth.width(inst.args[1].tmp()) <= Arg::Width32))
forceMove32IfDidSpill = true;
}
Modified: trunk/Source/_javascript_Core/b3/air/AirOpcode.opcodes (194492 => 194493)
--- trunk/Source/_javascript_Core/b3/air/AirOpcode.opcodes 2016-01-02 05:56:29 UTC (rev 194492)
+++ trunk/Source/_javascript_Core/b3/air/AirOpcode.opcodes 2016-01-02 06:03:17 UTC (rev 194493)
@@ -201,10 +201,10 @@
Tmp, Tmp
Addr, Tmp
-arm64: DivDouble U:F:32, U:F:32, D:F:32
+arm64: DivDouble U:F:64, U:F:32, D:F:64
Tmp, Tmp, Tmp
-x86: DivDouble U:F:32, UD:F:32
+x86: DivDouble U:F:64, UD:F:64
Tmp, Tmp
Addr, Tmp
Modified: trunk/Source/_javascript_Core/b3/air/AirTmpWidth.cpp (194492 => 194493)
--- trunk/Source/_javascript_Core/b3/air/AirTmpWidth.cpp 2016-01-02 05:56:29 UTC (rev 194492)
+++ trunk/Source/_javascript_Core/b3/air/AirTmpWidth.cpp 2016-01-02 06:03:17 UTC (rev 194493)
@@ -30,6 +30,7 @@
#include "AirCode.h"
#include "AirInstInlines.h"
+#include <wtf/ListDump.h>
namespace JSC { namespace B3 { namespace Air {
@@ -50,6 +51,13 @@
{
// Set this to true to cause this analysis to always return pessimistic results.
const bool beCareful = false;
+
+ const bool verbose = false;
+
+ if (verbose) {
+ dataLog("Code before TmpWidth:\n");
+ dataLog(code);
+ }
m_width.clear();
@@ -150,8 +158,16 @@
}
}
}
+
+ if (verbose)
+ dataLog("width: ", mapDump(m_width), "\n");
}
+void TmpWidth::Widths::dump(PrintStream& out) const
+{
+ out.print("{use = ", use, ", def = ", def, "}");
+}
+
} } } // namespace JSC::B3::Air
#endif // ENABLE(B3_JIT)
Modified: trunk/Source/_javascript_Core/b3/air/AirTmpWidth.h (194492 => 194493)
--- trunk/Source/_javascript_Core/b3/air/AirTmpWidth.h 2016-01-02 05:56:29 UTC (rev 194492)
+++ trunk/Source/_javascript_Core/b3/air/AirTmpWidth.h 2016-01-02 06:03:17 UTC (rev 194493)
@@ -92,6 +92,8 @@
use = Arg::minimumWidth(type);
def = Arg::minimumWidth(type);
}
+
+ void dump(PrintStream& out) const;
Arg::Width use;
Arg::Width def;
Modified: trunk/Source/_javascript_Core/ftl/FTLB3Output.cpp (194492 => 194493)
--- trunk/Source/_javascript_Core/ftl/FTLB3Output.cpp 2016-01-02 05:56:29 UTC (rev 194492)
+++ trunk/Source/_javascript_Core/ftl/FTLB3Output.cpp 2016-01-02 06:03:17 UTC (rev 194493)
@@ -125,6 +125,11 @@
return result;
}
+LValue Output::unsignedToDouble(LValue value)
+{
+ return intToDouble(zeroExt(value, Int64));
+}
+
LValue Output::load8SignExt32(TypedPointer pointer)
{
LValue load = m_block->appendNew<MemoryValue>(m_proc, Load8S, Int32, origin(), pointer.value());
Modified: trunk/Source/_javascript_Core/ftl/FTLB3Output.h (194492 => 194493)
--- trunk/Source/_javascript_Core/ftl/FTLB3Output.h 2016-01-02 05:56:29 UTC (rev 194492)
+++ trunk/Source/_javascript_Core/ftl/FTLB3Output.h 2016-01-02 06:03:17 UTC (rev 194493)
@@ -189,7 +189,7 @@
}
LValue zeroExtPtr(LValue value) { return zeroExt(value, B3::Int64); }
LValue intToDouble(LValue value) { return m_block->appendNew<B3::Value>(m_proc, B3::IToD, origin(), value); }
- LValue unsignedToDouble(LValue value) { CRASH(); }
+ LValue unsignedToDouble(LValue);
LValue castToInt32(LValue value)
{
return value->type() == B3::Int32 ? value :