- add third_party src.
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestObject.cpp
1 /*
2  * Copyright (C) 2013 Google Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  *     * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above
11  * copyright notice, this list of conditions and the following disclaimer
12  * in the documentation and/or other materials provided with the
13  * distribution.
14  *     * Neither the name of Google Inc. nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
32
33 #include "config.h"
34 #include "V8TestObject.h"
35
36 #include "HTMLNames.h"
37 #include "RuntimeEnabledFeatures.h"
38 #include "V8DOMStringList.h"
39 #include "V8Document.h"
40 #include "V8EventTarget.h"
41 #include "V8MessagePort.h"
42 #include "V8Node.h"
43 #include "V8SVGDocument.h"
44 #include "V8SVGPoint.h"
45 #include "V8TestCallback.h"
46 #include "V8TestInterface.h"
47 #include "V8TestNode.h"
48 #include "V8TestObjectectA.h"
49 #include "V8TestObjectectB.h"
50 #include "V8TestObjectectC.h"
51 #include "V8TestSubObj.h"
52 #include "bindings/v8/BindingSecurity.h"
53 #include "bindings/v8/Dictionary.h"
54 #include "bindings/v8/ExceptionMessages.h"
55 #include "bindings/v8/ExceptionState.h"
56 #include "bindings/v8/ScriptController.h"
57 #include "bindings/v8/ScriptValue.h"
58 #include "bindings/v8/SerializedScriptValue.h"
59 #include "bindings/v8/V8AbstractEventListener.h"
60 #include "bindings/v8/V8Binding.h"
61 #include "bindings/v8/V8DOMActivityLogger.h"
62 #include "bindings/v8/V8DOMConfiguration.h"
63 #include "bindings/v8/V8DOMWrapper.h"
64 #include "bindings/v8/V8EventListenerList.h"
65 #include "bindings/v8/V8HiddenPropertyName.h"
66 #include "bindings/v8/V8ObjectConstructor.h"
67 #include "bindings/v8/custom/V8Float32ArrayCustom.h"
68 #include "core/dom/ContextFeatures.h"
69 #include "core/dom/Document.h"
70 #include "core/dom/ExceptionCode.h"
71 #include "core/dom/custom/CustomElementCallbackDispatcher.h"
72 #include "core/frame/DOMWindow.h"
73 #include "core/page/UseCounter.h"
74 #include "core/svg/properties/SVGPropertyTearOff.h"
75 #include "core/svg/properties/SVGStaticPropertyTearOff.h"
76 #include "platform/TraceEvent.h"
77 #include "wtf/GetPtr.h"
78 #include "wtf/RefPtr.h"
79 #include "wtf/UnusedParam.h"
80
81 namespace WebCore {
82
83 static void initializeScriptWrappableForInterface(TestObj* object)
84 {
85     if (ScriptWrappable::wrapperCanBeStoredInObject(object))
86         ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::wrapperTypeInfo);
87     else
88         ASSERT_NOT_REACHED();
89 }
90
91 } // namespace WebCore
92
93 // In ScriptWrappable::init, the use of a local function declaration has an issue on Windows:
94 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
95 // in the global namespace.
96 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
97 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObj* object)
98 {
99     WebCore::initializeScriptWrappableForInterface(object);
100 }
101
102 namespace WebCore {
103 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { V8TestObject::GetTemplate, V8TestObject::derefObject, 0, V8TestObject::toEventTarget, 0, V8TestObject::installPerContextEnabledPrototypeProperties, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype };
104
105 namespace TestObjV8Internal {
106
107 template <typename T> void V8_USE(T) { }
108
109 static void readOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
110 {
111     TestObj* imp = V8TestObject::toNative(info.Holder());
112     v8SetReturnValueInt(info, imp->readOnlyLongAttr());
113 }
114
115 static void readOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
116 {
117     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
118     TestObjV8Internal::readOnlyLongAttrAttributeGetter(info);
119     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
120 }
121
122 static void readOnlyStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
123 {
124     TestObj* imp = V8TestObject::toNative(info.Holder());
125     v8SetReturnValueString(info, imp->readOnlyStringAttr(), info.GetIsolate());
126 }
127
128 static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
129 {
130     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
131     TestObjV8Internal::readOnlyStringAttrAttributeGetter(info);
132     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
133 }
134
135 static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
136 {
137     TestObj* imp = V8TestObject::toNative(info.Holder());
138     RefPtr<TestObj> result = imp->readOnlyTestObjectAttr();
139     if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get()))
140         return;
141     v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
142     if (!wrapper.IsEmpty()) {
143         V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "readOnlyTestObjectAttr", wrapper);
144         v8SetReturnValue(info, wrapper);
145     }
146 }
147
148 static void readOnlyTestObjectAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
149 {
150     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
151     TestObjV8Internal::readOnlyTestObjectAttrAttributeGetter(info);
152     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
153 }
154
155 static void staticReadOnlyLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
156 {
157     v8SetReturnValueInt(info, TestObj::staticReadOnlyLongAttr());
158 }
159
160 static void staticReadOnlyLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
161 {
162     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
163     TestObjV8Internal::staticReadOnlyLongAttrAttributeGetter(info);
164     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
165 }
166
167 static void staticStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
168 {
169     v8SetReturnValueString(info, TestObj::staticStringAttr(), info.GetIsolate());
170 }
171
172 static void staticStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
173 {
174     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
175     TestObjV8Internal::staticStringAttrAttributeGetter(info);
176     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
177 }
178
179 static void staticStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
180 {
181     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
182     TestObj::setStaticStringAttr(cppValue);
183 }
184
185 static void staticStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
186 {
187     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
188     TestObjV8Internal::staticStringAttrAttributeSetter(jsValue, info);
189     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
190 }
191
192 static void enumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
193 {
194     TestObj* imp = V8TestObject::toNative(info.Holder());
195     v8SetReturnValueString(info, imp->enumAttr(), info.GetIsolate());
196 }
197
198 static void enumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
199 {
200     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
201     TestObjV8Internal::enumAttrAttributeGetter(info);
202     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
203 }
204
205 static void enumAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
206 {
207     TestObj* imp = V8TestObject::toNative(info.Holder());
208     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
209     String string = cppValue;
210     if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3"))
211         return;
212     imp->setEnumAttr(cppValue);
213 }
214
215 static void enumAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
216 {
217     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
218     TestObjV8Internal::enumAttrAttributeSetter(jsValue, info);
219     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
220 }
221
222 static void readOnlyEnumAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
223 {
224     TestObj* imp = V8TestObject::toNative(info.Holder());
225     v8SetReturnValueString(info, imp->readOnlyEnumAttr(), info.GetIsolate());
226 }
227
228 static void readOnlyEnumAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
229 {
230     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
231     TestObjV8Internal::readOnlyEnumAttrAttributeGetter(info);
232     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
233 }
234
235 static void byteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
236 {
237     TestObj* imp = V8TestObject::toNative(info.Holder());
238     v8SetReturnValueInt(info, imp->byteAttr());
239 }
240
241 static void byteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
242 {
243     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
244     TestObjV8Internal::byteAttrAttributeGetter(info);
245     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
246 }
247
248 static void byteAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
249 {
250     TestObj* imp = V8TestObject::toNative(info.Holder());
251     V8TRYCATCH_VOID(int, cppValue, toInt8(jsValue));
252     imp->setByteAttr(cppValue);
253 }
254
255 static void byteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
256 {
257     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
258     TestObjV8Internal::byteAttrAttributeSetter(jsValue, info);
259     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
260 }
261
262 static void octetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
263 {
264     TestObj* imp = V8TestObject::toNative(info.Holder());
265     v8SetReturnValueUnsigned(info, imp->octetAttr());
266 }
267
268 static void octetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
269 {
270     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
271     TestObjV8Internal::octetAttrAttributeGetter(info);
272     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
273 }
274
275 static void octetAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
276 {
277     TestObj* imp = V8TestObject::toNative(info.Holder());
278     V8TRYCATCH_VOID(unsigned, cppValue, toUInt8(jsValue));
279     imp->setOctetAttr(cppValue);
280 }
281
282 static void octetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
283 {
284     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
285     TestObjV8Internal::octetAttrAttributeSetter(jsValue, info);
286     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
287 }
288
289 static void shortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
290 {
291     TestObj* imp = V8TestObject::toNative(info.Holder());
292     v8SetReturnValueInt(info, imp->shortAttr());
293 }
294
295 static void shortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
296 {
297     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
298     TestObjV8Internal::shortAttrAttributeGetter(info);
299     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
300 }
301
302 static void shortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
303 {
304     TestObj* imp = V8TestObject::toNative(info.Holder());
305     V8TRYCATCH_VOID(int, cppValue, toInt16(jsValue));
306     imp->setShortAttr(cppValue);
307 }
308
309 static void shortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
310 {
311     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
312     TestObjV8Internal::shortAttrAttributeSetter(jsValue, info);
313     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
314 }
315
316 static void unsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
317 {
318     TestObj* imp = V8TestObject::toNative(info.Holder());
319     v8SetReturnValueUnsigned(info, imp->unsignedShortAttr());
320 }
321
322 static void unsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
323 {
324     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
325     TestObjV8Internal::unsignedShortAttrAttributeGetter(info);
326     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
327 }
328
329 static void unsignedShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
330 {
331     TestObj* imp = V8TestObject::toNative(info.Holder());
332     V8TRYCATCH_VOID(unsigned, cppValue, toUInt16(jsValue));
333     imp->setUnsignedShortAttr(cppValue);
334 }
335
336 static void unsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
337 {
338     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
339     TestObjV8Internal::unsignedShortAttrAttributeSetter(jsValue, info);
340     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
341 }
342
343 static void longAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
344 {
345     TestObj* imp = V8TestObject::toNative(info.Holder());
346     v8SetReturnValueInt(info, imp->longAttr());
347 }
348
349 static void longAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
350 {
351     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
352     TestObjV8Internal::longAttrAttributeGetter(info);
353     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
354 }
355
356 static void longAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
357 {
358     TestObj* imp = V8TestObject::toNative(info.Holder());
359     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
360     imp->setLongAttr(cppValue);
361 }
362
363 static void longAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
364 {
365     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
366     TestObjV8Internal::longAttrAttributeSetter(jsValue, info);
367     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
368 }
369
370 static void longLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
371 {
372     TestObj* imp = V8TestObject::toNative(info.Holder());
373     v8SetReturnValue(info, static_cast<double>(imp->longLongAttr()));
374 }
375
376 static void longLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
377 {
378     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
379     TestObjV8Internal::longLongAttrAttributeGetter(info);
380     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
381 }
382
383 static void longLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
384 {
385     TestObj* imp = V8TestObject::toNative(info.Holder());
386     V8TRYCATCH_VOID(long long, cppValue, toInt64(jsValue));
387     imp->setLongLongAttr(cppValue);
388 }
389
390 static void longLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
391 {
392     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
393     TestObjV8Internal::longLongAttrAttributeSetter(jsValue, info);
394     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
395 }
396
397 static void unsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
398 {
399     TestObj* imp = V8TestObject::toNative(info.Holder());
400     v8SetReturnValue(info, static_cast<double>(imp->unsignedLongLongAttr()));
401 }
402
403 static void unsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
404 {
405     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
406     TestObjV8Internal::unsignedLongLongAttrAttributeGetter(info);
407     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
408 }
409
410 static void unsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
411 {
412     TestObj* imp = V8TestObject::toNative(info.Holder());
413     V8TRYCATCH_VOID(unsigned long long, cppValue, toUInt64(jsValue));
414     imp->setUnsignedLongLongAttr(cppValue);
415 }
416
417 static void unsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
418 {
419     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
420     TestObjV8Internal::unsignedLongLongAttrAttributeSetter(jsValue, info);
421     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
422 }
423
424 static void stringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
425 {
426     TestObj* imp = V8TestObject::toNative(info.Holder());
427     v8SetReturnValueString(info, imp->stringAttr(), info.GetIsolate());
428 }
429
430 static void stringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
431 {
432     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
433     TestObjV8Internal::stringAttrAttributeGetter(info);
434     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
435 }
436
437 static void stringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
438 {
439     TestObj* imp = V8TestObject::toNative(info.Holder());
440     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
441     imp->setStringAttr(cppValue);
442 }
443
444 static void stringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
445 {
446     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
447     TestObjV8Internal::stringAttrAttributeSetter(jsValue, info);
448     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
449 }
450
451 static void eventHandlerAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
452 {
453     TestObj* imp = V8TestObject::toNative(info.Holder());
454     EventListener* jsValue = imp->eventHandlerAttr(isolatedWorldForIsolate(info.GetIsolate()));
455     v8SetReturnValue(info, jsValue ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(jsValue)->getListenerObject(imp->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
456 }
457
458 static void eventHandlerAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
459 {
460     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
461     TestObjV8Internal::eventHandlerAttrAttributeGetter(info);
462     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
463 }
464
465 static void eventHandlerAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
466 {
467     TestObj* imp = V8TestObject::toNative(info.Holder());
468     transferHiddenDependency(info.Holder(), imp->eventHandlerAttr(isolatedWorldForIsolate(info.GetIsolate())), jsValue, V8TestObject::eventListenerCacheIndex, info.GetIsolate());
469     imp->setEventHandlerAttr(V8EventListenerList::getEventListener(jsValue, true, ListenerFindOrCreate), isolatedWorldForIsolate(info.GetIsolate()));
470 }
471
472 static void eventHandlerAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
473 {
474     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
475     TestObjV8Internal::eventHandlerAttrAttributeSetter(jsValue, info);
476     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
477 }
478
479 static void testObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
480 {
481     TestObj* imp = V8TestObject::toNative(info.Holder());
482     v8SetReturnValueFast(info, imp->testObjAttr(), imp);
483 }
484
485 static void testObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
486 {
487     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
488     UseCounter::count(activeDOMWindow(), UseCounter::TestFeature);
489     TestObjV8Internal::testObjAttrAttributeGetter(info);
490     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
491 }
492
493 static void testObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
494 {
495     TestObj* imp = V8TestObject::toNative(info.Holder());
496     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
497     imp->setTestObjAttr(WTF::getPtr(cppValue));
498 }
499
500 static void testObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
501 {
502     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
503     UseCounter::count(activeDOMWindow(), UseCounter::TestFeature);
504     TestObjV8Internal::testObjAttrAttributeSetter(jsValue, info);
505     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
506 }
507
508 static void XMLObjAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
509 {
510     TestObj* imp = V8TestObject::toNative(info.Holder());
511     v8SetReturnValueFast(info, imp->xmlObjAttr(), imp);
512 }
513
514 static void XMLObjAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
515 {
516     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
517     TestObjV8Internal::XMLObjAttrAttributeGetter(info);
518     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
519 }
520
521 static void XMLObjAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
522 {
523     TestObj* imp = V8TestObject::toNative(info.Holder());
524     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
525     imp->setXMLObjAttr(WTF::getPtr(cppValue));
526 }
527
528 static void XMLObjAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
529 {
530     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
531     TestObjV8Internal::XMLObjAttrAttributeSetter(jsValue, info);
532     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
533 }
534
535 static void createAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
536 {
537     TestObj* imp = V8TestObject::toNative(info.Holder());
538     v8SetReturnValueBool(info, imp->isCreate());
539 }
540
541 static void createAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
542 {
543     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
544     TestObjV8Internal::createAttributeGetter(info);
545     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
546 }
547
548 static void createAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
549 {
550     TestObj* imp = V8TestObject::toNative(info.Holder());
551     V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue());
552     imp->setCreate(cppValue);
553 }
554
555 static void createAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
556 {
557     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
558     TestObjV8Internal::createAttributeSetter(jsValue, info);
559     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
560 }
561
562 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
563 {
564     TestObj* imp = V8TestObject::toNative(info.Holder());
565     v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::reflectedstringattrAttr), info.GetIsolate());
566 }
567
568 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
569 {
570     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
571     TestObjV8Internal::reflectedStringAttrAttributeGetter(info);
572     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
573 }
574
575 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
576 {
577     TestObj* imp = V8TestObject::toNative(info.Holder());
578     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue);
579     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
580     imp->setAttribute(HTMLNames::reflectedstringattrAttr, cppValue);
581 }
582
583 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
584 {
585     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
586     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
587     TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info);
588     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
589 }
590
591 static void reflectedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
592 {
593     TestObj* imp = V8TestObject::toNative(info.Holder());
594     v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::reflectedintegralattrAttr));
595 }
596
597 static void reflectedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
598 {
599     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
600     TestObjV8Internal::reflectedIntegralAttrAttributeGetter(info);
601     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
602 }
603
604 static void reflectedIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
605 {
606     TestObj* imp = V8TestObject::toNative(info.Holder());
607     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
608     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
609     imp->setIntegralAttribute(HTMLNames::reflectedintegralattrAttr, cppValue);
610 }
611
612 static void reflectedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
613 {
614     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
615     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
616     TestObjV8Internal::reflectedIntegralAttrAttributeSetter(jsValue, info);
617     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
618 }
619
620 static void reflectedUnsignedIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
621 {
622     TestObj* imp = V8TestObject::toNative(info.Holder());
623     v8SetReturnValueUnsigned(info, std::max(0, imp->getIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr)));
624 }
625
626 static void reflectedUnsignedIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
627 {
628     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
629     TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeGetter(info);
630     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
631 }
632
633 static void reflectedUnsignedIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
634 {
635     TestObj* imp = V8TestObject::toNative(info.Holder());
636     V8TRYCATCH_VOID(unsigned, cppValue, toUInt32(jsValue));
637     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
638     imp->setUnsignedIntegralAttribute(HTMLNames::reflectedunsignedintegralattrAttr, cppValue);
639 }
640
641 static void reflectedUnsignedIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
642 {
643     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
644     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
645     TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeSetter(jsValue, info);
646     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
647 }
648
649 static void reflectedBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
650 {
651     TestObj* imp = V8TestObject::toNative(info.Holder());
652     v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::reflectedbooleanattrAttr));
653 }
654
655 static void reflectedBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
656 {
657     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
658     TestObjV8Internal::reflectedBooleanAttrAttributeGetter(info);
659     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
660 }
661
662 static void reflectedBooleanAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
663 {
664     TestObj* imp = V8TestObject::toNative(info.Holder());
665     V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue());
666     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
667     imp->setBooleanAttribute(HTMLNames::reflectedbooleanattrAttr, cppValue);
668 }
669
670 static void reflectedBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
671 {
672     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
673     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
674     TestObjV8Internal::reflectedBooleanAttrAttributeSetter(jsValue, info);
675     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
676 }
677
678 static void reflectedURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
679 {
680     TestObj* imp = V8TestObject::toNative(info.Holder());
681     v8SetReturnValueString(info, imp->getURLAttribute(HTMLNames::reflectedurlattrAttr), info.GetIsolate());
682 }
683
684 static void reflectedURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
685 {
686     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
687     TestObjV8Internal::reflectedURLAttrAttributeGetter(info);
688     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
689 }
690
691 static void reflectedURLAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
692 {
693     TestObj* imp = V8TestObject::toNative(info.Holder());
694     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue);
695     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
696     imp->setAttribute(HTMLNames::reflectedurlattrAttr, cppValue);
697 }
698
699 static void reflectedURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
700 {
701     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
702     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
703     TestObjV8Internal::reflectedURLAttrAttributeSetter(jsValue, info);
704     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
705 }
706
707 static void reflectedStringAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
708 {
709     TestObj* imp = V8TestObject::toNative(info.Holder());
710     v8SetReturnValueString(info, imp->fastGetAttribute(HTMLNames::customContentStringAttrAttr), info.GetIsolate());
711 }
712
713 static void reflectedStringAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
714 {
715     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
716     TestObjV8Internal::reflectedStringAttrAttributeGetter(info);
717     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
718 }
719
720 static void reflectedStringAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
721 {
722     TestObj* imp = V8TestObject::toNative(info.Holder());
723     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue);
724     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
725     imp->setAttribute(HTMLNames::customContentStringAttrAttr, cppValue);
726 }
727
728 static void reflectedStringAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
729 {
730     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
731     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
732     TestObjV8Internal::reflectedStringAttrAttributeSetter(jsValue, info);
733     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
734 }
735
736 static void reflectedCustomIntegralAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
737 {
738     TestObj* imp = V8TestObject::toNative(info.Holder());
739     v8SetReturnValueInt(info, imp->getIntegralAttribute(HTMLNames::customContentIntegralAttrAttr));
740 }
741
742 static void reflectedCustomIntegralAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
743 {
744     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
745     TestObjV8Internal::reflectedCustomIntegralAttrAttributeGetter(info);
746     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
747 }
748
749 static void reflectedCustomIntegralAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
750 {
751     TestObj* imp = V8TestObject::toNative(info.Holder());
752     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
753     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
754     imp->setIntegralAttribute(HTMLNames::customContentIntegralAttrAttr, cppValue);
755 }
756
757 static void reflectedCustomIntegralAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
758 {
759     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
760     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
761     TestObjV8Internal::reflectedCustomIntegralAttrAttributeSetter(jsValue, info);
762     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
763 }
764
765 static void reflectedCustomBooleanAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
766 {
767     TestObj* imp = V8TestObject::toNative(info.Holder());
768     v8SetReturnValueBool(info, imp->fastHasAttribute(HTMLNames::customContentBooleanAttrAttr));
769 }
770
771 static void reflectedCustomBooleanAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
772 {
773     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
774     TestObjV8Internal::reflectedCustomBooleanAttrAttributeGetter(info);
775     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
776 }
777
778 static void reflectedCustomBooleanAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
779 {
780     TestObj* imp = V8TestObject::toNative(info.Holder());
781     V8TRYCATCH_VOID(bool, cppValue, jsValue->BooleanValue());
782     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
783     imp->setBooleanAttribute(HTMLNames::customContentBooleanAttrAttr, cppValue);
784 }
785
786 static void reflectedCustomBooleanAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
787 {
788     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
789     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
790     TestObjV8Internal::reflectedCustomBooleanAttrAttributeSetter(jsValue, info);
791     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
792 }
793
794 static void reflectedCustomURLAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
795 {
796     TestObj* imp = V8TestObject::toNative(info.Holder());
797     v8SetReturnValueString(info, imp->getURLAttribute(HTMLNames::customContentURLAttrAttr), info.GetIsolate());
798 }
799
800 static void reflectedCustomURLAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
801 {
802     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
803     TestObjV8Internal::reflectedCustomURLAttrAttributeGetter(info);
804     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
805 }
806
807 static void reflectedCustomURLAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
808 {
809     TestObj* imp = V8TestObject::toNative(info.Holder());
810     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, cppValue, jsValue);
811     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
812     imp->setAttribute(HTMLNames::customContentURLAttrAttr, cppValue);
813 }
814
815 static void reflectedCustomURLAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
816 {
817     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
818     CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
819     TestObjV8Internal::reflectedCustomURLAttrAttributeSetter(jsValue, info);
820     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
821 }
822
823 static void typedArrayAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
824 {
825     TestObj* imp = V8TestObject::toNative(info.Holder());
826     v8SetReturnValueFast(info, imp->typedArrayAttr(), imp);
827 }
828
829 static void typedArrayAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
830 {
831     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
832     TestObjV8Internal::typedArrayAttrAttributeGetter(info);
833     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
834 }
835
836 static void typedArrayAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
837 {
838     TestObj* imp = V8TestObject::toNative(info.Holder());
839     V8TRYCATCH_VOID(Float32Array*, cppValue, jsValue->IsFloat32Array() ? V8Float32Array::toNative(v8::Handle<v8::Float32Array>::Cast(jsValue)) : 0);
840     imp->setTypedArrayAttr(WTF::getPtr(cppValue));
841 }
842
843 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
844 {
845     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
846     TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info);
847     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
848 }
849
850 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
851 {
852     TestObj* imp = V8TestObject::toNative(info.Holder());
853     ExceptionState es(info.GetIsolate());
854     int jsValue = imp->attrWithGetterException(es);
855     if (UNLIKELY(es.throwIfNeeded()))
856         return;
857     v8SetReturnValueInt(info, jsValue);
858 }
859
860 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
861 {
862     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
863     TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info);
864     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
865 }
866
867 static void attrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
868 {
869     TestObj* imp = V8TestObject::toNative(info.Holder());
870     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
871     imp->setAttrWithGetterException(cppValue);
872 }
873
874 static void attrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
875 {
876     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
877     TestObjV8Internal::attrWithGetterExceptionAttributeSetter(jsValue, info);
878     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
879 }
880
881 static void attrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
882 {
883     TestObj* imp = V8TestObject::toNative(info.Holder());
884     v8SetReturnValueInt(info, imp->attrWithSetterException());
885 }
886
887 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
888 {
889     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
890     TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info);
891     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
892 }
893
894 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
895 {
896     TestObj* imp = V8TestObject::toNative(info.Holder());
897     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
898     ExceptionState es(info.GetIsolate());
899     imp->setAttrWithSetterException(cppValue, es);
900     es.throwIfNeeded();
901 }
902
903 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
904 {
905     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
906     TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info);
907     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
908 }
909
910 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
911 {
912     TestObj* imp = V8TestObject::toNative(info.Holder());
913     ExceptionState es(info.GetIsolate());
914     String jsValue = imp->stringAttrWithGetterException(es);
915     if (UNLIKELY(es.throwIfNeeded()))
916         return;
917     v8SetReturnValueString(info, jsValue, info.GetIsolate());
918 }
919
920 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
921 {
922     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
923     TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info);
924     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
925 }
926
927 static void stringAttrWithGetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
928 {
929     TestObj* imp = V8TestObject::toNative(info.Holder());
930     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
931     imp->setStringAttrWithGetterException(cppValue);
932 }
933
934 static void stringAttrWithGetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
935 {
936     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
937     TestObjV8Internal::stringAttrWithGetterExceptionAttributeSetter(jsValue, info);
938     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
939 }
940
941 static void stringAttrWithSetterExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
942 {
943     TestObj* imp = V8TestObject::toNative(info.Holder());
944     v8SetReturnValueString(info, imp->stringAttrWithSetterException(), info.GetIsolate());
945 }
946
947 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
948 {
949     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
950     TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info);
951     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
952 }
953
954 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
955 {
956     TestObj* imp = V8TestObject::toNative(info.Holder());
957     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
958     ExceptionState es(info.GetIsolate());
959     imp->setStringAttrWithSetterException(cppValue, es);
960     es.throwIfNeeded();
961 }
962
963 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
964 {
965     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
966     TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, info);
967     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
968 }
969
970 static void customAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
971 {
972     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
973     V8TestObject::customAttrAttributeGetterCustom(info);
974     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
975 }
976
977 static void customAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
978 {
979     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
980     V8TestObject::customAttrAttributeSetterCustom(jsValue, info);
981     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
982 }
983
984 static void withScriptStateAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
985 {
986     TestObj* imp = V8TestObject::toNative(info.Holder());
987     ScriptState* currentState = ScriptState::current();
988     if (!currentState)
989         return v8Undefined();
990     ScriptState& state = *currentState;
991     v8SetReturnValueInt(info, imp->withScriptStateAttribute(&state));
992 }
993
994 static void withScriptStateAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
995 {
996     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
997     TestObjV8Internal::withScriptStateAttributeAttributeGetter(info);
998     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
999 }
1000
1001 static void withScriptStateAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1002 {
1003     TestObj* imp = V8TestObject::toNative(info.Holder());
1004     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1005     ScriptState* currentState = ScriptState::current();
1006     if (!currentState)
1007         return;
1008     ScriptState& state = *currentState;
1009     imp->setWithScriptStateAttribute(&state, cppValue);
1010     if (state.hadException())
1011         throwError(state.exception(), info.GetIsolate());
1012 }
1013
1014 static void withScriptStateAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1015 {
1016     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1017     TestObjV8Internal::withScriptStateAttributeAttributeSetter(jsValue, info);
1018     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1019 }
1020
1021 static void withExecutionContextAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1022 {
1023     TestObj* imp = V8TestObject::toNative(info.Holder());
1024     ExecutionContext* scriptContext = getExecutionContext();
1025     v8SetReturnValueFast(info, imp->withExecutionContextAttribute(scriptContext), imp);
1026 }
1027
1028 static void withExecutionContextAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1029 {
1030     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1031     TestObjV8Internal::withExecutionContextAttributeAttributeGetter(info);
1032     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1033 }
1034
1035 static void withExecutionContextAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1036 {
1037     TestObj* imp = V8TestObject::toNative(info.Holder());
1038     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1039     ExecutionContext* scriptContext = getExecutionContext();
1040     imp->setWithExecutionContextAttribute(scriptContext, WTF::getPtr(cppValue));
1041 }
1042
1043 static void withExecutionContextAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1044 {
1045     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1046     TestObjV8Internal::withExecutionContextAttributeAttributeSetter(jsValue, info);
1047     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1048 }
1049
1050 static void withActiveWindowAndFirstWindowAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1051 {
1052     TestObj* imp = V8TestObject::toNative(info.Holder());
1053     v8SetReturnValueFast(info, imp->withActiveWindowAndFirstWindowAttribute(), imp);
1054 }
1055
1056 static void withActiveWindowAndFirstWindowAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1057 {
1058     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1059     TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetter(info);
1060     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1061 }
1062
1063 static void withActiveWindowAndFirstWindowAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1064 {
1065     TestObj* imp = V8TestObject::toNative(info.Holder());
1066     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1067     imp->setWithActiveWindowAndFirstWindowAttribute(activeDOMWindow(), firstDOMWindow(), WTF::getPtr(cppValue));
1068 }
1069
1070 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1071 {
1072     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1073     TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(jsValue, info);
1074     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1075 }
1076
1077 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1078 {
1079     TestObj* imp = V8TestObject::toNative(info.Holder());
1080     ExceptionState es(info.GetIsolate());
1081     ScriptState* currentState = ScriptState::current();
1082     if (!currentState)
1083         return v8Undefined();
1084     ScriptState& state = *currentState;
1085     RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, es);
1086     if (UNLIKELY(es.throwIfNeeded()))
1087         return;
1088     if (state.hadException()) {
1089         throwError(state.exception(), info.GetIsolate());
1090         return;
1091     }
1092     v8SetReturnValueFast(info, jsValue.release(), imp);
1093 }
1094
1095 static void withScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1096 {
1097     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1098     TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetter(info);
1099     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1100 }
1101
1102 static void withScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1103 {
1104     TestObj* imp = V8TestObject::toNative(info.Holder());
1105     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1106     ScriptState* currentState = ScriptState::current();
1107     if (!currentState)
1108         return;
1109     ScriptState& state = *currentState;
1110     imp->setWithScriptStateAttributeRaises(&state, WTF::getPtr(cppValue));
1111     if (state.hadException())
1112         throwError(state.exception(), info.GetIsolate());
1113 }
1114
1115 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1116 {
1117     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1118     TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, info);
1119     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1120 }
1121
1122 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1123 {
1124     TestObj* imp = V8TestObject::toNative(info.Holder());
1125     ExceptionState es(info.GetIsolate());
1126     ExecutionContext* scriptContext = getExecutionContext();
1127     RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptContext, es);
1128     if (UNLIKELY(es.throwIfNeeded()))
1129         return;
1130     v8SetReturnValueFast(info, jsValue.release(), imp);
1131 }
1132
1133 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1134 {
1135     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1136     TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetter(info);
1137     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1138 }
1139
1140 static void withExecutionContextAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1141 {
1142     TestObj* imp = V8TestObject::toNative(info.Holder());
1143     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1144     ExecutionContext* scriptContext = getExecutionContext();
1145     imp->setWithExecutionContextAttributeRaises(scriptContext, WTF::getPtr(cppValue));
1146 }
1147
1148 static void withExecutionContextAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1149 {
1150     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1151     TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetter(jsValue, info);
1152     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1153 }
1154
1155 static void withExecutionContextAndScriptStateAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1156 {
1157     TestObj* imp = V8TestObject::toNative(info.Holder());
1158     ScriptState* currentState = ScriptState::current();
1159     if (!currentState)
1160         return v8Undefined();
1161     ScriptState& state = *currentState;
1162     ExecutionContext* scriptContext = getExecutionContext();
1163     v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateAttribute(&state, scriptContext), imp);
1164 }
1165
1166 static void withExecutionContextAndScriptStateAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1167 {
1168     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1169     TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGetter(info);
1170     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1171 }
1172
1173 static void withExecutionContextAndScriptStateAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1174 {
1175     TestObj* imp = V8TestObject::toNative(info.Holder());
1176     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1177     ScriptState* currentState = ScriptState::current();
1178     if (!currentState)
1179         return;
1180     ScriptState& state = *currentState;
1181     ExecutionContext* scriptContext = getExecutionContext();
1182     imp->setWithExecutionContextAndScriptStateAttribute(&state, scriptContext, WTF::getPtr(cppValue));
1183     if (state.hadException())
1184         throwError(state.exception(), info.GetIsolate());
1185 }
1186
1187 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1188 {
1189     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1190     TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSetter(jsValue, info);
1191     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1192 }
1193
1194 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1195 {
1196     TestObj* imp = V8TestObject::toNative(info.Holder());
1197     ExceptionState es(info.GetIsolate());
1198     ScriptState* currentState = ScriptState::current();
1199     if (!currentState)
1200         return v8Undefined();
1201     ScriptState& state = *currentState;
1202     ExecutionContext* scriptContext = getExecutionContext();
1203     RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRaises(&state, scriptContext, es);
1204     if (UNLIKELY(es.throwIfNeeded()))
1205         return;
1206     if (state.hadException()) {
1207         throwError(state.exception(), info.GetIsolate());
1208         return;
1209     }
1210     v8SetReturnValueFast(info, jsValue.release(), imp);
1211 }
1212
1213 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1214 {
1215     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1216     TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(info);
1217     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1218 }
1219
1220 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1221 {
1222     TestObj* imp = V8TestObject::toNative(info.Holder());
1223     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1224     ScriptState* currentState = ScriptState::current();
1225     if (!currentState)
1226         return;
1227     ScriptState& state = *currentState;
1228     ExecutionContext* scriptContext = getExecutionContext();
1229     imp->setWithExecutionContextAndScriptStateAttributeRaises(&state, scriptContext, WTF::getPtr(cppValue));
1230     if (state.hadException())
1231         throwError(state.exception(), info.GetIsolate());
1232 }
1233
1234 static void withExecutionContextAndScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1235 {
1236     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1237     TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeSetter(jsValue, info);
1238     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1239 }
1240
1241 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1242 {
1243     TestObj* imp = V8TestObject::toNative(info.Holder());
1244     ScriptState* currentState = ScriptState::current();
1245     if (!currentState)
1246         return v8Undefined();
1247     ScriptState& state = *currentState;
1248     ExecutionContext* scriptContext = getExecutionContext();
1249     v8SetReturnValueFast(info, imp->withExecutionContextAndScriptStateWithSpacesAttribute(&state, scriptContext), imp);
1250 }
1251
1252 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1253 {
1254     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1255     TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetter(info);
1256     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1257 }
1258
1259 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1260 {
1261     TestObj* imp = V8TestObject::toNative(info.Holder());
1262     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1263     ScriptState* currentState = ScriptState::current();
1264     if (!currentState)
1265         return;
1266     ScriptState& state = *currentState;
1267     ExecutionContext* scriptContext = getExecutionContext();
1268     imp->setWithExecutionContextAndScriptStateWithSpacesAttribute(&state, scriptContext, WTF::getPtr(cppValue));
1269     if (state.hadException())
1270         throwError(state.exception(), info.GetIsolate());
1271 }
1272
1273 static void withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1274 {
1275     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1276     TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetter(jsValue, info);
1277     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1278 }
1279
1280 static void enforcedRangeByteAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1281 {
1282     TestObj* imp = V8TestObject::toNative(info.Holder());
1283     v8SetReturnValueInt(info, imp->enforcedRangeByteAttr());
1284 }
1285
1286 static void enforcedRangeByteAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1287 {
1288     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1289     TestObjV8Internal::enforcedRangeByteAttrAttributeGetter(info);
1290     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1291 }
1292
1293 static void enforcedRangeByteAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1294 {
1295     TestObj* imp = V8TestObject::toNative(info.Holder());
1296     V8TRYCATCH_WITH_TYPECHECK_VOID(int, cppValue, toInt8(jsValue, EnforceRange, ok), info.GetIsolate());
1297     imp->setEnforcedRangeByteAttr(cppValue);
1298 }
1299
1300 static void enforcedRangeByteAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1301 {
1302     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1303     TestObjV8Internal::enforcedRangeByteAttrAttributeSetter(jsValue, info);
1304     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1305 }
1306
1307 static void enforcedRangeOctetAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1308 {
1309     TestObj* imp = V8TestObject::toNative(info.Holder());
1310     v8SetReturnValueUnsigned(info, imp->enforcedRangeOctetAttr());
1311 }
1312
1313 static void enforcedRangeOctetAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1314 {
1315     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1316     TestObjV8Internal::enforcedRangeOctetAttrAttributeGetter(info);
1317     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1318 }
1319
1320 static void enforcedRangeOctetAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1321 {
1322     TestObj* imp = V8TestObject::toNative(info.Holder());
1323     V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, cppValue, toUInt8(jsValue, EnforceRange, ok), info.GetIsolate());
1324     imp->setEnforcedRangeOctetAttr(cppValue);
1325 }
1326
1327 static void enforcedRangeOctetAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1328 {
1329     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1330     TestObjV8Internal::enforcedRangeOctetAttrAttributeSetter(jsValue, info);
1331     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1332 }
1333
1334 static void enforcedRangeShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1335 {
1336     TestObj* imp = V8TestObject::toNative(info.Holder());
1337     v8SetReturnValueInt(info, imp->enforcedRangeShortAttr());
1338 }
1339
1340 static void enforcedRangeShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1341 {
1342     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1343     TestObjV8Internal::enforcedRangeShortAttrAttributeGetter(info);
1344     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1345 }
1346
1347 static void enforcedRangeShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1348 {
1349     TestObj* imp = V8TestObject::toNative(info.Holder());
1350     V8TRYCATCH_WITH_TYPECHECK_VOID(int, cppValue, toInt16(jsValue, EnforceRange, ok), info.GetIsolate());
1351     imp->setEnforcedRangeShortAttr(cppValue);
1352 }
1353
1354 static void enforcedRangeShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1355 {
1356     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1357     TestObjV8Internal::enforcedRangeShortAttrAttributeSetter(jsValue, info);
1358     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1359 }
1360
1361 static void enforcedRangeUnsignedShortAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1362 {
1363     TestObj* imp = V8TestObject::toNative(info.Holder());
1364     v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedShortAttr());
1365 }
1366
1367 static void enforcedRangeUnsignedShortAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1368 {
1369     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1370     TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeGetter(info);
1371     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1372 }
1373
1374 static void enforcedRangeUnsignedShortAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1375 {
1376     TestObj* imp = V8TestObject::toNative(info.Holder());
1377     V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, cppValue, toUInt16(jsValue, EnforceRange, ok), info.GetIsolate());
1378     imp->setEnforcedRangeUnsignedShortAttr(cppValue);
1379 }
1380
1381 static void enforcedRangeUnsignedShortAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1382 {
1383     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1384     TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeSetter(jsValue, info);
1385     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1386 }
1387
1388 static void enforcedRangeLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1389 {
1390     TestObj* imp = V8TestObject::toNative(info.Holder());
1391     v8SetReturnValueInt(info, imp->enforcedRangeLongAttr());
1392 }
1393
1394 static void enforcedRangeLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1395 {
1396     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1397     TestObjV8Internal::enforcedRangeLongAttrAttributeGetter(info);
1398     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1399 }
1400
1401 static void enforcedRangeLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1402 {
1403     TestObj* imp = V8TestObject::toNative(info.Holder());
1404     V8TRYCATCH_WITH_TYPECHECK_VOID(int, cppValue, toInt32(jsValue, EnforceRange, ok), info.GetIsolate());
1405     imp->setEnforcedRangeLongAttr(cppValue);
1406 }
1407
1408 static void enforcedRangeLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1409 {
1410     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1411     TestObjV8Internal::enforcedRangeLongAttrAttributeSetter(jsValue, info);
1412     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1413 }
1414
1415 static void enforcedRangeUnsignedLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1416 {
1417     TestObj* imp = V8TestObject::toNative(info.Holder());
1418     v8SetReturnValueUnsigned(info, imp->enforcedRangeUnsignedLongAttr());
1419 }
1420
1421 static void enforcedRangeUnsignedLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1422 {
1423     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1424     TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeGetter(info);
1425     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1426 }
1427
1428 static void enforcedRangeUnsignedLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1429 {
1430     TestObj* imp = V8TestObject::toNative(info.Holder());
1431     V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, cppValue, toUInt32(jsValue, EnforceRange, ok), info.GetIsolate());
1432     imp->setEnforcedRangeUnsignedLongAttr(cppValue);
1433 }
1434
1435 static void enforcedRangeUnsignedLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1436 {
1437     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1438     TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeSetter(jsValue, info);
1439     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1440 }
1441
1442 static void enforcedRangeLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1443 {
1444     TestObj* imp = V8TestObject::toNative(info.Holder());
1445     v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeLongLongAttr()));
1446 }
1447
1448 static void enforcedRangeLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1449 {
1450     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1451     TestObjV8Internal::enforcedRangeLongLongAttrAttributeGetter(info);
1452     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1453 }
1454
1455 static void enforcedRangeLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1456 {
1457     TestObj* imp = V8TestObject::toNative(info.Holder());
1458     V8TRYCATCH_WITH_TYPECHECK_VOID(long long, cppValue, toInt64(jsValue, EnforceRange, ok), info.GetIsolate());
1459     imp->setEnforcedRangeLongLongAttr(cppValue);
1460 }
1461
1462 static void enforcedRangeLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1463 {
1464     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1465     TestObjV8Internal::enforcedRangeLongLongAttrAttributeSetter(jsValue, info);
1466     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1467 }
1468
1469 static void enforcedRangeUnsignedLongLongAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1470 {
1471     TestObj* imp = V8TestObject::toNative(info.Holder());
1472     v8SetReturnValue(info, static_cast<double>(imp->enforcedRangeUnsignedLongLongAttr()));
1473 }
1474
1475 static void enforcedRangeUnsignedLongLongAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1476 {
1477     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1478     TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetter(info);
1479     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1480 }
1481
1482 static void enforcedRangeUnsignedLongLongAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1483 {
1484     TestObj* imp = V8TestObject::toNative(info.Holder());
1485     V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, cppValue, toUInt64(jsValue, EnforceRange, ok), info.GetIsolate());
1486     imp->setEnforcedRangeUnsignedLongLongAttr(cppValue);
1487 }
1488
1489 static void enforcedRangeUnsignedLongLongAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1490 {
1491     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1492     TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetter(jsValue, info);
1493     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1494 }
1495
1496 #if ENABLE(Condition1)
1497 static void conditionalAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1498 {
1499     TestObj* imp = V8TestObject::toNative(info.Holder());
1500     v8SetReturnValueInt(info, imp->conditionalAttr1());
1501 }
1502 #endif // ENABLE(Condition1)
1503
1504 #if ENABLE(Condition1)
1505 static void conditionalAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1506 {
1507     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1508     TestObjV8Internal::conditionalAttr1AttributeGetter(info);
1509     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1510 }
1511 #endif // ENABLE(Condition1)
1512
1513 #if ENABLE(Condition1)
1514 static void conditionalAttr1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1515 {
1516     TestObj* imp = V8TestObject::toNative(info.Holder());
1517     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1518     imp->setConditionalAttr1(cppValue);
1519 }
1520 #endif // ENABLE(Condition1)
1521
1522 #if ENABLE(Condition1)
1523 static void conditionalAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1524 {
1525     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1526     TestObjV8Internal::conditionalAttr1AttributeSetter(jsValue, info);
1527     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1528 }
1529 #endif // ENABLE(Condition1)
1530
1531 #if ENABLE(Condition1) && ENABLE(Condition2)
1532 static void conditionalAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1533 {
1534     TestObj* imp = V8TestObject::toNative(info.Holder());
1535     v8SetReturnValueInt(info, imp->conditionalAttr2());
1536 }
1537 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1538
1539 #if ENABLE(Condition1) && ENABLE(Condition2)
1540 static void conditionalAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1541 {
1542     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1543     TestObjV8Internal::conditionalAttr2AttributeGetter(info);
1544     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1545 }
1546 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1547
1548 #if ENABLE(Condition1) && ENABLE(Condition2)
1549 static void conditionalAttr2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1550 {
1551     TestObj* imp = V8TestObject::toNative(info.Holder());
1552     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1553     imp->setConditionalAttr2(cppValue);
1554 }
1555 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1556
1557 #if ENABLE(Condition1) && ENABLE(Condition2)
1558 static void conditionalAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1559 {
1560     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1561     TestObjV8Internal::conditionalAttr2AttributeSetter(jsValue, info);
1562     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1563 }
1564 #endif // ENABLE(Condition1) && ENABLE(Condition2)
1565
1566 #if ENABLE(Condition1) || ENABLE(Condition2)
1567 static void conditionalAttr3AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1568 {
1569     TestObj* imp = V8TestObject::toNative(info.Holder());
1570     v8SetReturnValueInt(info, imp->conditionalAttr3());
1571 }
1572 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1573
1574 #if ENABLE(Condition1) || ENABLE(Condition2)
1575 static void conditionalAttr3AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1576 {
1577     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1578     TestObjV8Internal::conditionalAttr3AttributeGetter(info);
1579     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1580 }
1581 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1582
1583 #if ENABLE(Condition1) || ENABLE(Condition2)
1584 static void conditionalAttr3AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1585 {
1586     TestObj* imp = V8TestObject::toNative(info.Holder());
1587     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1588     imp->setConditionalAttr3(cppValue);
1589 }
1590 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1591
1592 #if ENABLE(Condition1) || ENABLE(Condition2)
1593 static void conditionalAttr3AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1594 {
1595     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1596     TestObjV8Internal::conditionalAttr3AttributeSetter(jsValue, info);
1597     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1598 }
1599 #endif // ENABLE(Condition1) || ENABLE(Condition2)
1600
1601 static void cachedAttribute1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1602 {
1603     TestObj* imp = V8TestObject::toNative(info.Holder());
1604     v8SetReturnValue(info, imp->cachedAttribute1().v8Value());
1605 }
1606
1607 static void cachedAttribute1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1608 {
1609     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1610     TestObjV8Internal::cachedAttribute1AttributeGetter(info);
1611     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1612 }
1613
1614 static void cachedAttribute2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1615 {
1616     TestObj* imp = V8TestObject::toNative(info.Holder());
1617     v8SetReturnValue(info, imp->cachedAttribute2().v8Value());
1618 }
1619
1620 static void cachedAttribute2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1621 {
1622     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1623     TestObjV8Internal::cachedAttribute2AttributeGetter(info);
1624     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1625 }
1626
1627 static void anyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1628 {
1629     TestObj* imp = V8TestObject::toNative(info.Holder());
1630     v8SetReturnValue(info, imp->anyAttribute().v8Value());
1631 }
1632
1633 static void anyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1634 {
1635     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1636     TestObjV8Internal::anyAttributeAttributeGetter(info);
1637     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1638 }
1639
1640 static void anyAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1641 {
1642     TestObj* imp = V8TestObject::toNative(info.Holder());
1643     V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate()));
1644     imp->setAnyAttribute(cppValue);
1645 }
1646
1647 static void anyAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1648 {
1649     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1650     TestObjV8Internal::anyAttributeAttributeSetter(jsValue, info);
1651     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1652 }
1653
1654 static void callbackFunctionAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1655 {
1656     TestObj* imp = V8TestObject::toNative(info.Holder());
1657     v8SetReturnValue(info, imp->callbackFunctionAttribute().v8Value());
1658 }
1659
1660 static void callbackFunctionAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1661 {
1662     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1663     TestObjV8Internal::callbackFunctionAttributeAttributeGetter(info);
1664     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1665 }
1666
1667 static void callbackFunctionAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1668 {
1669     TestObj* imp = V8TestObject::toNative(info.Holder());
1670     V8TRYCATCH_VOID(ScriptValue, cppValue, ScriptValue(jsValue, info.GetIsolate()));
1671     imp->setCallbackFunctionAttribute(cppValue);
1672 }
1673
1674 static void callbackFunctionAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1675 {
1676     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1677     TestObjV8Internal::callbackFunctionAttributeAttributeSetter(jsValue, info);
1678     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1679 }
1680
1681 static void enabledAtRuntimeAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1682 {
1683     TestObj* imp = V8TestObject::toNative(info.Holder());
1684     v8SetReturnValueInt(info, imp->enabledAtRuntimeAttr());
1685 }
1686
1687 static void enabledAtRuntimeAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1688 {
1689     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1690     TestObjV8Internal::enabledAtRuntimeAttrAttributeGetter(info);
1691     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1692 }
1693
1694 static void enabledAtRuntimeAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1695 {
1696     TestObj* imp = V8TestObject::toNative(info.Holder());
1697     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1698     imp->setEnabledAtRuntimeAttr(cppValue);
1699 }
1700
1701 static void enabledAtRuntimeAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1702 {
1703     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1704     TestObjV8Internal::enabledAtRuntimeAttrAttributeSetter(jsValue, info);
1705     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1706 }
1707
1708 static void enabledPerContextAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1709 {
1710     TestObj* imp = V8TestObject::toNative(info.Holder());
1711     v8SetReturnValueInt(info, imp->enabledPerContextAttr());
1712 }
1713
1714 static void enabledPerContextAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1715 {
1716     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1717     TestObjV8Internal::enabledPerContextAttrAttributeGetter(info);
1718     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1719 }
1720
1721 static void enabledPerContextAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1722 {
1723     TestObj* imp = V8TestObject::toNative(info.Holder());
1724     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1725     imp->setEnabledPerContextAttr(cppValue);
1726 }
1727
1728 static void enabledPerContextAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1729 {
1730     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1731     TestObjV8Internal::enabledPerContextAttrAttributeSetter(jsValue, info);
1732     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1733 }
1734
1735 static void floatArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1736 {
1737     TestObj* imp = V8TestObject::toNative(info.Holder());
1738     v8SetReturnValue(info, v8Array(imp->floatArray(), info.GetIsolate()));
1739 }
1740
1741 static void floatArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1742 {
1743     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1744     TestObjV8Internal::floatArrayAttributeGetter(info);
1745     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1746 }
1747
1748 static void floatArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1749 {
1750     TestObj* imp = V8TestObject::toNative(info.Holder());
1751     V8TRYCATCH_VOID(Vector<float>, cppValue, toNativeArray<float>(jsValue, 0, info.GetIsolate()));
1752     imp->setFloatArray(cppValue);
1753 }
1754
1755 static void floatArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1756 {
1757     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1758     TestObjV8Internal::floatArrayAttributeSetter(jsValue, info);
1759     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1760 }
1761
1762 static void doubleArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1763 {
1764     TestObj* imp = V8TestObject::toNative(info.Holder());
1765     v8SetReturnValue(info, v8Array(imp->doubleArray(), info.GetIsolate()));
1766 }
1767
1768 static void doubleArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1769 {
1770     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1771     TestObjV8Internal::doubleArrayAttributeGetter(info);
1772     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1773 }
1774
1775 static void doubleArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1776 {
1777     TestObj* imp = V8TestObject::toNative(info.Holder());
1778     V8TRYCATCH_VOID(Vector<double>, cppValue, toNativeArray<double>(jsValue, 0, info.GetIsolate()));
1779     imp->setDoubleArray(cppValue);
1780 }
1781
1782 static void doubleArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1783 {
1784     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1785     TestObjV8Internal::doubleArrayAttributeSetter(jsValue, info);
1786     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1787 }
1788
1789 static void messagePortArrayAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1790 {
1791     TestObj* imp = V8TestObject::toNative(info.Holder());
1792     v8SetReturnValue(info, v8Array(imp->messagePortArray(), info.GetIsolate()));
1793 }
1794
1795 static void messagePortArrayAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1796 {
1797     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1798     TestObjV8Internal::messagePortArrayAttributeGetter(info);
1799     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1800 }
1801
1802 static void messagePortArrayAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1803 {
1804     TestObj* imp = V8TestObject::toNative(info.Holder());
1805     V8TRYCATCH_VOID(Vector<RefPtr<MessagePort> >, cppValue, (toRefPtrNativeArray<MessagePort, V8MessagePort>(jsValue, 0, info.GetIsolate())));
1806     imp->setMessagePortArray(cppValue);
1807 }
1808
1809 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1810 {
1811     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1812     TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info);
1813     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1814 }
1815
1816 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1817 {
1818     TestObj* imp = V8TestObject::toNative(info.Holder());
1819     ExceptionState es(info.GetIsolate());
1820     if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), es)) {
1821         v8SetReturnValueNull(info);
1822         es.throwIfNeeded();
1823         return;
1824     }
1825     v8SetReturnValueFast(info, imp->contentDocument(), imp);
1826 }
1827
1828 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1829 {
1830     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1831     TestObjV8Internal::contentDocumentAttributeGetter(info);
1832     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1833 }
1834
1835 static void mutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1836 {
1837     TestObj* imp = V8TestObject::toNative(info.Holder());
1838     v8SetReturnValueFast(info, WTF::getPtr(SVGStaticPropertyTearOff<TestObj, SVGPoint>::create(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)), imp);
1839 }
1840
1841 static void mutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1842 {
1843     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1844     TestObjV8Internal::mutablePointAttributeGetter(info);
1845     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1846 }
1847
1848 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1849 {
1850     TestObj* imp = V8TestObject::toNative(info.Holder());
1851     V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1852     if (!WTF::getPtr(cppValue)) {
1853         throwUninformativeAndGenericTypeError(info.GetIsolate());
1854         return;
1855     }
1856     imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference());
1857 }
1858
1859 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1860 {
1861     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1862     TestObjV8Internal::mutablePointAttributeSetter(jsValue, info);
1863     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1864 }
1865
1866 static void immutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1867 {
1868     TestObj* imp = V8TestObject::toNative(info.Holder());
1869     v8SetReturnValueFast(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->immutablePoint())), imp);
1870 }
1871
1872 static void immutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1873 {
1874     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1875     TestObjV8Internal::immutablePointAttributeGetter(info);
1876     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1877 }
1878
1879 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1880 {
1881     TestObj* imp = V8TestObject::toNative(info.Holder());
1882     V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1883     if (!WTF::getPtr(cppValue)) {
1884         throwUninformativeAndGenericTypeError(info.GetIsolate());
1885         return;
1886     }
1887     imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference());
1888 }
1889
1890 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1891 {
1892     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1893     TestObjV8Internal::immutablePointAttributeSetter(jsValue, info);
1894     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1895 }
1896
1897 static void strawberryAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1898 {
1899     TestObj* imp = V8TestObject::toNative(info.Holder());
1900     v8SetReturnValueInt(info, imp->blueberry());
1901 }
1902
1903 static void strawberryAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1904 {
1905     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1906     TestObjV8Internal::strawberryAttributeGetter(info);
1907     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1908 }
1909
1910 static void strawberryAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1911 {
1912     TestObj* imp = V8TestObject::toNative(info.Holder());
1913     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
1914     imp->setBlueberry(cppValue);
1915 }
1916
1917 static void strawberryAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1918 {
1919     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1920     TestObjV8Internal::strawberryAttributeSetter(jsValue, info);
1921     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1922 }
1923
1924 static void strictFloatAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1925 {
1926     TestObj* imp = V8TestObject::toNative(info.Holder());
1927     v8SetReturnValue(info, imp->strictFloat());
1928 }
1929
1930 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1931 {
1932     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1933     TestObjV8Internal::strictFloatAttributeGetter(info);
1934     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1935 }
1936
1937 static void strictFloatAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1938 {
1939     TestObj* imp = V8TestObject::toNative(info.Holder());
1940     V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue()));
1941     imp->setStrictFloat(cppValue);
1942 }
1943
1944 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1945 {
1946     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1947     TestObjV8Internal::strictFloatAttributeSetter(jsValue, info);
1948     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1949 }
1950
1951 static void replaceableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1952 {
1953     TestObj* imp = V8TestObject::toNative(info.Holder());
1954     v8SetReturnValueInt(info, imp->replaceableAttribute());
1955 }
1956
1957 static void replaceableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1958 {
1959     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1960     TestObjV8Internal::replaceableAttributeAttributeGetter(info);
1961     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1962 }
1963
1964 static void nullableDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1965 {
1966     TestObj* imp = V8TestObject::toNative(info.Holder());
1967     bool isNull = false;
1968     double jsValue = imp->nullableDoubleAttribute(isNull);
1969     if (isNull) {
1970         v8SetReturnValueNull(info);
1971         return;
1972     }
1973     v8SetReturnValue(info, jsValue);
1974 }
1975
1976 static void nullableDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1977 {
1978     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1979     TestObjV8Internal::nullableDoubleAttributeAttributeGetter(info);
1980     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1981 }
1982
1983 static void nullableLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
1984 {
1985     TestObj* imp = V8TestObject::toNative(info.Holder());
1986     bool isNull = false;
1987     int jsValue = imp->nullableLongAttribute(isNull);
1988     if (isNull) {
1989         v8SetReturnValueNull(info);
1990         return;
1991     }
1992     v8SetReturnValueInt(info, jsValue);
1993 }
1994
1995 static void nullableLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1996 {
1997     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1998     TestObjV8Internal::nullableLongAttributeAttributeGetter(info);
1999     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2000 }
2001
2002 static void nullableBooleanAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2003 {
2004     TestObj* imp = V8TestObject::toNative(info.Holder());
2005     bool isNull = false;
2006     bool jsValue = imp->nullableBooleanAttribute(isNull);
2007     if (isNull) {
2008         v8SetReturnValueNull(info);
2009         return;
2010     }
2011     v8SetReturnValueBool(info, jsValue);
2012 }
2013
2014 static void nullableBooleanAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2015 {
2016     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2017     TestObjV8Internal::nullableBooleanAttributeAttributeGetter(info);
2018     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2019 }
2020
2021 static void nullableStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2022 {
2023     TestObj* imp = V8TestObject::toNative(info.Holder());
2024     bool isNull = false;
2025     String jsValue = imp->nullableStringAttribute(isNull);
2026     if (isNull) {
2027         v8SetReturnValueNull(info);
2028         return;
2029     }
2030     v8SetReturnValueString(info, jsValue, info.GetIsolate());
2031 }
2032
2033 static void nullableStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2034 {
2035     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2036     TestObjV8Internal::nullableStringAttributeAttributeGetter(info);
2037     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2038 }
2039
2040 static void nullableLongSettableAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2041 {
2042     TestObj* imp = V8TestObject::toNative(info.Holder());
2043     bool isNull = false;
2044     int jsValue = imp->nullableLongSettableAttribute(isNull);
2045     if (isNull) {
2046         v8SetReturnValueNull(info);
2047         return;
2048     }
2049     v8SetReturnValueInt(info, jsValue);
2050 }
2051
2052 static void nullableLongSettableAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2053 {
2054     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2055     TestObjV8Internal::nullableLongSettableAttributeAttributeGetter(info);
2056     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2057 }
2058
2059 static void nullableLongSettableAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2060 {
2061     TestObj* imp = V8TestObject::toNative(info.Holder());
2062     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2063     imp->setNullableLongSettableAttribute(cppValue);
2064 }
2065
2066 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2067 {
2068     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2069     TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, info);
2070     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2071 }
2072
2073 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2074 {
2075     TestObj* imp = V8TestObject::toNative(info.Holder());
2076     ExceptionState es(info.GetIsolate());
2077     bool isNull = false;
2078     int jsValue = imp->nullableStringValue(isNull, es);
2079     if (isNull) {
2080         v8SetReturnValueNull(info);
2081         return;
2082     }
2083     if (UNLIKELY(es.throwIfNeeded()))
2084         return;
2085     v8SetReturnValueInt(info, jsValue);
2086 }
2087
2088 static void nullableStringValueAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2089 {
2090     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2091     TestObjV8Internal::nullableStringValueAttributeGetter(info);
2092     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2093 }
2094
2095 static void nullableStringValueAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2096 {
2097     TestObj* imp = V8TestObject::toNative(info.Holder());
2098     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2099     imp->setNullableStringValue(cppValue);
2100 }
2101
2102 static void nullableStringValueAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2103 {
2104     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2105     TestObjV8Internal::nullableStringValueAttributeSetter(jsValue, info);
2106     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2107 }
2108
2109 static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2110 {
2111     TestObj* imp = V8TestObject::toNative(info.Holder());
2112     RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute();
2113     if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.GetReturnValue(), result.get()))
2114         return;
2115     v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
2116     if (!wrapper.IsEmpty()) {
2117         V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWorldReadOnlyAttribute", wrapper);
2118         v8SetReturnValue(info, wrapper);
2119     }
2120 }
2121
2122 static void perWorldReadOnlyAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2123 {
2124     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2125     TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetter(info);
2126     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2127 }
2128
2129 static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2130 {
2131     TestObj* imp = V8TestObject::toNative(info.Holder());
2132     RefPtr<TestObj> result = imp->perWorldReadOnlyAttribute();
2133     if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObject>(info.GetReturnValue(), result.get()))
2134         return;
2135     v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIsolate());
2136     if (!wrapper.IsEmpty()) {
2137         V8HiddenPropertyName::setNamedHiddenReference(info.Holder(), "perWorldReadOnlyAttribute", wrapper);
2138         v8SetReturnValue(info, wrapper);
2139     }
2140 }
2141
2142 static void perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2143 {
2144     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2145     TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterForMainWorld(info);
2146     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2147 }
2148
2149 static void perWorldAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2150 {
2151     TestObj* imp = V8TestObject::toNative(info.Holder());
2152     v8SetReturnValueFast(info, imp->perWorldAttribute(), imp);
2153 }
2154
2155 static void perWorldAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2156 {
2157     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2158     TestObjV8Internal::perWorldAttributeAttributeGetter(info);
2159     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2160 }
2161
2162 static void perWorldAttributeAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2163 {
2164     TestObj* imp = V8TestObject::toNative(info.Holder());
2165     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
2166     imp->setPerWorldAttribute(WTF::getPtr(cppValue));
2167 }
2168
2169 static void perWorldAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2170 {
2171     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2172     TestObjV8Internal::perWorldAttributeAttributeSetter(jsValue, info);
2173     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2174 }
2175
2176 static void perWorldAttributeAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2177 {
2178     TestObj* imp = V8TestObject::toNative(info.Holder());
2179     v8SetReturnValueForMainWorld(info, imp->perWorldAttribute());
2180 }
2181
2182 static void perWorldAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2183 {
2184     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2185     TestObjV8Internal::perWorldAttributeAttributeGetterForMainWorld(info);
2186     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2187 }
2188
2189 static void perWorldAttributeAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2190 {
2191     TestObj* imp = V8TestObject::toNative(info.Holder());
2192     V8TRYCATCH_VOID(TestObj*, cppValue, V8TestObject::HasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
2193     imp->setPerWorldAttribute(WTF::getPtr(cppValue));
2194 }
2195
2196 static void perWorldAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2197 {
2198     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2199     TestObjV8Internal::perWorldAttributeAttributeSetterForMainWorld(jsValue, info);
2200     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2201 }
2202
2203 static void activityLoggedAttr1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2204 {
2205     TestObj* imp = V8TestObject::toNative(info.Holder());
2206     v8SetReturnValueInt(info, imp->activityLoggedAttr1());
2207 }
2208
2209 static void activityLoggedAttr1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2210 {
2211     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2212     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2213     if (contextData && contextData->activityLogger())
2214         contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 0, 0, "Getter");
2215     TestObjV8Internal::activityLoggedAttr1AttributeGetter(info);
2216     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2217 }
2218
2219 static void activityLoggedAttr1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2220 {
2221     TestObj* imp = V8TestObject::toNative(info.Holder());
2222     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2223     imp->setActivityLoggedAttr1(cppValue);
2224 }
2225
2226 static void activityLoggedAttr1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2227 {
2228     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2229     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2230     if (contextData && contextData->activityLogger()) {
2231         v8::Handle<v8::Value> loggerArg[] = { jsValue };
2232         contextData->activityLogger()->log("TestObject.activityLoggedAttr1", 1, &loggerArg[0], "Setter");
2233     }
2234     TestObjV8Internal::activityLoggedAttr1AttributeSetter(jsValue, info);
2235     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2236 }
2237
2238 static void activityLoggedAttr2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2239 {
2240     TestObj* imp = V8TestObject::toNative(info.Holder());
2241     v8SetReturnValueInt(info, imp->activityLoggedAttr2());
2242 }
2243
2244 static void activityLoggedAttr2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2245 {
2246     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2247     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2248     if (contextData && contextData->activityLogger())
2249         contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0, 0, "Getter");
2250     TestObjV8Internal::activityLoggedAttr2AttributeGetter(info);
2251     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2252 }
2253
2254 static void activityLoggedAttr2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2255 {
2256     TestObj* imp = V8TestObject::toNative(info.Holder());
2257     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2258     imp->setActivityLoggedAttr2(cppValue);
2259 }
2260
2261 static void activityLoggedAttr2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2262 {
2263     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2264     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2265     if (contextData && contextData->activityLogger()) {
2266         v8::Handle<v8::Value> loggerArg[] = { jsValue };
2267         contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter");
2268     }
2269     TestObjV8Internal::activityLoggedAttr2AttributeSetter(jsValue, info);
2270     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2271 }
2272
2273 static void activityLoggedAttr2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2274 {
2275     TestObj* imp = V8TestObject::toNative(info.Holder());
2276     v8SetReturnValueInt(info, imp->activityLoggedAttr2());
2277 }
2278
2279 static void activityLoggedAttr2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2280 {
2281     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2282     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2283     if (contextData && contextData->activityLogger())
2284         contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 0, 0, "Getter");
2285     TestObjV8Internal::activityLoggedAttr2AttributeGetterForMainWorld(info);
2286     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2287 }
2288
2289 static void activityLoggedAttr2AttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2290 {
2291     TestObj* imp = V8TestObject::toNative(info.Holder());
2292     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2293     imp->setActivityLoggedAttr2(cppValue);
2294 }
2295
2296 static void activityLoggedAttr2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2297 {
2298     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2299     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2300     if (contextData && contextData->activityLogger()) {
2301         v8::Handle<v8::Value> loggerArg[] = { jsValue };
2302         contextData->activityLogger()->log("TestObject.activityLoggedAttr2", 1, &loggerArg[0], "Setter");
2303     }
2304     TestObjV8Internal::activityLoggedAttr2AttributeSetterForMainWorld(jsValue, info);
2305     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2306 }
2307
2308 static void activityLoggedInIsolatedWorldsAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2309 {
2310     TestObj* imp = V8TestObject::toNative(info.Holder());
2311     v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttr());
2312 }
2313
2314 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2315 {
2316     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2317     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2318     if (contextData && contextData->activityLogger())
2319         contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttr", 0, 0, "Getter");
2320     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetter(info);
2321     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2322 }
2323
2324 static void activityLoggedInIsolatedWorldsAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2325 {
2326     TestObj* imp = V8TestObject::toNative(info.Holder());
2327     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2328     imp->setActivityLoggedInIsolatedWorldsAttr(cppValue);
2329 }
2330
2331 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2332 {
2333     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2334     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2335     if (contextData && contextData->activityLogger()) {
2336         v8::Handle<v8::Value> loggerArg[] = { jsValue };
2337         contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttr", 1, &loggerArg[0], "Setter");
2338     }
2339     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetter(jsValue, info);
2340     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2341 }
2342
2343 static void activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2344 {
2345     TestObj* imp = V8TestObject::toNative(info.Holder());
2346     v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttr());
2347 }
2348
2349 static void activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2350 {
2351     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2352     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterForMainWorld(info);
2353     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2354 }
2355
2356 static void activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2357 {
2358     TestObj* imp = V8TestObject::toNative(info.Holder());
2359     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2360     imp->setActivityLoggedInIsolatedWorldsAttr(cppValue);
2361 }
2362
2363 static void activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2364 {
2365     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2366     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterForMainWorld(jsValue, info);
2367     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2368 }
2369
2370 static void activityLoggedAttrSetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2371 {
2372     TestObj* imp = V8TestObject::toNative(info.Holder());
2373     v8SetReturnValueInt(info, imp->activityLoggedAttrSetter1());
2374 }
2375
2376 static void activityLoggedAttrSetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2377 {
2378     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2379     TestObjV8Internal::activityLoggedAttrSetter1AttributeGetter(info);
2380     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2381 }
2382
2383 static void activityLoggedAttrSetter1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2384 {
2385     TestObj* imp = V8TestObject::toNative(info.Holder());
2386     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2387     imp->setActivityLoggedAttrSetter1(cppValue);
2388 }
2389
2390 static void activityLoggedAttrSetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2391 {
2392     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2393     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2394     if (contextData && contextData->activityLogger()) {
2395         v8::Handle<v8::Value> loggerArg[] = { jsValue };
2396         contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter1", 1, &loggerArg[0], "Setter");
2397     }
2398     TestObjV8Internal::activityLoggedAttrSetter1AttributeSetter(jsValue, info);
2399     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2400 }
2401
2402 static void activityLoggedAttrSetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2403 {
2404     TestObj* imp = V8TestObject::toNative(info.Holder());
2405     v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2());
2406 }
2407
2408 static void activityLoggedAttrSetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2409 {
2410     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2411     TestObjV8Internal::activityLoggedAttrSetter2AttributeGetter(info);
2412     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2413 }
2414
2415 static void activityLoggedAttrSetter2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2416 {
2417     TestObj* imp = V8TestObject::toNative(info.Holder());
2418     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2419     imp->setActivityLoggedAttrSetter2(cppValue);
2420 }
2421
2422 static void activityLoggedAttrSetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2423 {
2424     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2425     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2426     if (contextData && contextData->activityLogger()) {
2427         v8::Handle<v8::Value> loggerArg[] = { jsValue };
2428         contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter");
2429     }
2430     TestObjV8Internal::activityLoggedAttrSetter2AttributeSetter(jsValue, info);
2431     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2432 }
2433
2434 static void activityLoggedAttrSetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2435 {
2436     TestObj* imp = V8TestObject::toNative(info.Holder());
2437     v8SetReturnValueInt(info, imp->activityLoggedAttrSetter2());
2438 }
2439
2440 static void activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2441 {
2442     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2443     TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterForMainWorld(info);
2444     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2445 }
2446
2447 static void activityLoggedAttrSetter2AttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2448 {
2449     TestObj* imp = V8TestObject::toNative(info.Holder());
2450     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2451     imp->setActivityLoggedAttrSetter2(cppValue);
2452 }
2453
2454 static void activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2455 {
2456     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2457     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2458     if (contextData && contextData->activityLogger()) {
2459         v8::Handle<v8::Value> loggerArg[] = { jsValue };
2460         contextData->activityLogger()->log("TestObject.activityLoggedAttrSetter2", 1, &loggerArg[0], "Setter");
2461     }
2462     TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterForMainWorld(jsValue, info);
2463     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2464 }
2465
2466 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2467 {
2468     TestObj* imp = V8TestObject::toNative(info.Holder());
2469     v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter());
2470 }
2471
2472 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2473 {
2474     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2475     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetter(info);
2476     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2477 }
2478
2479 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2480 {
2481     TestObj* imp = V8TestObject::toNative(info.Holder());
2482     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2483     imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue);
2484 }
2485
2486 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2487 {
2488     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2489     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2490     if (contextData && contextData->activityLogger()) {
2491         v8::Handle<v8::Value> loggerArg[] = { jsValue };
2492         contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttrSetter", 1, &loggerArg[0], "Setter");
2493     }
2494     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetter(jsValue, info);
2495     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2496 }
2497
2498 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2499 {
2500     TestObj* imp = V8TestObject::toNative(info.Holder());
2501     v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrSetter());
2502 }
2503
2504 static void activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2505 {
2506     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2507     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterForMainWorld(info);
2508     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2509 }
2510
2511 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2512 {
2513     TestObj* imp = V8TestObject::toNative(info.Holder());
2514     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2515     imp->setActivityLoggedInIsolatedWorldsAttrSetter(cppValue);
2516 }
2517
2518 static void activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2519 {
2520     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2521     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterForMainWorld(jsValue, info);
2522     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2523 }
2524
2525 static void activityLoggedAttrGetter1AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2526 {
2527     TestObj* imp = V8TestObject::toNative(info.Holder());
2528     v8SetReturnValueInt(info, imp->activityLoggedAttrGetter1());
2529 }
2530
2531 static void activityLoggedAttrGetter1AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2532 {
2533     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2534     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2535     if (contextData && contextData->activityLogger())
2536         contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter1", 0, 0, "Getter");
2537     TestObjV8Internal::activityLoggedAttrGetter1AttributeGetter(info);
2538     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2539 }
2540
2541 static void activityLoggedAttrGetter1AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2542 {
2543     TestObj* imp = V8TestObject::toNative(info.Holder());
2544     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2545     imp->setActivityLoggedAttrGetter1(cppValue);
2546 }
2547
2548 static void activityLoggedAttrGetter1AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2549 {
2550     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2551     TestObjV8Internal::activityLoggedAttrGetter1AttributeSetter(jsValue, info);
2552     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2553 }
2554
2555 static void activityLoggedAttrGetter2AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2556 {
2557     TestObj* imp = V8TestObject::toNative(info.Holder());
2558     v8SetReturnValueInt(info, imp->activityLoggedAttrGetter2());
2559 }
2560
2561 static void activityLoggedAttrGetter2AttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2562 {
2563     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2564     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2565     if (contextData && contextData->activityLogger())
2566         contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2", 0, 0, "Getter");
2567     TestObjV8Internal::activityLoggedAttrGetter2AttributeGetter(info);
2568     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2569 }
2570
2571 static void activityLoggedAttrGetter2AttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2572 {
2573     TestObj* imp = V8TestObject::toNative(info.Holder());
2574     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2575     imp->setActivityLoggedAttrGetter2(cppValue);
2576 }
2577
2578 static void activityLoggedAttrGetter2AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2579 {
2580     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2581     TestObjV8Internal::activityLoggedAttrGetter2AttributeSetter(jsValue, info);
2582     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2583 }
2584
2585 static void activityLoggedAttrGetter2AttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2586 {
2587     TestObj* imp = V8TestObject::toNative(info.Holder());
2588     v8SetReturnValueInt(info, imp->activityLoggedAttrGetter2());
2589 }
2590
2591 static void activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2592 {
2593     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2594     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2595     if (contextData && contextData->activityLogger())
2596         contextData->activityLogger()->log("TestObject.activityLoggedAttrGetter2", 0, 0, "Getter");
2597     TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterForMainWorld(info);
2598     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2599 }
2600
2601 static void activityLoggedAttrGetter2AttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2602 {
2603     TestObj* imp = V8TestObject::toNative(info.Holder());
2604     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2605     imp->setActivityLoggedAttrGetter2(cppValue);
2606 }
2607
2608 static void activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2609 {
2610     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2611     TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterForMainWorld(jsValue, info);
2612     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2613 }
2614
2615 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2616 {
2617     TestObj* imp = V8TestObject::toNative(info.Holder());
2618     v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrGetter());
2619 }
2620
2621 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2622 {
2623     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2624     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
2625     if (contextData && contextData->activityLogger())
2626         contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldsAttrGetter", 0, 0, "Getter");
2627     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetter(info);
2628     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2629 }
2630
2631 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2632 {
2633     TestObj* imp = V8TestObject::toNative(info.Holder());
2634     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2635     imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue);
2636 }
2637
2638 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2639 {
2640     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2641     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetter(jsValue, info);
2642     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2643 }
2644
2645 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(const v8::PropertyCallbackInfo<v8::Value>& info)
2646 {
2647     TestObj* imp = V8TestObject::toNative(info.Holder());
2648     v8SetReturnValueInt(info, imp->activityLoggedInIsolatedWorldsAttrGetter());
2649 }
2650
2651 static void activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2652 {
2653     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2654     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterForMainWorld(info);
2655     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2656 }
2657
2658 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2659 {
2660     TestObj* imp = V8TestObject::toNative(info.Holder());
2661     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2662     imp->setActivityLoggedInIsolatedWorldsAttrGetter(cppValue);
2663 }
2664
2665 static void activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2666 {
2667     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2668     TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterForMainWorld(jsValue, info);
2669     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2670 }
2671
2672 static void deprecatedStaticReadOnlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2673 {
2674     v8SetReturnValueInt(info, TestObj::deprecatedStaticReadOnlyAttr());
2675 }
2676
2677 static void deprecatedStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2678 {
2679     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2680     UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticReadonlyAttribute);
2681     TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetter(info);
2682     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2683 }
2684
2685 static void deprecatedStaticAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2686 {
2687     v8SetReturnValueInt(info, TestObj::deprecatedStaticAttr());
2688 }
2689
2690 static void deprecatedStaticAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2691 {
2692     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2693     UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAttribute);
2694     TestObjV8Internal::deprecatedStaticAttrAttributeGetter(info);
2695     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2696 }
2697
2698 static void deprecatedStaticAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2699 {
2700     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2701     TestObj::setDeprecatedStaticAttr(cppValue);
2702 }
2703
2704 static void deprecatedStaticAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2705 {
2706     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2707     UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticAttribute);
2708     TestObjV8Internal::deprecatedStaticAttrAttributeSetter(jsValue, info);
2709     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2710 }
2711
2712 static void deprecatedReadonlyAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2713 {
2714     TestObj* imp = V8TestObject::toNative(info.Holder());
2715     v8SetReturnValueInt(info, imp->deprecatedReadonlyAttr());
2716 }
2717
2718 static void deprecatedReadonlyAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2719 {
2720     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2721     UseCounter::countDeprecation(activeExecutionContext(), UseCounter::ReadonlyAttribute);
2722     TestObjV8Internal::deprecatedReadonlyAttrAttributeGetter(info);
2723     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2724 }
2725
2726 static void deprecatedAttrAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2727 {
2728     TestObj* imp = V8TestObject::toNative(info.Holder());
2729     v8SetReturnValueInt(info, imp->deprecatedAttr());
2730 }
2731
2732 static void deprecatedAttrAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2733 {
2734     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2735     UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute);
2736     TestObjV8Internal::deprecatedAttrAttributeGetter(info);
2737     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2738 }
2739
2740 static void deprecatedAttrAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2741 {
2742     TestObj* imp = V8TestObject::toNative(info.Holder());
2743     V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
2744     imp->setDeprecatedAttr(cppValue);
2745 }
2746
2747 static void deprecatedAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2748 {
2749     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2750     UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Attribute);
2751     TestObjV8Internal::deprecatedAttrAttributeSetter(jsValue, info);
2752     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2753 }
2754
2755 static void locationAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2756 {
2757     TestObj* imp = V8TestObject::toNative(info.Holder());
2758     v8SetReturnValueFast(info, imp->location(), imp);
2759 }
2760
2761 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2762 {
2763     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2764     TestObjV8Internal::locationAttributeGetter(info);
2765     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2766 }
2767
2768 static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2769 {
2770     TestObj* proxyImp = V8TestObject::toNative(info.Holder());
2771     TestNode* imp = proxyImp->location();
2772     if (!imp)
2773         return;
2774     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
2775     imp->setHref(cppValue);
2776 }
2777
2778 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2779 {
2780     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2781     TestObjV8Internal::locationAttributeSetter(jsValue, info);
2782     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2783 }
2784
2785 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
2786 {
2787     TestObj* imp = V8TestObject::toNative(info.Holder());
2788     v8SetReturnValueFast(info, imp->locationWithException(), imp);
2789 }
2790
2791 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2792 {
2793     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2794     TestObjV8Internal::locationWithExceptionAttributeGetter(info);
2795     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2796 }
2797
2798 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2799 {
2800     TestObj* proxyImp = V8TestObject::toNative(info.Holder());
2801     TestNode* imp = proxyImp->locationWithException();
2802     if (!imp)
2803         return;
2804     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
2805     ExceptionState es(info.GetIsolate());
2806     imp->setHrefThrows(cppValue, es);
2807     es.throwIfNeeded();
2808 }
2809
2810 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2811 {
2812     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2813     TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info);
2814     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2815 }
2816
2817 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
2818 {
2819     v8::Handle<v8::Value> data = info.Data();
2820     ASSERT(data->IsExternal());
2821     V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
2822     if (!perContextData)
2823         return;
2824     v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
2825 }
2826
2827 static void TestObjReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2828 {
2829     info.This()->ForceSet(name, jsValue);
2830 }
2831
2832 static void TestObjReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2833 {
2834     TestObjV8Internal::TestObjReplaceableAttributeSetter(name, jsValue, info);
2835 }
2836
2837 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2838 {
2839     TestObj* imp = V8TestObject::toNative(info.Holder());
2840     imp->voidMethod();
2841 }
2842
2843 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2844 {
2845     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2846     TestObjV8Internal::voidMethodMethod(info);
2847     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2848 }
2849
2850 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2851 {
2852     if (UNLIKELY(info.Length() < 3)) {
2853         throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
2854         return;
2855     }
2856     TestObj* imp = V8TestObject::toNative(info.Holder());
2857     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2858     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
2859     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
2860     imp->voidMethodWithArgs(longArg, strArg, objArg);
2861 }
2862
2863 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2864 {
2865     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2866     TestObjV8Internal::voidMethodWithArgsMethod(info);
2867     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2868 }
2869
2870 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2871 {
2872     TestObj* imp = V8TestObject::toNative(info.Holder());
2873     v8SetReturnValueInt(info, imp->longMethod());
2874 }
2875
2876 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2877 {
2878     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2879     TestObjV8Internal::longMethodMethod(info);
2880     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2881 }
2882
2883 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2884 {
2885     if (UNLIKELY(info.Length() < 3)) {
2886         throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
2887         return;
2888     }
2889     TestObj* imp = V8TestObject::toNative(info.Holder());
2890     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2891     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
2892     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
2893     v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg));
2894 }
2895
2896 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2897 {
2898     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2899     TestObjV8Internal::longMethodWithArgsMethod(info);
2900     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2901 }
2902
2903 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2904 {
2905     TestObj* imp = V8TestObject::toNative(info.Holder());
2906     v8SetReturnValue(info, imp->objMethod());
2907 }
2908
2909 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2910 {
2911     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2912     UseCounter::count(activeDOMWindow(), UseCounter::TestFeature);
2913     TestObjV8Internal::objMethodMethod(info);
2914     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2915 }
2916
2917 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2918 {
2919     if (UNLIKELY(info.Length() < 3)) {
2920         throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
2921         return;
2922     }
2923     TestObj* imp = V8TestObject::toNative(info.Holder());
2924     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2925     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
2926     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
2927     v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg));
2928 }
2929
2930 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2931 {
2932     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2933     TestObjV8Internal::objMethodWithArgsMethod(info);
2934     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2935 }
2936
2937 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2938 {
2939     if (UNLIKELY(info.Length() < 1)) {
2940         throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
2941         return;
2942     }
2943     TestObj* imp = V8TestObject::toNative(info.Holder());
2944     V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNativeArray<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate())));
2945     imp->methodWithSequenceArg(sequenceArg);
2946 }
2947
2948 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2949 {
2950     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2951     TestObjV8Internal::methodWithSequenceArgMethod(info);
2952     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2953 }
2954
2955 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2956 {
2957     if (UNLIKELY(info.Length() < 1)) {
2958         throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
2959         return;
2960     }
2961     TestObj* imp = V8TestObject::toNative(info.Holder());
2962     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
2963     v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.GetIsolate()));
2964 }
2965
2966 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2967 {
2968     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2969     TestObjV8Internal::methodReturningSequenceMethod(info);
2970     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2971 }
2972
2973 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2974 {
2975     if (UNLIKELY(info.Length() < 1)) {
2976         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
2977         return;
2978     }
2979     TestObj* imp = V8TestObject::toNative(info.Holder());
2980     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]);
2981     String string = enumArg;
2982     if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || string == "EnumValue3")) {
2983         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.GetIsolate());
2984         return;
2985     }
2986     imp->methodWithEnumArg(enumArg);
2987 }
2988
2989 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
2990 {
2991     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
2992     TestObjV8Internal::methodWithEnumArgMethod(info);
2993     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2994 }
2995
2996 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
2997 {
2998     if (UNLIKELY(info.Length() < 2)) {
2999         throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAllArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
3000         return;
3001     }
3002     TestObj* imp = V8TestObject::toNative(info.Holder());
3003     ExceptionState es(info.GetIsolate());
3004     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3005     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[1], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[1])) : 0);
3006     RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, es);
3007     if (es.throwIfNeeded())
3008         return;
3009     v8SetReturnValue(info, result.release());
3010 }
3011
3012 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3013 {
3014     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3015     TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info);
3016     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3017 }
3018
3019 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3020 {
3021     if (UNLIKELY(info.Length() < 1)) {
3022         throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3023         return;
3024     }
3025     TestObj* imp = V8TestObject::toNative(info.Holder());
3026     bool serializedArgDidThrow = false;
3027     RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(info[0], 0, 0, serializedArgDidThrow, info.GetIsolate());
3028     if (serializedArgDidThrow)
3029         return;
3030     imp->serializedValue(serializedArg);
3031 }
3032
3033 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3034 {
3035     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3036     TestObjV8Internal::serializedValueMethod(info);
3037     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3038 }
3039
3040 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3041 {
3042     if (UNLIKELY(info.Length() < 1)) {
3043         throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3044         return;
3045     }
3046     TestObj* imp = V8TestObject::toNative(info.Holder());
3047     V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate()));
3048     if (!oo.isUndefinedOrNull() && !oo.isObject()) {
3049         throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 1 ('oo') is not an object."), info.GetIsolate());
3050         return;
3051     }
3052     V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate()));
3053     if (!ooo.isUndefinedOrNull() && !ooo.isObject()) {
3054         throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "TestObject", "parameter 2 ('ooo') is not an object."), info.GetIsolate());
3055         return;
3056     }
3057     imp->optionsObject(oo, ooo);
3058 }
3059
3060 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3061 {
3062     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3063     TestObjV8Internal::optionsObjectMethod(info);
3064     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3065 }
3066
3067 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3068 {
3069     TestObj* imp = V8TestObject::toNative(info.Holder());
3070     ExceptionState es(info.GetIsolate());
3071     imp->methodWithException(es);
3072     if (es.throwIfNeeded())
3073         return;
3074 }
3075
3076 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3077 {
3078     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3079     TestObjV8Internal::methodWithExceptionMethod(info);
3080     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3081 }
3082
3083 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3084 {
3085     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3086     UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature);
3087     V8TestObject::customMethodMethodCustom(info);
3088     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3089 }
3090
3091 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3092 {
3093     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3094     V8TestObject::customMethodWithArgsMethodCustom(info);
3095     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3096 }
3097
3098 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3099 {
3100     EventTarget* impl = V8TestObject::toNative(info.Holder());
3101     if (DOMWindow* window = impl->toDOMWindow()) {
3102         ExceptionState es(info.GetIsolate());
3103         if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) {
3104             es.throwIfNeeded();
3105             return;
3106         }
3107
3108         if (!window->document())
3109             return;
3110     }
3111
3112     RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[1], false, ListenerFindOrCreate);
3113     if (listener) {
3114         V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, stringResource, info[0]);
3115         impl->addEventListener(stringResource, listener, info[2]->BooleanValue());
3116         if (!impl->toNode())
3117             createHiddenDependency(info.Holder(), info[1], V8TestObject::eventListenerCacheIndex, info.GetIsolate());
3118     }
3119 }
3120
3121 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3122 {
3123     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3124     TestObjV8Internal::addEventListenerMethod(info);
3125     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3126 }
3127
3128 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3129 {
3130     EventTarget* impl = V8TestObject::toNative(info.Holder());
3131     if (DOMWindow* window = impl->toDOMWindow()) {
3132         ExceptionState es(info.GetIsolate());
3133         if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) {
3134             es.throwIfNeeded();
3135             return;
3136         }
3137
3138         if (!window->document())
3139             return;
3140     }
3141
3142     RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[1], false, ListenerFindOnly);
3143     if (listener) {
3144         V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, stringResource, info[0]);
3145         impl->removeEventListener(stringResource, listener.get(), info[2]->BooleanValue());
3146         if (!impl->toNode())
3147             removeHiddenDependency(info.Holder(), info[1], V8TestObject::eventListenerCacheIndex, info.GetIsolate());
3148     }
3149 }
3150
3151 static void removeEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3152 {
3153     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3154     TestObjV8Internal::removeEventListenerMethod(info);
3155     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3156 }
3157
3158 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3159 {
3160     TestObj* imp = V8TestObject::toNative(info.Holder());
3161     ScriptState* currentState = ScriptState::current();
3162     if (!currentState)
3163         return;
3164     ScriptState& state = *currentState;
3165     imp->withScriptStateVoid(&state);
3166     if (state.hadException()) {
3167         v8::Local<v8::Value> exception = state.exception();
3168         state.clearException();
3169         throwError(exception, info.GetIsolate());
3170         return;
3171     }
3172 }
3173
3174 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3175 {
3176     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3177     TestObjV8Internal::withScriptStateVoidMethod(info);
3178     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3179 }
3180
3181 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3182 {
3183     TestObj* imp = V8TestObject::toNative(info.Holder());
3184     ScriptState* currentState = ScriptState::current();
3185     if (!currentState)
3186         return;
3187     ScriptState& state = *currentState;
3188     RefPtr<TestObj> result = imp->withScriptStateObj(&state);
3189     if (state.hadException()) {
3190         v8::Local<v8::Value> exception = state.exception();
3191         state.clearException();
3192         throwError(exception, info.GetIsolate());
3193         return;
3194     }
3195     v8SetReturnValue(info, result.release());
3196 }
3197
3198 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3199 {
3200     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3201     TestObjV8Internal::withScriptStateObjMethod(info);
3202     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3203 }
3204
3205 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3206 {
3207     TestObj* imp = V8TestObject::toNative(info.Holder());
3208     ExceptionState es(info.GetIsolate());
3209     ScriptState* currentState = ScriptState::current();
3210     if (!currentState)
3211         return;
3212     ScriptState& state = *currentState;
3213     imp->withScriptStateVoidException(&state, es);
3214     if (es.throwIfNeeded())
3215         return;
3216     if (state.hadException()) {
3217         v8::Local<v8::Value> exception = state.exception();
3218         state.clearException();
3219         throwError(exception, info.GetIsolate());
3220         return;
3221     }
3222 }
3223
3224 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3225 {
3226     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3227     TestObjV8Internal::withScriptStateVoidExceptionMethod(info);
3228     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3229 }
3230
3231 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3232 {
3233     TestObj* imp = V8TestObject::toNative(info.Holder());
3234     ExceptionState es(info.GetIsolate());
3235     ScriptState* currentState = ScriptState::current();
3236     if (!currentState)
3237         return;
3238     ScriptState& state = *currentState;
3239     RefPtr<TestObj> result = imp->withScriptStateObjException(&state, es);
3240     if (es.throwIfNeeded())
3241         return;
3242     if (state.hadException()) {
3243         v8::Local<v8::Value> exception = state.exception();
3244         state.clearException();
3245         throwError(exception, info.GetIsolate());
3246         return;
3247     }
3248     v8SetReturnValue(info, result.release());
3249 }
3250
3251 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3252 {
3253     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3254     TestObjV8Internal::withScriptStateObjExceptionMethod(info);
3255     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3256 }
3257
3258 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3259 {
3260     TestObj* imp = V8TestObject::toNative(info.Holder());
3261     ExecutionContext* scriptContext = getExecutionContext();
3262     imp->withExecutionContext(scriptContext);
3263 }
3264
3265 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3266 {
3267     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3268     TestObjV8Internal::withExecutionContextMethod(info);
3269     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3270 }
3271
3272 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3273 {
3274     TestObj* imp = V8TestObject::toNative(info.Holder());
3275     ScriptState* currentState = ScriptState::current();
3276     if (!currentState)
3277         return;
3278     ScriptState& state = *currentState;
3279     ExecutionContext* scriptContext = getExecutionContext();
3280     imp->withExecutionContextAndScriptState(&state, scriptContext);
3281     if (state.hadException()) {
3282         v8::Local<v8::Value> exception = state.exception();
3283         state.clearException();
3284         throwError(exception, info.GetIsolate());
3285         return;
3286     }
3287 }
3288
3289 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3290 {
3291     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3292     TestObjV8Internal::withExecutionContextAndScriptStateMethod(info);
3293     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3294 }
3295
3296 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3297 {
3298     TestObj* imp = V8TestObject::toNative(info.Holder());
3299     ExceptionState es(info.GetIsolate());
3300     ScriptState* currentState = ScriptState::current();
3301     if (!currentState)
3302         return;
3303     ScriptState& state = *currentState;
3304     ExecutionContext* scriptContext = getExecutionContext();
3305     RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException(&state, scriptContext, es);
3306     if (es.throwIfNeeded())
3307         return;
3308     if (state.hadException()) {
3309         v8::Local<v8::Value> exception = state.exception();
3310         state.clearException();
3311         throwError(exception, info.GetIsolate());
3312         return;
3313     }
3314     v8SetReturnValue(info, result.release());
3315 }
3316
3317 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3318 {
3319     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3320     TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info);
3321     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3322 }
3323
3324 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3325 {
3326     TestObj* imp = V8TestObject::toNative(info.Holder());
3327     ScriptState* currentState = ScriptState::current();
3328     if (!currentState)
3329         return;
3330     ScriptState& state = *currentState;
3331     ExecutionContext* scriptContext = getExecutionContext();
3332     RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateWithSpaces(&state, scriptContext);
3333     if (state.hadException()) {
3334         v8::Local<v8::Value> exception = state.exception();
3335         state.clearException();
3336         throwError(exception, info.GetIsolate());
3337         return;
3338     }
3339     v8SetReturnValue(info, result.release());
3340 }
3341
3342 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3343 {
3344     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3345     TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info);
3346     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3347 }
3348
3349 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3350 {
3351     TestObj* imp = V8TestObject::toNative(info.Holder());
3352     imp->withActiveWindowAndFirstWindow(activeDOMWindow(), firstDOMWindow());
3353 }
3354
3355 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3356 {
3357     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3358     TestObjV8Internal::withActiveWindowAndFirstWindowMethod(info);
3359     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3360 }
3361
3362 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3363 {
3364     TestObj* imp = V8TestObject::toNative(info.Holder());
3365     if (UNLIKELY(info.Length() <= 0)) {
3366         imp->methodWithOptionalArg();
3367         return;
3368     }
3369     V8TRYCATCH_VOID(int, opt, toInt32(info[0]));
3370     imp->methodWithOptionalArg(opt);
3371 }
3372
3373 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3374 {
3375     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3376     TestObjV8Internal::methodWithOptionalArgMethod(info);
3377     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3378 }
3379
3380 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3381 {
3382     if (UNLIKELY(info.Length() < 1)) {
3383         throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptionalArgAndOptionalArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3384         return;
3385     }
3386     TestObj* imp = V8TestObject::toNative(info.Holder());
3387     V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0]));
3388     if (UNLIKELY(info.Length() <= 1)) {
3389         imp->methodWithNonOptionalArgAndOptionalArg(nonOpt);
3390         return;
3391     }
3392     V8TRYCATCH_VOID(int, opt, toInt32(info[1]));
3393     imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt);
3394 }
3395
3396 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3397 {
3398     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3399     TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info);
3400     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3401 }
3402
3403 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3404 {
3405     if (UNLIKELY(info.Length() < 1)) {
3406         throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptionalArgAndTwoOptionalArgs", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3407         return;
3408     }
3409     TestObj* imp = V8TestObject::toNative(info.Holder());
3410     V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0]));
3411     if (UNLIKELY(info.Length() <= 1)) {
3412         imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt);
3413         return;
3414     }
3415     V8TRYCATCH_VOID(int, opt1, toInt32(info[1]));
3416     if (UNLIKELY(info.Length() <= 2)) {
3417         imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1);
3418         return;
3419     }
3420     V8TRYCATCH_VOID(int, opt2, toInt32(info[2]));
3421     imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2);
3422 }
3423
3424 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3425 {
3426     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3427     TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info);
3428     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3429 }
3430
3431 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3432 {
3433     TestObj* imp = V8TestObject::toNative(info.Holder());
3434     if (UNLIKELY(info.Length() <= 0)) {
3435         imp->methodWithOptionalString();
3436         return;
3437     }
3438     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
3439     imp->methodWithOptionalString(str);
3440 }
3441
3442 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3443 {
3444     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3445     TestObjV8Internal::methodWithOptionalStringMethod(info);
3446     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3447 }
3448
3449 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3450 {
3451     TestObj* imp = V8TestObject::toNative(info.Holder());
3452     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
3453     imp->methodWithOptionalStringIsUndefined(str);
3454 }
3455
3456 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3457 {
3458     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3459     TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(info);
3460     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3461 }
3462
3463 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3464 {
3465     TestObj* imp = V8TestObject::toNative(info.Holder());
3466     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull(info, 0));
3467     imp->methodWithOptionalStringIsNullString(str);
3468 }
3469
3470 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3471 {
3472     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3473     TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info);
3474     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3475 }
3476
3477 static void methodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3478 {
3479     if (UNLIKELY(info.Length() < 1)) {
3480         throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3481         return;
3482     }
3483     TestObj* imp = V8TestObject::toNative(info.Holder());
3484     if (info.Length() <= 0 || !info[0]->IsFunction()) {
3485         throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3486         return;
3487     }
3488     RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecutionContext());
3489     imp->methodWithCallbackArg(callback);
3490 }
3491
3492 static void methodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3493 {
3494     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3495     TestObjV8Internal::methodWithCallbackArgMethod(info);
3496     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3497 }
3498
3499 static void methodWithNonCallbackArgAndCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3500 {
3501     if (UNLIKELY(info.Length() < 2)) {
3502         throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallbackArgAndCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
3503         return;
3504     }
3505     TestObj* imp = V8TestObject::toNative(info.Holder());
3506     V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0]));
3507     if (info.Length() <= 1 || !info[1]->IsFunction()) {
3508         throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallbackArgAndCallbackArg", "TestObject", "The callback provided as parameter 2 is not a function."), info.GetIsolate());
3509         return;
3510     }
3511     RefPtr<TestCallback> callback = V8TestCallback::create(info[1], getExecutionContext());
3512     imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback);
3513 }
3514
3515 static void methodWithNonCallbackArgAndCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3516 {
3517     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3518     TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(info);
3519     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3520 }
3521
3522 static void methodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3523 {
3524     TestObj* imp = V8TestObject::toNative(info.Holder());
3525     RefPtr<TestCallback> callback;
3526     if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) {
3527         if (!info[0]->IsFunction()) {
3528             throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3529             return;
3530         }
3531         callback = V8TestCallback::create(info[0], getExecutionContext());
3532     }
3533     imp->methodWithCallbackAndOptionalArg(callback);
3534 }
3535
3536 static void methodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3537 {
3538     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3539     TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(info);
3540     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3541 }
3542
3543 static void methodWithNullableCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3544 {
3545     if (UNLIKELY(info.Length() < 1)) {
3546         throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3547         return;
3548     }
3549     TestObj* imp = V8TestObject::toNative(info.Holder());
3550     if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) {
3551         throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3552         return;
3553     }
3554     RefPtr<TestCallback> callback = info[0]->IsNull() ? 0 : V8TestCallback::create(info[0], getExecutionContext());
3555     imp->methodWithNullableCallbackArg(callback);
3556 }
3557
3558 static void methodWithNullableCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3559 {
3560     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3561     TestObjV8Internal::methodWithNullableCallbackArgMethod(info);
3562     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3563 }
3564
3565 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3566 {
3567     RefPtr<TestCallback> callback;
3568     if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) {
3569         if (!info[0]->IsFunction()) {
3570             throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3571             return;
3572         }
3573         callback = V8TestCallback::create(info[0], getExecutionContext());
3574     }
3575     TestObj::staticMethodWithCallbackAndOptionalArg(callback);
3576 }
3577
3578 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3579 {
3580     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3581     TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info);
3582     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3583 }
3584
3585 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3586 {
3587     if (UNLIKELY(info.Length() < 1)) {
3588         throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3589         return;
3590     }
3591     if (info.Length() <= 0 || !info[0]->IsFunction()) {
3592         throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallbackArg", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3593         return;
3594     }
3595     RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecutionContext());
3596     TestObj::staticMethodWithCallbackArg(callback);
3597 }
3598
3599 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3600 {
3601     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3602     TestObjV8Internal::staticMethodWithCallbackArgMethod(info);
3603     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3604 }
3605
3606 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3607 {
3608     if (UNLIKELY(info.Length() < 1)) {
3609         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3610         return;
3611     }
3612     TestObj* imp = V8TestObject::toNative(info.Holder());
3613     V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(info[0], EnforceRange, ok), info.GetIsolate());
3614     imp->methodWithEnforceRangeInt8(value);
3615 }
3616
3617 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3618 {
3619     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3620     TestObjV8Internal::methodWithEnforceRangeInt8Method(info);
3621     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3622 }
3623
3624 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3625 {
3626     if (UNLIKELY(info.Length() < 1)) {
3627         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3628         return;
3629     }
3630     TestObj* imp = V8TestObject::toNative(info.Holder());
3631     V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(info[0], EnforceRange, ok), info.GetIsolate());
3632     imp->methodWithEnforceRangeUInt8(value);
3633 }
3634
3635 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3636 {
3637     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3638     TestObjV8Internal::methodWithEnforceRangeUInt8Method(info);
3639     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3640 }
3641
3642 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3643 {
3644     if (UNLIKELY(info.Length() < 1)) {
3645         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3646         return;
3647     }
3648     TestObj* imp = V8TestObject::toNative(info.Holder());
3649     V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt16(info[0], EnforceRange, ok), info.GetIsolate());
3650     imp->methodWithEnforceRangeInt16(value);
3651 }
3652
3653 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3654 {
3655     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3656     TestObjV8Internal::methodWithEnforceRangeInt16Method(info);
3657     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3658 }
3659
3660 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3661 {
3662     if (UNLIKELY(info.Length() < 1)) {
3663         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3664         return;
3665     }
3666     TestObj* imp = V8TestObject::toNative(info.Holder());
3667     V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt16(info[0], EnforceRange, ok), info.GetIsolate());
3668     imp->methodWithEnforceRangeUInt16(value);
3669 }
3670
3671 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3672 {
3673     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3674     TestObjV8Internal::methodWithEnforceRangeUInt16Method(info);
3675     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3676 }
3677
3678 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3679 {
3680     if (UNLIKELY(info.Length() < 1)) {
3681         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3682         return;
3683     }
3684     TestObj* imp = V8TestObject::toNative(info.Holder());
3685     V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(info[0], EnforceRange, ok), info.GetIsolate());
3686     imp->methodWithEnforceRangeInt32(value);
3687 }
3688
3689 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3690 {
3691     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3692     TestObjV8Internal::methodWithEnforceRangeInt32Method(info);
3693     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3694 }
3695
3696 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3697 {
3698     if (UNLIKELY(info.Length() < 1)) {
3699         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3700         return;
3701     }
3702     TestObj* imp = V8TestObject::toNative(info.Holder());
3703     V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(info[0], EnforceRange, ok), info.GetIsolate());
3704     imp->methodWithEnforceRangeUInt32(value);
3705 }
3706
3707 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3708 {
3709     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3710     TestObjV8Internal::methodWithEnforceRangeUInt32Method(info);
3711     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3712 }
3713
3714 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3715 {
3716     if (UNLIKELY(info.Length() < 1)) {
3717         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3718         return;
3719     }
3720     TestObj* imp = V8TestObject::toNative(info.Holder());
3721     V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(info[0], EnforceRange, ok), info.GetIsolate());
3722     imp->methodWithEnforceRangeInt64(value);
3723 }
3724
3725 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3726 {
3727     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3728     TestObjV8Internal::methodWithEnforceRangeInt64Method(info);
3729     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3730 }
3731
3732 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3733 {
3734     if (UNLIKELY(info.Length() < 1)) {
3735         throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRangeUInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3736         return;
3737     }
3738     TestObj* imp = V8TestObject::toNative(info.Holder());
3739     V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(info[0], EnforceRange, ok), info.GetIsolate());
3740     imp->methodWithEnforceRangeUInt64(value);
3741 }
3742
3743 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3744 {
3745     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3746     TestObjV8Internal::methodWithEnforceRangeUInt64Method(info);
3747     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3748 }
3749
3750 #if ENABLE(Condition1)
3751
3752 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3753 {
3754     TestObj* imp = V8TestObject::toNative(info.Holder());
3755     v8SetReturnValueString(info, imp->conditionalMethod1(), info.GetIsolate());
3756 }
3757
3758 #endif // ENABLE(Condition1)
3759
3760 #if ENABLE(Condition1)
3761
3762 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3763 {
3764     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3765     TestObjV8Internal::conditionalMethod1Method(info);
3766     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3767 }
3768
3769 #endif // ENABLE(Condition1)
3770
3771 #if ENABLE(Condition1) && ENABLE(Condition2)
3772
3773 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3774 {
3775     TestObj* imp = V8TestObject::toNative(info.Holder());
3776     imp->conditionalMethod2();
3777 }
3778
3779 #endif // ENABLE(Condition1) && ENABLE(Condition2)
3780
3781 #if ENABLE(Condition1) && ENABLE(Condition2)
3782
3783 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3784 {
3785     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3786     TestObjV8Internal::conditionalMethod2Method(info);
3787     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3788 }
3789
3790 #endif // ENABLE(Condition1) && ENABLE(Condition2)
3791
3792 #if ENABLE(Condition1) || ENABLE(Condition2)
3793
3794 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3795 {
3796     TestObj* imp = V8TestObject::toNative(info.Holder());
3797     imp->conditionalMethod3();
3798 }
3799
3800 #endif // ENABLE(Condition1) || ENABLE(Condition2)
3801
3802 #if ENABLE(Condition1) || ENABLE(Condition2)
3803
3804 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3805 {
3806     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3807     TestObjV8Internal::conditionalMethod3Method(info);
3808     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3809 }
3810
3811 #endif // ENABLE(Condition1) || ENABLE(Condition2)
3812
3813 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3814 {
3815     TestObj* imp = V8TestObject::toNative(info.Holder());
3816     v8SetReturnValue(info, imp->callbackFunctionReturnValue().v8Value());
3817 }
3818
3819 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3820 {
3821     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3822     TestObjV8Internal::callbackFunctionReturnValueMethod(info);
3823     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3824 }
3825
3826 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3827 {
3828     if (UNLIKELY(info.Length() < 1)) {
3829         throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgument", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3830         return;
3831     }
3832     TestObj* imp = V8TestObject::toNative(info.Holder());
3833     V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate()));
3834     imp->callbackFunctionArgument(function);
3835 }
3836
3837 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
3838 {
3839     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3840     TestObjV8Internal::callbackFunctionArgumentMethod(info);
3841     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3842 }
3843
3844 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3845 {
3846     if (UNLIKELY(info.Length() < 2)) {
3847         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
3848         return;
3849     }
3850     TestObj* imp = V8TestObject::toNative(info.Holder());
3851     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
3852     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]);
3853     imp->overloadedMethod(objArg, strArg);
3854 }
3855
3856 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3857 {
3858     if (UNLIKELY(info.Length() < 1)) {
3859         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3860         return;
3861     }
3862     TestObj* imp = V8TestObject::toNative(info.Holder());
3863     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
3864     if (UNLIKELY(info.Length() <= 1)) {
3865         imp->overloadedMethod(objArg);
3866         return;
3867     }
3868     V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
3869     imp->overloadedMethod(objArg, longArg);
3870 }
3871
3872 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3873 {
3874     if (UNLIKELY(info.Length() < 1)) {
3875         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3876         return;
3877     }
3878     TestObj* imp = V8TestObject::toNative(info.Holder());
3879     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3880     imp->overloadedMethod(strArg);
3881 }
3882
3883 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3884 {
3885     if (UNLIKELY(info.Length() < 1)) {
3886         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3887         return;
3888     }
3889     TestObj* imp = V8TestObject::toNative(info.Holder());
3890     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
3891     imp->overloadedMethod(longArg);
3892 }
3893
3894 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3895 {
3896     if (UNLIKELY(info.Length() < 1)) {
3897         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3898         return;
3899     }
3900     TestObj* imp = V8TestObject::toNative(info.Holder());
3901     if (info.Length() <= 0 || !info[0]->IsFunction()) {
3902         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
3903         return;
3904     }
3905     RefPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecutionContext());
3906     imp->overloadedMethod(callback);
3907 }
3908
3909 static void overloadedMethod6Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3910 {
3911     if (UNLIKELY(info.Length() < 1)) {
3912         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3913         return;
3914     }
3915     TestObj* imp = V8TestObject::toNative(info.Holder());
3916     V8TRYCATCH_VOID(DOMStringList*, listArg, V8DOMStringList::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
3917     imp->overloadedMethod(listArg);
3918 }
3919
3920 static void overloadedMethod7Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3921 {
3922     if (UNLIKELY(info.Length() < 1)) {
3923         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3924         return;
3925     }
3926     TestObj* imp = V8TestObject::toNative(info.Holder());
3927     bool arrayArgIsNull = info[0]->IsNull();
3928     V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate()));
3929     imp->overloadedMethod(arrayArgIsNull ? 0 : &arrayArg);
3930 }
3931
3932 static void overloadedMethod8Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3933 {
3934     if (UNLIKELY(info.Length() < 1)) {
3935         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3936         return;
3937     }
3938     TestObj* imp = V8TestObject::toNative(info.Holder());
3939     V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
3940     imp->overloadedMethod(objArg);
3941 }
3942
3943 static void overloadedMethod9Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3944 {
3945     if (UNLIKELY(info.Length() < 1)) {
3946         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3947         return;
3948     }
3949     TestObj* imp = V8TestObject::toNative(info.Holder());
3950     V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1, info.GetIsolate()));
3951     imp->overloadedMethod(arrayArg);
3952 }
3953
3954 static void overloadedMethod10Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3955 {
3956     if (UNLIKELY(info.Length() < 1)) {
3957         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3958         return;
3959     }
3960     TestObj* imp = V8TestObject::toNative(info.Holder());
3961     V8TRYCATCH_VOID(Vector<unsigned>, arrayArg, toNativeArray<unsigned>(info[0], 1, info.GetIsolate()));
3962     imp->overloadedMethod(arrayArg);
3963 }
3964
3965 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>& info)
3966 {
3967     if (UNLIKELY(info.Length() < 1)) {
3968         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
3969         return;
3970     }
3971     TestObj* imp = V8TestObject::toNative(info.Holder());
3972     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3973     imp->overloadedMethod(strArg);
3974 }
3975
3976 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3977 {
3978     if ((info.Length() == 2 && (info[0]->IsNull() || V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) && (info[1]->IsNull() || info[1]->IsUndefined() || info[1]->IsString() || info[1]->IsObject()))) {
3979         overloadedMethod1Method(info);
3980         return;
3981     }
3982     if ((info.Length() == 1 && (info[0]->IsNull() || V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())))) || (info.Length() == 2 && (info[0]->IsNull() || V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
3983         overloadedMethod2Method(info);
3984         return;
3985     }
3986     if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsUndefined() || info[0]->IsString() || info[0]->IsObject()))) {
3987         overloadedMethod3Method(info);
3988         return;
3989     }
3990     if (info.Length() == 1) {
3991         overloadedMethod4Method(info);
3992         return;
3993     }
3994     if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsFunction()))) {
3995         overloadedMethod5Method(info);
3996         return;
3997     }
3998     if ((info.Length() == 1 && (info[0]->IsNull() || V8DOMStringList::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
3999         overloadedMethod6Method(info);
4000         return;
4001     }
4002     if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsArray()))) {
4003         overloadedMethod7Method(info);
4004         return;
4005     }
4006     if ((info.Length() == 1 && (V8TestObject::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))))) {
4007         overloadedMethod8Method(info);
4008         return;
4009     }
4010     if ((info.Length() == 1 && (info[0]->IsArray()))) {
4011         overloadedMethod9Method(info);
4012         return;
4013     }
4014     if ((info.Length() == 1 && (info[0]->IsArray()))) {
4015         overloadedMethod10Method(info);
4016         return;
4017     }
4018     if (info.Length() == 1) {
4019         overloadedMethod11Method(info);
4020         return;
4021     }
4022     if (UNLIKELY(info.Length() < 1)) {
4023         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4024         return;
4025     }
4026     throwUninformativeAndGenericTypeError(info.GetIsolate());
4027 }
4028
4029 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4030 {
4031     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4032     TestObjV8Internal::overloadedMethodMethod(info);
4033     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4034 }
4035
4036 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4037 {
4038     TestObj::classMethod();
4039 }
4040
4041 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4042 {
4043     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4044     TestObjV8Internal::classMethodMethod(info);
4045     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4046 }
4047
4048 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4049 {
4050     if (UNLIKELY(info.Length() <= 0)) {
4051         v8SetReturnValueInt(info, TestObj::classMethodWithOptional());
4052         return;
4053     }
4054     V8TRYCATCH_VOID(int, arg, toInt32(info[0]));
4055     v8SetReturnValueInt(info, TestObj::classMethodWithOptional(arg));
4056 }
4057
4058 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4059 {
4060     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4061     TestObjV8Internal::classMethodWithOptionalMethod(info);
4062     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4063 }
4064
4065 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4066 {
4067     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4068     V8TestObject::classMethod2MethodCustom(info);
4069     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4070 }
4071
4072 #if ENABLE(Condition1)
4073
4074 static void overloadedMethod11Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4075 {
4076     if (UNLIKELY(info.Length() < 1)) {
4077         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4078         return;
4079     }
4080     V8TRYCATCH_VOID(int, arg, toInt32(info[0]));
4081     TestObj::overloadedMethod1(arg);
4082 }
4083
4084 #endif // ENABLE(Condition1)
4085
4086 #if ENABLE(Condition1)
4087
4088 static void overloadedMethod12Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4089 {
4090     if (UNLIKELY(info.Length() < 1)) {
4091         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4092         return;
4093     }
4094     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, info[0]);
4095     TestObj::overloadedMethod1(type);
4096 }
4097
4098 #endif // ENABLE(Condition1)
4099
4100 #if ENABLE(Condition1)
4101
4102 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4103 {
4104     if (info.Length() == 1) {
4105         overloadedMethod11Method(info);
4106         return;
4107     }
4108     if ((info.Length() == 1 && (info[0]->IsNull() || info[0]->IsUndefined() || info[0]->IsString() || info[0]->IsObject()))) {
4109         overloadedMethod12Method(info);
4110         return;
4111     }
4112     if (UNLIKELY(info.Length() < 1)) {
4113         throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4114         return;
4115     }
4116     throwUninformativeAndGenericTypeError(info.GetIsolate());
4117 }
4118
4119 #endif // ENABLE(Condition1)
4120
4121 #if ENABLE(Condition1)
4122
4123 static void overloadedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4124 {
4125     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4126     TestObjV8Internal::overloadedMethod1Method(info);
4127     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4128 }
4129
4130 #endif // ENABLE(Condition1)
4131
4132 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4133 {
4134     if (UNLIKELY(info.Length() < 2)) {
4135         throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4136         return;
4137     }
4138     TestObj* imp = V8TestObject::toNative(info.Holder());
4139     unsigned objArgsShort = 0;
4140     V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue());
4141     if (!std::isnan(objArgsShortNativeValue))
4142         objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue);
4143     unsigned objArgsLong = 0;
4144     V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue());
4145     if (!std::isnan(objArgsLongNativeValue))
4146         objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue);
4147     imp->classMethodWithClamp(objArgsShort, objArgsLong);
4148 }
4149
4150 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4151 {
4152     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4153     TestObjV8Internal::classMethodWithClampMethod(info);
4154     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4155 }
4156
4157 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4158 {
4159     if (UNLIKELY(info.Length() < 1)) {
4160         throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4161         return;
4162     }
4163     TestObj* imp = V8TestObject::toNative(info.Holder());
4164     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4165     imp->enabledAtRuntimeMethod(longArg);
4166 }
4167
4168 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4169 {
4170     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4171     TestObjV8Internal::enabledAtRuntimeMethodMethod(info);
4172     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4173 }
4174
4175 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4176 {
4177     if (UNLIKELY(info.Length() < 1)) {
4178         throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4179         return;
4180     }
4181     TestObj* imp = V8TestObject::toNative(info.Holder());
4182     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4183     imp->enabledPerContextMethod(longArg);
4184 }
4185
4186 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4187 {
4188     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4189     TestObjV8Internal::enabledPerContextMethodMethod(info);
4190     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4191 }
4192
4193 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4194 {
4195     if (UNLIKELY(info.Length() < 1)) {
4196         throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLongSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4197         return;
4198     }
4199     TestObj* imp = V8TestObject::toNative(info.Holder());
4200     V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsigned>(info[0], 1, info.GetIsolate()));
4201     imp->methodWithUnsignedLongSequence(unsignedLongSequence);
4202 }
4203
4204 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4205 {
4206     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4207     TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info);
4208     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4209 }
4210
4211 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4212 {
4213     if (UNLIKELY(info.Length() < 1)) {
4214         throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4215         return;
4216     }
4217     TestObj* imp = V8TestObject::toNative(info.Holder());
4218     ExceptionState es(info.GetIsolate());
4219     V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, info.GetIsolate()));
4220     Vector<String> result = imp->stringArrayFunction(values, es);
4221     if (es.throwIfNeeded())
4222         return;
4223     v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
4224 }
4225
4226 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4227 {
4228     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4229     TestObjV8Internal::stringArrayFunctionMethod(info);
4230     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4231 }
4232
4233 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4234 {
4235     if (UNLIKELY(info.Length() < 1)) {
4236         throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4237         return;
4238     }
4239     TestObj* imp = V8TestObject::toNative(info.Holder());
4240     ExceptionState es(info.GetIsolate());
4241     V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4242     RefPtr<DOMStringList> result = imp->domStringListFunction(values, es);
4243     if (es.throwIfNeeded())
4244         return;
4245     v8SetReturnValue(info, result.release());
4246 }
4247
4248 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4249 {
4250     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4251     TestObjV8Internal::domStringListFunctionMethod(info);
4252     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4253 }
4254
4255 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4256 {
4257     TestObj* imp = V8TestObject::toNative(info.Holder());
4258     ExceptionState es(info.GetIsolate());
4259     if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(es), es)) {
4260         v8SetReturnValueNull(info);
4261         es.throwIfNeeded();
4262         return;
4263     }
4264     RefPtr<SVGDocument> result = imp->getSVGDocument(es);
4265     if (es.throwIfNeeded())
4266         return;
4267     v8SetReturnValue(info, result.release());
4268 }
4269
4270 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4271 {
4272     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4273     TestObjV8Internal::getSVGDocumentMethod(info);
4274     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4275 }
4276
4277 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4278 {
4279     if (UNLIKELY(info.Length() < 1)) {
4280         throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4281         return;
4282     }
4283     TestObj* imp = V8TestObject::toNative(info.Holder());
4284     V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4285     imp->convert1(value);
4286 }
4287
4288 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4289 {
4290     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4291     TestObjV8Internal::convert1Method(info);
4292     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4293 }
4294
4295 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4296 {
4297     if (UNLIKELY(info.Length() < 1)) {
4298         throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4299         return;
4300     }
4301     TestObj* imp = V8TestObject::toNative(info.Holder());
4302     V8TRYCATCH_VOID(TestNode*, value, V8TestNode::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4303     imp->convert2(value);
4304 }
4305
4306 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4307 {
4308     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4309     TestObjV8Internal::convert2Method(info);
4310     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4311 }
4312
4313 static void mutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4314 {
4315     TestObj* imp = V8TestObject::toNative(info.Holder());
4316     v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->mutablePointFunction())));
4317 }
4318
4319 static void mutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4320 {
4321     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4322     TestObjV8Internal::mutablePointFunctionMethod(info);
4323     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4324 }
4325
4326 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4327 {
4328     TestObj* imp = V8TestObject::toNative(info.Holder());
4329     v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->immutablePointFunction())));
4330 }
4331
4332 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4333 {
4334     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4335     TestObjV8Internal::immutablePointFunctionMethod(info);
4336     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4337 }
4338
4339 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4340 {
4341     if (UNLIKELY(info.Length() < 2)) {
4342         throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4343         return;
4344     }
4345     TestObj* imp = V8TestObject::toNative(info.Holder());
4346     V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4347     V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1]));
4348     if (!item) {
4349         throwUninformativeAndGenericTypeError(info.GetIsolate());
4350         return;
4351     }
4352     v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp->svgPointMethod(item->propertyReference(), index))));
4353 }
4354
4355 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4356 {
4357     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4358     TestObjV8Internal::svgPointMethodMethod(info);
4359     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4360 }
4361
4362 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4363 {
4364     if (UNLIKELY(info.Length() < 2)) {
4365         throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4366         return;
4367     }
4368     TestObj* imp = V8TestObject::toNative(info.Holder());
4369     ExceptionState es(info.GetIsolate());
4370     if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
4371         throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod", "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
4372         return;
4373     }
4374     V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4375     V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1]));
4376     if (!item) {
4377         throwUninformativeAndGenericTypeError(info.GetIsolate());
4378         return;
4379     }
4380     SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index, es);
4381     if (es.throwIfNeeded())
4382         return;
4383     v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(result)));
4384 }
4385
4386 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4387 {
4388     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4389     TestObjV8Internal::strictSVGPointMethodMethod(info);
4390     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4391 }
4392
4393 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4394 {
4395     TestObj* imp = V8TestObject::toNative(info.Holder());
4396     imp->banana();
4397 }
4398
4399 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4400 {
4401     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4402     TestObjV8Internal::orangeMethod(info);
4403     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4404 }
4405
4406 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4407 {
4408     if (UNLIKELY(info.Length() < 3)) {
4409         throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
4410         return;
4411     }
4412     TestObj* imp = V8TestObject::toNative(info.Holder());
4413     ExceptionState es(info.GetIsolate());
4414     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
4415     V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue()));
4416     V8TRYCATCH_VOID(int, b, toInt32(info[2]));
4417     bool result = imp->strictFunction(str, a, b, es);
4418     if (es.throwIfNeeded())
4419         return;
4420     v8SetReturnValueBool(info, result);
4421 }
4422
4423 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4424 {
4425     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4426     TestObjV8Internal::strictFunctionMethod(info);
4427     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4428 }
4429
4430 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4431 {
4432     if (UNLIKELY(info.Length() < 1)) {
4433         throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4434         return;
4435     }
4436     TestObj* imp = V8TestObject::toNative(info.Holder());
4437     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]);
4438     V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1));
4439     imp->variadicStringMethod(head, tail);
4440 }
4441
4442 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4443 {
4444     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4445     TestObjV8Internal::variadicStringMethodMethod(info);
4446     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4447 }
4448
4449 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4450 {
4451     if (UNLIKELY(info.Length() < 1)) {
4452         throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4453         return;
4454     }
4455     TestObj* imp = V8TestObject::toNative(info.Holder());
4456     V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue()));
4457     V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1));
4458     imp->variadicDoubleMethod(head, tail);
4459 }
4460
4461 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4462 {
4463     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4464     TestObjV8Internal::variadicDoubleMethodMethod(info);
4465     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4466 }
4467
4468 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4469 {
4470     if (UNLIKELY(info.Length() < 1)) {
4471         throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4472         return;
4473     }
4474     TestObj* imp = V8TestObject::toNative(info.Holder());
4475     V8TRYCATCH_VOID(Node*, head, V8Node::HasInstance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4476     Vector<RefPtr<Node> > tail;
4477     for (int i = 1; i < info.Length(); ++i) {
4478         if (!V8Node::HasInstance(info[i], info.GetIsolate(), worldType(info.GetIsolate()))) {
4479             throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate());
4480             return;
4481         }
4482         tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i])));
4483     }
4484     imp->variadicNodeMethod(head, tail);
4485 }
4486
4487 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4488 {
4489     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4490     TestObjV8Internal::variadicNodeMethodMethod(info);
4491     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4492 }
4493
4494 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4495 {
4496     if (UNLIKELY(info.Length() < 3)) {
4497         throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArguments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsolate());
4498         return;
4499     }
4500     TestObj* imp = V8TestObject::toNative(info.Holder());
4501     bool strIsNull = info[0]->IsNull();
4502     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource, info[0]);
4503     String str = strStringResource;
4504     bool lIsNull = info[1]->IsNull();
4505     V8TRYCATCH_VOID(int, l, toInt32(info[1]));
4506     V8TRYCATCH_VOID(TestObj*, obj, V8TestObject::HasInstance(info[2], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::Object>::Cast(info[2])) : 0);
4507     if (UNLIKELY(info.Length() <= 3)) {
4508         imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj);
4509         return;
4510     }
4511     bool dIsNull = info[3]->IsNull();
4512     V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue()));
4513     imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj, dIsNull ? 0 : &d);
4514 }
4515
4516 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4517 {
4518     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4519     TestObjV8Internal::methodWithNullableArgumentsMethod(info);
4520     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4521 }
4522
4523 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4524 {
4525     TestObj* imp = V8TestObject::toNative(info.Holder());
4526     imp->perWorldMethod();
4527 }
4528
4529 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4530 {
4531     TestObj* imp = V8TestObject::toNative(info.Holder());
4532     imp->perWorldMethod();
4533 }
4534
4535 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4536 {
4537     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4538     TestObjV8Internal::perWorldMethodMethod(info);
4539     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4540 }
4541
4542 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4543 {
4544     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4545     TestObjV8Internal::perWorldMethodMethodForMainWorld(info);
4546     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4547 }
4548
4549 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4550 {
4551     if (UNLIKELY(info.Length() < 1)) {
4552         throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4553         return;
4554     }
4555     TestObj* imp = V8TestObject::toNative(info.Holder());
4556     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4557     imp->overloadedPerWorldMethod(longArg);
4558 }
4559
4560 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4561 {
4562     if (UNLIKELY(info.Length() < 1)) {
4563         throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4564         return;
4565     }
4566     TestObj* imp = V8TestObject::toNative(info.Holder());
4567     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4568     imp->overloadedPerWorldMethod(longArg);
4569 }
4570
4571 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4572 {
4573     if (UNLIKELY(info.Length() < 2)) {
4574         throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4575         return;
4576     }
4577     TestObj* imp = V8TestObject::toNative(info.Holder());
4578     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4579     V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
4580     imp->overloadedPerWorldMethod(strArg, longArg);
4581 }
4582
4583 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4584 {
4585     if (UNLIKELY(info.Length() < 2)) {
4586         throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4587         return;
4588     }
4589     TestObj* imp = V8TestObject::toNative(info.Holder());
4590     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4591     V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
4592     imp->overloadedPerWorldMethod(strArg, longArg);
4593 }
4594
4595 static void overloadedPerWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4596 {
4597     if (info.Length() == 1) {
4598         overloadedPerWorldMethod1Method(info);
4599         return;
4600     }
4601     if (info.Length() == 2) {
4602         overloadedPerWorldMethod2Method(info);
4603         return;
4604     }
4605     if (UNLIKELY(info.Length() < 1)) {
4606         throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4607         return;
4608     }
4609     throwUninformativeAndGenericTypeError(info.GetIsolate());
4610 }
4611
4612 static void overloadedPerWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4613 {
4614     if (info.Length() == 1) {
4615         overloadedPerWorldMethod1MethodForMainWorld(info);
4616         return;
4617     }
4618     if (info.Length() == 2) {
4619         overloadedPerWorldMethod2MethodForMainWorld(info);
4620         return;
4621     }
4622     if (UNLIKELY(info.Length() < 1)) {
4623         throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4624         return;
4625     }
4626     throwUninformativeAndGenericTypeError(info.GetIsolate());
4627 }
4628
4629 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4630 {
4631     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4632     TestObjV8Internal::overloadedPerWorldMethodMethod(info);
4633     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4634 }
4635
4636 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4637 {
4638     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4639     TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info);
4640     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4641 }
4642
4643 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4644 {
4645     if (UNLIKELY(info.Length() < 1)) {
4646         throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4647         return;
4648     }
4649     TestObj* imp = V8TestObject::toNative(info.Holder());
4650     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4651     imp->activityLoggedMethod1(longArg);
4652 }
4653
4654 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4655 {
4656     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4657     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4658     if (contextData && contextData->activityLogger()) {
4659         Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4660         contextData->activityLogger()->log("TestObject.activityLoggedMethod1", info.Length(), loggerArgs.data(), "Method");
4661     }
4662     TestObjV8Internal::activityLoggedMethod1Method(info);
4663     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4664 }
4665
4666 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4667 {
4668     if (UNLIKELY(info.Length() < 1)) {
4669         throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4670         return;
4671     }
4672     TestObj* imp = V8TestObject::toNative(info.Holder());
4673     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4674     imp->activityLoggedMethod2(longArg);
4675 }
4676
4677 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4678 {
4679     if (UNLIKELY(info.Length() < 1)) {
4680         throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4681         return;
4682     }
4683     TestObj* imp = V8TestObject::toNative(info.Holder());
4684     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4685     imp->activityLoggedMethod2(longArg);
4686 }
4687
4688 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4689 {
4690     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4691     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4692     if (contextData && contextData->activityLogger()) {
4693         Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4694         contextData->activityLogger()->log("TestObject.activityLoggedMethod2", info.Length(), loggerArgs.data(), "Method");
4695     }
4696     TestObjV8Internal::activityLoggedMethod2Method(info);
4697     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4698 }
4699
4700 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4701 {
4702     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4703     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4704     if (contextData && contextData->activityLogger()) {
4705         Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4706         contextData->activityLogger()->log("TestObject.activityLoggedMethod2", info.Length(), loggerArgs.data(), "Method");
4707     }
4708     TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info);
4709     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4710 }
4711
4712 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4713 {
4714     if (UNLIKELY(info.Length() < 1)) {
4715         throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsolatedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4716         return;
4717     }
4718     TestObj* imp = V8TestObject::toNative(info.Holder());
4719     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4720     imp->activityLoggedInIsolatedWorldMethod(longArg);
4721 }
4722
4723 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4724 {
4725     if (UNLIKELY(info.Length() < 1)) {
4726         throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsolatedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4727         return;
4728     }
4729     TestObj* imp = V8TestObject::toNative(info.Holder());
4730     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4731     imp->activityLoggedInIsolatedWorldMethod(longArg);
4732 }
4733
4734 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4735 {
4736     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4737     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4738     if (contextData && contextData->activityLogger()) {
4739         Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4740         contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedWorldMethod", info.Length(), loggerArgs.data(), "Method");
4741     }
4742     TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info);
4743     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4744 }
4745
4746 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4747 {
4748     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4749     TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(info);
4750     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4751 }
4752
4753 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4754 {
4755     if (UNLIKELY(info.Length() < 1)) {
4756         throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4757         return;
4758     }
4759     TestObj* imp = V8TestObject::toNative(info.Holder());
4760     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4761     imp->overloadedActivityLoggedMethod(longArg);
4762 }
4763
4764 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4765 {
4766     if (UNLIKELY(info.Length() < 1)) {
4767         throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4768         return;
4769     }
4770     TestObj* imp = V8TestObject::toNative(info.Holder());
4771     V8TRYCATCH_VOID(int, longArg, toInt32(info[0]));
4772     imp->overloadedActivityLoggedMethod(longArg);
4773 }
4774
4775 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& info)
4776 {
4777     if (UNLIKELY(info.Length() < 2)) {
4778         throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4779         return;
4780     }
4781     TestObj* imp = V8TestObject::toNative(info.Holder());
4782     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4783     V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
4784     imp->overloadedActivityLoggedMethod(strArg, longArg);
4785 }
4786
4787 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4788 {
4789     if (UNLIKELY(info.Length() < 2)) {
4790         throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsolate());
4791         return;
4792     }
4793     TestObj* imp = V8TestObject::toNative(info.Holder());
4794     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
4795     V8TRYCATCH_VOID(int, longArg, toInt32(info[1]));
4796     imp->overloadedActivityLoggedMethod(strArg, longArg);
4797 }
4798
4799 static void overloadedActivityLoggedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4800 {
4801     if (info.Length() == 1) {
4802         overloadedActivityLoggedMethod1Method(info);
4803         return;
4804     }
4805     if (info.Length() == 2) {
4806         overloadedActivityLoggedMethod2Method(info);
4807         return;
4808     }
4809     if (UNLIKELY(info.Length() < 1)) {
4810         throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4811         return;
4812     }
4813     throwUninformativeAndGenericTypeError(info.GetIsolate());
4814 }
4815
4816 static void overloadedActivityLoggedMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4817 {
4818     if (info.Length() == 1) {
4819         overloadedActivityLoggedMethod1MethodForMainWorld(info);
4820         return;
4821     }
4822     if (info.Length() == 2) {
4823         overloadedActivityLoggedMethod2MethodForMainWorld(info);
4824         return;
4825     }
4826     if (UNLIKELY(info.Length() < 1)) {
4827         throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLoggedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4828         return;
4829     }
4830     throwUninformativeAndGenericTypeError(info.GetIsolate());
4831 }
4832
4833 static void overloadedActivityLoggedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4834 {
4835     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4836     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4837     if (contextData && contextData->activityLogger()) {
4838         Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4839         contextData->activityLogger()->log("TestObject.overloadedActivityLoggedMethod", info.Length(), loggerArgs.data(), "Method");
4840     }
4841     TestObjV8Internal::overloadedActivityLoggedMethodMethod(info);
4842     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4843 }
4844
4845 static void overloadedActivityLoggedMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
4846 {
4847     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4848     V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->GetCurrentContext());
4849     if (contextData && contextData->activityLogger()) {
4850         Vector<v8::Handle<v8::Value> > loggerArgs = toVectorOfArguments(info);
4851         contextData->activityLogger()->log("TestObject.overloadedActivityLoggedMethod", info.Length(), loggerArgs.data(), "Method");
4852     }
4853     TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info);
4854     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4855 }
4856
4857 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4858 {
4859     TestObj* imp = V8TestObject::toNative(info.Holder());
4860     imp->deprecatedMethod();
4861 }
4862
4863 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4864 {
4865     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4866     UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Method);
4867     TestObjV8Internal::deprecatedMethodMethod(info);
4868     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4869 }
4870
4871 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4872 {
4873     TestObj::deprecatedStaticMethod();
4874 }
4875
4876 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
4877 {
4878     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4879     UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMethod);
4880     TestObjV8Internal::deprecatedStaticMethodMethod(info);
4881     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4882 }
4883
4884 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
4885 {
4886     if (UNLIKELY(info.Length() < 1)) {
4887         throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
4888         return;
4889     }
4890     if (info.Length() <= 0 || !info[0]->IsFunction()) {
4891         throwTypeError(ExceptionMessages::failedToExecute("Constructor", "TestObject", "The callback provided as parameter 1 is not a function."), info.GetIsolate());
4892         return;
4893     }
4894     RefPtr<TestCallback> testCallback = V8TestCallback::create(info[0], getExecutionContext());
4895
4896     RefPtr<TestObj> impl = TestObj::create(testCallback);
4897     v8::Handle<v8::Object> wrapper = info.Holder();
4898
4899     V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl.release(), &V8TestObject::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
4900     info.GetReturnValue().Set(wrapper);
4901 }
4902
4903 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
4904 {
4905     ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
4906     TestObj* collection = V8TestObject::toNative(info.Holder());
4907     RefPtr<Node> element = collection->item(index);
4908     if (!element)
4909         return;
4910     v8SetReturnValueFast(info, element.release(), collection);
4911 }
4912
4913 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
4914 {
4915     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
4916     TestObjV8Internal::indexedPropertyGetter(index, info);
4917     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4918 }
4919
4920 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
4921 {
4922     if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
4923         return;
4924     if (info.Holder()->HasRealNamedCallbackProperty(name))
4925         return;
4926     if (info.Holder()->HasRealNamedProperty(name))
4927         return;
4928
4929     ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
4930     TestObj* collection = V8TestObject::toNative(info.Holder());
4931     AtomicString propertyName = toWebCoreAtomicString(name);
4932     String element = collection->namedItem(propertyName);
4933     if (element.isNull())
4934         return;
4935     v8SetReturnValueString(info, element, info.GetIsolate());
4936 }
4937
4938 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
4939 {
4940     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
4941     TestObjV8Internal::namedPropertyGetter(name, info);
4942     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4943 }
4944
4945 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
4946 {
4947     ExceptionState es(info.GetIsolate());
4948     TestObj* collection = V8TestObject::toNative(info.Holder());
4949     Vector<String> names;
4950     collection->namedPropertyEnumerator(names, es);
4951     if (es.throwIfNeeded())
4952         return;
4953     v8::Handle<v8::Array> v8names = v8::Array::New(names.size());
4954     for (size_t i = 0; i < names.size(); ++i)
4955         v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i], info.GetIsolate()));
4956     v8SetReturnValue(info, v8names);
4957 }
4958
4959 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
4960 {
4961     TestObj* collection = V8TestObject::toNative(info.Holder());
4962     AtomicString propertyName = toWebCoreAtomicString(name);
4963     ExceptionState es(info.GetIsolate());
4964     bool result = collection->namedPropertyQuery(propertyName, es);
4965     if (es.throwIfNeeded())
4966         return;
4967     if (!result)
4968         return;
4969     v8SetReturnValueInt(info, v8::None);
4970 }
4971
4972 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
4973 {
4974     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
4975     TestObjV8Internal::namedPropertyEnumerator(info);
4976     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4977 }
4978
4979 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
4980 {
4981     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
4982     TestObjV8Internal::namedPropertyQuery(name, info);
4983     TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4984 }
4985
4986 } // namespace TestObjV8Internal
4987
4988 static const V8DOMConfiguration::AttributeConfiguration V8TestObjectAttributes[] = {
4989     {"readOnlyLongAttr", TestObjV8Internal::readOnlyLongAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4990     {"readOnlyStringAttr", TestObjV8Internal::readOnlyStringAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4991     {"readOnlyTestObjectAttr", TestObjV8Internal::readOnlyTestObjectAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4992     {"enumAttr", TestObjV8Internal::enumAttrAttributeGetterCallback, TestObjV8Internal::enumAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4993     {"readOnlyEnumAttr", TestObjV8Internal::readOnlyEnumAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4994     {"byteAttr", TestObjV8Internal::byteAttrAttributeGetterCallback, TestObjV8Internal::byteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4995     {"octetAttr", TestObjV8Internal::octetAttrAttributeGetterCallback, TestObjV8Internal::octetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4996     {"shortAttr", TestObjV8Internal::shortAttrAttributeGetterCallback, TestObjV8Internal::shortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4997     {"unsignedShortAttr", TestObjV8Internal::unsignedShortAttrAttributeGetterCallback, TestObjV8Internal::unsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4998     {"longAttr", TestObjV8Internal::longAttrAttributeGetterCallback, TestObjV8Internal::longAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
4999     {"longLongAttr", TestObjV8Internal::longLongAttrAttributeGetterCallback, TestObjV8Internal::longLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5000     {"unsignedLongLongAttr", TestObjV8Internal::unsignedLongLongAttrAttributeGetterCallback, TestObjV8Internal::unsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5001     {"stringAttr", TestObjV8Internal::stringAttrAttributeGetterCallback, TestObjV8Internal::stringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5002     {"eventHandlerAttr", TestObjV8Internal::eventHandlerAttrAttributeGetterCallback, TestObjV8Internal::eventHandlerAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5003     {"testObjAttr", TestObjV8Internal::testObjAttrAttributeGetterCallback, TestObjV8Internal::testObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5004     {"XMLObjAttr", TestObjV8Internal::XMLObjAttrAttributeGetterCallback, TestObjV8Internal::XMLObjAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5005     {"create", TestObjV8Internal::createAttributeGetterCallback, TestObjV8Internal::createAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5006     {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGetterCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5007     {"reflectedIntegralAttr", TestObjV8Internal::reflectedIntegralAttrAttributeGetterCallback, TestObjV8Internal::reflectedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5008     {"reflectedUnsignedIntegralAttr", TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeGetterCallback, TestObjV8Internal::reflectedUnsignedIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5009     {"reflectedBooleanAttr", TestObjV8Internal::reflectedBooleanAttrAttributeGetterCallback, TestObjV8Internal::reflectedBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5010     {"reflectedURLAttr", TestObjV8Internal::reflectedURLAttrAttributeGetterCallback, TestObjV8Internal::reflectedURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5011     {"reflectedStringAttr", TestObjV8Internal::reflectedStringAttrAttributeGetterCallback, TestObjV8Internal::reflectedStringAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5012     {"reflectedCustomIntegralAttr", TestObjV8Internal::reflectedCustomIntegralAttrAttributeGetterCallback, TestObjV8Internal::reflectedCustomIntegralAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5013     {"reflectedCustomBooleanAttr", TestObjV8Internal::reflectedCustomBooleanAttrAttributeGetterCallback, TestObjV8Internal::reflectedCustomBooleanAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5014     {"reflectedCustomURLAttr", TestObjV8Internal::reflectedCustomURLAttrAttributeGetterCallback, TestObjV8Internal::reflectedCustomURLAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5015     {"typedArrayAttr", TestObjV8Internal::typedArrayAttrAttributeGetterCallback, TestObjV8Internal::typedArrayAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5016     {"attrWithGetterException", TestObjV8Internal::attrWithGetterExceptionAttributeGetterCallback, TestObjV8Internal::attrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5017     {"attrWithSetterException", TestObjV8Internal::attrWithSetterExceptionAttributeGetterCallback, TestObjV8Internal::attrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5018     {"stringAttrWithGetterException", TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithGetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5019     {"stringAttrWithSetterException", TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetterCallback, TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5020     {"customAttr", TestObjV8Internal::customAttrAttributeGetterCallback, TestObjV8Internal::customAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5021     {"withScriptStateAttribute", TestObjV8Internal::withScriptStateAttributeAttributeGetterCallback, TestObjV8Internal::withScriptStateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5022     {"withExecutionContextAttribute", TestObjV8Internal::withExecutionContextAttributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5023     {"withActiveWindowAndFirstWindowAttribute", TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeGetterCallback, TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5024     {"withScriptStateAttributeRaises", TestObjV8Internal::withScriptStateAttributeRaisesAttributeGetterCallback, TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5025     {"withExecutionContextAttributeRaises", TestObjV8Internal::withExecutionContextAttributeRaisesAttributeGetterCallback, TestObjV8Internal::withExecutionContextAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5026     {"withExecutionContextAndScriptStateAttribute", TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5027     {"withExecutionContextAndScriptStateAttributeRaises", TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeGetterCallback, TestObjV8Internal::withExecutionContextAndScriptStateAttributeRaisesAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5028     {"withExecutionContextAndScriptStateWithSpacesAttribute", TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeGetterCallback, TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5029     {"enforcedRangeByteAttr", TestObjV8Internal::enforcedRangeByteAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeByteAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5030     {"enforcedRangeOctetAttr", TestObjV8Internal::enforcedRangeOctetAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeOctetAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5031     {"enforcedRangeShortAttr", TestObjV8Internal::enforcedRangeShortAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5032     {"enforcedRangeUnsignedShortAttr", TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedShortAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5033     {"enforcedRangeLongAttr", TestObjV8Internal::enforcedRangeLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5034     {"enforcedRangeUnsignedLongAttr", TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5035     {"enforcedRangeLongLongAttr", TestObjV8Internal::enforcedRangeLongLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5036     {"enforcedRangeUnsignedLongLongAttr", TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeGetterCallback, TestObjV8Internal::enforcedRangeUnsignedLongLongAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5037 #if ENABLE(Condition1)
5038     {"conditionalAttr1", TestObjV8Internal::conditionalAttr1AttributeGetterCallback, TestObjV8Internal::conditionalAttr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5039 #endif // ENABLE(Condition1)
5040 #if ENABLE(Condition1) && ENABLE(Condition2)
5041     {"conditionalAttr2", TestObjV8Internal::conditionalAttr2AttributeGetterCallback, TestObjV8Internal::conditionalAttr2AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5042 #endif // ENABLE(Condition1) && ENABLE(Condition2)
5043 #if ENABLE(Condition1) || ENABLE(Condition2)
5044     {"conditionalAttr3", TestObjV8Internal::conditionalAttr3AttributeGetterCallback, TestObjV8Internal::conditionalAttr3AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5045 #endif // ENABLE(Condition1) || ENABLE(Condition2)
5046 #if ENABLE(Condition1)
5047     {"conditionalAttr4", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectA::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5048 #endif // ENABLE(Condition1)
5049 #if ENABLE(Condition1) && ENABLE(Condition2)
5050     {"conditionalAttr5", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectB::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5051 #endif // ENABLE(Condition1) && ENABLE(Condition2)
5052 #if ENABLE(Condition1) || ENABLE(Condition2)
5053     {"conditionalAttr6", TestObjV8Internal::TestObjConstructorGetter, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestObjectectC::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
5054 #endif // ENABLE(Condition1) || ENABLE(Condition2)
5055     {"cachedAttribute1", TestObjV8Internal::cachedAttribute1AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5056     {"cachedAttribute2", TestObjV8Internal::cachedAttribute2AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5057     {"anyAttribute", TestObjV8Internal::anyAttributeAttributeGetterCallback, TestObjV8Internal::anyAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5058     {"callbackFunctionAttribute", TestObjV8Internal::callbackFunctionAttributeAttributeGetterCallback, TestObjV8Internal::callbackFunctionAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5059     {"floatArray", TestObjV8Internal::floatArrayAttributeGetterCallback, TestObjV8Internal::floatArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5060     {"doubleArray", TestObjV8Internal::doubleArrayAttributeGetterCallback, TestObjV8Internal::doubleArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5061     {"messagePortArray", TestObjV8Internal::messagePortArrayAttributeGetterCallback, TestObjV8Internal::messagePortArrayAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5062     {"contentDocument", TestObjV8Internal::contentDocumentAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5063     {"mutablePoint", TestObjV8Internal::mutablePointAttributeGetterCallback, TestObjV8Internal::mutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5064     {"immutablePoint", TestObjV8Internal::immutablePointAttributeGetterCallback, TestObjV8Internal::immutablePointAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5065     {"strawberry", TestObjV8Internal::strawberryAttributeGetterCallback, TestObjV8Internal::strawberryAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5066     {"strictFloat", TestObjV8Internal::strictFloatAttributeGetterCallback, TestObjV8Internal::strictFloatAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5067     {"replaceableAttribute", TestObjV8Internal::replaceableAttributeAttributeGetterCallback, TestObjV8Internal::TestObjReplaceableAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5068     {"nullableDoubleAttribute", TestObjV8Internal::nullableDoubleAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5069     {"nullableLongAttribute", TestObjV8Internal::nullableLongAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5070     {"nullableBooleanAttribute", TestObjV8Internal::nullableBooleanAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5071     {"nullableStringAttribute", TestObjV8Internal::nullableStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5072     {"nullableLongSettableAttribute", TestObjV8Internal::nullableLongSettableAttributeAttributeGetterCallback, TestObjV8Internal::nullableLongSettableAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5073     {"nullableStringValue", TestObjV8Internal::nullableStringValueAttributeGetterCallback, TestObjV8Internal::nullableStringValueAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5074     {"perWorldReadOnlyAttribute", TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterCallback, 0, TestObjV8Internal::perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5075     {"perWorldAttribute", TestObjV8Internal::perWorldAttributeAttributeGetterCallback, TestObjV8Internal::perWorldAttributeAttributeSetterCallback, TestObjV8Internal::perWorldAttributeAttributeGetterCallbackForMainWorld, TestObjV8Internal::perWorldAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5076     {"activityLoggedAttr1", TestObjV8Internal::activityLoggedAttr1AttributeGetterCallback, TestObjV8Internal::activityLoggedAttr1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5077     {"activityLoggedAttr2", TestObjV8Internal::activityLoggedAttr2AttributeGetterCallback, TestObjV8Internal::activityLoggedAttr2AttributeSetterCallback, TestObjV8Internal::activityLoggedAttr2AttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedAttr2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5078     {"activityLoggedInIsolatedWorldsAttr", TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5079     {"activityLoggedAttrSetter1", TestObjV8Internal::activityLoggedAttrSetter1AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5080     {"activityLoggedAttrSetter2", TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterCallback, TestObjV8Internal::activityLoggedAttrSetter2AttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedAttrSetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5081     {"activityLoggedInIsolatedWorldsAttrSetter", TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrSetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5082     {"activityLoggedAttrGetter1", TestObjV8Internal::activityLoggedAttrGetter1AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter1AttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5083     {"activityLoggedAttrGetter2", TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterCallback, TestObjV8Internal::activityLoggedAttrGetter2AttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedAttrGetter2AttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5084     {"activityLoggedInIsolatedWorldsAttrGetter", TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallback, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeGetterCallbackForMainWorld, TestObjV8Internal::activityLoggedInIsolatedWorldsAttrGetterAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5085     {"deprecatedReadonlyAttr", TestObjV8Internal::deprecatedReadonlyAttrAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5086     {"deprecatedAttr", TestObjV8Internal::deprecatedAttrAttributeGetterCallback, TestObjV8Internal::deprecatedAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5087     {"location", TestObjV8Internal::locationAttributeGetterCallback, TestObjV8Internal::locationAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5088     {"locationWithException", TestObjV8Internal::locationWithExceptionAttributeGetterCallback, TestObjV8Internal::locationWithExceptionAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
5089 };
5090
5091 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = {
5092     {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0},
5093     {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0},
5094     {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0, 0},
5095     {"methodWithSequenceArg", TestObjV8Internal::methodWithSequenceArgMethodCallback, 0, 1},
5096     {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethodCallback, 0, 1},
5097     {"methodWithEnumArg", TestObjV8Internal::methodWithEnumArgMethodCallback, 0, 1},
5098     {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0, 1},
5099     {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0, 1},
5100     {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback, 0, 0},
5101     {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0, 0},
5102     {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallback, 0, 3},
5103     {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0, 2},
5104     {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback, 0, 2},
5105     {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback, 0, 0},
5106     {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback, 0, 0},
5107     {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExceptionMethodCallback, 0, 0},
5108     {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExceptionMethodCallback, 0, 0},
5109     {"withExecutionContext", TestObjV8Internal::withExecutionContextMethodCallback, 0, 0},
5110     {"withExecutionContextAndScriptState", TestObjV8Internal::withExecutionContextAndScriptStateMethodCallback, 0, 0},
5111     {"withExecutionContextAndScriptStateObjException", TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethodCallback, 0, 0},
5112     {"withExecutionContextAndScriptStateWithSpaces", TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethodCallback, 0, 0},
5113     {"withActiveWindowAndFirstWindow", TestObjV8Internal::withActiveWindowAndFirstWindowMethodCallback, 0, 0},
5114     {"methodWithOptionalArg", TestObjV8Internal::methodWithOptionalArgMethodCallback, 0, 0},
5115     {"methodWithNonOptionalArgAndOptionalArg", TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethodCallback, 0, 1},
5116     {"methodWithNonOptionalArgAndTwoOptionalArgs", TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback, 0, 1},
5117     {"methodWithOptionalString", TestObjV8Internal::methodWithOptionalStringMethodCallback, 0, 0},
5118     {"methodWithOptionalStringIsUndefined", TestObjV8Internal::methodWithOptionalStringIsUndefinedMethodCallback, 0, 0},
5119     {"methodWithOptionalStringIsNullString", TestObjV8Internal::methodWithOptionalStringIsNullStringMethodCallback, 0, 0},
5120     {"methodWithCallbackArg", TestObjV8Internal::methodWithCallbackArgMethodCallback, 0, 1},
5121     {"methodWithNonCallbackArgAndCallbackArg", TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethodCallback, 0, 2},
5122     {"methodWithCallbackAndOptionalArg", TestObjV8Internal::methodWithCallbackAndOptionalArgMethodCallback, 0, 0},
5123     {"methodWithNullableCallbackArg", TestObjV8Internal::methodWithNullableCallbackArgMethodCallback, 0, 1},
5124     {"methodWithEnforceRangeInt8", TestObjV8Internal::methodWithEnforceRangeInt8MethodCallback, 0, 1},
5125     {"methodWithEnforceRangeUInt8", TestObjV8Internal::methodWithEnforceRangeUInt8MethodCallback, 0, 1},
5126     {"methodWithEnforceRangeInt16", TestObjV8Internal::methodWithEnforceRangeInt16MethodCallback, 0, 1},
5127     {"methodWithEnforceRangeUInt16", TestObjV8Internal::methodWithEnforceRangeUInt16MethodCallback, 0, 1},
5128     {"methodWithEnforceRangeInt32", TestObjV8Internal::methodWithEnforceRangeInt32MethodCallback, 0, 1},
5129     {"methodWithEnforceRangeUInt32", TestObjV8Internal::methodWithEnforceRangeUInt32MethodCallback, 0, 1},
5130     {"methodWithEnforceRangeInt64", TestObjV8Internal::methodWithEnforceRangeInt64MethodCallback, 0, 1},
5131     {"methodWithEnforceRangeUInt64", TestObjV8Internal::methodWithEnforceRangeUInt64MethodCallback, 0, 1},
5132 #if ENABLE(Condition1)
5133     {"conditionalMethod1", TestObjV8Internal::conditionalMethod1MethodCallback, 0, 0},
5134 #endif // ENABLE(Condition1)
5135 #if ENABLE(Condition1) && ENABLE(Condition2)
5136     {"conditionalMethod2", TestObjV8Internal::conditionalMethod2MethodCallback, 0, 0},
5137 #endif // ENABLE(Condition1) && ENABLE(Condition2)
5138 #if ENABLE(Condition1) || ENABLE(Condition2)
5139     {"conditionalMethod3", TestObjV8Internal::conditionalMethod3MethodCallback, 0, 0},
5140 #endif // ENABLE(Condition1) || ENABLE(Condition2)
5141     {"callbackFunctionReturnValue", TestObjV8Internal::callbackFunctionReturnValueMethodCallback, 0, 0},
5142     {"callbackFunctionArgument", TestObjV8Internal::callbackFunctionArgumentMethodCallback, 0, 1},
5143     {"overloadedMethod", TestObjV8Internal::overloadedMethodMethodCallback, 0, 2},
5144     {"classMethodWithClamp", TestObjV8Internal::classMethodWithClampMethodCallback, 0, 2},
5145     {"methodWithUnsignedLongSequence", TestObjV8Internal::methodWithUnsignedLongSequenceMethodCallback, 0, 1},
5146     {"stringArrayFunction", TestObjV8Internal::stringArrayFunctionMethodCallback, 0, 1},
5147     {"getSVGDocument", TestObjV8Internal::getSVGDocumentMethodCallback, 0, 0},
5148     {"mutablePointFunction", TestObjV8Internal::mutablePointFunctionMethodCallback, 0, 0},
5149     {"immutablePointFunction", TestObjV8Internal::immutablePointFunctionMethodCallback, 0, 0},
5150     {"strictSVGPointMethod", TestObjV8Internal::strictSVGPointMethodMethodCallback, 0, 2},
5151     {"orange", TestObjV8Internal::orangeMethodCallback, 0, 0},
5152     {"strictFunction", TestObjV8Internal::strictFunctionMethodCallback, 0, 3},
5153     {"variadicStringMethod", TestObjV8Internal::variadicStringMethodMethodCallback, 0, 2},
5154     {"variadicDoubleMethod", TestObjV8Internal::variadicDoubleMethodMethodCallback, 0, 2},
5155     {"methodWithNullableArguments", TestObjV8Internal::methodWithNullableArgumentsMethodCallback, 0, 3},
5156     {"perWorldMethod", TestObjV8Internal::perWorldMethodMethodCallback, TestObjV8Internal::perWorldMethodMethodCallbackForMainWorld, 0},
5157     {"overloadedPerWorldMethod", TestObjV8Internal::overloadedPerWorldMethodMethodCallback, TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorld, 1},
5158     {"activityLoggedMethod1", TestObjV8Internal::activityLoggedMethod1MethodCallback, 0, 1},
5159     {"activityLoggedMethod2", TestObjV8Internal::activityLoggedMethod2MethodCallback, TestObjV8Internal::activityLoggedMethod2MethodCallbackForMainWorld, 1},
5160     {"activityLoggedInIsolatedWorldMethod", TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodCallback, TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld, 1},
5161     {"overloadedActivityLoggedMethod", TestObjV8Internal::overloadedActivityLoggedMethodMethodCallback, TestObjV8Internal::overloadedActivityLoggedMethodMethodCallbackForMainWorld, 1},
5162     {"deprecatedMethod", TestObjV8Internal::deprecatedMethodMethodCallback, 0, 0},
5163 };
5164
5165 void V8TestObject::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
5166 {
5167     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor");
5168     if (!info.IsConstructCall()) {
5169         throwTypeError(ExceptionMessages::failedToConstruct("TestObject", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate());
5170         return;
5171     }
5172
5173     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) {
5174         info.GetReturnValue().Set(info.Holder());
5175         return;
5176     }
5177
5178     TestObjV8Internal::constructor(info);
5179 }
5180
5181 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestObjectTemplate(v8::Handle<v8::FunctionTemplate> desc, v8::Isolate* isolate, WrapperWorldType currentWorldType)
5182 {
5183     desc->ReadOnlyPrototype();
5184
5185     v8::Local<v8::Signature> defaultSignature;
5186     defaultSignature = V8DOMConfiguration::installDOMClassTemplate(desc, "TestObject", V8EventTarget::GetTemplate(isolate, currentWorldType), V8TestObject::internalFieldCount,
5187         V8TestObjectAttributes, WTF_ARRAY_LENGTH(V8TestObjectAttributes),
5188         V8TestObjectMethods, WTF_ARRAY_LENGTH(V8TestObjectMethods),
5189         isolate, currentWorldType);
5190     UNUSED_PARAM(defaultSignature);
5191     desc->SetCallHandler(V8TestObject::constructorCallback);
5192     desc->SetLength(1);
5193     v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
5194     v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
5195     UNUSED_PARAM(instance);
5196     UNUSED_PARAM(proto);
5197     if (RuntimeEnabledFeatures::featureNameEnabled()) {
5198         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
5199         {"enabledAtRuntimeAttr", TestObjV8Internal::enabledAtRuntimeAttrAttributeGetterCallback, TestObjV8Internal::enabledAtRuntimeAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
5200         V8DOMConfiguration::installAttribute(instance, proto, attributeConfiguration, isolate, currentWorldType);
5201     }
5202     static const V8DOMConfiguration::ConstantConfiguration V8TestObjectConstants[] = {
5203         {"DEPRECATED_CONSTANT", 1},
5204     };
5205     V8DOMConfiguration::installConstants(desc, proto, V8TestObjectConstants, WTF_ARRAY_LENGTH(V8TestObjectConstants), isolate);
5206     COMPILE_ASSERT(1 == TestObj::DEPRECATED_CONSTANT, TheValueOfTestObj_DEPRECATED_CONSTANTDoesntMatchWithImplementation);
5207     desc->InstanceTemplate()->SetIndexedPropertyHandler(TestObjV8Internal::indexedPropertyGetterCallback, 0, 0, 0, indexedPropertyEnumerator<TestObj>);
5208     desc->InstanceTemplate()->SetNamedPropertyHandler(TestObjV8Internal::namedPropertyGetterCallback, 0, TestObjV8Internal::namedPropertyQueryCallback, 0, TestObjV8Internal::namedPropertyEnumeratorCallback);
5209
5210     // Custom Signature 'voidMethodWithArgs'
5211     const int voidMethodWithArgsArgc = 3;
5212     v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5213     v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
5214     proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMethodWithArgsSignature, 3));
5215
5216     // Custom Signature 'longMethodWithArgs'
5217     const int longMethodWithArgsArgc = 3;
5218     v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5219     v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(desc, longMethodWithArgsArgc, longMethodWithArgsArgv);
5220     proto->Set(v8::String::NewSymbol("longMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMethodWithArgsSignature, 3));
5221
5222     // Custom Signature 'objMethodWithArgs'
5223     const int objMethodWithArgsArgc = 3;
5224     v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5225     v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv);
5226     proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMethodWithArgsSignature, 3));
5227
5228     // Custom Signature 'methodThatRequiresAllArgsAndThrows'
5229     const int methodThatRequiresAllArgsAndThrowsArgc = 2;
5230     v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObject::wrapperTypeInfo, currentWorldType) };
5231     v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
5232     proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethodCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature, 2));
5233     desc->Set(v8::String::NewSymbol("staticMethodWithCallbackAndOptionalArg"), v8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5234     desc->Set(v8::String::NewSymbol("staticMethodWithCallbackArg"), v8::FunctionTemplate::New(TestObjV8Internal::staticMethodWithCallbackArgMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
5235     desc->Set(v8::String::NewSymbol("classMethod"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5236     desc->Set(v8::String::NewSymbol("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjV8Internal::classMethodWithOptionalMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5237     desc->Set(v8::String::NewSymbol("classMethod2"), v8::FunctionTemplate::New(TestObjV8Internal::classMethod2MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
5238 #if ENABLE(Condition1)
5239     desc->Set(v8::String::NewSymbol("overloadedMethod1"), v8::FunctionTemplate::New(TestObjV8Internal::overloadedMethod1MethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 1));
5240 #endif // ENABLE(Condition1)
5241     if (RuntimeEnabledFeatures::featureNameEnabled())
5242         proto->Set(v8::String::NewSymbol("enabledAtRuntimeMethod"), v8::FunctionTemplate::New(TestObjV8Internal::enabledAtRuntimeMethodMethodCallback, v8Undefined(), defaultSignature, 1));
5243
5244     // Custom Signature 'domStringListFunction'
5245     const int domStringListFunctionArgc = 1;
5246     v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::wrapperTypeInfo, currentWorldType) };
5247     v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::New(desc, domStringListFunctionArgc, domStringListFunctionArgv);
5248     proto->Set(v8::String::NewSymbol("domStringListFunction"), v8::FunctionTemplate::New(TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(), domStringListFunctionSignature, 1));
5249
5250     // Custom Signature 'convert1'
5251     const int convert1Argc = 1;
5252     v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) };
5253     v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv);
5254     proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature, 1));
5255
5256     // Custom Signature 'convert2'
5257     const int convert2Argc = 1;
5258     v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8TestNode::wrapperTypeInfo, currentWorldType) };
5259     v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
5260     proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature, 1));
5261
5262     // Custom Signature 'svgPointMethod'
5263     const int svgPointMethodArgc = 2;
5264     v8::Handle<v8::FunctionTemplate> svgPointMethodArgv[svgPointMethodArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8SVGPoint::wrapperTypeInfo, currentWorldType), v8::Handle<v8::FunctionTemplate>() };
5265     v8::Handle<v8::Signature> svgPointMethodSignature = v8::Signature::New(desc, svgPointMethodArgc, svgPointMethodArgv);
5266     proto->Set(v8::String::NewSymbol("svgPointMethod"), v8::FunctionTemplate::New(TestObjV8Internal::svgPointMethodMethodCallback, v8Undefined(), svgPointMethodSignature, 2));
5267
5268     // Custom Signature 'variadicNodeMethod'
5269     const int variadicNodeMethodArgc = 2;
5270     v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperTypeInfo, currentWorldType), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::wrapperTypeInfo, currentWorldType) };
5271     v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(desc, variadicNodeMethodArgc, variadicNodeMethodArgv);
5272     proto->Set(v8::String::NewSymbol("variadicNodeMethod"), v8::FunctionTemplate::New(TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variadicNodeMethodSignature, 2));
5273     desc->Set(v8::String::NewSymbol("deprecatedStaticMethod"), v8::FunctionTemplate::New(TestObjV8Internal::deprecatedStaticMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
5274     desc->SetNativeDataProperty(v8::String::NewSymbol("staticReadOnlyLongAttr"), TestObjV8Internal::staticReadOnlyLongAttrAttributeGetterCallback, 0, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5275     desc->SetNativeDataProperty(v8::String::NewSymbol("staticStringAttr"), TestObjV8Internal::staticStringAttrAttributeGetterCallback, TestObjV8Internal::staticStringAttrAttributeSetterCallback, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5276     desc->SetNativeDataProperty(v8::String::NewSymbol("TestSubObj"), TestObjV8Internal::TestObjConstructorGetter, 0, v8::External::New(const_cast<WrapperTypeInfo*>(&V8TestSubObj::wrapperTypeInfo)), static_cast<v8::PropertyAttribute>(v8::DontEnum), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5277     desc->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticReadOnlyAttr"), TestObjV8Internal::deprecatedStaticReadOnlyAttrAttributeGetterCallback, 0, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5278     desc->SetNativeDataProperty(v8::String::NewSymbol("deprecatedStaticAttr"), TestObjV8Internal::deprecatedStaticAttrAttributeGetterCallback, TestObjV8Internal::deprecatedStaticAttrAttributeSetterCallback, v8::External::New(0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
5279
5280     // Custom toString template
5281     desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->toStringTemplate());
5282     return desc;
5283 }
5284
5285 v8::Handle<v8::FunctionTemplate> V8TestObject::GetTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
5286 {
5287     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
5288     V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
5289     if (result != data->templateMap(currentWorldType).end())
5290         return result->value.newLocal(isolate);
5291
5292     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
5293     v8::HandleScope handleScope(isolate);
5294     v8::Handle<v8::FunctionTemplate> templ =
5295         ConfigureV8TestObjectTemplate(data->rawTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
5296     data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
5297     return handleScope.Close(templ);
5298 }
5299
5300 bool V8TestObject::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
5301 {
5302     return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
5303 }
5304
5305 bool V8TestObject::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
5306 {
5307     return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
5308         || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
5309         || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
5310 }
5311
5312 void V8TestObject::installPerContextEnabledProperties(v8::Handle<v8::Object> instance, TestObj* impl, v8::Isolate* isolate)
5313 {
5314     v8::Local<v8::Object> proto = v8::Local<v8::Object>::Cast(instance->GetPrototype());
5315     if (ContextFeatures::featureNameEnabled(impl->document())) {
5316         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
5317         {"enabledPerContextAttr", TestObjV8Internal::enabledPerContextAttrAttributeGetterCallback, TestObjV8Internal::enabledPerContextAttrAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
5318         V8DOMConfiguration::installAttribute(instance, proto, attributeConfiguration, isolate);
5319     }
5320 }
5321
5322 void V8TestObject::installPerContextEnabledPrototypeProperties(v8::Handle<v8::Object> proto, v8::Isolate* isolate)
5323 {
5324     UNUSED_PARAM(proto);
5325     v8::Local<v8::Signature> defaultSignature = v8::Signature::New(GetTemplate(isolate, worldType(isolate)));
5326     UNUSED_PARAM(defaultSignature);
5327
5328     ExecutionContext* context = toExecutionContext(proto->CreationContext());
5329     if (context && context->isDocument() && ContextFeatures::featureNameEnabled(toDocument(context)))
5330         proto->Set(v8::String::NewSymbol("enabledPerContextMethod"), v8::FunctionTemplate::New(TestObjV8Internal::enabledPerContextMethodMethodCallback, v8Undefined(), defaultSignature, 1)->GetFunction());
5331 }
5332
5333 EventTarget* V8TestObject::toEventTarget(v8::Handle<v8::Object> object)
5334 {
5335     return toNative(object);
5336 }
5337
5338 v8::Handle<v8::Object> V8TestObject::createWrapper(PassRefPtr<TestObj> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
5339 {
5340     ASSERT(impl);
5341     ASSERT(!DOMDataStore::containsWrapper<V8TestObject>(impl.get(), isolate));
5342     if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
5343         const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
5344         // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
5345         // the same object de-ref functions, though, so use that as the basis of the check.
5346         RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction == wrapperTypeInfo.derefObjectFunction);
5347     }
5348
5349     v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate);
5350     if (UNLIKELY(wrapper.IsEmpty()))
5351         return wrapper;
5352
5353     installPerContextEnabledProperties(wrapper, impl.get(), isolate);
5354     V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
5355     return wrapper;
5356 }
5357
5358 void V8TestObject::derefObject(void* object)
5359 {
5360     fromInternalPointer(object)->deref();
5361 }
5362
5363 } // namespace WebCore