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

Side by Side Diff: Source/bindings/tests/results/V8TestObject.cpp

Issue 289843006: Avoid extra arity and type check on distinguishing argument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: additional test Created 6 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "HTMLNames.h" 10 #include "HTMLNames.h"
(...skipping 6905 matching lines...) Expand 10 before | Expand all | Expand 10 after
6916 exceptionState.throwIfNeeded(); 6916 exceptionState.throwIfNeeded();
6917 } 6917 }
6918 6918
6919 static void overloadedMethodLMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 6919 static void overloadedMethodLMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
6920 { 6920 {
6921 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 6921 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
6922 TestObjectV8Internal::overloadedMethodLMethod(info); 6922 TestObjectV8Internal::overloadedMethodLMethod(info);
6923 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 6923 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
6924 } 6924 }
6925 6925
6926 static void overloadedMethodM1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
6927 {
6928 TestObject* impl = V8TestObject::toNative(info.Holder());
6929 if (info.Length() > 0 && !V8TestInterface::hasInstance(info[0], info.GetIsol ate())) {
6930 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodM", " TestObject", "parameter 1 is not of type 'TestInterface'."), info.GetIsolate());
6931 return;
6932 }
6933 TONATIVE_VOID(TestInterfaceImplementation*, testInterfaceArg1, V8TestInterfa ce::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
6934 TONATIVE_VOID(TestInterfaceImplementation*, testInterfaceArg2, V8TestInterfa ce::toNativeWithTypeCheck(info.GetIsolate(), info[1]));
6935 impl->overloadedMethodM(testInterfaceArg1, testInterfaceArg2);
6936 }
6937
6938 static void overloadedMethodM2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
6939 {
6940 TestObject* impl = V8TestObject::toNative(info.Holder());
6941 if (info.Length() > 0 && !V8TestInterface::hasInstance(info[0], info.GetIsol ate())) {
6942 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodM", " TestObject", "parameter 1 is not of type 'TestInterface'."), info.GetIsolate());
6943 return;
6944 }
6945 TONATIVE_VOID(TestInterfaceImplementation*, testInterfaceArg, V8TestInterfac e::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
6946 TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmp ty::toNativeWithTypeCheck(info.GetIsolate(), info[1]));
6947 impl->overloadedMethodM(testInterfaceArg, testInterfaceEmptyArg);
6948 }
6949
6950 static void overloadedMethodMMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
6951 {
6952 switch (info.Length()) {
6953 case 2:
6954 if (V8TestInterface::hasInstance(info[1], info.GetIsolate())) {
6955 overloadedMethodM1Method(info);
6956 return;
6957 }
6958 if (V8TestInterfaceEmpty::hasInstance(info[1], info.GetIsolate())) {
6959 overloadedMethodM2Method(info);
6960 return;
6961 }
6962 break;
6963 }
6964 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodM", "TestObject", info.Holder(), info.GetIsolate());
6965 if (UNLIKELY(info.Length() < 2)) {
6966 throwArityTypeError(exceptionState, 2, info.Length());
6967 return;
6968 }
6969 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
6970 exceptionState.throwIfNeeded();
6971 }
6972
6973 static void overloadedMethodMMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
6974 {
6975 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
6976 TestObjectV8Internal::overloadedMethodMMethod(info);
6977 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
6978 }
6979
6980 static void overloadedMethodN1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
6981 {
6982 TestObject* impl = V8TestObject::toNative(info.Holder());
6983 TONATIVE_VOID(double, a, static_cast<double>(info[0]->NumberValue()));
6984 TONATIVE_VOID(TestInterfaceImplementation*, b, V8TestInterface::toNativeWith TypeCheck(info.GetIsolate(), info[1]));
6985 impl->overloadedMethodN(a, b);
6986 }
6987
6988 static void overloadedMethodN2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
6989 {
6990 TestObject* impl = V8TestObject::toNative(info.Holder());
6991 TONATIVE_VOID(double, a, static_cast<double>(info[0]->NumberValue()));
6992 if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], info.Ge tIsolate())) {
6993 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodN", " TestObject", "parameter 2 is not of type 'TestInterfaceEmpty'."), info.GetIsolat e());
6994 return;
6995 }
6996 TONATIVE_VOID(TestInterfaceEmpty*, b, V8TestInterfaceEmpty::toNativeWithType Check(info.GetIsolate(), info[1]));
6997 if (UNLIKELY(info.Length() <= 2)) {
6998 impl->overloadedMethodN(a, b);
6999 return;
7000 }
7001 TONATIVE_VOID(TestInterfaceImplementation*, c, V8TestInterface::toNativeWith TypeCheck(info.GetIsolate(), info[2]));
7002 impl->overloadedMethodN(a, b, c);
7003 }
7004
7005 static void overloadedMethodN3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
7006 {
7007 TestObject* impl = V8TestObject::toNative(info.Holder());
7008 TONATIVE_VOID(double, a, static_cast<double>(info[0]->NumberValue()));
7009 if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], info.Ge tIsolate())) {
7010 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodN", " TestObject", "parameter 2 is not of type 'TestInterfaceEmpty'."), info.GetIsolat e());
7011 return;
7012 }
7013 TONATIVE_VOID(TestInterfaceEmpty*, b, V8TestInterfaceEmpty::toNativeWithType Check(info.GetIsolate(), info[1]));
7014 TONATIVE_VOID(TestInterfaceEmpty*, c, V8TestInterfaceEmpty::toNativeWithType Check(info.GetIsolate(), info[2]));
7015 impl->overloadedMethodN(a, b, c);
7016 }
7017
7018 static void overloadedMethodNMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
7019 {
7020 switch (info.Length()) {
7021 case 2:
7022 if (V8TestInterface::hasInstance(info[1], info.GetIsolate())) {
7023 overloadedMethodN1Method(info);
7024 return;
7025 }
7026 if (V8TestInterfaceEmpty::hasInstance(info[1], info.GetIsolate())) {
7027 overloadedMethodN2Method(info);
7028 return;
7029 }
7030 break;
7031 case 3:
7032 if (info[2]->IsUndefined()) {
7033 overloadedMethodN2Method(info);
7034 return;
7035 }
7036 if (V8TestInterface::hasInstance(info[2], info.GetIsolate())) {
7037 overloadedMethodN2Method(info);
7038 return;
7039 }
7040 if (V8TestInterfaceEmpty::hasInstance(info[2], info.GetIsolate())) {
7041 overloadedMethodN3Method(info);
7042 return;
7043 }
7044 break;
7045 }
7046 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodN", "TestObject", info.Holder(), info.GetIsolate());
7047 if (UNLIKELY(info.Length() < 2)) {
7048 throwArityTypeError(exceptionState, 2, info.Length());
7049 return;
7050 }
7051 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
7052 exceptionState.throwIfNeeded();
7053 }
7054
7055 static void overloadedMethodNMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
7056 {
7057 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
7058 TestObjectV8Internal::overloadedMethodNMethod(info);
7059 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
7060 }
7061
6926 static void overloadedPerWorldBindingsMethod1Method(const v8::FunctionCallbackIn fo<v8::Value>& info) 7062 static void overloadedPerWorldBindingsMethod1Method(const v8::FunctionCallbackIn fo<v8::Value>& info)
6927 { 7063 {
6928 TestObject* impl = V8TestObject::toNative(info.Holder()); 7064 TestObject* impl = V8TestObject::toNative(info.Holder());
6929 impl->overloadedPerWorldBindingsMethod(); 7065 impl->overloadedPerWorldBindingsMethod();
6930 } 7066 }
6931 7067
6932 static void overloadedPerWorldBindingsMethod1MethodForMainWorld(const v8::Functi onCallbackInfo<v8::Value>& info) 7068 static void overloadedPerWorldBindingsMethod1MethodForMainWorld(const v8::Functi onCallbackInfo<v8::Value>& info)
6933 { 7069 {
6934 TestObject* impl = V8TestObject::toNative(info.Holder()); 7070 TestObject* impl = V8TestObject::toNative(info.Holder());
6935 impl->overloadedPerWorldBindingsMethod(); 7071 impl->overloadedPerWorldBindingsMethod();
(...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after
8625 {"overloadedMethodC", TestObjectV8Internal::overloadedMethodCMethodCallback, 0, 1}, 8761 {"overloadedMethodC", TestObjectV8Internal::overloadedMethodCMethodCallback, 0, 1},
8626 {"overloadedMethodD", TestObjectV8Internal::overloadedMethodDMethodCallback, 0, 1}, 8762 {"overloadedMethodD", TestObjectV8Internal::overloadedMethodDMethodCallback, 0, 1},
8627 {"overloadedMethodE", TestObjectV8Internal::overloadedMethodEMethodCallback, 0, 1}, 8763 {"overloadedMethodE", TestObjectV8Internal::overloadedMethodEMethodCallback, 0, 1},
8628 {"overloadedMethodF", TestObjectV8Internal::overloadedMethodFMethodCallback, 0, 1}, 8764 {"overloadedMethodF", TestObjectV8Internal::overloadedMethodFMethodCallback, 0, 1},
8629 {"overloadedMethodG", TestObjectV8Internal::overloadedMethodGMethodCallback, 0, 0}, 8765 {"overloadedMethodG", TestObjectV8Internal::overloadedMethodGMethodCallback, 0, 0},
8630 {"overloadedMethodH", TestObjectV8Internal::overloadedMethodHMethodCallback, 0, 0}, 8766 {"overloadedMethodH", TestObjectV8Internal::overloadedMethodHMethodCallback, 0, 0},
8631 {"overloadedMethodI", TestObjectV8Internal::overloadedMethodIMethodCallback, 0, 1}, 8767 {"overloadedMethodI", TestObjectV8Internal::overloadedMethodIMethodCallback, 0, 1},
8632 {"overloadedMethodJ", TestObjectV8Internal::overloadedMethodJMethodCallback, 0, 1}, 8768 {"overloadedMethodJ", TestObjectV8Internal::overloadedMethodJMethodCallback, 0, 1},
8633 {"overloadedMethodK", TestObjectV8Internal::overloadedMethodKMethodCallback, 0, 1}, 8769 {"overloadedMethodK", TestObjectV8Internal::overloadedMethodKMethodCallback, 0, 1},
8634 {"overloadedMethodL", TestObjectV8Internal::overloadedMethodLMethodCallback, 0, 1}, 8770 {"overloadedMethodL", TestObjectV8Internal::overloadedMethodLMethodCallback, 0, 1},
8771 {"overloadedMethodM", TestObjectV8Internal::overloadedMethodMMethodCallback, 0, 2},
8772 {"overloadedMethodN", TestObjectV8Internal::overloadedMethodNMethodCallback, 0, 2},
8635 {"overloadedPerWorldBindingsMethod", TestObjectV8Internal::overloadedPerWorl dBindingsMethodMethodCallback, TestObjectV8Internal::overloadedPerWorldBindingsM ethodMethodCallbackForMainWorld, 0}, 8773 {"overloadedPerWorldBindingsMethod", TestObjectV8Internal::overloadedPerWorl dBindingsMethodMethodCallback, TestObjectV8Internal::overloadedPerWorldBindingsM ethodMethodCallbackForMainWorld, 0},
8636 {"voidMethodClampUnsignedShortArg", TestObjectV8Internal::voidMethodClampUns ignedShortArgMethodCallback, 0, 1}, 8774 {"voidMethodClampUnsignedShortArg", TestObjectV8Internal::voidMethodClampUns ignedShortArgMethodCallback, 0, 1},
8637 {"voidMethodClampUnsignedLongArg", TestObjectV8Internal::voidMethodClampUnsi gnedLongArgMethodCallback, 0, 1}, 8775 {"voidMethodClampUnsignedLongArg", TestObjectV8Internal::voidMethodClampUnsi gnedLongArgMethodCallback, 0, 1},
8638 {"voidMethodDefaultUndefinedTestInterfaceEmptyArg", TestObjectV8Internal::vo idMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback, 0, 0}, 8776 {"voidMethodDefaultUndefinedTestInterfaceEmptyArg", TestObjectV8Internal::vo idMethodDefaultUndefinedTestInterfaceEmptyArgMethodCallback, 0, 0},
8639 {"voidMethodDefaultUndefinedLongArg", TestObjectV8Internal::voidMethodDefaul tUndefinedLongArgMethodCallback, 0, 0}, 8777 {"voidMethodDefaultUndefinedLongArg", TestObjectV8Internal::voidMethodDefaul tUndefinedLongArgMethodCallback, 0, 0},
8640 {"voidMethodDefaultUndefinedStringArg", TestObjectV8Internal::voidMethodDefa ultUndefinedStringArgMethodCallback, 0, 0}, 8778 {"voidMethodDefaultUndefinedStringArg", TestObjectV8Internal::voidMethodDefa ultUndefinedStringArgMethodCallback, 0, 0},
8641 {"voidMethodDefaultNullStringStringArg", TestObjectV8Internal::voidMethodDef aultNullStringStringArgMethodCallback, 0, 0}, 8779 {"voidMethodDefaultNullStringStringArg", TestObjectV8Internal::voidMethodDef aultNullStringStringArgMethodCallback, 0, 0},
8642 {"voidMethodEnforceRangeLongArg", TestObjectV8Internal::voidMethodEnforceRan geLongArgMethodCallback, 0, 1}, 8780 {"voidMethodEnforceRangeLongArg", TestObjectV8Internal::voidMethodEnforceRan geLongArgMethodCallback, 0, 1},
8643 {"voidMethodTreatNullAsNullStringStringArg", TestObjectV8Internal::voidMetho dTreatNullAsNullStringStringArgMethodCallback, 0, 1}, 8781 {"voidMethodTreatNullAsNullStringStringArg", TestObjectV8Internal::voidMetho dTreatNullAsNullStringStringArgMethodCallback, 0, 1},
8644 {"voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg", TestO bjectV8Internal::voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringString ArgMethodCallback, 0, 1}, 8782 {"voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringStringArg", TestO bjectV8Internal::voidMethodTreatNullAsNullStringTreatUndefinedAsNullStringString ArgMethodCallback, 0, 1},
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
8866 fromInternalPointer(object)->deref(); 9004 fromInternalPointer(object)->deref();
8867 } 9005 }
8868 9006
8869 template<> 9007 template<>
8870 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea tionContext, v8::Isolate* isolate) 9008 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea tionContext, v8::Isolate* isolate)
8871 { 9009 {
8872 return toV8(impl, creationContext, isolate); 9010 return toV8(impl, creationContext, isolate);
8873 } 9011 }
8874 9012
8875 } // namespace WebCore 9013 } // namespace WebCore
OLDNEW
« Source/bindings/tests/idls/TestObject.idl ('K') | « Source/bindings/tests/idls/TestObject.idl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698