StackVisitor::Status operator()(StackVisitor& visitor) { if (visitor->callFrame() == m_callFrame) { m_callerFrame = visitor->callerFrame(); return StackVisitor::Done; } return StackVisitor::Continue; }
StackVisitor::Status operator()(StackVisitor& visitor) { JSObject* callee = visitor->callee(); if (callee != m_targetCallee) return StackVisitor::Continue; m_result = JSValue(visitor->createArguments()); return StackVisitor::Done; }
StackVisitor::Status operator()(StackVisitor& visitor) { if (!m_hasSkippedFirstFrame) { m_hasSkippedFirstFrame = true; return StackVisitor::Continue; } unsigned line = 0; unsigned unusedColumn = 0; visitor->computeLineAndColumn(line, unusedColumn); m_line = line; m_url = visitor->sourceURL(); return StackVisitor::Done; }
StackVisitor::Status operator()(StackVisitor& visitor) { if (!m_foundStartCallFrame && (visitor->callFrame() == m_startCallFrame)) m_foundStartCallFrame = true; if (m_foundStartCallFrame) { if (visitor->callFrame()->codeBlock()) { m_foundCallFrame = visitor->callFrame(); return StackVisitor::Done; } m_index++; } return StackVisitor::Continue; }
StackVisitor::Status operator()(StackVisitor& visitor) { if (m_currentFrame++ > 1) { m_jitType = visitor->codeBlock()->jitType(); return StackVisitor::Done; } return StackVisitor::Continue; }
StackVisitor::Status operator()(StackVisitor& visitor) const { if (m_remainingCapacityForFrameCapture) { // If callee is unknown, but we've not added any frame yet, we should // still add the frame, because something called us, and gave us arguments. JSObject* callee = visitor->callee(); if (!callee && visitor->index()) return StackVisitor::Done; StringBuilder& builder = m_builder; if (!builder.isEmpty()) builder.append('\n'); builder.append('#'); builder.appendNumber(visitor->index()); builder.append(' '); builder.append(visitor->functionName()); builder.appendLiteral("() at "); builder.append(visitor->sourceURL()); if (visitor->isJSFrame()) { builder.append(':'); unsigned lineNumber; unsigned unusedColumn; visitor->computeLineAndColumn(lineNumber, unusedColumn); builder.appendNumber(lineNumber); } if (!callee) return StackVisitor::Done; m_remainingCapacityForFrameCapture--; return StackVisitor::Continue; } return StackVisitor::Done; }
StackVisitor::Status operator()(StackVisitor& visitor) { currentFrame++; if (currentFrame == targetFrame) { codeBlock = visitor->codeBlock(); return StackVisitor::Done; } return StackVisitor::Continue; }
StackVisitor::Status operator()(StackVisitor& visitor) { m_currentFrame++; if (m_currentFrame > m_framesToSkip) visitor->print(2); if (m_action == PrintOne && m_currentFrame > m_framesToSkip) return StackVisitor::Done; return StackVisitor::Continue; }
StackVisitor::Status operator()(StackVisitor& visitor) { if (m_needToSkipAFrame) { m_needToSkipAFrame = false; return StackVisitor::Continue; } if (m_remainingCapacityForFrameCapture) { unsigned line; unsigned column; visitor->computeLineAndColumn(line, column); m_frames.append(ScriptCallFrame(visitor->functionName(), visitor->sourceURL(), line, column)); m_remainingCapacityForFrameCapture--; return StackVisitor::Continue; } return StackVisitor::Done; }
StackVisitor::Status operator()(StackVisitor& visitor) { if (!m_hasSkippedFirstFrame) { m_hasSkippedFirstFrame = true; return StackVisitor::Continue; } if (m_object->allowsAccessFrom(visitor->callFrame())) m_result = JSValue::encode(m_object->prototype()); return StackVisitor::Done; }
StackVisitor::Status operator()(StackVisitor& visitor) const { m_currentFrame++; if (m_currentFrame > m_framesToSkip) { visitor->dump(WTF::dataFile(), Indenter(2), [&] (PrintStream& out) { out.print("[", (m_currentFrame - m_framesToSkip - 1), "] "); }); } if (m_action == PrintOne && m_currentFrame > m_framesToSkip) return StackVisitor::Done; return StackVisitor::Continue; }
StackVisitor::Status operator()(StackVisitor& visitor) { if (!m_hasSkippedFirstFrame) { m_hasSkippedFirstFrame = true; return StackVisitor::Continue; } unsigned line = 0; unsigned column = 0; visitor->computeLineAndColumn(line, column); m_currentNode = ProfileNode::create(m_exec, LegacyProfiler::createCallIdentifier(m_exec, visitor->callee(), visitor->sourceURL(), line, column), m_head.get(), m_head.get()); m_head->insertNode(m_currentNode.get()); m_foundParent = true; return StackVisitor::Done; }
StackVisitor::Status operator()(StackVisitor& visitor) { if (!m_hasSkippedFirstFrame) { m_hasSkippedFirstFrame = true; return StackVisitor::Continue; } unsigned line = 0; unsigned column = 0; visitor->computeLineAndColumn(line, column); m_currentNode = ProfileNode::create(m_exec, LegacyProfiler::createCallIdentifier(m_exec, visitor->callee(), visitor->sourceURL(), line, column), m_rootNode.get()); // Assume that profile times are relative to when the |console.profile| command is evaluated. // This matches the logic in JSStartProfiling() and InspectorTimelineAgent::startFromConsole(). m_currentNode->appendCall(ProfileNode::Call(0.0)); m_rootNode->spliceNode(m_currentNode.get()); m_foundParent = true; return StackVisitor::Done; }
StackVisitor::Status operator()(StackVisitor& visitor) { JSObject* callee = visitor->callee(); if (callee && callee->inherits(JSBoundFunction::info())) return StackVisitor::Continue; if (!m_hasFoundFrame && (callee != m_targetCallee)) return StackVisitor::Continue; m_hasFoundFrame = true; if (!m_hasSkippedToCallerFrame) { m_hasSkippedToCallerFrame = true; return StackVisitor::Continue; } if (callee) m_result = callee; return StackVisitor::Done; }
StackVisitor::Status operator()(StackVisitor& visitor) { m_trace.append(String::format(" %zu %s\n", visitor->index(), visitor->toString().utf8().data())); return StackVisitor::Continue; }
StackVisitor::Status operator()(StackVisitor& visitor) { visitor->print(2); return m_action == PrintAll ? StackVisitor::Continue : StackVisitor::Done; }
StackVisitor::Status operator()(StackVisitor& visitor) { visitor->computeLineAndColumn(m_line, m_column); return StackVisitor::Done; }