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

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

Issue 105693002: Generate a bit less code to handle failed arity checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
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 4703 matching lines...) Expand 10 before | Expand all | Expand 10 after
4714 return; 4714 return;
4715 } 4715 }
4716 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 4716 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
4717 V8TRYCATCH_VOID(int, longArg1, toInt32(info[0])); 4717 V8TRYCATCH_VOID(int, longArg1, toInt32(info[0]));
4718 V8TRYCATCH_VOID(int, longArg2, toInt32(info[1])); 4718 V8TRYCATCH_VOID(int, longArg2, toInt32(info[1]));
4719 imp->overloadedMethodA(longArg1, longArg2); 4719 imp->overloadedMethodA(longArg1, longArg2);
4720 } 4720 }
4721 4721
4722 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 4722 static void overloadedMethodAMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
4723 { 4723 {
4724 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodA", "TestObjectPython", info.Holder(), info.GetIsolate());
4724 if (((info.Length() == 1))) { 4725 if (((info.Length() == 1))) {
4725 overloadedMethodA1Method(info); 4726 overloadedMethodA1Method(info);
4726 return; 4727 return;
4727 } 4728 }
4728 if (((info.Length() == 2))) { 4729 if (((info.Length() == 2))) {
4729 overloadedMethodA2Method(info); 4730 overloadedMethodA2Method(info);
4730 return; 4731 return;
4731 } 4732 }
4732 if (UNLIKELY(info.Length() < 1)) { 4733 if (UNLIKELY(info.Length() < 1)) {
4733 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate()); 4734 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
4735 exceptionState.throwIfNeeded();
4734 return; 4736 return;
4735 } 4737 }
4736 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "Test ObjectPython", "No function was found that matched the signature provided."), in fo.GetIsolate()); 4738 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
4739 exceptionState.throwIfNeeded();
4737 } 4740 }
4738 4741
4739 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 4742 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
4740 { 4743 {
4741 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4744 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4742 TestObjectPythonV8Internal::overloadedMethodAMethod(info); 4745 TestObjectPythonV8Internal::overloadedMethodAMethod(info);
4743 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4746 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4744 } 4747 }
4745 4748
4746 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 4749 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 18 matching lines...) Expand all
4765 if (UNLIKELY(info.Length() <= 1)) { 4768 if (UNLIKELY(info.Length() <= 1)) {
4766 imp->overloadedMethodB(longArg1); 4769 imp->overloadedMethodB(longArg1);
4767 return; 4770 return;
4768 } 4771 }
4769 V8TRYCATCH_VOID(int, longArg2, toInt32(info[1])); 4772 V8TRYCATCH_VOID(int, longArg2, toInt32(info[1]));
4770 imp->overloadedMethodB(longArg1, longArg2); 4773 imp->overloadedMethodB(longArg1, longArg2);
4771 } 4774 }
4772 4775
4773 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 4776 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
4774 { 4777 {
4778 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodB", "TestObjectPython", info.Holder(), info.GetIsolate());
4775 if (((info.Length() == 1))) { 4779 if (((info.Length() == 1))) {
4776 overloadedMethodB1Method(info); 4780 overloadedMethodB1Method(info);
4777 return; 4781 return;
4778 } 4782 }
4779 if (((info.Length() == 1)) || ((info.Length() == 2))) { 4783 if (((info.Length() == 1)) || ((info.Length() == 2))) {
4780 overloadedMethodB2Method(info); 4784 overloadedMethodB2Method(info);
4781 return; 4785 return;
4782 } 4786 }
4783 if (UNLIKELY(info.Length() < 1)) { 4787 if (UNLIKELY(info.Length() < 1)) {
4784 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate()); 4788 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
4789 exceptionState.throwIfNeeded();
4785 return; 4790 return;
4786 } 4791 }
4787 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "Test ObjectPython", "No function was found that matched the signature provided."), in fo.GetIsolate()); 4792 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
4793 exceptionState.throwIfNeeded();
4788 } 4794 }
4789 4795
4790 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 4796 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
4791 { 4797 {
4792 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4798 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4793 TestObjectPythonV8Internal::overloadedMethodBMethod(info); 4799 TestObjectPythonV8Internal::overloadedMethodBMethod(info);
4794 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4800 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4795 } 4801 }
4796 4802
4797 static void overloadedMethodC1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 4803 static void overloadedMethodC1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 14 matching lines...) Expand all
4812 return; 4818 return;
4813 } 4819 }
4814 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 4820 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
4815 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); 4821 V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4816 V8TRYCATCH_VOID(Vector<int>, longArgs, toNativeArguments<int>(info, 1)); 4822 V8TRYCATCH_VOID(Vector<int>, longArgs, toNativeArguments<int>(info, 1));
4817 imp->overloadedMethodC(longArg, longArgs); 4823 imp->overloadedMethodC(longArg, longArgs);
4818 } 4824 }
4819 4825
4820 static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 4826 static void overloadedMethodCMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
4821 { 4827 {
4828 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodC", "TestObjectPython", info.Holder(), info.GetIsolate());
4822 if (((info.Length() == 1))) { 4829 if (((info.Length() == 1))) {
4823 overloadedMethodC1Method(info); 4830 overloadedMethodC1Method(info);
4824 return; 4831 return;
4825 } 4832 }
4826 if () { 4833 if () {
4827 overloadedMethodC2Method(info); 4834 overloadedMethodC2Method(info);
4828 return; 4835 return;
4829 } 4836 }
4830 if (UNLIKELY(info.Length() < 1)) { 4837 if (UNLIKELY(info.Length() < 1)) {
4831 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate()); 4838 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
4839 exceptionState.throwIfNeeded();
4832 return; 4840 return;
4833 } 4841 }
4834 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodC", "Test ObjectPython", "No function was found that matched the signature provided."), in fo.GetIsolate()); 4842 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
4843 exceptionState.throwIfNeeded();
4835 } 4844 }
4836 4845
4837 static void overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 4846 static void overloadedMethodCMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
4838 { 4847 {
4839 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4848 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4840 TestObjectPythonV8Internal::overloadedMethodCMethod(info); 4849 TestObjectPythonV8Internal::overloadedMethodCMethod(info);
4841 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4850 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4842 } 4851 }
4843 4852
4844 static void overloadedMethodD1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 4853 static void overloadedMethodD1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 13 matching lines...) Expand all
4858 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodD", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate()); 4867 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodD", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate());
4859 return; 4868 return;
4860 } 4869 }
4861 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 4870 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
4862 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8 TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); 4871 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE mpty::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8 TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4863 imp->overloadedMethodD(testInterfaceEmptyArg); 4872 imp->overloadedMethodD(testInterfaceEmptyArg);
4864 } 4873 }
4865 4874
4866 static void overloadedMethodDMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 4875 static void overloadedMethodDMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
4867 { 4876 {
4877 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodD", "TestObjectPython", info.Holder(), info.GetIsolate());
4868 if (((info.Length() == 1))) { 4878 if (((info.Length() == 1))) {
4869 overloadedMethodD1Method(info); 4879 overloadedMethodD1Method(info);
4870 return; 4880 return;
4871 } 4881 }
4872 if (((info.Length() == 1) && (V8TestInterfaceEmpty::hasInstance(info[0], inf o.GetIsolate(), worldType(info.GetIsolate()))))) { 4882 if (((info.Length() == 1) && (V8TestInterfaceEmpty::hasInstance(info[0], inf o.GetIsolate(), worldType(info.GetIsolate()))))) {
4873 overloadedMethodD2Method(info); 4883 overloadedMethodD2Method(info);
4874 return; 4884 return;
4875 } 4885 }
4876 if (UNLIKELY(info.Length() < 1)) { 4886 if (UNLIKELY(info.Length() < 1)) {
4877 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodD", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate()); 4887 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
4888 exceptionState.throwIfNeeded();
4878 return; 4889 return;
4879 } 4890 }
4880 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodD", "Test ObjectPython", "No function was found that matched the signature provided."), in fo.GetIsolate()); 4891 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
4892 exceptionState.throwIfNeeded();
4881 } 4893 }
4882 4894
4883 static void overloadedMethodDMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 4895 static void overloadedMethodDMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
4884 { 4896 {
4885 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4897 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4886 TestObjectPythonV8Internal::overloadedMethodDMethod(info); 4898 TestObjectPythonV8Internal::overloadedMethodDMethod(info);
4887 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4899 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4888 } 4900 }
4889 4901
4890 static void overloadedMethodE1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 4902 static void overloadedMethodE1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 13 matching lines...) Expand all
4904 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodE", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate()); 4916 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodE", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate());
4905 return; 4917 return;
4906 } 4918 }
4907 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 4919 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
4908 V8TRYCATCH_VOID(Vector<int>, longArrayArg, toNativeArray<int>(info[0], 1, in fo.GetIsolate())); 4920 V8TRYCATCH_VOID(Vector<int>, longArrayArg, toNativeArray<int>(info[0], 1, in fo.GetIsolate()));
4909 imp->overloadedMethodE(longArrayArg); 4921 imp->overloadedMethodE(longArrayArg);
4910 } 4922 }
4911 4923
4912 static void overloadedMethodEMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 4924 static void overloadedMethodEMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
4913 { 4925 {
4926 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodE", "TestObjectPython", info.Holder(), info.GetIsolate());
4914 if (((info.Length() == 1))) { 4927 if (((info.Length() == 1))) {
4915 overloadedMethodE1Method(info); 4928 overloadedMethodE1Method(info);
4916 return; 4929 return;
4917 } 4930 }
4918 if (((info.Length() == 1) && (info[0]->IsArray()))) { 4931 if (((info.Length() == 1) && (info[0]->IsArray()))) {
4919 overloadedMethodE2Method(info); 4932 overloadedMethodE2Method(info);
4920 return; 4933 return;
4921 } 4934 }
4922 if (UNLIKELY(info.Length() < 1)) { 4935 if (UNLIKELY(info.Length() < 1)) {
4923 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodE", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate()); 4936 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
4937 exceptionState.throwIfNeeded();
4924 return; 4938 return;
4925 } 4939 }
4926 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodE", "Test ObjectPython", "No function was found that matched the signature provided."), in fo.GetIsolate()); 4940 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
4941 exceptionState.throwIfNeeded();
4927 } 4942 }
4928 4943
4929 static void overloadedMethodEMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 4944 static void overloadedMethodEMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
4930 { 4945 {
4931 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4946 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4932 TestObjectPythonV8Internal::overloadedMethodEMethod(info); 4947 TestObjectPythonV8Internal::overloadedMethodEMethod(info);
4933 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4948 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4934 } 4949 }
4935 4950
4936 static void overloadedMethodF1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 4951 static void overloadedMethodF1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 13 matching lines...) Expand all
4950 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodF", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate()); 4965 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodF", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate());
4951 return; 4966 return;
4952 } 4967 }
4953 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); 4968 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder());
4954 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyNullableArg, V8TestIn terfaceEmpty::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate( ))) ? V8TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0) ; 4969 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyNullableArg, V8TestIn terfaceEmpty::hasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate( ))) ? V8TestInterfaceEmpty::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0) ;
4955 imp->overloadedMethodF(testInterfaceEmptyNullableArg); 4970 imp->overloadedMethodF(testInterfaceEmptyNullableArg);
4956 } 4971 }
4957 4972
4958 static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo) 4973 static void overloadedMethodFMethod(const v8::FunctionCallbackInfo<v8::Value>& i nfo)
4959 { 4974 {
4975 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM ethodF", "TestObjectPython", info.Holder(), info.GetIsolate());
4960 if (((info.Length() == 1))) { 4976 if (((info.Length() == 1))) {
4961 overloadedMethodF1Method(info); 4977 overloadedMethodF1Method(info);
4962 return; 4978 return;
4963 } 4979 }
4964 if (((info.Length() == 1) && (info[0]->IsNull() || V8TestInterfaceEmpty::has Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) { 4980 if (((info.Length() == 1) && (info[0]->IsNull() || V8TestInterfaceEmpty::has Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
4965 overloadedMethodF2Method(info); 4981 overloadedMethodF2Method(info);
4966 return; 4982 return;
4967 } 4983 }
4968 if (UNLIKELY(info.Length() < 1)) { 4984 if (UNLIKELY(info.Length() < 1)) {
4969 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodF", " TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())), inf o.GetIsolate()); 4985 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
4986 exceptionState.throwIfNeeded();
4970 return; 4987 return;
4971 } 4988 }
4972 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodF", "Test ObjectPython", "No function was found that matched the signature provided."), in fo.GetIsolate()); 4989 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
4990 exceptionState.throwIfNeeded();
4973 } 4991 }
4974 4992
4975 static void overloadedMethodFMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 4993 static void overloadedMethodFMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
4976 { 4994 {
4977 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4995 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4978 TestObjectPythonV8Internal::overloadedMethodFMethod(info); 4996 TestObjectPythonV8Internal::overloadedMethodFMethod(info);
4979 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4997 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4980 } 4998 }
4981 4999
4982 static void overloadedMethodG1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 5000 static void overloadedMethodG1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
5106 throwTypeError(ExceptionMessages::failedToExecute("overloadedStaticMetho d", "TestObjectPython", ExceptionMessages::notEnoughArguments(2, info.Length())) , info.GetIsolate()); 5124 throwTypeError(ExceptionMessages::failedToExecute("overloadedStaticMetho d", "TestObjectPython", ExceptionMessages::notEnoughArguments(2, info.Length())) , info.GetIsolate());
5107 return; 5125 return;
5108 } 5126 }
5109 V8TRYCATCH_VOID(int, longArg1, toInt32(info[0])); 5127 V8TRYCATCH_VOID(int, longArg1, toInt32(info[0]));
5110 V8TRYCATCH_VOID(int, longArg2, toInt32(info[1])); 5128 V8TRYCATCH_VOID(int, longArg2, toInt32(info[1]));
5111 TestObjectPython::overloadedStaticMethod(longArg1, longArg2); 5129 TestObjectPython::overloadedStaticMethod(longArg1, longArg2);
5112 } 5130 }
5113 5131
5114 static void overloadedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu e>& info) 5132 static void overloadedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu e>& info)
5115 { 5133 {
5134 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedS taticMethod", "TestObjectPython", info.Holder(), info.GetIsolate());
5116 if (((info.Length() == 1))) { 5135 if (((info.Length() == 1))) {
5117 overloadedStaticMethod1Method(info); 5136 overloadedStaticMethod1Method(info);
5118 return; 5137 return;
5119 } 5138 }
5120 if (((info.Length() == 2))) { 5139 if (((info.Length() == 2))) {
5121 overloadedStaticMethod2Method(info); 5140 overloadedStaticMethod2Method(info);
5122 return; 5141 return;
5123 } 5142 }
5124 if (UNLIKELY(info.Length() < 1)) { 5143 if (UNLIKELY(info.Length() < 1)) {
5125 throwTypeError(ExceptionMessages::failedToExecute("overloadedStaticMetho d", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, info.Length())) , info.GetIsolate()); 5144 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
5145 exceptionState.throwIfNeeded();
5126 return; 5146 return;
5127 } 5147 }
5128 throwTypeError(ExceptionMessages::failedToExecute("overloadedStaticMethod", "TestObjectPython", "No function was found that matched the signature provided." ), info.GetIsolate()); 5148 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
5149 exceptionState.throwIfNeeded();
5129 } 5150 }
5130 5151
5131 static void overloadedStaticMethodMethodCallback(const v8::FunctionCallbackInfo< v8::Value>& info) 5152 static void overloadedStaticMethodMethodCallback(const v8::FunctionCallbackInfo< v8::Value>& info)
5132 { 5153 {
5133 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 5154 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
5134 TestObjectPythonV8Internal::overloadedStaticMethodMethod(info); 5155 TestObjectPythonV8Internal::overloadedStaticMethodMethod(info);
5135 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 5156 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
5136 } 5157 }
5137 5158
5138 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in fo) 5159 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in fo)
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after
6538 fromInternalPointer(object)->deref(); 6559 fromInternalPointer(object)->deref();
6539 } 6560 }
6540 6561
6541 template<> 6562 template<>
6542 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate) 6563 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object > creationContext, v8::Isolate* isolate)
6543 { 6564 {
6544 return toV8(impl, creationContext, isolate); 6565 return toV8(impl, creationContext, isolate);
6545 } 6566 }
6546 6567
6547 } // namespace WebCore 6568 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.cpp ('k') | Source/bindings/tests/results/V8TestOverloadedConstructors.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698