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

Side by Side Diff: Source/bindings/templates/methods.cpp

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
OLDNEW
1 {##############################################################################} 1 {##############################################################################}
2 {% macro generate_method(method, world_suffix) %} 2 {% macro generate_method(method, world_suffix) %}
3 {% filter conditional(method.conditional_string) %} 3 {% filter conditional(method.conditional_string) %}
4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) 4 static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info)
5 { 5 {
6 {% if method.is_raises_exception or method.is_check_security_for_frame or 6 {% if method.is_raises_exception or method.is_check_security_for_frame or
7 method.name in ['addEventListener', 'removeEventListener'] %} 7 method.name in ['addEventListener', 'removeEventListener'] %}
8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate()); 8 ExceptionState exceptionState(ExceptionState::ExecutionContext, "{{method.na me}}", "{{interface_name}}", info.Holder(), info.GetIsolate());
9 {% endif %} 9 {% endif %}
10 {% if method.name in ['addEventListener', 'removeEventListener'] %} 10 {% if method.name in ['addEventListener', 'removeEventListener'] %}
11 {{add_remove_event_listener_method(method.name) | indent}} 11 {{add_remove_event_listener_method(method.name) | indent}}
12 {% else %} 12 {% else %}
13 {% if method.number_of_required_arguments %} 13 {% if method.number_of_required_arguments %}
14 if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) { 14 if (info.Length() < {{method.number_of_required_arguments}}) {
15 throwTypeError(ExceptionMessages::failedToExecute("{{method.name}}", "{{ interface_name}}", ExceptionMessages::notEnoughArguments({{method.number_of_requ ired_arguments}}, info.Length())), info.GetIsolate()); 15 throwTypeError(ExceptionMessages::failedToExecute("{{method.name}}", "{{ interface_name}}", ExceptionMessages::notEnoughArguments({{method.number_of_requ ired_arguments}}, info.Length())), info.GetIsolate());
16 return; 16 return;
17 } 17 }
18 {% endif %} 18 {% endif %}
19 {% if not method.is_static %} 19 {% if not method.is_static %}
20 {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder()); 20 {{cpp_class}}* imp = {{v8_class}}::toNative(info.Holder());
21 {% endif %} 21 {% endif %}
22 {% if method.is_custom_element_callbacks %} 22 {% if method.is_custom_element_callbacks %}
23 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; 23 CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
24 {% endif %} 24 {% endif %}
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 v8SetReturnValue(info, privateTemplate->GetFunction()); 264 v8SetReturnValue(info, privateTemplate->GetFunction());
265 } 265 }
266 266
267 static void {{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Lo cal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 267 static void {{method.name}}OriginSafeMethodGetterCallback{{world_suffix}}(v8::Lo cal<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
268 { 268 {
269 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 269 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
270 {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix }}(info); 270 {{cpp_class}}V8Internal::{{method.name}}OriginSafeMethodGetter{{world_suffix }}(info);
271 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 271 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
272 } 272 }
273 {% endmacro %} 273 {% endmacro %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface.cpp ('k') | Source/bindings/tests/results/V8SupportTestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698