ProfilerCompilation.h [plain text]
#pragma once
#include "ExitKind.h"
#include "JSCJSValue.h"
#include "ProfilerCompilationKind.h"
#include "ProfilerCompiledBytecode.h"
#include "ProfilerExecutionCounter.h"
#include "ProfilerJettisonReason.h"
#include "ProfilerOSRExit.h"
#include "ProfilerOSRExitSite.h"
#include "ProfilerOriginStack.h"
#include "ProfilerProfiledBytecodes.h"
#include "ProfilerUID.h"
#include <wtf/RefCounted.h>
#include <wtf/SegmentedVector.h>
namespace JSC {
class FireDetail;
namespace Profiler {
class Bytecodes;
class Database;
class Compilation : public RefCounted<Compilation> {
public:
Compilation(Bytecodes*, CompilationKind);
~Compilation();
void addProfiledBytecodes(Database&, CodeBlock*);
unsigned profiledBytecodesSize() const { return m_profiledBytecodes.size(); }
const ProfiledBytecodes& profiledBytecodesAt(unsigned i) const { return m_profiledBytecodes[i]; }
void noticeInlinedGetById() { m_numInlinedGetByIds++; }
void noticeInlinedPutById() { m_numInlinedPutByIds++; }
void noticeInlinedCall() { m_numInlinedCalls++; }
Bytecodes* bytecodes() const { return m_bytecodes; }
CompilationKind kind() const { return m_kind; }
void addDescription(const CompiledBytecode&);
void addDescription(const OriginStack&, const CString& description);
ExecutionCounter* executionCounterFor(const OriginStack&);
void addOSRExitSite(const Vector<const void*>& codeAddresses);
OSRExit* addOSRExit(unsigned id, const OriginStack&, ExitKind, bool isWatchpoint);
void setJettisonReason(JettisonReason, const FireDetail*);
UID uid() const { return m_uid; }
void dump(PrintStream&) const;
JSValue toJS(ExecState*) const;
private:
Bytecodes* m_bytecodes;
CompilationKind m_kind;
JettisonReason m_jettisonReason;
CString m_additionalJettisonReason;
Vector<ProfiledBytecodes> m_profiledBytecodes;
Vector<CompiledBytecode> m_descriptions;
HashMap<OriginStack, std::unique_ptr<ExecutionCounter>> m_counters;
Vector<OSRExitSite> m_osrExitSites;
SegmentedVector<OSRExit> m_osrExits;
unsigned m_numInlinedGetByIds;
unsigned m_numInlinedPutByIds;
unsigned m_numInlinedCalls;
UID m_uid;
};
} }