181 CallFrame* callFrame = exec;
182 String functionName;
183 if (exec->callee()) {
184 if (asObject(exec->callee())->inherits(&InternalFunction::s_info)) {
185 functionName = asInternalFunction(exec->callee())->name(exec);
186 builder.appendLiteral("#0 ");
187 builder.append(functionName);
188 builder.appendLiteral("() ");
189 count++;
190 }
191 }
192 while (true) {
193 RELEASE_ASSERT(callFrame);
194 int signedLineNumber;
195 intptr_t sourceID;
196 String urlString;
197 JSValue function;
198
199 exec->interpreter()->retrieveLastCaller(callFrame, signedLineNumber, sourceID, urlString, function);
200
201 if (function)
202 functionName = jsCast<JSFunction*>(function)->name(exec);
203 else {
204 // Caller is unknown, but if frame is empty we should still add the frame, because
205 // something called us, and gave us arguments.
206 if (count)
207 break;
208 }
209 unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0;
181 Vector<StackFrame> stackTrace;
182 exec->interpreter()->getStackTrace(stackTrace, maxStackSize);
183 for (Vector<StackFrame>::const_iterator iter = stackTrace.begin(); iter < stackTrace.end(); iter++) {