If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Not enough JavaScript frames in some call stacks




Gecko Profiler
a month ago
a month ago


(Reporter: mstange, Unassigned)


(Blocks: 1 bug)


Firefox Tracking Flags

(firefox57 affected)




a month ago
If you drag a tab, something calls getImageData on a canvas. The stack in the profiler looks like this:

>        [...]
>        mozilla::dom::CanvasRenderingContext2D::GetImageDataArray(JSContext*, int, int, unsigned int, unsigned int, JSObject**)
>        mozilla::dom::CanvasRenderingContext2D::GetImageData(JSContext*, double, double, double, double, mozilla::ErrorResult&)
>        mozilla::dom::CanvasRenderingContext2DBinding::getImageData(JSContext*, JS::Handle<JSObject*>, mozilla::dom::CanvasRenderingContext2D*, JSJitMethodCallArgs const&)
>        mozilla::dom::GenericBindingMethod(JSContext*, unsigned int, JS::Value*)
>        js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct)
>        <name omitted>
>        js::ForwardingProxyHandler::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const
>        js::CrossCompartmentWrapper::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&) const
>        js::Proxy::call(JSContext*, JS::Handle<JSObject*>, JS::CallArgs const&)
>        js::proxy_Call(JSContext*, unsigned int, JS::Value*)
>        js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct)
>        Interpret(JSContext*, js::RunState&)
>        js::RunScript(JSContext*, js::RunState&)
>  JS -> next
>        js::RunScript
>        js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct)
>        <name omitted>
>        js::CallSelfHostedFunction(JSContext*, JS::Handle<js::PropertyName*>, JS::Handle<JS::Value>, js::AnyInvokeArgs const&, JS::MutableHandle<JS::Value>)
>        AsyncFunctionResume(JSContext*, JS::Handle<js::PromiseObject*>, JS::Handle<JS::Value>, ResumeKind, JS::Handle<JS::Value>)
>        PromiseReactionJob(JSContext*, unsigned int, JS::Value*)
>        js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct)
>        <name omitted>
>        JS::Call(JSContext*, JS::Handle<JS::Value>, JS::Handle<JS::Value>, JS::HandleValueArray const&, JS::MutableHandle<JS::Value>)
>        mozilla::dom::PromiseJobCallback::Call(JSContext*, JS::Handle<JS::Value>, mozilla::ErrorResult&)
>        mozilla::PromiseJobRunnable::Run()
>        mozilla::dom::Promise::PerformMicroTaskCheckpoint()
>        mozilla::CycleCollectedJSContext::AfterProcessTask(unsigned int)
>        XPCJSContext::AfterProcessTask(unsigned int)
>        nsThread::ProcessNextEvent(bool, bool*)
>        [...]

This stack contains lots of C++ functions, a few pseudo frames, and one (1) JS frame. The JS frame is for the self-hosted "next" function.

There are at least two JS functions missing in this call stack: The one that calls next, and the one that calls getImageData.

It looks like it would be the JS interpreter's job to push pseudo frames for these functions, and it doesn't do it.
You need to log in before you can comment on or make changes to this bug.