2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
22 #include "JSCounter.h"
26 #include <runtime/JSString.h>
27 #include <wtf/GetPtr.h>
33 ASSERT_CLASS_FITS_IN_CELL(JSCounter);
37 #define THUNK_GENERATOR(generator) , generator
39 #define THUNK_GENERATOR(generator)
42 #define INTRINSIC(intrinsic) , intrinsic
44 #define INTRINSIC(intrinsic)
47 static const HashTableValue JSCounterTableValues[] =
49 { "identifier", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCounterIdentifier), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
50 { "listStyle", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCounterListStyle), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
51 { "separator", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCounterSeparator), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCounterConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
56 #undef THUNK_GENERATOR
57 static const HashTable JSCounterTable = { 9, 7, JSCounterTableValues, 0 };
58 /* Hash table for constructor */
60 #define THUNK_GENERATOR(generator) , generator
62 #define THUNK_GENERATOR(generator)
65 #define INTRINSIC(intrinsic) , intrinsic
67 #define INTRINSIC(intrinsic)
70 static const HashTableValue JSCounterConstructorTableValues[] =
72 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
75 #undef THUNK_GENERATOR
76 static const HashTable JSCounterConstructorTable = { 1, 0, JSCounterConstructorTableValues, 0 };
77 const ClassInfo JSCounterConstructor::s_info = { "CounterConstructor", &DOMConstructorObject::s_info, &JSCounterConstructorTable, 0, CREATE_METHOD_TABLE(JSCounterConstructor) };
79 JSCounterConstructor::JSCounterConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
80 : DOMConstructorObject(structure, globalObject)
84 void JSCounterConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
86 Base::finishCreation(exec->globalData());
87 ASSERT(inherits(&s_info));
88 putDirect(exec->globalData(), exec->propertyNames().prototype, JSCounterPrototype::self(exec, globalObject), DontDelete | ReadOnly);
91 bool JSCounterConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
93 return getStaticValueSlot<JSCounterConstructor, JSDOMWrapper>(exec, &JSCounterConstructorTable, static_cast<JSCounterConstructor*>(cell), propertyName, slot);
96 bool JSCounterConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
98 return getStaticValueDescriptor<JSCounterConstructor, JSDOMWrapper>(exec, &JSCounterConstructorTable, static_cast<JSCounterConstructor*>(object), propertyName, descriptor);
101 /* Hash table for prototype */
103 #define THUNK_GENERATOR(generator) , generator
105 #define THUNK_GENERATOR(generator)
108 #define INTRINSIC(intrinsic) , intrinsic
110 #define INTRINSIC(intrinsic)
113 static const HashTableValue JSCounterPrototypeTableValues[] =
115 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
118 #undef THUNK_GENERATOR
119 static const HashTable JSCounterPrototypeTable = { 1, 0, JSCounterPrototypeTableValues, 0 };
120 const ClassInfo JSCounterPrototype::s_info = { "CounterPrototype", &JSC::JSNonFinalObject::s_info, &JSCounterPrototypeTable, 0, CREATE_METHOD_TABLE(JSCounterPrototype) };
122 JSObject* JSCounterPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
124 return getDOMPrototype<JSCounter>(exec, globalObject);
127 const ClassInfo JSCounter::s_info = { "Counter", &JSDOMWrapper::s_info, &JSCounterTable, 0 , CREATE_METHOD_TABLE(JSCounter) };
129 JSCounter::JSCounter(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Counter> impl)
130 : JSDOMWrapper(structure, globalObject)
131 , m_impl(impl.leakRef())
135 void JSCounter::finishCreation(JSGlobalData& globalData)
137 Base::finishCreation(globalData);
138 ASSERT(inherits(&s_info));
141 JSObject* JSCounter::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
143 return JSCounterPrototype::create(exec->globalData(), globalObject, JSCounterPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
146 bool JSCounter::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
148 JSCounter* thisObject = jsCast<JSCounter*>(cell);
149 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
150 return getStaticValueSlot<JSCounter, Base>(exec, &JSCounterTable, thisObject, propertyName, slot);
153 bool JSCounter::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
155 JSCounter* thisObject = jsCast<JSCounter*>(object);
156 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
157 return getStaticValueDescriptor<JSCounter, Base>(exec, &JSCounterTable, thisObject, propertyName, descriptor);
160 JSValue jsCounterIdentifier(ExecState* exec, JSValue slotBase, const Identifier&)
162 JSCounter* castedThis = static_cast<JSCounter*>(asObject(slotBase));
164 Counter* imp = static_cast<Counter*>(castedThis->impl());
165 JSValue result = jsString(exec, imp->identifier());
170 JSValue jsCounterListStyle(ExecState* exec, JSValue slotBase, const Identifier&)
172 JSCounter* castedThis = static_cast<JSCounter*>(asObject(slotBase));
174 Counter* imp = static_cast<Counter*>(castedThis->impl());
175 JSValue result = jsString(exec, imp->listStyle());
180 JSValue jsCounterSeparator(ExecState* exec, JSValue slotBase, const Identifier&)
182 JSCounter* castedThis = static_cast<JSCounter*>(asObject(slotBase));
184 Counter* imp = static_cast<Counter*>(castedThis->impl());
185 JSValue result = jsString(exec, imp->separator());
190 JSValue jsCounterConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
192 JSCounter* domObject = static_cast<JSCounter*>(asObject(slotBase));
193 return JSCounter::getConstructor(exec, domObject->globalObject());
196 JSValue JSCounter::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
198 return getDOMConstructor<JSCounterConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
201 static inline bool isObservable(JSCounter* jsCounter)
203 if (jsCounter->hasCustomProperties())
208 bool JSCounterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
210 JSCounter* jsCounter = static_cast<JSCounter*>(handle.get().asCell());
211 if (!isObservable(jsCounter))
213 UNUSED_PARAM(visitor);
217 void JSCounterOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
219 JSCounter* jsCounter = static_cast<JSCounter*>(handle.get().asCell());
220 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
221 uncacheWrapper(world, jsCounter->impl(), jsCounter);
222 jsCounter->releaseImpl();
225 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Counter* impl)
227 return wrap<JSCounter>(exec, globalObject, impl);
230 Counter* toCounter(JSC::JSValue value)
232 return value.inherits(&JSCounter::s_info) ? static_cast<JSCounter*>(asObject(value))->impl() : 0;