Closed
Bug 1036781
Opened 11 years ago
Closed 10 years ago
Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit
Categories
(Core :: JavaScript Engine: JIT, defect)
Core
JavaScript Engine: JIT
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file)
301.05 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
Replace calls to the deprecated MOZ_ASSUME_UNREACHABLE macro with MOZ_CRASH.
Calls to MOZ_NOT_REACHED were replaced with MOZ_ASSUME_UNREACHABLE which, instead of crashing unconditionally, invokes undefined behavior in the name of dubious and dangerous compiler optimizations. See bug 990764 for details. This patch reverts to the original crashing behavior.
(MOZ_ASSUME_UNREACHABLE will eventually be removed or renamed in bug 990764.)
Attachment #8453545 -
Flags: review?(jdemooij)
Comment 1•11 years ago
|
||
Comment on attachment 8453545 [details] [diff] [review]
replace-js-jit-MOZ_ASSUME_UNREACHABLE.patch
Review of attachment 8453545 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, thanks!
Attachment #8453545 -
Flags: review?(jdemooij) → review+
Assignee | ||
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
![]() |
||
Comment 4•11 years ago
|
||
This would appear to the most likely bug in the range that caused a 52% regression on awfy on asmjs-ubench-skinning on 32-bit mac both asm.js and no-asm.js.
Comment 5•11 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #4)
> This would appear to the most likely bug in the range that caused a 52%
> regression on awfy on asmjs-ubench-skinning on 32-bit mac both asm.js and
> no-asm.js.
I'm not familiar with the benchmark, but "ubench" in the name suggests we don't spend a lot of time compiling, right? Maybe we call some VM function that's now slower?
Assignee | ||
Comment 6•11 years ago
|
||
I can back out this change. Later I will submit a new patch for review that renames these MOZ_ASSUME_UNREACHABLE calls to MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE (with equivalent behavior with a new name) instead of MOZ_CRASH.
Assignee | ||
Comment 7•11 years ago
|
||
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
![]() |
||
Comment 8•11 years ago
|
||
Oops, I missed these replies.
(In reply to Jan de Mooij [:jandem] from comment #5)
> I'm not familiar with the benchmark, but "ubench" in the name suggests we
> don't spend a lot of time compiling, right? Maybe we call some VM function
> that's now slower?
Yes, I expect you're right; compilation time should be inconsequential for skinning. A VM path was affected. A little profiling would hopefully point to the offender.
Comment 9•11 years ago
|
||
Chris let me know if you want help tracking this down.
Assignee | ||
Comment 10•11 years ago
|
||
Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH and MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE in js/src/asmjs:
https://hg.mozilla.org/integration/mozilla-inbound/rev/264ff666617e
Comment 11•11 years ago
|
||
For what it's worth, AWFY isn't updating at the moment, but local testing says there's no slowdown for asm.js micro benchmarks on a x86 build.
Comment 12•11 years ago
|
||
Assignee | ||
Comment 13•11 years ago
|
||
Part 2: js/src/jit/x86 with only 1.8% regression on asmjs-ubench-skinning
But I backed out and relanded to fix the incorrect bug number in the commit message. :(
https://hg.mozilla.org/integration/mozilla-inbound/rev/a8e3534959ba
https://hg.mozilla.org/integration/mozilla-inbound/rev/33373d724284
https://hg.mozilla.org/integration/mozilla-inbound/rev/ee2ceee36816
Comment 14•11 years ago
|
||
Assignee | ||
Comment 15•11 years ago
|
||
Part 3: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit for x86 and x64:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ff9ac3b549cc
Comment 16•11 years ago
|
||
Assignee | ||
Comment 17•11 years ago
|
||
Part 4: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit for Baseline code.
https://hg.mozilla.org/integration/mozilla-inbound/rev/21bc84614aa2
Assignee | ||
Comment 18•11 years ago
|
||
Part 4 was backed out for unrelated crashes from bug 1054630:
https://hg.mozilla.org/integration/mozilla-inbound/rev/95e2221d349a
Relanding part 4:
https://hg.mozilla.org/integration/mozilla-inbound/rev/00188cde54d6
Assignee | ||
Comment 19•11 years ago
|
||
Part 5: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit for Ion.
https://hg.mozilla.org/integration/mozilla-inbound/rev/bdc4a4fe462f
Assignee | ||
Comment 20•11 years ago
|
||
Part 6: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit/arm/
Part 7: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit/mips/
https://hg.mozilla.org/integration/mozilla-inbound/rev/d89484b7c0fa
https://hg.mozilla.org/integration/mozilla-inbound/rev/7b719ddeea01
Assignee | ||
Comment 21•11 years ago
|
||
I backed out the ARM changes to see if it burned Android 2.3 Opt, whose tests started timing out with this changeset.
https://tbpl.mozilla.org/?tree=Mozilla-Inbound&rev=7b719ddeea01
https://hg.mozilla.org/integration/mozilla-inbound/rev/eeee10f1b325
Comment 22•11 years ago
|
||
![]() |
||
Comment 23•11 years ago
|
||
I just thought of something: MOZ_CRASH("why") will actually print "why" in a release build (to stderr), right? Has anyone measured the binary size increase from all these otherwise-unused string literals? It seems pretty easy to measure (just change MOZ_CRASH not to embed the string and measure binary before/after).
Comment 24•11 years ago
|
||
(In reply to Luke Wagner [:luke] from comment #23)
> I just thought of something: MOZ_CRASH("why") will actually print "why" in a
> release build (to stderr), right? Has anyone measured the binary size
> increase from all these otherwise-unused string literals? It seems pretty
> easy to measure (just change MOZ_CRASH not to embed the string and measure
> binary before/after).
Only in release builds:
* If we're a DEBUG build and we crash at a MOZ_CRASH which provides an
* explanation-string, we print the string to stderr. Otherwise, we don't
* print anything; this is because we want MOZ_CRASH to be 100% safe in release
* builds, and it's hard to print to stderr safely when memory might have been
* corrupted.
("Don't increase the binary size" could probably also be mentioned there...)
Comment 25•11 years ago
|
||
(In reply to Jan de Mooij [:jandem] from comment #24)
> Only in release builds:
Oops, s/release/debug/ obviously.
![]() |
||
Comment 26•11 years ago
|
||
Oops, thanks, I misread the code.
Assignee | ||
Comment 27•11 years ago
|
||
Part 8: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit/*Allocator.* code
https://hg.mozilla.org/integration/mozilla-inbound/rev/66e350a413a6
Assignee | ||
Comment 29•10 years ago
|
||
Part 9: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit/arm/
https://hg.mozilla.org/integration/mozilla-inbound/rev/499e35dfdace
Comment 30•10 years ago
|
||
Assignee | ||
Comment 31•10 years ago
|
||
Part 10: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit MIR code.
https://hg.mozilla.org/integration/mozilla-inbound/rev/8106c19ed3b0
Comment 32•10 years ago
|
||
Assignee | ||
Comment 33•10 years ago
|
||
Part 12: Replace MOZ_ASSUME_UNREACHABLE with MOZ_CRASH in js/src/jit:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fb651803afe9
Assignee | ||
Comment 34•10 years ago
|
||
With this final patch, there was no asmjs-ubench-skinning regression:
http://arewefastyet.com/#machine=11&view=single&suite=asmjs-ubench&subtest=skinning
But there was minor regression on Octane DeltaBlue, Splay, and SplayLatency but it looks like a temporary blip:
http://arewefastyet.com/#machine=11&view=breakdown&suite=octane
Comment 35•10 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 11 years ago → 10 years ago
Resolution: --- → FIXED
Target Milestone: mozilla33 → mozilla35
You need to log in
before you can comment on or make changes to this bug.
Description
•