From 1b0c1aeb1b21324e7d3b6ea401c799a5388cfef4 Mon Sep 17 00:00:00 2001 From: Akshendra Pratap Date: Mon, 20 Oct 2014 05:54:00 +0200 Subject: [PATCH] Bug 1058651 - Added MOZ_UNLIKELY to Codegen.py argument number and exception checks; r=bz --- dom/bindings/Codegen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 30cdb3ab8b2..36d4031eb05 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -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}"); } """,