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

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterfaceConstructor.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 "V8TestInterfaceConstructor.h" 8 #include "V8TestInterfaceConstructor.h"
9 9
10 #include "bindings/core/v8/Dictionary.h" 10 #include "bindings/core/v8/Dictionary.h"
(...skipping 15 matching lines...) Expand all
26 26
27 const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbe dderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor:: refObject, V8TestInterfaceConstructor::derefObject, V8TestInterfaceConstructor:: createPersistentHandle, 0, 0, 0, V8TestInterfaceConstructor::installConditionall yEnabledMethods, V8TestInterfaceConstructor::installConditionallyEnabledProperti es, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClass Id, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject }; 27 const WrapperTypeInfo V8TestInterfaceConstructor::wrapperTypeInfo = { gin::kEmbe dderBlink, V8TestInterfaceConstructor::domTemplate, V8TestInterfaceConstructor:: refObject, V8TestInterfaceConstructor::derefObject, V8TestInterfaceConstructor:: createPersistentHandle, 0, 0, 0, V8TestInterfaceConstructor::installConditionall yEnabledMethods, V8TestInterfaceConstructor::installConditionallyEnabledProperti es, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClass Id, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject };
28 28
29 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eConstructor.h. 29 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfac eConstructor.h.
30 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 30 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
31 // bindings/core/v8/ScriptWrappable.h. 31 // bindings/core/v8/ScriptWrappable.h.
32 const WrapperTypeInfo& TestInterfaceConstructor::s_wrapperTypeInfo = V8TestInter faceConstructor::wrapperTypeInfo; 32 const WrapperTypeInfo& TestInterfaceConstructor::s_wrapperTypeInfo = V8TestInter faceConstructor::wrapperTypeInfo;
33 33
34 namespace TestInterfaceConstructorV8Internal { 34 namespace TestInterfaceConstructorV8Internal {
35 35
36 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info) 36 static void constructor1(const v8::FunctionCallbackInfo<v8::Value>& info, int ty pe_checked_argument_index)
37 { 37 {
38 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 38 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
39 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 39 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
40 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 40 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
41 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, exceptionState); 41 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, exceptionState);
42 if (exceptionState.hadException()) { 42 if (exceptionState.hadException()) {
43 exceptionState.throwIfNeeded(); 43 exceptionState.throwIfNeeded();
44 return; 44 return;
45 } 45 }
46 v8::Handle<v8::Object> wrapper = info.Holder(); 46 v8::Handle<v8::Object> wrapper = info.Holder();
47 impl->associateWithWrapper(&V8TestInterfaceConstructor::wrapperTypeInfo, wra pper, info.GetIsolate()); 47 impl->associateWithWrapper(&V8TestInterfaceConstructor::wrapperTypeInfo, wra pper, info.GetIsolate());
48 v8SetReturnValue(info, wrapper); 48 v8SetReturnValue(info, wrapper);
49 } 49 }
50 50
51 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info) 51 static void constructor2(const v8::FunctionCallbackInfo<v8::Value>& info, int ty pe_checked_argument_index)
52 { 52 {
53 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 53 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
54 double doubleArg; 54 double doubleArg;
55 V8StringResource<> stringArg; 55 V8StringResource<> stringArg;
56 TestInterfaceEmpty* testInterfaceEmptyArg; 56 TestInterfaceEmpty* testInterfaceEmptyArg;
57 Dictionary dictionaryArg; 57 Dictionary dictionaryArg;
58 Vector<String> sequenceStringArg; 58 Vector<String> sequenceStringArg;
59 Vector<Dictionary> sequenceDictionaryArg; 59 Vector<Dictionary> sequenceDictionaryArg;
60 Dictionary optionalDictionaryArg; 60 Dictionary optionalDictionaryArg;
61 TestInterfaceEmpty* optionalTestInterfaceEmptyArg; 61 TestInterfaceEmpty* optionalTestInterfaceEmptyArg;
(...skipping 22 matching lines...) Expand all
84 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionary Arg, sequenceStringArg, sequenceDictionaryArg, optionalDictionaryArg, optionalTe stInterfaceEmptyArg, exceptionState); 84 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, doubleArg, stringArg, testInterfaceEmptyArg, dictionary Arg, sequenceStringArg, sequenceDictionaryArg, optionalDictionaryArg, optionalTe stInterfaceEmptyArg, exceptionState);
85 if (exceptionState.hadException()) { 85 if (exceptionState.hadException()) {
86 exceptionState.throwIfNeeded(); 86 exceptionState.throwIfNeeded();
87 return; 87 return;
88 } 88 }
89 v8::Handle<v8::Object> wrapper = info.Holder(); 89 v8::Handle<v8::Object> wrapper = info.Holder();
90 impl->associateWithWrapper(&V8TestInterfaceConstructor::wrapperTypeInfo, wra pper, info.GetIsolate()); 90 impl->associateWithWrapper(&V8TestInterfaceConstructor::wrapperTypeInfo, wra pper, info.GetIsolate());
91 v8SetReturnValue(info, wrapper); 91 v8SetReturnValue(info, wrapper);
92 } 92 }
93 93
94 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info) 94 static void constructor3(const v8::FunctionCallbackInfo<v8::Value>& info, int ty pe_checked_argument_index)
95 { 95 {
96 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 96 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
97 V8StringResource<> arg; 97 V8StringResource<> arg;
98 V8StringResource<> optArg; 98 V8StringResource<> optArg;
99 { 99 {
100 TOSTRING_VOID_INTERNAL(arg, info[0]); 100 TOSTRING_VOID_INTERNAL(arg, info[0]);
101 if (UNLIKELY(info.Length() <= 1)) { 101 if (UNLIKELY(info.Length() <= 1)) {
102 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate()); 102 ExecutionContext* executionContext = currentExecutionContext(info.Ge tIsolate());
103 Document& document = *toDocument(currentExecutionContext(info.GetIso late())); 103 Document& document = *toDocument(currentExecutionContext(info.GetIso late()));
104 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eate(executionContext, document, arg, exceptionState); 104 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::cr eate(executionContext, document, arg, exceptionState);
(...skipping 13 matching lines...) Expand all
118 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, arg, optArg, exceptionState); 118 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, arg, optArg, exceptionState);
119 if (exceptionState.hadException()) { 119 if (exceptionState.hadException()) {
120 exceptionState.throwIfNeeded(); 120 exceptionState.throwIfNeeded();
121 return; 121 return;
122 } 122 }
123 v8::Handle<v8::Object> wrapper = info.Holder(); 123 v8::Handle<v8::Object> wrapper = info.Holder();
124 impl->associateWithWrapper(&V8TestInterfaceConstructor::wrapperTypeInfo, wra pper, info.GetIsolate()); 124 impl->associateWithWrapper(&V8TestInterfaceConstructor::wrapperTypeInfo, wra pper, info.GetIsolate());
125 v8SetReturnValue(info, wrapper); 125 v8SetReturnValue(info, wrapper);
126 } 126 }
127 127
128 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info) 128 static void constructor4(const v8::FunctionCallbackInfo<v8::Value>& info, int ty pe_checked_argument_index)
129 { 129 {
130 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 130 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
131 V8StringResource<> arg; 131 V8StringResource<> arg;
132 V8StringResource<> arg2; 132 V8StringResource<> arg2;
133 V8StringResource<> arg3; 133 V8StringResource<> arg3;
134 { 134 {
135 TOSTRING_VOID_INTERNAL(arg, info[0]); 135 TOSTRING_VOID_INTERNAL(arg, info[0]);
136 TOSTRING_VOID_INTERNAL(arg2, info[1]); 136 TOSTRING_VOID_INTERNAL(arg2, info[1]);
137 TOSTRING_VOID_INTERNAL(arg3, info[2]); 137 TOSTRING_VOID_INTERNAL(arg3, info[2]);
138 } 138 }
139 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ()); 139 ExecutionContext* executionContext = currentExecutionContext(info.GetIsolate ());
140 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ; 140 Document& document = *toDocument(currentExecutionContext(info.GetIsolate())) ;
141 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, arg, arg2, arg3, exceptionState); 141 RefPtr<TestInterfaceConstructor> impl = TestInterfaceConstructor::create(exe cutionContext, document, arg, arg2, arg3, exceptionState);
142 if (exceptionState.hadException()) { 142 if (exceptionState.hadException()) {
143 exceptionState.throwIfNeeded(); 143 exceptionState.throwIfNeeded();
144 return; 144 return;
145 } 145 }
146 v8::Handle<v8::Object> wrapper = info.Holder(); 146 v8::Handle<v8::Object> wrapper = info.Holder();
147 impl->associateWithWrapper(&V8TestInterfaceConstructor::wrapperTypeInfo, wra pper, info.GetIsolate()); 147 impl->associateWithWrapper(&V8TestInterfaceConstructor::wrapperTypeInfo, wra pper, info.GetIsolate());
148 v8SetReturnValue(info, wrapper); 148 v8SetReturnValue(info, wrapper);
149 } 149 }
150 150
151 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 151 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
152 { 152 {
153 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate()); 153 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte rfaceConstructor", info.Holder(), info.GetIsolate());
154 switch (std::min(8, info.Length())) { 154 switch (std::min(8, info.Length())) {
155 case 0: 155 case 0:
156 if (true) { 156 if (true) {
157 TestInterfaceConstructorV8Internal::constructor1(info); 157 TestInterfaceConstructorV8Internal::constructor1(info, -1);
158 return; 158 return;
159 } 159 }
160 break; 160 break;
161 case 1: 161 case 1:
162 if (true) { 162 if (true) {
163 TestInterfaceConstructorV8Internal::constructor3(info); 163 TestInterfaceConstructorV8Internal::constructor3(info, -1);
164 return; 164 return;
165 } 165 }
166 break; 166 break;
167 case 2: 167 case 2:
168 if (true) { 168 if (true) {
169 TestInterfaceConstructorV8Internal::constructor3(info); 169 TestInterfaceConstructorV8Internal::constructor3(info, -1);
170 return; 170 return;
171 } 171 }
172 break; 172 break;
173 case 3: 173 case 3:
174 if (true) { 174 if (true) {
175 TestInterfaceConstructorV8Internal::constructor4(info); 175 TestInterfaceConstructorV8Internal::constructor4(info, -1);
176 return; 176 return;
177 } 177 }
178 break; 178 break;
179 case 6: 179 case 6:
180 if (true) { 180 if (true) {
181 TestInterfaceConstructorV8Internal::constructor2(info); 181 TestInterfaceConstructorV8Internal::constructor2(info, -1);
182 return; 182 return;
183 } 183 }
184 break; 184 break;
185 case 7: 185 case 7:
186 if (true) { 186 if (true) {
187 TestInterfaceConstructorV8Internal::constructor2(info); 187 TestInterfaceConstructorV8Internal::constructor2(info, -1);
188 return; 188 return;
189 } 189 }
190 break; 190 break;
191 case 8: 191 case 8:
192 if (true) { 192 if (true) {
193 TestInterfaceConstructorV8Internal::constructor2(info); 193 TestInterfaceConstructorV8Internal::constructor2(info, -1);
194 return; 194 return;
195 } 195 }
196 break; 196 break;
197 default: 197 default:
198 if (info.Length() >= 0) { 198 if (info.Length() >= 0) {
199 throwArityTypeError(exceptionState, "[0, 1, 2, 3, 6, 7, 8]", info.Le ngth()); 199 throwArityTypeError(exceptionState, "[0, 1, 2, 3, 6, 7, 8]", info.Le ngth());
200 return; 200 return;
201 } 201 }
202 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, i nfo.Length())); 202 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(0, i nfo.Length()));
203 exceptionState.throwIfNeeded(); 203 exceptionState.throwIfNeeded();
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 return 0; 352 return 0;
353 } 353 }
354 354
355 template<> 355 template<>
356 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate) 356 v8::Handle<v8::Value> toV8NoInline(TestInterfaceConstructor* impl, v8::Handle<v8 ::Object> creationContext, v8::Isolate* isolate)
357 { 357 {
358 return toV8(impl, creationContext, isolate); 358 return toV8(impl, creationContext, isolate);
359 } 359 }
360 360
361 } // namespace blink 361 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698