DFG_ASSERT should allow stuffing registers before trapping.
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2017 08:23:18 +0000 (08:23 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Jun 2017 08:23:18 +0000 (08:23 +0000)
commit26f5496b1aa3da9e3126a472d763f9e0645df9c0
treef5a4df17637e5319e828f0f19bdbd552423d2b1c
parentccdd89a2e7694b72711661f2ff8fa04bbe7299b8
DFG_ASSERT should allow stuffing registers before trapping.
https://bugs.webkit.org/show_bug.cgi?id=174005

Reviewed by Mark Lam.

Source/JavaScriptCore:

DFG_ASSERT currently prints error data to stderr before crashing,
which is nice for local development. In the wild, however, we
can't see this information in crash logs. This patch enables
stuffing some of the most useful information from DFG_ASSERTS into
up to five registers right before crashing. The values stuffed
should not impact any logging during local development.

* assembler/AbortReason.h:
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::verifyEdge):
* dfg/DFGGraph.cpp:
(JSC::DFG::logForCrash):
(JSC::DFG::Graph::logAssertionFailure):
(JSC::DFG::crash): Deleted.
(JSC::DFG::Graph::handleAssertionFailure): Deleted.
* dfg/DFGGraph.h:

Source/WTF:

Add new template functions that enable stuffing up to five values
into registers before crashing.

* wtf/Assertions.h:
(CRASH_WITH_INFO):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/AbortReason.h
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Source/JavaScriptCore/dfg/DFGGraph.cpp
Source/JavaScriptCore/dfg/DFGGraph.h
Source/WTF/ChangeLog
Source/WTF/wtf/Assertions.h