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

Side by Side Diff: Source/bindings/scripts/v8_interface.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: add code change in Source/bindings/tests/results/ 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 | « no previous file | Source/bindings/scripts/v8_methods.py » ('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 # coding=utf-8 2 # coding=utf-8
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 # • an interface type that V implements 767 # • an interface type that V implements
768 # (Unlike most of these tests, this can return multiple methods, since we 768 # (Unlike most of these tests, this can return multiple methods, since we
769 # test if it implements an interface. Thus we need a for loop, not a next.) 769 # test if it implements an interface. Thus we need a for loop, not a next.)
770 # (We distinguish wrapper types from built-in interface types.) 770 # (We distinguish wrapper types from built-in interface types.)
771 for idl_type, method in ((idl_type, method) 771 for idl_type, method in ((idl_type, method)
772 for idl_type, method in idl_types_methods 772 for idl_type, method in idl_types_methods
773 if idl_type.is_wrapper_type): 773 if idl_type.is_wrapper_type):
774 test = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate())'.forma t(idl_type=idl_type.base_type, cpp_value=cpp_value) 774 test = 'V8{idl_type}::hasInstance({cpp_value}, info.GetIsolate())'.forma t(idl_type=idl_type.base_type, cpp_value=cpp_value)
775 yield test, method 775 yield test, method
776 776
777 for argument in arguments:
yunchao 2014/09/30 09:17:29 resolution_tests_methods has filtered a lot of arg
Jens Widell 2014/09/30 09:38:22 Ah, yes, that's true. Note though that this functi
778 if argument['idl_type_object'].is_wrapper_type:
779 argument['type_checked_already'] = True
780
781
777 # 8. Otherwise: if V is any kind of object except for a native Date object, 782 # 8. Otherwise: if V is any kind of object except for a native Date object,
778 # a native RegExp object, and there is an entry in S that has one of the 783 # a native RegExp object, and there is an entry in S that has one of the
779 # following types at position i of its type list, 784 # following types at position i of its type list,
780 # • an array type 785 # • an array type
781 # • a sequence type 786 # • a sequence type
782 # ... 787 # ...
783 # • a dictionary 788 # • a dictionary
784 # 789 #
785 # FIXME: 790 # FIXME:
786 # We don't strictly follow the algorithm here. The algorithm says "remove 791 # We don't strictly follow the algorithm here. The algorithm says "remove
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 deleter = next( 1159 deleter = next(
1155 method 1160 method
1156 for method in interface.operations 1161 for method in interface.operations
1157 if ('deleter' in method.specials and 1162 if ('deleter' in method.specials and
1158 len(method.arguments) == 1 and 1163 len(method.arguments) == 1 and
1159 str(method.arguments[0].idl_type) == 'DOMString')) 1164 str(method.arguments[0].idl_type) == 'DOMString'))
1160 except StopIteration: 1165 except StopIteration:
1161 return None 1166 return None
1162 1167
1163 return property_deleter(deleter) 1168 return property_deleter(deleter)
OLDNEW
« no previous file with comments | « no previous file | Source/bindings/scripts/v8_methods.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698