#ifndef V8_DEBUG_DEBUG_TYPE_PROFILE_H_
#define V8_DEBUG_DEBUG_TYPE_PROFILE_H_
#include <memory>
#include <vector>
#include "src/debug/debug-interface.h"
#include "src/handles/handles.h"
#include "src/objects/objects.h"
namespace v8 {
namespace internal {
class Isolate;
struct TypeProfileEntry {
explicit TypeProfileEntry(
int pos, std::vector<v8::internal::Handle<internal::String>> t)
: position(pos), types(std::move(t)) {}
int position;
std::vector<v8::internal::Handle<internal::String>> types;
};
struct TypeProfileScript {
explicit TypeProfileScript(Handle<Script> s) : script(s) {}
Handle<Script> script;
std::vector<TypeProfileEntry> entries;
};
class TypeProfile : public std::vector<TypeProfileScript> {
public:
static std::unique_ptr<TypeProfile> Collect(Isolate* isolate);
static void SelectMode(Isolate* isolate, debug::TypeProfileMode mode);
private:
TypeProfile() = default;
};
}
}
#endif