Closed Bug 1369420 Opened 9 years ago Closed 3 years ago

Identical failure paths should be collapsed

Categories

(Core :: CSS Parsing and Computation, enhancement, P3)

enhancement

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox57 --- wontfix
firefox58 --- wontfix
firefox59 --- ?

People

(Reporter: away, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [Stylo])

In the disassembly of style::properties::PropertyDeclaration::parse_into, at the end there is an area with hundreds of repetitions of: 142476 00000001`80437946 e8b5490f00 call xul!alloc::oom::oom (00000001`8052c300) 142476 00000001`8043794b 0f0b ud2 142476 00000001`8043794d e8ae490f00 call xul!alloc::oom::oom (00000001`8052c300) 142476 00000001`80437952 0f0b ud2 142476 00000001`80437954 e8a7490f00 call xul!alloc::oom::oom (00000001`8052c300) 142476 00000001`80437959 0f0b ud2 ... I'm guessing what's happening is that the compiler places unlikely fatal codepaths at the end of the function, outside of the normal control flow (which is good) but it would be good if it could recognize when several of these paths will lead to the same place and collapse them to save space. (Such an optimization would be incorrect if we're using the return address as a differentiator for which particular OOM occurred, but I don't believe that's the case here.) This was on a Win64 opt build, if it matters.
This sounds like something Rust or LLVM should optimize? It doesn't seem to me this is something optimizable in our code.
Marking this a tooling bug per comment 1, NI dmajor to verify.
Flags: needinfo?(dmajor)
Summary: stylo: Identical failure paths should be collapsed → Identical failure paths should be collapsed
Whiteboard: [Stylo]
Yep.
Flags: needinfo?(dmajor)
Should we ask some Rust guys to take a look at this problem?
How much would it win us?
Flags: needinfo?(dmajor)
Hard to say; it varies based on function. style::properties::PropertyDeclaration::parse_into is about 1% repeated-oom-gunk (5KB). style::properties::{{impl}}::clone has about 6 pages of oom-gunk compared to 3 pages of actual code! Some other random functions I dumped don't have any repetition at all. Wild guess, maybe that 1% number is reasonable to extrapolate from?
Flags: needinfo?(dmajor)
That seems significant enough to pursue. Brian, can you route this and bring it up with the right people?
Flags: needinfo?(andersrb)
I have cross-posted a bug and pinged somebody who might be interested: https://github.com/rust-lang/rust/issues/42666
Flags: needinfo?(andersrb)
Priority: -- → P3

This doesn't seem to be happening anymore.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.