Closed Bug 1058651 Opened 5 years ago Closed 5 years ago

Add MOZ_UNLIKELY to codegen argc and exception checks


(Core :: DOM: Core & HTML, defect)

Not set





(Reporter: Ms2ger, Assigned: akshendra521994, Mentored)


(Blocks 1 open bug)


(Whiteboard: [lang=python][lang=c++])


(1 file)

The codegen for DOM bindings (<>) generates code that includes checks on the number of arguments and checks if the native function threw an exception.

We expect that these checks are only quite rarely true, so it seems worthwhile to wrap those checks in the MOZ_UNLIKELY() macro, to potentially improve the compiled code.

For number of arguments: <>
For exceptions: <>
Whiteboard: [lang=python][lang=c++]
I want to patch this,but need some help.
Thanks, Mohit. The first thing to do is get your development environment set up; a good place to read how to do that is here:

BZ, can you point to an example of where we're already using MOZ_UNLIKELY() so Mohit can get a sense of what a successful patch looks like here?
I've gone through the docs and also completed the code for firefox exercise which was a part of it and as I'm working on linux I've setup an enviroment by the help of instructions given in the docs.
What is the status of this bug?
Attached patch 1058651.patchSplinter Review
Attachment #8507854 - Flags: review?(bzbarsky)
Comment on attachment 8507854 [details] [diff] [review]

I missed the part of comment 2 directed at me.  :(

Attachment #8507854 - Flags: review?(bzbarsky) → review+
Akshendra, are you able to push this to try yourself, or do you need me to do it?
Assignee: nobody → akshendra521994
Flags: needinfo?(akshendra521994)
I don't seem to have a level 1 hg account, so I cannot I suppose.
Flags: needinfo?(akshendra521994)
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.