#ifndef ProfileGenerator_h
#define ProfileGenerator_h
+#include "Profile.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
namespace JSC {
- class CallIdentifier;
class ExecState;
+ class JSGlobalObject;
class Profile;
class ProfileNode;
class UString;
+ struct CallIdentifier;
class ProfileGenerator : public RefCounted<ProfileGenerator> {
public:
- static PassRefPtr<ProfileGenerator> create(const UString& title, ExecState* originatingExec, unsigned uid);
+ static PassRefPtr<ProfileGenerator> create(ExecState*, const UString& title, unsigned uid);
// Members
const UString& title() const;
PassRefPtr<Profile> profile() const { return m_profile; }
- ExecState* originatingGlobalExec() const { return m_originatingGlobalExec; }
+ JSGlobalObject* origin() const { return m_origin; }
unsigned profileGroup() const { return m_profileGroup; }
// Collecting
- void willExecute(const CallIdentifier&);
- void didExecute(const CallIdentifier&);
+ void willExecute(ExecState* callerCallFrame, const CallIdentifier&);
+ void didExecute(ExecState* callerCallFrame, const CallIdentifier&);
+
+ void exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&);
// Stopping Profiling
void stopProfiling();
- typedef void (ProfileGenerator::*ProfileFunction)(const CallIdentifier& callIdentifier);
+ typedef void (ProfileGenerator::*ProfileFunction)(ExecState* callerOrHandlerCallFrame, const CallIdentifier& callIdentifier);
private:
- ProfileGenerator(const UString& title, ExecState* originatingExec, unsigned uid);
+ ProfileGenerator(ExecState*, const UString& title, unsigned uid);
void addParentForConsoleStart(ExecState*);
void removeProfileStart();
void removeProfileEnd();
RefPtr<Profile> m_profile;
- ExecState* m_originatingGlobalExec;
+ JSGlobalObject* m_origin;
unsigned m_profileGroup;
RefPtr<ProfileNode> m_head;
RefPtr<ProfileNode> m_currentNode;