Title: [191602] trunk/Source/_javascript_Core
- Revision
- 191602
- Author
- [email protected]
- Date
- 2015-10-26 14:45:59 -0700 (Mon, 26 Oct 2015)
Log Message
Add logging to warn about under-estimated FTL inline cache sizes.
https://bugs.webkit.org/show_bug.cgi?id=150570
Reviewed by Geoffrey Garen.
Added 2 options:
1. JSC_dumpFailedICSizing - dumps an error message if the FTL encounters IC size
estimates that are less than the actual needed code size.
This option is useful for when we add a new IC and want to compute an
estimated size for the IC. To do this:
1. Build jsc for the target port with a very small IC size (enough to
store the jump instruction needed for the out of line fallback
implementation).
2. Implement a test suite with scenarios that exercise all the code paths in
the IC generator.
3. Run jsc with JSC_dumpFailedICSizing=true on the test suite.
4. The max value reported by the dumps will be the worst case size needed to
store the IC. We should use this value for our estimate.
5. Update the IC's estimated size and rebuild jsc.
6. Re-run (3) and confirm that there are no more error messages about the
IC sizing.
2. JSC_assertICSizing - same as JSC_dumpFailedICSizing except that it also
crashes the VM each time it encounters an inadequate IC size estimate.
This option is useful for regression testing to ensure that our estimates
do not regress.
* ftl/FTLCompile.cpp:
(JSC::FTL::generateInlineIfPossibleOutOfLineIfNot):
* runtime/Options.h:
Modified Paths
Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (191601 => 191602)
--- trunk/Source/_javascript_Core/ChangeLog 2015-10-26 21:45:23 UTC (rev 191601)
+++ trunk/Source/_javascript_Core/ChangeLog 2015-10-26 21:45:59 UTC (rev 191602)
@@ -1,3 +1,38 @@
+2015-10-26 Mark Lam <[email protected]>
+
+ Add logging to warn about under-estimated FTL inline cache sizes.
+ https://bugs.webkit.org/show_bug.cgi?id=150570
+
+ Reviewed by Geoffrey Garen.
+
+ Added 2 options:
+ 1. JSC_dumpFailedICSizing - dumps an error message if the FTL encounters IC size
+ estimates that are less than the actual needed code size.
+
+ This option is useful for when we add a new IC and want to compute an
+ estimated size for the IC. To do this:
+ 1. Build jsc for the target port with a very small IC size (enough to
+ store the jump instruction needed for the out of line fallback
+ implementation).
+ 2. Implement a test suite with scenarios that exercise all the code paths in
+ the IC generator.
+ 3. Run jsc with JSC_dumpFailedICSizing=true on the test suite.
+ 4. The max value reported by the dumps will be the worst case size needed to
+ store the IC. We should use this value for our estimate.
+ 5. Update the IC's estimated size and rebuild jsc.
+ 6. Re-run (3) and confirm that there are no more error messages about the
+ IC sizing.
+
+ 2. JSC_assertICSizing - same as JSC_dumpFailedICSizing except that it also
+ crashes the VM each time it encounters an inadequate IC size estimate.
+
+ This option is useful for regression testing to ensure that our estimates
+ do not regress.
+
+ * ftl/FTLCompile.cpp:
+ (JSC::FTL::generateInlineIfPossibleOutOfLineIfNot):
+ * runtime/Options.h:
+
2015-10-26 Saam barati <[email protected]>
r190735 Caused us to maybe trample the base's tag-GPR on 32-bit inline cache when the cache allocates a scratch register and then jumps to the slow path
Modified: trunk/Source/_javascript_Core/ftl/FTLCompile.cpp (191601 => 191602)
--- trunk/Source/_javascript_Core/ftl/FTLCompile.cpp 2015-10-26 21:45:23 UTC (rev 191601)
+++ trunk/Source/_javascript_Core/ftl/FTLCompile.cpp 2015-10-26 21:45:59 UTC (rev 191602)
@@ -169,6 +169,15 @@
return;
}
+ if (Options::assertICSizing() || Options::dumpFailedICSizing()) {
+ static size_t maxSize = 0;
+ if (maxSize < actualCodeSize)
+ maxSize = actualCodeSize;
+ dataLogF("ALERT: Under-estimated FTL Inline Cache Size for %s: estimated %zu, actual %zu, max %zu\n", codeDescription, sizeOfInlineCode, actualCodeSize, maxSize);
+ if (Options::assertICSizing())
+ CRASH();
+ }
+
// If there isn't enough space in the provided inline code area, allocate out of line
// executable memory to link the provided code. Place a jump at the beginning of the
// inline area and jump to the out of line code. Similarly return by appending a jump
Modified: trunk/Source/_javascript_Core/runtime/Options.h (191601 => 191602)
--- trunk/Source/_javascript_Core/runtime/Options.h 2015-10-26 21:45:23 UTC (rev 191601)
+++ trunk/Source/_javascript_Core/runtime/Options.h 2015-10-26 21:45:59 UTC (rev 191602)
@@ -280,6 +280,9 @@
\
v(unsigned, reoptimizationRetryCounterMax, 0, nullptr) \
\
+ v(bool, assertICSizing, false, "crash if estimated IC sizes are inadequate") \
+ v(bool, dumpFailedICSizing, false, "dumps a log entry if estimated IC sizes are inadequate") \
+ \
v(unsigned, minimumOptimizationDelay, 1, nullptr) \
v(unsigned, maximumOptimizationDelay, 5, nullptr) \
v(double, desiredProfileLivenessRate, 0.75, nullptr) \
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes