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

Side by Side Diff: Source/bindings/scripts/v8_methods.py

Issue 611953003: Canvas2D Performance: fix the bottleneck of hasInstance during JS binding -- overloading (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: update code accordingly (w/o redundant type check for overload resolution) Created 6 years, 2 months 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
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/templates/methods.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) 2013 Google Inc. All rights reserved. 1 # Copyright (C) 2013 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 # FIXME: Remove generic 'Dictionary' special-casing 233 # FIXME: Remove generic 'Dictionary' special-casing
234 'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictio nary', 234 'is_dictionary': idl_type.is_dictionary or idl_type.base_type == 'Dictio nary',
235 'is_nullable': idl_type.is_nullable, 235 'is_nullable': idl_type.is_nullable,
236 'is_optional': argument.is_optional, 236 'is_optional': argument.is_optional,
237 'is_variadic_wrapper_type': is_variadic_wrapper_type, 237 'is_variadic_wrapper_type': is_variadic_wrapper_type,
238 'is_wrapper_type': idl_type.is_wrapper_type, 238 'is_wrapper_type': idl_type.is_wrapper_type,
239 'name': argument.name, 239 'name': argument.name,
240 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value( 240 'private_script_cpp_value_to_v8_value': idl_type.cpp_value_to_v8_value(
241 argument.name, isolate='scriptState->isolate()', 241 argument.name, isolate='scriptState->isolate()',
242 creation_context='scriptState->context()->Global()'), 242 creation_context='scriptState->context()->Global()'),
243 # 'type_checked_already': False,
243 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value), 244 'v8_set_return_value': v8_set_return_value(interface.name, method, this_ cpp_value),
244 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name , method, this_cpp_value, for_main_world=True), 245 'v8_set_return_value_for_main_world': v8_set_return_value(interface.name , method, this_cpp_value, for_main_world=True),
245 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, ind ex, type_checked, return_promise=method.returns_promise), 246 'v8_value_to_local_cpp_value': v8_value_to_local_cpp_value(argument, ind ex, type_checked, return_promise=method.returns_promise),
246 'vector_type': v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc _type), 247 'vector_type': v8_types.cpp_ptr_type('Vector', 'HeapVector', idl_type.gc _type),
247 } 248 }
248 249
249 250
250 def argument_declarations_for_private_script(interface, method): 251 def argument_declarations_for_private_script(interface, method):
251 argument_declarations = ['LocalFrame* frame'] 252 argument_declarations = ['LocalFrame* frame']
252 argument_declarations.append('%s* holderImpl' % interface.name) 253 argument_declarations.append('%s* holderImpl' % interface.name)
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 450
450 IdlOperation.returns_promise = property(method_returns_promise) 451 IdlOperation.returns_promise = property(method_returns_promise)
451 452
452 453
453 def argument_conversion_needs_exception_state(method, argument): 454 def argument_conversion_needs_exception_state(method, argument):
454 idl_type = argument.idl_type 455 idl_type = argument.idl_type
455 return (idl_type.v8_conversion_needs_exception_state or 456 return (idl_type.v8_conversion_needs_exception_state or
456 argument.is_variadic or 457 argument.is_variadic or
457 (method.returns_promise and (idl_type.is_string_type or 458 (method.returns_promise and (idl_type.is_string_type or
458 idl_type.is_enum))) 459 idl_type.is_enum)))
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_interface.py ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698