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

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterfaceConstructor2.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 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 "V8TestInterfaceConstructor2.h" 8 #include "V8TestInterfaceConstructor2.h"
9 9
10 #include "bindings/core/v8/Dictionary.h" 10 #include "bindings/core/v8/Dictionary.h"
(...skipping 14 matching lines...) Expand all
25 25
26 const WrapperTypeInfo V8TestInterfaceConstructor2::wrapperTypeInfo = { gin::kEmb edderBlink, V8TestInterfaceConstructor2::domTemplate, V8TestInterfaceConstructor 2::refObject, V8TestInterfaceConstructor2::derefObject, V8TestInterfaceConstruct or2::createPersistentHandle, 0, 0, 0, V8TestInterfaceConstructor2::installCondit ionallyEnabledMethods, V8TestInterfaceConstructor2::installConditionallyEnabledP roperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::Obje ctClassId, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject }; 26 const WrapperTypeInfo V8TestInterfaceConstructor2::wrapperTypeInfo = { gin::kEmb edderBlink, V8TestInterfaceConstructor2::domTemplate, V8TestInterfaceConstructor 2::refObject, V8TestInterfaceConstructor2::derefObject, V8TestInterfaceConstruct or2::createPersistentHandle, 0, 0, 0, V8TestInterfaceConstructor2::installCondit ionallyEnabledMethods, V8TestInterfaceConstructor2::installConditionallyEnabledP roperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::Obje ctClassId, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject };
27 27
28 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eConstructor2.h. 28 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eConstructor2.h.
29 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 29 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
30 // bindings/core/v8/ScriptWrappable.h. 30 // bindings/core/v8/ScriptWrappable.h.
31 const WrapperTypeInfo& TestInterfaceConstructor2::s_wrapperTypeInfo = V8TestInte rfaceConstructor2::wrapperTypeInfo; 31 const WrapperTypeInfo& TestInterfaceConstructor2::s_wrapperTypeInfo = V8TestInte rfaceConstructor2::wrapperTypeInfo;
32 32
33 namespace TestInterfaceConstructor2V8Internal { 33 namespace TestInterfaceConstructor2V8Internal {
34 34
35 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) 35 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info, int ty pe_checked_argument_index)
36 { 36 {
37 V8StringResource<> stringArg; 37 V8StringResource<> stringArg;
38 { 38 {
39 TOSTRING_VOID_INTERNAL(stringArg, info[0]); 39 TOSTRING_VOID_INTERNAL(stringArg, info[0]);
40 } 40 }
41 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringArg); 41 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringArg);
42 v8::Handle<v8::Object> wrapper = info.Holder(); 42 v8::Handle<v8::Object> wrapper = info.Holder();
43 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate()); 43 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate());
44 v8SetReturnValue(info, wrapper); 44 v8SetReturnValue(info, wrapper);
45 } 45 }
46 46
47 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 47 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info, int ty pe_checked_argument_index)
48 { 48 {
49 Dictionary dictionaryArg; 49 Dictionary dictionaryArg;
50 { 50 {
51 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) { 51 if (!isUndefinedOrNull(info[0]) && !info[0]->IsObject()) {
52 V8ThrowException::throwTypeError(ExceptionMessages::failedToConstruc t("TestInterfaceConstructor2", "parameter 1 ('dictionaryArg') is not an object." ), info.GetIsolate()); 52 V8ThrowException::throwTypeError(ExceptionMessages::failedToConstruc t("TestInterfaceConstructor2", "parameter 1 ('dictionaryArg') is not an object." ), info.GetIsolate());
53 return; 53 return;
54 } 54 }
55 dictionaryArg = Dictionary(info[0], info.GetIsolate()); 55 dictionaryArg = Dictionary(info[0], info.GetIsolate());
56 } 56 }
57 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(d ictionaryArg); 57 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(d ictionaryArg);
58 v8::Handle<v8::Object> wrapper = info.Holder(); 58 v8::Handle<v8::Object> wrapper = info.Holder();
59 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate()); 59 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate());
60 v8SetReturnValue(info, wrapper); 60 v8SetReturnValue(info, wrapper);
61 } 61 }
62 62
63 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) 63 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info, int ty pe_checked_argument_index)
64 { 64 {
65 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 65 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
66 Vector<Vector<String> > stringSequenceSequenceArg; 66 Vector<Vector<String> > stringSequenceSequenceArg;
67 { 67 {
68 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(stringSequenceSequenceArg, toImplA rray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState), exceptionSt ate); 68 TONATIVE_VOID_EXCEPTIONSTATE_INTERNAL(stringSequenceSequenceArg, toImplA rray<Vector<String>>(info[0], 1, info.GetIsolate(), exceptionState), exceptionSt ate);
69 } 69 }
70 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringSequenceSequenceArg); 70 RefPtr<TestInterfaceConstructor2> impl = TestInterfaceConstructor2::create(s tringSequenceSequenceArg);
71 v8::Handle<v8::Object> wrapper = info.Holder(); 71 v8::Handle<v8::Object> wrapper = info.Holder();
72 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate()); 72 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate());
73 v8SetReturnValue(info, wrapper); 73 v8SetReturnValue(info, wrapper);
74 } 74 }
75 75
76 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) 76 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info, int ty pe_checked_argument_index)
77 { 77 {
78 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 78 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
79 TestInterfaceEmpty* testInterfaceEmptyArg; 79 TestInterfaceEmpty* testInterfaceEmptyArg;
80 int longArg; 80 int longArg;
81 V8StringResource<> defaultUndefinedOptionalStringArg; 81 V8StringResource<> defaultUndefinedOptionalStringArg;
82 V8StringResource<> defaultNullStringOptionalStringArg; 82 V8StringResource<> defaultNullStringOptionalStringArg;
83 Dictionary defaultUndefinedOptionalDictionaryArg; 83 Dictionary defaultUndefinedOptionalDictionaryArg;
84 V8StringResource<> optionalStringArg; 84 V8StringResource<> optionalStringArg;
85 { 85 {
86 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[0]); 86 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.G etIsolate(), info[0]);
(...skipping 24 matching lines...) Expand all
111 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate()); 111 impl->associateWithWrapper(&V8TestInterfaceConstructor2::wrapperTypeInfo, wr apper, info.GetIsolate());
112 v8SetReturnValue(info, wrapper); 112 v8SetReturnValue(info, wrapper);
113 } 113 }
114 114
115 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 115 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
116 { 116 {
117 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate()); 117 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor2", info.Holder(), info.GetIsolate());
118 switch (std::min(6, info.Length())) { 118 switch (std::min(6, info.Length())) {
119 case 1: 119 case 1:
120 if (info[0]->IsArray()) { 120 if (info[0]->IsArray()) {
121 TestInterfaceConstructor2V8Internal::constructor3(info); 121 TestInterfaceConstructor2V8Internal::constructor3(info, 0);
122 return; 122 return;
123 } 123 }
124 if (info[0]->IsObject()) { 124 if (info[0]->IsObject()) {
125 TestInterfaceConstructor2V8Internal::constructor2(info); 125 TestInterfaceConstructor2V8Internal::constructor2(info, 0);
126 return; 126 return;
127 } 127 }
128 if (true) { 128 if (true) {
129 TestInterfaceConstructor2V8Internal::constructor1(info); 129 TestInterfaceConstructor2V8Internal::constructor1(info, -1);
130 return; 130 return;
131 } 131 }
132 break; 132 break;
133 case 2: 133 case 2:
134 if (true) { 134 if (true) {
135 TestInterfaceConstructor2V8Internal::constructor4(info); 135 TestInterfaceConstructor2V8Internal::constructor4(info, -1);
136 return; 136 return;
137 } 137 }
138 break; 138 break;
139 case 3: 139 case 3:
140 if (true) { 140 if (true) {
141 TestInterfaceConstructor2V8Internal::constructor4(info); 141 TestInterfaceConstructor2V8Internal::constructor4(info, -1);
142 return; 142 return;
143 } 143 }
144 break; 144 break;
145 case 4: 145 case 4:
146 if (true) { 146 if (true) {
147 TestInterfaceConstructor2V8Internal::constructor4(info); 147 TestInterfaceConstructor2V8Internal::constructor4(info, -1);
148 return; 148 return;
149 } 149 }
150 break; 150 break;
151 case 5: 151 case 5:
152 if (true) { 152 if (true) {
153 TestInterfaceConstructor2V8Internal::constructor4(info); 153 TestInterfaceConstructor2V8Internal::constructor4(info, -1);
154 return; 154 return;
155 } 155 }
156 break; 156 break;
157 case 6: 157 case 6:
158 if (true) { 158 if (true) {
159 TestInterfaceConstructor2V8Internal::constructor4(info); 159 TestInterfaceConstructor2V8Internal::constructor4(info, -1);
160 return; 160 return;
161 } 161 }
162 break; 162 break;
163 default: 163 default:
164 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length())); 164 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i nfo.Length()));
165 exceptionState.throwIfNeeded(); 165 exceptionState.throwIfNeeded();
166 return; 166 return;
167 } 167 }
168 exceptionState.throwTypeError("No matching constructor signature."); 168 exceptionState.throwTypeError("No matching constructor signature.");
169 exceptionState.throwIfNeeded(); 169 exceptionState.throwIfNeeded();
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 return 0; 245 return 0;
246 } 246 }
247 247
248 template<> 248 template<>
249 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate) 249 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor2* impl, v8::Handle<v 8::Object> creationContext, v8::Isolate* isolate)
250 { 250 {
251 return toV8(impl, creationContext, isolate); 251 return toV8(impl, creationContext, isolate);
252 } 252 }
253 253
254 } // namespace blink 254 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698