5 #ifndef V8_V8_PLATFORM_H_
6 #define V8_V8_PLATFORM_H_
49 virtual void Run() = 0;
61 virtual void Run(
double deadline_in_seconds) = 0;
101 double delay_in_seconds) = 0;
120 double delay_in_seconds) {}
295 #if !defined(V8_USE_PERFETTO)
304 static uint8_t no = 0;
317 char phase,
const uint8_t* category_enabled_flag,
const char* name,
318 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
319 const char** arg_names,
const uint8_t* arg_types,
320 const uint64_t* arg_values,
322 unsigned int flags) {
326 char phase,
const uint8_t* category_enabled_flag,
const char* name,
327 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args,
328 const char** arg_names,
const uint8_t* arg_types,
329 const uint64_t* arg_values,
331 unsigned int flags, int64_t timestamp) {
340 const char* name, uint64_t handle) {}
418 virtual bool FreePages(
void* address, size_t length) = 0;
424 size_t new_length) = 0;
472 void* new_address)
const = 0;
500 size_t length,
const void* original_address) {
516 using PlatformSharedMemoryHandle = intptr_t;
517 static constexpr PlatformSharedMemoryHandle kInvalidSharedMemoryHandle = -1;
534 return static_cast<
unsigned int>(
handle);
553 return reinterpret_cast<
void*>(
handle);
558 return static_cast<PlatformSharedMemoryHandle>(fd);
561 PlatformSharedMemoryHandle handle) {
562 return static_cast<
int>(handle);
589 using Address = uintptr_t;
592 Address base, size_t size,
594 : page_size_(page_size),
595 allocation_granularity_(allocation_granularity),
598 max_page_permissions_(max_page_permissions) {}
626 Address
base()
const {
return base_; }
633 size_t
size()
const {
return size_; }
696 virtual void FreePages(Address address, size_t size) = 0;
769 PlatformSharedMemoryHandle handle, uint64_t offset) = 0;
814 Address hint, size_t size, size_t alignment,
851 const size_t page_size_;
852 const size_t allocation_granularity_;
863 using MallocFn =
void* (*)(size_t);
864 using FreeFn =
void (*)(
void*);
903 return &default_allocator;
975 double delay_in_seconds) = 0;
1078 return &default_observer;