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.
23 #if ENABLE(JAVASCRIPT_DEBUGGER)
25 #include "JSJavaScriptCallFrame.h"
27 #include "JSJavaScriptCallFrame.h"
28 #include "JavaScriptCallFrame.h"
30 #include <runtime/Error.h>
31 #include <runtime/JSString.h>
32 #include <wtf/GetPtr.h>
38 ASSERT_CLASS_FITS_IN_CELL(JSJavaScriptCallFrame);
42 #define THUNK_GENERATOR(generator) , generator
44 #define THUNK_GENERATOR(generator)
47 #define INTRINSIC(intrinsic) , intrinsic
49 #define INTRINSIC(intrinsic)
52 static const HashTableValue JSJavaScriptCallFrameTableValues[] =
54 { "caller", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameCaller), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
55 { "sourceID", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameSourceID), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56 { "line", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameLine), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
57 { "column", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameColumn), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58 { "scopeChain", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameScopeChain), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59 { "thisObject", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameThisObject), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60 { "functionName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameFunctionName), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61 { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameType), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
62 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
65 #undef THUNK_GENERATOR
66 static const HashTable JSJavaScriptCallFrameTable = { 17, 15, JSJavaScriptCallFrameTableValues, 0 };
67 /* Hash table for prototype */
69 #define THUNK_GENERATOR(generator) , generator
71 #define THUNK_GENERATOR(generator)
74 #define INTRINSIC(intrinsic) , intrinsic
76 #define INTRINSIC(intrinsic)
79 static const HashTableValue JSJavaScriptCallFramePrototypeTableValues[] =
81 { "GLOBAL_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameGLOBAL_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
82 { "LOCAL_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameLOCAL_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
83 { "WITH_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameWITH_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
84 { "CLOSURE_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameCLOSURE_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
85 { "CATCH_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameCATCH_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
86 { "evaluate", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsJavaScriptCallFramePrototypeFunctionEvaluate), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
87 { "scopeType", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsJavaScriptCallFramePrototypeFunctionScopeType), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
88 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
91 #undef THUNK_GENERATOR
92 static const HashTable JSJavaScriptCallFramePrototypeTable = { 17, 15, JSJavaScriptCallFramePrototypeTableValues, 0 };
93 const ClassInfo JSJavaScriptCallFramePrototype::s_info = { "JavaScriptCallFramePrototype", &JSC::JSNonFinalObject::s_info, &JSJavaScriptCallFramePrototypeTable, 0, CREATE_METHOD_TABLE(JSJavaScriptCallFramePrototype) };
95 JSObject* JSJavaScriptCallFramePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
97 return getDOMPrototype<JSJavaScriptCallFrame>(exec, globalObject);
100 bool JSJavaScriptCallFramePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
102 JSJavaScriptCallFramePrototype* thisObject = jsCast<JSJavaScriptCallFramePrototype*>(cell);
103 return getStaticPropertySlot<JSJavaScriptCallFramePrototype, JSObject>(exec, &JSJavaScriptCallFramePrototypeTable, thisObject, propertyName, slot);
106 bool JSJavaScriptCallFramePrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
108 JSJavaScriptCallFramePrototype* thisObject = jsCast<JSJavaScriptCallFramePrototype*>(object);
109 return getStaticPropertyDescriptor<JSJavaScriptCallFramePrototype, JSObject>(exec, &JSJavaScriptCallFramePrototypeTable, thisObject, propertyName, descriptor);
112 const ClassInfo JSJavaScriptCallFrame::s_info = { "JavaScriptCallFrame", &JSDOMWrapper::s_info, &JSJavaScriptCallFrameTable, 0 , CREATE_METHOD_TABLE(JSJavaScriptCallFrame) };
114 JSJavaScriptCallFrame::JSJavaScriptCallFrame(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<JavaScriptCallFrame> impl)
115 : JSDOMWrapper(structure, globalObject)
116 , m_impl(impl.leakRef())
120 void JSJavaScriptCallFrame::finishCreation(JSGlobalData& globalData)
122 Base::finishCreation(globalData);
123 ASSERT(inherits(&s_info));
126 JSObject* JSJavaScriptCallFrame::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
128 return JSJavaScriptCallFramePrototype::create(exec->globalData(), globalObject, JSJavaScriptCallFramePrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
131 bool JSJavaScriptCallFrame::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
133 JSJavaScriptCallFrame* thisObject = jsCast<JSJavaScriptCallFrame*>(cell);
134 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
135 return getStaticValueSlot<JSJavaScriptCallFrame, Base>(exec, &JSJavaScriptCallFrameTable, thisObject, propertyName, slot);
138 bool JSJavaScriptCallFrame::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
140 JSJavaScriptCallFrame* thisObject = jsCast<JSJavaScriptCallFrame*>(object);
141 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
142 return getStaticValueDescriptor<JSJavaScriptCallFrame, Base>(exec, &JSJavaScriptCallFrameTable, thisObject, propertyName, descriptor);
145 JSValue jsJavaScriptCallFrameCaller(ExecState* exec, JSValue slotBase, const Identifier&)
147 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase));
149 JavaScriptCallFrame* imp = static_cast<JavaScriptCallFrame*>(castedThis->impl());
150 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->caller()));
155 JSValue jsJavaScriptCallFrameSourceID(ExecState* exec, JSValue slotBase, const Identifier&)
157 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase));
159 JavaScriptCallFrame* imp = static_cast<JavaScriptCallFrame*>(castedThis->impl());
160 JSValue result = jsNumber(imp->sourceID());
165 JSValue jsJavaScriptCallFrameLine(ExecState* exec, JSValue slotBase, const Identifier&)
167 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase));
169 JavaScriptCallFrame* imp = static_cast<JavaScriptCallFrame*>(castedThis->impl());
170 JSValue result = jsNumber(imp->line());
175 JSValue jsJavaScriptCallFrameColumn(ExecState* exec, JSValue slotBase, const Identifier&)
177 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase));
179 JavaScriptCallFrame* imp = static_cast<JavaScriptCallFrame*>(castedThis->impl());
180 JSValue result = jsNumber(imp->column());
185 JSValue jsJavaScriptCallFrameScopeChain(ExecState* exec, JSValue slotBase, const Identifier&)
187 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase));
188 return castedThis->scopeChain(exec);
192 JSValue jsJavaScriptCallFrameThisObject(ExecState* exec, JSValue slotBase, const Identifier&)
194 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase));
195 return castedThis->thisObject(exec);
199 JSValue jsJavaScriptCallFrameFunctionName(ExecState* exec, JSValue slotBase, const Identifier&)
201 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase));
203 JavaScriptCallFrame* imp = static_cast<JavaScriptCallFrame*>(castedThis->impl());
204 JSValue result = jsString(exec, imp->functionName());
209 JSValue jsJavaScriptCallFrameType(ExecState* exec, JSValue slotBase, const Identifier&)
211 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase));
212 return castedThis->type(exec);
216 EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionEvaluate(ExecState* exec)
218 JSValue thisValue = exec->hostThisValue();
219 if (!thisValue.inherits(&JSJavaScriptCallFrame::s_info))
220 return throwVMTypeError(exec);
221 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(thisValue));
222 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSJavaScriptCallFrame::s_info);
223 return JSValue::encode(castedThis->evaluate(exec));
226 EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionScopeType(ExecState* exec)
228 JSValue thisValue = exec->hostThisValue();
229 if (!thisValue.inherits(&JSJavaScriptCallFrame::s_info))
230 return throwVMTypeError(exec);
231 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(thisValue));
232 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSJavaScriptCallFrame::s_info);
233 return JSValue::encode(castedThis->scopeType(exec));
238 JSValue jsJavaScriptCallFrameGLOBAL_SCOPE(ExecState* exec, JSValue, const Identifier&)
241 return jsNumber(static_cast<int>(0));
244 JSValue jsJavaScriptCallFrameLOCAL_SCOPE(ExecState* exec, JSValue, const Identifier&)
247 return jsNumber(static_cast<int>(1));
250 JSValue jsJavaScriptCallFrameWITH_SCOPE(ExecState* exec, JSValue, const Identifier&)
253 return jsNumber(static_cast<int>(2));
256 JSValue jsJavaScriptCallFrameCLOSURE_SCOPE(ExecState* exec, JSValue, const Identifier&)
259 return jsNumber(static_cast<int>(3));
262 JSValue jsJavaScriptCallFrameCATCH_SCOPE(ExecState* exec, JSValue, const Identifier&)
265 return jsNumber(static_cast<int>(4));
268 static inline bool isObservable(JSJavaScriptCallFrame* jsJavaScriptCallFrame)
270 if (jsJavaScriptCallFrame->hasCustomProperties())
275 bool JSJavaScriptCallFrameOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
277 JSJavaScriptCallFrame* jsJavaScriptCallFrame = static_cast<JSJavaScriptCallFrame*>(handle.get().asCell());
278 if (!isObservable(jsJavaScriptCallFrame))
280 UNUSED_PARAM(visitor);
284 void JSJavaScriptCallFrameOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
286 JSJavaScriptCallFrame* jsJavaScriptCallFrame = static_cast<JSJavaScriptCallFrame*>(handle.get().asCell());
287 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
288 uncacheWrapper(world, jsJavaScriptCallFrame->impl(), jsJavaScriptCallFrame);
289 jsJavaScriptCallFrame->releaseImpl();
292 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JavaScriptCallFrame* impl)
294 return wrap<JSJavaScriptCallFrame>(exec, globalObject, impl);
297 JavaScriptCallFrame* toJavaScriptCallFrame(JSC::JSValue value)
299 return value.inherits(&JSJavaScriptCallFrame::s_info) ? static_cast<JSJavaScriptCallFrame*>(asObject(value))->impl() : 0;
304 #endif // ENABLE(JAVASCRIPT_DEBUGGER)