Assertions Are Pessimistic, Assumptions Are Optimistic (2014)(blog.regehr.org)
blog.regehr.org
Assertions Are Pessimistic, Assumptions Are Optimistic (2014)
http://blog.regehr.org/archives/1096
4 comments
Looks like others took up the cause later, see https://raw.githubusercontent.com/bjacob/builtin-unreachable... and https://groups.google.com/forum/#!topic/mozilla.dev.platform...
This is fascinating, I didn't realize that compilers even could do so much with one simple primitive!
What a weird typing / prolog-cut mechanism.
Also, many asserts are rewritten to provide debugging information, not just crashing the program. Firefox had a bunch of asserts that sent logged information before they died, for example. As a result, you're usually willing to take the performance hit to find out why your program failed, esp when the hit is small (here it's shown to be <10%).