5 #ifndef V8_V8_PLATFORM_H_ 6 #define V8_V8_PLATFORM_H_ 25 virtual ~
Task() =
default;
27 virtual void Run() = 0;
39 virtual void Run(
double deadline_in_seconds) = 0;
54 virtual void PostTask(std::unique_ptr<Task> task) = 0;
71 double delay_in_seconds) = 0;
81 virtual void PostIdleTask(std::unique_ptr<IdleTask> task) = 0;
134 static uint8_t no = 0;
147 char phase,
const uint8_t* category_enabled_flag,
const char* name,
148 const char* scope, uint64_t
id, uint64_t bind_id, int32_t num_args,
149 const char** arg_names,
const uint8_t* arg_types,
150 const uint64_t* arg_values,
151 std::unique_ptr<ConvertableToTraceFormat>* arg_convertables,
152 unsigned int flags) {
155 virtual uint64_t AddTraceEventWithTimestamp(
156 char phase,
const uint8_t* category_enabled_flag,
const char* name,
157 const char* scope, uint64_t
id, uint64_t bind_id, int32_t num_args,
158 const char** arg_names,
const uint8_t* arg_types,
159 const uint64_t* arg_values,
160 std::unique_ptr<ConvertableToTraceFormat>* arg_convertables,
161 unsigned int flags,
int64_t timestamp) {
170 const char* name, uint64_t handle) {}
175 virtual void OnTraceEnabled() = 0;
176 virtual void OnTraceDisabled() = 0;
234 virtual void*
AllocatePages(
void* address,
size_t length,
size_t alignment,
240 virtual bool FreePages(
void* address,
size_t length) = 0;
246 size_t new_length) = 0;
317 Isolate* isolate) = 0;
339 double delay_in_seconds) = 0;
347 "Use a taskrunner acquired by GetForegroundTaskRunner instead.",
348 virtual void CallOnForegroundThread(Isolate* isolate,
Task* task)) = 0;
357 "Use a taskrunner acquired by GetForegroundTaskRunner instead.",
358 virtual void CallDelayedOnForegroundThread(Isolate* isolate,
Task* task,
359 double delay_in_seconds)) = 0;
370 "Use a taskrunner acquired by GetForegroundTaskRunner instead.",
371 virtual void CallIdleOnForegroundThread(Isolate* isolate,
399 typedef void (*StackTracePrinter)();
429 #endif // V8_V8_PLATFORM_H_
virtual bool NonNestableTasksEnabled() const
virtual void PostTask(std::unique_ptr< Task > task)=0
virtual void PostDelayedTask(std::unique_ptr< Task > task, double delay_in_seconds)=0
virtual bool FreePages(void *address, size_t length)=0
virtual void SetRandomMmapSeed(int64_t seed)=0
virtual void UpdateTraceEventDuration(const uint8_t *category_enabled_flag, const char *name, uint64_t handle)
virtual bool IdleTasksEnabled()=0
virtual void PostIdleTask(std::unique_ptr< IdleTask > task)=0
virtual void * GetRandomMmapAddr()=0
virtual bool ReleasePages(void *address, size_t length, size_t new_length)=0
virtual const uint8_t * GetCategoryGroupEnabled(const char *name)
virtual void * AllocatePages(void *address, size_t length, size_t alignment, Permission permissions)=0
virtual void AddTraceStateObserver(TraceStateObserver *)
virtual void PostNonNestableTask(std::unique_ptr< Task > task)
virtual size_t AllocatePageSize()=0
virtual uint64_t AddTraceEvent(char phase, const uint8_t *category_enabled_flag, const char *name, const char *scope, uint64_t id, uint64_t bind_id, int32_t num_args, const char **arg_names, const uint8_t *arg_types, const uint64_t *arg_values, std::unique_ptr< ConvertableToTraceFormat > *arg_convertables, unsigned int flags)
virtual bool DiscardSystemPages(void *address, size_t size)
virtual size_t CommitPageSize()=0
virtual void RemoveTraceStateObserver(TraceStateObserver *)
virtual bool SetPermissions(void *address, size_t length, Permission permissions)=0