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

Unified Diff: Source/bindings/templates/interface.cpp

Issue 657523002: Skip expensive hasInstance() type-checks in overloads (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/templates/interface.cpp
diff --git a/Source/bindings/templates/interface.cpp b/Source/bindings/templates/interface.cpp
index 8e9b8ac9a13a00b436cfd92f3dacf20a09b670da..c07b91e4ff8acd58abc443f1276964ced58ab15c 100644
--- a/Source/bindings/templates/interface.cpp
+++ b/Source/bindings/templates/interface.cpp
@@ -470,10 +470,10 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
{% for length, tests_constructors in constructor_overloads.length_tests_methods %}
case {{length}}:
{# Then resolve by testing argument #}
- {% for test, constructor in tests_constructors %}
+ {% for test, constructor, type_checked_argument_index in tests_constructors %}
{# 10. If i = d, then: #}
if ({{test}}) {
- {{cpp_class}}V8Internal::constructor{{constructor.overload_index}}(info);
+ {{cpp_class}}V8Internal::constructor{{constructor.overload_index}}(info, {{type_checked_argument_index}});
return;
}
{% endfor %}

Powered by Google App Engine
This is Rietveld 408576698