|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
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. |
|
9 |
|
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. |
|
14 |
|
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. |
|
19 */ |
|
20 |
|
21 #include "config.h" |
|
22 |
|
23 #if ENABLE(JAVASCRIPT_DEBUGGER) |
|
24 |
|
25 #include "JSJavaScriptCallFrame.h" |
|
26 |
|
27 #include "JSJavaScriptCallFrame.h" |
|
28 #include "JavaScriptCallFrame.h" |
|
29 #include "KURL.h" |
|
30 #include <runtime/Error.h> |
|
31 #include <runtime/JSNumberCell.h> |
|
32 #include <runtime/JSString.h> |
|
33 #include <wtf/GetPtr.h> |
|
34 |
|
35 using namespace JSC; |
|
36 |
|
37 namespace WebCore { |
|
38 |
|
39 ASSERT_CLASS_FITS_IN_CELL(JSJavaScriptCallFrame); |
|
40 |
|
41 /* Hash table */ |
|
42 #if ENABLE(JIT) |
|
43 #define THUNK_GENERATOR(generator) , generator |
|
44 #else |
|
45 #define THUNK_GENERATOR(generator) |
|
46 #endif |
|
47 |
|
48 static const HashTableValue JSJavaScriptCallFrameTableValues[8] = |
|
49 { |
|
50 { "caller", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameCaller), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
51 { "sourceID", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameSourceID), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
52 { "line", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameLine), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
53 { "scopeChain", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameScopeChain), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
54 { "thisObject", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameThisObject), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
55 { "functionName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameFunctionName), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
56 { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameType), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
57 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
58 }; |
|
59 |
|
60 #undef THUNK_GENERATOR |
|
61 static JSC_CONST_HASHTABLE HashTable JSJavaScriptCallFrameTable = { 17, 15, JSJavaScriptCallFrameTableValues, 0 }; |
|
62 /* Hash table for prototype */ |
|
63 #if ENABLE(JIT) |
|
64 #define THUNK_GENERATOR(generator) , generator |
|
65 #else |
|
66 #define THUNK_GENERATOR(generator) |
|
67 #endif |
|
68 |
|
69 static const HashTableValue JSJavaScriptCallFramePrototypeTableValues[8] = |
|
70 { |
|
71 { "GLOBAL_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameGLOBAL_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
72 { "LOCAL_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameLOCAL_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
73 { "WITH_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameWITH_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
74 { "CLOSURE_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameCLOSURE_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
75 { "CATCH_SCOPE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsJavaScriptCallFrameCATCH_SCOPE), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
76 { "evaluate", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsJavaScriptCallFramePrototypeFunctionEvaluate), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
77 { "scopeType", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsJavaScriptCallFramePrototypeFunctionScopeType), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
78 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
79 }; |
|
80 |
|
81 #undef THUNK_GENERATOR |
|
82 static JSC_CONST_HASHTABLE HashTable JSJavaScriptCallFramePrototypeTable = { 17, 15, JSJavaScriptCallFramePrototypeTableValues, 0 }; |
|
83 const ClassInfo JSJavaScriptCallFramePrototype::s_info = { "JavaScriptCallFramePrototype", 0, &JSJavaScriptCallFramePrototypeTable, 0 }; |
|
84 |
|
85 JSObject* JSJavaScriptCallFramePrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
86 { |
|
87 return getDOMPrototype<JSJavaScriptCallFrame>(exec, globalObject); |
|
88 } |
|
89 |
|
90 bool JSJavaScriptCallFramePrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
91 { |
|
92 return getStaticPropertySlot<JSJavaScriptCallFramePrototype, JSObject>(exec, &JSJavaScriptCallFramePrototypeTable, this, propertyName, slot); |
|
93 } |
|
94 |
|
95 bool JSJavaScriptCallFramePrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
96 { |
|
97 return getStaticPropertyDescriptor<JSJavaScriptCallFramePrototype, JSObject>(exec, &JSJavaScriptCallFramePrototypeTable, this, propertyName, descriptor); |
|
98 } |
|
99 |
|
100 const ClassInfo JSJavaScriptCallFrame::s_info = { "JavaScriptCallFrame", 0, &JSJavaScriptCallFrameTable, 0 }; |
|
101 |
|
102 JSJavaScriptCallFrame::JSJavaScriptCallFrame(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<JavaScriptCallFrame> impl) |
|
103 : DOMObjectWithGlobalPointer(structure, globalObject) |
|
104 , m_impl(impl) |
|
105 { |
|
106 } |
|
107 |
|
108 JSJavaScriptCallFrame::~JSJavaScriptCallFrame() |
|
109 { |
|
110 forgetDOMObject(this, impl()); |
|
111 } |
|
112 |
|
113 JSObject* JSJavaScriptCallFrame::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
114 { |
|
115 return new (exec) JSJavaScriptCallFramePrototype(globalObject, JSJavaScriptCallFramePrototype::createStructure(globalObject->objectPrototype())); |
|
116 } |
|
117 |
|
118 bool JSJavaScriptCallFrame::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
119 { |
|
120 return getStaticValueSlot<JSJavaScriptCallFrame, Base>(exec, &JSJavaScriptCallFrameTable, this, propertyName, slot); |
|
121 } |
|
122 |
|
123 bool JSJavaScriptCallFrame::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
124 { |
|
125 return getStaticValueDescriptor<JSJavaScriptCallFrame, Base>(exec, &JSJavaScriptCallFrameTable, this, propertyName, descriptor); |
|
126 } |
|
127 |
|
128 JSValue jsJavaScriptCallFrameCaller(ExecState* exec, JSValue slotBase, const Identifier&) |
|
129 { |
|
130 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase)); |
|
131 UNUSED_PARAM(exec); |
|
132 JavaScriptCallFrame* imp = static_cast<JavaScriptCallFrame*>(castedThis->impl()); |
|
133 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->caller())); |
|
134 return result; |
|
135 } |
|
136 |
|
137 JSValue jsJavaScriptCallFrameSourceID(ExecState* exec, JSValue slotBase, const Identifier&) |
|
138 { |
|
139 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase)); |
|
140 UNUSED_PARAM(exec); |
|
141 JavaScriptCallFrame* imp = static_cast<JavaScriptCallFrame*>(castedThis->impl()); |
|
142 JSValue result = jsNumber(exec, imp->sourceID()); |
|
143 return result; |
|
144 } |
|
145 |
|
146 JSValue jsJavaScriptCallFrameLine(ExecState* exec, JSValue slotBase, const Identifier&) |
|
147 { |
|
148 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase)); |
|
149 UNUSED_PARAM(exec); |
|
150 JavaScriptCallFrame* imp = static_cast<JavaScriptCallFrame*>(castedThis->impl()); |
|
151 JSValue result = jsNumber(exec, imp->line()); |
|
152 return result; |
|
153 } |
|
154 |
|
155 JSValue jsJavaScriptCallFrameScopeChain(ExecState* exec, JSValue slotBase, const Identifier&) |
|
156 { |
|
157 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase)); |
|
158 return castedThis->scopeChain(exec); |
|
159 } |
|
160 |
|
161 JSValue jsJavaScriptCallFrameThisObject(ExecState* exec, JSValue slotBase, const Identifier&) |
|
162 { |
|
163 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase)); |
|
164 return castedThis->thisObject(exec); |
|
165 } |
|
166 |
|
167 JSValue jsJavaScriptCallFrameFunctionName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
168 { |
|
169 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase)); |
|
170 UNUSED_PARAM(exec); |
|
171 JavaScriptCallFrame* imp = static_cast<JavaScriptCallFrame*>(castedThis->impl()); |
|
172 JSValue result = jsString(exec, imp->functionName()); |
|
173 return result; |
|
174 } |
|
175 |
|
176 JSValue jsJavaScriptCallFrameType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
177 { |
|
178 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(slotBase)); |
|
179 return castedThis->type(exec); |
|
180 } |
|
181 |
|
182 EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionEvaluate(ExecState* exec) |
|
183 { |
|
184 JSValue thisValue = exec->hostThisValue(); |
|
185 if (!thisValue.inherits(&JSJavaScriptCallFrame::s_info)) |
|
186 return throwVMTypeError(exec); |
|
187 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(thisValue)); |
|
188 return JSValue::encode(castedThis->evaluate(exec)); |
|
189 } |
|
190 |
|
191 EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionScopeType(ExecState* exec) |
|
192 { |
|
193 JSValue thisValue = exec->hostThisValue(); |
|
194 if (!thisValue.inherits(&JSJavaScriptCallFrame::s_info)) |
|
195 return throwVMTypeError(exec); |
|
196 JSJavaScriptCallFrame* castedThis = static_cast<JSJavaScriptCallFrame*>(asObject(thisValue)); |
|
197 return JSValue::encode(castedThis->scopeType(exec)); |
|
198 } |
|
199 |
|
200 // Constant getters |
|
201 |
|
202 JSValue jsJavaScriptCallFrameGLOBAL_SCOPE(ExecState* exec, JSValue, const Identifier&) |
|
203 { |
|
204 return jsNumber(exec, static_cast<int>(0)); |
|
205 } |
|
206 |
|
207 JSValue jsJavaScriptCallFrameLOCAL_SCOPE(ExecState* exec, JSValue, const Identifier&) |
|
208 { |
|
209 return jsNumber(exec, static_cast<int>(1)); |
|
210 } |
|
211 |
|
212 JSValue jsJavaScriptCallFrameWITH_SCOPE(ExecState* exec, JSValue, const Identifier&) |
|
213 { |
|
214 return jsNumber(exec, static_cast<int>(2)); |
|
215 } |
|
216 |
|
217 JSValue jsJavaScriptCallFrameCLOSURE_SCOPE(ExecState* exec, JSValue, const Identifier&) |
|
218 { |
|
219 return jsNumber(exec, static_cast<int>(3)); |
|
220 } |
|
221 |
|
222 JSValue jsJavaScriptCallFrameCATCH_SCOPE(ExecState* exec, JSValue, const Identifier&) |
|
223 { |
|
224 return jsNumber(exec, static_cast<int>(4)); |
|
225 } |
|
226 |
|
227 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, JavaScriptCallFrame* object) |
|
228 { |
|
229 return getDOMObjectWrapper<JSJavaScriptCallFrame>(exec, globalObject, object); |
|
230 } |
|
231 JavaScriptCallFrame* toJavaScriptCallFrame(JSC::JSValue value) |
|
232 { |
|
233 return value.inherits(&JSJavaScriptCallFrame::s_info) ? static_cast<JSJavaScriptCallFrame*>(asObject(value))->impl() : 0; |
|
234 } |
|
235 |
|
236 } |
|
237 |
|
238 #endif // ENABLE(JAVASCRIPT_DEBUGGER) |