#include "src/api/api-inl.h"
#include "src/builtins/builtins-utils-inl.h"
#include "src/builtins/builtins.h"
#include "src/heap/heap-inl.h"
#include "src/json/json-stringifier.h"
#include "src/logging/counters.h"
#include "src/objects/objects-inl.h"
#include "src/tracing/traced-value.h"
#if defined(V8_USE_PERFETTO)
#include "protos/perfetto/trace/track_event/debug_annotation.pbzero.h"
#endif
namespace v8 {
namespace internal {
namespace {
#define MAX_STACK_LENGTH …
class MaybeUtf8 { … };
#if !defined(V8_USE_PERFETTO)
class JsonTraceValue : public ConvertableToTraceFormat {
public:
explicit JsonTraceValue(Isolate* isolate, Handle<String> object) {
MaybeUtf8 data(isolate, object);
data_ = *data;
}
void AppendAsTraceFormat(std::string* out) const override { *out += data_; }
private:
std::string data_;
};
const uint8_t* GetCategoryGroupEnabled(Isolate* isolate,
Handle<String> string) {
MaybeUtf8 category(isolate, string);
return TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(*category);
}
#endif
#undef MAX_STACK_LENGTH
}
BUILTIN(IsTraceCategoryEnabled) { … }
BUILTIN(Trace) { … }
}
}