mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Bug 1058651 - Added MOZ_UNLIKELY to Codegen.py argument number and exception checks; r=bz
This commit is contained in:
parent
be97d2dab8
commit
dd64a73baf
@ -6344,7 +6344,7 @@ class CGCallGenerator(CGThing):
|
||||
if isFallible:
|
||||
self.cgRoot.prepend(CGGeneric("ErrorResult rv;\n"))
|
||||
self.cgRoot.append(CGGeneric("rv.WouldReportJSException();\n"))
|
||||
self.cgRoot.append(CGGeneric("if (rv.Failed()) {\n"))
|
||||
self.cgRoot.append(CGGeneric("if (MOZ_UNLIKELY(rv.Failed())) {\n"))
|
||||
self.cgRoot.append(CGIndenter(errorReport))
|
||||
self.cgRoot.append(CGGeneric("}\n"))
|
||||
|
||||
@ -6900,7 +6900,7 @@ class CGMethodCall(CGThing):
|
||||
if requiredArgs > 0:
|
||||
code = fill(
|
||||
"""
|
||||
if (args.length() < ${requiredArgs}) {
|
||||
if (MOZ_UNLIKELY(args.length() < ${requiredArgs})) {
|
||||
return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "${methodName}");
|
||||
}
|
||||
""",
|
||||
|
Loading…
Reference in New Issue
Block a user