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

Unified Diff: Source/bindings/tests/results/core/V8TestInterface.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/tests/results/core/V8TestInterface.cpp
diff --git a/Source/bindings/tests/results/core/V8TestInterface.cpp b/Source/bindings/tests/results/core/V8TestInterface.cpp
index a8bd66384aa1b3437ff689dc3cc9a11055323886..e0d7c42cae7f0770572a91fa09416926b622d1d4 100644
--- a/Source/bindings/tests/results/core/V8TestInterface.cpp
+++ b/Source/bindings/tests/results/core/V8TestInterface.cpp
@@ -987,7 +987,7 @@ static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
V8ThrowException::throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate());
return;
}
- testInterfaceEmptyArg = V8TestInterfaceEmpty::toImpl(v8::Handle<v8::Object>::Cast(info[0]));
+ testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[0]);
}
impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
}
@@ -1229,7 +1229,7 @@ static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
exceptionState.throwIfNeeded();
return;
}
- testInterfaceEmptyArg = V8TestInterfaceEmpty::toImpl(v8::Handle<v8::Object>::Cast(info[1]));
+ testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsolate(), info[1]);
}
ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate());
RefPtr<TestInterfaceEmpty> result = impl->implementsComplexMethod(executionContext, strArg, testInterfaceEmptyArg, exceptionState);
@@ -1442,13 +1442,13 @@ static void shortMethodWithShortArgumentImplementedInPrivateScriptMethodCallback
}
#endif // ENABLE(PARTIAL_CONDITION)
-static void partial2VoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+static void partial2VoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info, int type_checked_argument_index)
{
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
TestPartialInterfaceImplementation::partial2VoidMethod(*impl);
}
-static void partial2StaticVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+static void partial2StaticVoidMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info, int type_checked_argument_index)
{
TestPartialInterfaceImplementation::partial2StaticVoidMethod();
}
@@ -1494,7 +1494,7 @@ static void voidMethodPartialOverloadMethodCallback(const v8::FunctionCallbackIn
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
-static void partial2VoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+static void partial2VoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info, int type_checked_argument_index)
{
TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
V8StringResource<> value;
@@ -1510,13 +1510,13 @@ static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
switch (std::min(1, info.Length())) {
case 0:
if (true) {
- partial2VoidMethod1Method(info);
+ partial2VoidMethod1Method(info, -1);
return;
}
break;
case 1:
if (true) {
- partial2VoidMethod2Method(info);
+ partial2VoidMethod2Method(info, -1);
return;
}
break;
@@ -1536,7 +1536,7 @@ static void partial2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
}
-static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
+static void partial2StaticVoidMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info, int type_checked_argument_index)
{
V8StringResource<> value;
{
@@ -1551,13 +1551,13 @@ static void partial2StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Va
switch (std::min(1, info.Length())) {
case 0:
if (true) {
- partial2StaticVoidMethod1Method(info);
+ partial2StaticVoidMethod1Method(info, -1);
return;
}
break;
case 1:
if (true) {
- partial2StaticVoidMethod2Method(info);
+ partial2StaticVoidMethod2Method(info, -1);
return;
}
break;

Powered by Google App Engine
This is Rietveld 408576698