Open Bug 1481124 Opened 6 years ago Updated 2 years ago

Menu takes longer to open in Firefox than in chrome

Categories

(Core :: JavaScript Engine, defect, P3)

63 Branch
Unspecified
Android
defect

Tracking

()

Performance Impact low
Tracking Status
firefox63 --- affected

People

(Reporter: karlcow, Unassigned)

References

()

Details

(Whiteboard: [webcompat])

This is a spin-off of https://webcompat.com/issues/18031
This is related to a performance issue. Flagging with [qf]

Steps to reproduce
Entered too fast. :)

Steps to reproduce 

1. With Firefox Android (or Firefox Desktop RDM + Firefox Android UA + touch events)
2. Go to https://www.samsung.com/us/
3. tap the 3-bars menu
4. tap mobile
5. (wait) the menu takes a long time to open

(On the other hand on chrome this is alsmost instantaneous)


Performance Profile. (on desktop with RDM mode)
https://perfht.ml/2Mm49LL
Something weird with BytecodeParser::parse
Component: DOM → JavaScript Engine
BytecodeParser::parse() is called because the code is apparently trying to get a property from `undefined` (or `null`), in which case we try to decompile the bytecode to generate a more user-friendly error message.

(anonymous namespace)::BytecodeParser::parse()
  js::DecompileValueGenerator(JSContext*, int, JS::Handle<JS::Value>, JS::Handle<JSString*>, int)
    js::ReportIsNullOrUndefined(JSContext*, int, JS::Handle<JS::Value>)
      js::ToObjectSlow(JSContext*, JS::Handle<JS::Value>, bool)
        js::GetProperty(JSContext*, JS::Handle<JS::Value>, JS::Handle<js::PropertyName*>, JS::MutableHandle<JS::Value>) 
          js::jit::DoGetPropFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICGetProp_Fallback*, JS::MutableHandle<JS::Value>, JS::MutableHandle<JS::Value>)
            0x350351aa7094
We should use JSDVG_IGNORE_STACK in ReportIsNullOrUndefined if no debugger is attached. We still get the error message but will be something like |undefined is not a function| instead of |x.foo is not a function|. If user reloads with a debugger, they'd get the friendly message.
Whiteboard: [webcompat] [qf] → [webcompat] [qf:p3]
We should make sure to maintain the detail errors in jsshell though.
Detailed error messages are used even when no debugger is attached, don't they? At least I assume they are, for example when websites attach a |window.onerror| handler to intercept uncaught exceptions and then send them to the server for recording.
They'd still get an actionable error, they would just need to look at the line of code and see the name of the binding. The reason for failure and the location would still be accurate. As well, Ion isn't able to support the expression de-compiler in general.
Depends on: 1482846

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

Performance Impact: --- → P3
Whiteboard: [webcompat] [qf:p3] → [webcompat]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.