Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(402)

Side by Side Diff: Source/bindings/scripts/code_generator_v8.pm

Issue 113783002: [POSSIBLE PERFORMANCE IMPACT] Remove UNLIKELY from bindings required arguments check (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove FIXME Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org> 1 # Copyright (C) 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com> 2 # Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 3 # Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org> 4 # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
5 # Copyright (C) 2006 Apple Computer, Inc. 5 # Copyright (C) 2006 Apple Computer, Inc.
6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc. 6 # Copyright (C) 2007, 2008, 2009, 2012 Google Inc.
7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 7 # Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
8 # Copyright (C) Research In Motion Limited 2010. All rights reserved. 8 # Copyright (C) Research In Motion Limited 2010. All rights reserved.
9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 # Copyright (C) 2012 Ericsson AB. All rights reserved. 10 # Copyright (C) 2012 Ericsson AB. All rights reserved.
(...skipping 2509 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 if ($param->isOptional or $param->isVariadic) { 2520 if ($param->isOptional or $param->isVariadic) {
2521 $allowNonOptional = 0; 2521 $allowNonOptional = 0;
2522 } else { 2522 } else {
2523 die "An argument must not be declared to be optional unless all subs equent arguments to the operation are also optional." if !$allowNonOptional; 2523 die "An argument must not be declared to be optional unless all subs equent arguments to the operation are also optional." if !$allowNonOptional;
2524 $numMandatoryParams++; 2524 $numMandatoryParams++;
2525 } 2525 }
2526 } 2526 }
2527 2527
2528 my $argumentsCountCheckString = ""; 2528 my $argumentsCountCheckString = "";
2529 if ($numMandatoryParams >= 1) { 2529 if ($numMandatoryParams >= 1) {
2530 $argumentsCountCheckString .= " if (UNLIKELY(info.Length() < $numMand atoryParams)) {\n"; 2530 $argumentsCountCheckString .= " if (info.Length() < $numMandatoryPara ms) {\n";
2531 if ($hasExceptionState) { 2531 if ($hasExceptionState) {
2532 $argumentsCountCheckString .= " exceptionState.throwTypeError (ExceptionMessages::notEnoughArguments($numMandatoryParams, info.Length()));\n"; 2532 $argumentsCountCheckString .= " exceptionState.throwTypeError (ExceptionMessages::notEnoughArguments($numMandatoryParams, info.Length()));\n";
2533 $argumentsCountCheckString .= " exceptionState.throwIfNeeded( );\n"; 2533 $argumentsCountCheckString .= " exceptionState.throwIfNeeded( );\n";
2534 } else { 2534 } else {
2535 $argumentsCountCheckString .= " throwTypeError(ExceptionMessa ges::failedToExecute(\"$functionName\", \"$interfaceName\", ExceptionMessages::n otEnoughArguments($numMandatoryParams, info.Length())), info.GetIsolate());\n"; 2535 $argumentsCountCheckString .= " throwTypeError(ExceptionMessa ges::failedToExecute(\"$functionName\", \"$interfaceName\", ExceptionMessages::n otEnoughArguments($numMandatoryParams, info.Length())), info.GetIsolate());\n";
2536 } 2536 }
2537 $argumentsCountCheckString .= " return;\n"; 2537 $argumentsCountCheckString .= " return;\n";
2538 $argumentsCountCheckString .= " }\n"; 2538 $argumentsCountCheckString .= " }\n";
2539 } 2539 }
2540 return $argumentsCountCheckString; 2540 return $argumentsCountCheckString;
(...skipping 3810 matching lines...) Expand 10 before | Expand all | Expand 10 after
6351 6351
6352 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "ToV8"); 6352 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "ToV8");
6353 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "Wrap"); 6353 return 1 if ExtendedAttributeContains($interface->extendedAttributes->{"Cust om"}, "Wrap");
6354 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"}; 6354 return 1 if $interface->extendedAttributes->{"SpecialWrapFor"};
6355 return 1 if InheritsInterface($interface, "Document"); 6355 return 1 if InheritsInterface($interface, "Document");
6356 6356
6357 return 0; 6357 return 0;
6358 } 6358 }
6359 6359
6360 1; 6360 1;
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/templates/interface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698