<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 2, 2014, at 12:54 PM, Eric Christopher <<a href="mailto:echristo@gmail.com">echristo@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I do not like the idea of doing this for safe.div at all, but we could<br>certainly add more useful semantics to patchpoint without affecting WebKit.<br><br></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">I'm curious about this though, what do you have in mind here about sdiv?</span></blockquote></div><br><div><div>division + patchpoints just work the way you would expect</div><div><br></div><div>(1) if (division would fail) { call @patchpoint(all of my state) } else { result = a / b }</div><div><br></div><div>Good, this is exactly how patchpoints should be used in general. If you're not going to use the div0/overflow result, say because you deoptimize here, you would also have an unreachable on the cold path.</div><div><br></div><div>(2) call @safe.div; if (division-failed) { call @patchpoint(my state); unreachable }</div><div><br></div><div>Great! In this case, the operation we're checking already gives us the condition we need to check and it's easier to pattern match. Note that this use case alone is not a compelling reason for @safe.div. The good thing about @safe.div is that it can be used for such a wide variety of use cases and in some situations will lead to much better codegen (yes we could get performance data--I don't have it on hand).</div></div><div><br></div><div>-Andy</div></body></html>