v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::base::OS Class Reference

#include <platform.h>

Collaboration diagram for v8::base::OS:

Classes

class  MemoryMappedFile
 
struct  MemoryRange
 
struct  SharedLibraryAddress
 
struct  StackFrame
 

Public Types

enum class  MemoryPermission {
  kNoAccess , kRead , kReadWrite , kReadWriteExecute ,
  kReadExecute , kNoAccessWillJitLater
}
 
using Address = uintptr_t
 

Static Public Member Functions

static void Initialize (AbortMode abort_mode, const char *const gc_fake_mmap)
 
static bool IsHardwareEnforcedShadowStacksEnabled ()
 
static int GetUserTime (uint32_t *secs, uint32_t *usecs)
 
static int GetPeakMemoryUsageKb ()
 
static double TimeCurrentMillis ()
 
static TimezoneCacheCreateTimezoneCache ()
 
static int GetLastError ()
 
static FILE * FOpen (const char *path, const char *mode)
 
static bool Remove (const char *path)
 
static char DirectorySeparator ()
 
static bool isDirectorySeparator (const char ch)
 
static FILE * OpenTemporaryFile ()
 
static PRINTF_FORMAT (1, 2) void Print(const char *format
 
static static PRINTF_FORMAT (1, 0) void VPrint(const char *format
 
static PRINTF_FORMAT (2, 3) void FPrint(FILE *out
 
static const char static PRINTF_FORMAT (2, 0) void VFPrint(FILE *out
 
static PRINTF_FORMAT (1, 2) void PrintError(const char *format
 
static static PRINTF_FORMAT (1, 0) void VPrintError(const char *format
 
static PlatformSharedMemoryHandle CreateSharedMemoryHandleForTesting (size_t size)
 
static void DestroySharedMemoryHandle (PlatformSharedMemoryHandle handle)
 
static bool HasLazyCommits ()
 
static void Sleep (TimeDelta interval)
 
static void Abort ()
 
static void DebugBreak ()
 
static PRINTF_FORMAT (3, 4) int SNPrintF(char *str
 
static int const char static PRINTF_FORMAT (3, 0) int VSNPrintF(char *str
 
static void StrNCpy (char *dest, int length, const char *src, size_t n)
 
static std::vector< SharedLibraryAddressGetSharedLibraryAddresses ()
 
static void SignalCodeMovingGC ()
 
static bool ArmUsingHardFloat ()
 
static int ActivationFrameAlignment ()
 
static int GetCurrentProcessId ()
 
static int GetCurrentThreadId ()
 
static void AdjustSchedulingParams ()
 
static std::optional< MemoryRangeGetFirstFreeMemoryRangeWithin (Address boundary_start, Address boundary_end, size_t minimum_size, size_t alignment)
 
static void ExitProcess (int exit_code)
 
static V8_WARN_UNUSED_RESULT constexpr bool IsRemapPageSupported ()
 
static V8_WARN_UNUSED_RESULT bool RemapPages (const void *address, size_t size, void *new_address, MemoryPermission access)
 
static void SetDataReadOnly (void *address, size_t size)
 

Public Attributes

static static va_list args
 
static const char * format
 
static const char static const char * format
 
static const char static const char va_list args
 
static int length
 
static int const char * format
 
static int const char static int length
 
static int const char static int const char * format
 
static int const char static int const char va_list args
 

Static Public Attributes

static const char *const LogFileOpenMode = "w+"
 
static const int kStackWalkError = -1
 
static const int kStackWalkMaxNameLen = 256
 
static const int kStackWalkMaxTextLen = 256
 

Private Member Functions

 FRIEND_TEST (OS, RemapPages)
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (OS)
 

Static Private Member Functions

static int GetCurrentThreadIdInternal ()
 
static size_t AllocatePageSize ()
 
static size_t CommitPageSize ()
 
static void SetRandomMmapSeed (int64_t seed)
 
static void * GetRandomMmapAddr ()
 
static V8_WARN_UNUSED_RESULT void * Allocate (void *address, size_t size, size_t alignment, MemoryPermission access)
 
static V8_WARN_UNUSED_RESULT void * AllocateShared (size_t size, MemoryPermission access)
 
static V8_WARN_UNUSED_RESULT void * RemapShared (void *old_address, void *new_address, size_t size)
 
static void Free (void *address, size_t size)
 
static V8_WARN_UNUSED_RESULT void * AllocateShared (void *address, size_t size, OS::MemoryPermission access, PlatformSharedMemoryHandle handle, uint64_t offset)
 
static void FreeShared (void *address, size_t size)
 
static void Release (void *address, size_t size)
 
static V8_WARN_UNUSED_RESULT bool SetPermissions (void *address, size_t size, MemoryPermission access)
 
static V8_WARN_UNUSED_RESULT bool RecommitPages (void *address, size_t size, MemoryPermission access)
 
static V8_WARN_UNUSED_RESULT bool DiscardSystemPages (void *address, size_t size)
 
static V8_WARN_UNUSED_RESULT bool DecommitPages (void *address, size_t size)
 
static V8_WARN_UNUSED_RESULT bool SealPages (void *address, size_t size)
 
static V8_WARN_UNUSED_RESULT bool CanReserveAddressSpace ()
 
static V8_WARN_UNUSED_RESULT std::optional< AddressSpaceReservationCreateAddressSpaceReservation (void *hint, size_t size, size_t alignment, MemoryPermission max_permission)
 
static void FreeAddressSpaceReservation (AddressSpaceReservation reservation)
 

Static Private Attributes

static const int msPerSecond = 1000
 

Friends

class AddressSpaceReservation
 
class MemoryMappedFile
 
class PosixMemoryMappedFile
 
class v8::base::PageAllocator
 
class v8::base::VirtualAddressSpace
 
class v8::base::VirtualAddressSubspace
 

Detailed Description

Definition at line 145 of file platform.h.

Member Typedef Documentation

◆ Address

using v8::base::OS::Address = uintptr_t

Definition at line 315 of file platform.h.

Member Enumeration Documentation

◆ MemoryPermission

enum class v8::base::OS::MemoryPermission
strong
Enumerator
kNoAccess 
kRead 
kReadWrite 
kReadWriteExecute 
kReadExecute 
kNoAccessWillJitLater 

Definition at line 215 of file platform.h.

Member Function Documentation

◆ Abort()

void v8::base::OS::Abort ( )
static

Definition at line 724 of file platform-posix.cc.

Here is the caller graph for this function:

◆ ActivationFrameAlignment()

int v8::base::OS::ActivationFrameAlignment ( )
static

Definition at line 275 of file platform-posix.cc.

Here is the caller graph for this function:

◆ AdjustSchedulingParams()

void v8::base::OS::AdjustSchedulingParams ( )
static

Definition at line 130 of file platform-aix.cc.

Here is the caller graph for this function:

◆ Allocate()

void * v8::base::OS::Allocate ( void * address,
size_t size,
size_t alignment,
MemoryPermission access )
staticprivate

Definition at line 99 of file platform-cygwin.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AllocatePageSize()

size_t v8::base::OS::AllocatePageSize ( )
staticprivate

Definition at line 295 of file platform-posix.cc.

Here is the caller graph for this function:

◆ AllocateShared() [1/2]

void * v8::base::OS::AllocateShared ( size_t size,
MemoryPermission access )
staticprivate

Definition at line 456 of file platform-posix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AllocateShared() [2/2]

void * v8::base::OS::AllocateShared ( void * address,
size_t size,
OS::MemoryPermission access,
PlatformSharedMemoryHandle handle,
uint64_t offset )
staticprivate

Definition at line 163 of file platform-darwin.cc.

Here is the call graph for this function:

◆ ArmUsingHardFloat()

static bool v8::base::OS::ArmUsingHardFloat ( )
static

◆ CanReserveAddressSpace()

bool v8::base::OS::CanReserveAddressSpace ( )
staticprivate

Definition at line 336 of file platform-fuchsia.cc.

Here is the caller graph for this function:

◆ CommitPageSize()

size_t v8::base::OS::CommitPageSize ( )
staticprivate

Definition at line 305 of file platform-posix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateAddressSpaceReservation()

std::optional< AddressSpaceReservation > v8::base::OS::CreateAddressSpaceReservation ( void * hint,
size_t size,
size_t alignment,
MemoryPermission max_permission )
staticprivate

Definition at line 339 of file platform-fuchsia.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateSharedMemoryHandleForTesting()

PlatformSharedMemoryHandle v8::base::OS::CreateSharedMemoryHandleForTesting ( size_t size)
static

Definition at line 144 of file platform-darwin.cc.

◆ CreateTimezoneCache()

TimezoneCache * v8::base::OS::CreateTimezoneCache ( )
static

Definition at line 82 of file platform-aix.cc.

Here is the caller graph for this function:

◆ DebugBreak()

void v8::base::OS::DebugBreak ( )
static

Definition at line 740 of file platform-posix.cc.

Here is the caller graph for this function:

◆ DecommitPages()

bool v8::base::OS::DecommitPages ( void * address,
size_t size )
staticprivate

Definition at line 168 of file platform-aix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DestroySharedMemoryHandle()

void v8::base::OS::DestroySharedMemoryHandle ( PlatformSharedMemoryHandle handle)
static

Definition at line 156 of file platform-darwin.cc.

◆ DirectorySeparator()

char v8::base::OS::DirectorySeparator ( )
static

Definition at line 954 of file platform-posix.cc.

Here is the caller graph for this function:

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::base::OS::DISALLOW_IMPLICIT_CONSTRUCTORS ( OS )
private

◆ DiscardSystemPages()

bool v8::base::OS::DiscardSystemPages ( void * address,
size_t size )
staticprivate

Definition at line 181 of file platform-cygwin.cc.

Here is the caller graph for this function:

◆ ExitProcess()

void v8::base::OS::ExitProcess ( int exit_code)
static

Definition at line 867 of file platform-posix.cc.

Here is the caller graph for this function:

◆ FOpen()

FILE * v8::base::OS::FOpen ( const char * path,
const char * mode )
static

Definition at line 935 of file platform-posix.cc.

Here is the caller graph for this function:

◆ Free()

void v8::base::OS::Free ( void * address,
size_t size )
staticprivate

Definition at line 150 of file platform-cygwin.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FreeAddressSpaceReservation()

void v8::base::OS::FreeAddressSpaceReservation ( AddressSpaceReservation reservation)
staticprivate

Definition at line 356 of file platform-fuchsia.cc.

Here is the caller graph for this function:

◆ FreeShared()

void v8::base::OS::FreeShared ( void * address,
size_t size )
staticprivate

Definition at line 295 of file platform-fuchsia.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FRIEND_TEST()

v8::base::OS::FRIEND_TEST ( OS ,
RemapPages  )
private
Here is the call graph for this function:

◆ GetCurrentProcessId()

int v8::base::OS::GetCurrentProcessId ( )
static

Definition at line 843 of file platform-posix.cc.

Here is the caller graph for this function:

◆ GetCurrentThreadId()

int v8::base::OS::GetCurrentThreadId ( )
static

Definition at line 29 of file platform.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCurrentThreadIdInternal()

int v8::base::OS::GetCurrentThreadIdInternal ( )
staticprivate

Definition at line 847 of file platform-posix.cc.

Here is the caller graph for this function:

◆ GetFirstFreeMemoryRangeWithin()

std::optional< OS::MemoryRange > v8::base::OS::GetFirstFreeMemoryRangeWithin ( OS::Address boundary_start,
OS::Address boundary_end,
size_t minimum_size,
size_t alignment )
static

Definition at line 132 of file platform-aix.cc.

◆ GetLastError()

int v8::base::OS::GetLastError ( )
static

Definition at line 926 of file platform-posix.cc.

Here is the caller graph for this function:

◆ GetPeakMemoryUsageKb()

int v8::base::OS::GetPeakMemoryUsageKb ( )
static

Definition at line 890 of file platform-posix.cc.

Here is the caller graph for this function:

◆ GetRandomMmapAddr()

void * v8::base::OS::GetRandomMmapAddr ( )
staticprivate

Definition at line 319 of file platform-posix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetSharedLibraryAddresses()

std::vector< OS::SharedLibraryAddress > v8::base::OS::GetSharedLibraryAddresses ( )
static

Definition at line 88 of file platform-aix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetUserTime()

int v8::base::OS::GetUserTime ( uint32_t * secs,
uint32_t * usecs )
static

Definition at line 389 of file platform-fuchsia.cc.

◆ HasLazyCommits()

bool v8::base::OS::HasLazyCommits ( )
static

Definition at line 211 of file platform-cygwin.cc.

Here is the caller graph for this function:

◆ Initialize()

void v8::base::OS::Initialize ( AbortMode abort_mode,
const char *const gc_fake_mmap )
static

Definition at line 254 of file platform-fuchsia.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDirectorySeparator()

bool v8::base::OS::isDirectorySeparator ( const char ch)
static

Definition at line 956 of file platform-posix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsHardwareEnforcedShadowStacksEnabled()

bool v8::base::OS::IsHardwareEnforcedShadowStacksEnabled ( )
static

Definition at line 273 of file platform-posix.cc.

◆ IsRemapPageSupported()

static V8_WARN_UNUSED_RESULT constexpr bool v8::base::OS::IsRemapPageSupported ( )
inlinestaticconstexpr

Definition at line 333 of file platform.h.

Here is the caller graph for this function:

◆ OpenTemporaryFile()

FILE * v8::base::OS::OpenTemporaryFile ( )
static

Definition at line 961 of file platform-posix.cc.

Here is the caller graph for this function:

◆ PRINTF_FORMAT() [1/8]

static static v8::base::OS::PRINTF_FORMAT ( 1 ,
0  ) const
static

◆ PRINTF_FORMAT() [2/8]

static static v8::base::OS::PRINTF_FORMAT ( 1 ,
0  ) const
static

◆ PRINTF_FORMAT() [3/8]

static v8::base::OS::PRINTF_FORMAT ( 1 ,
2  ) const
static

◆ PRINTF_FORMAT() [4/8]

static v8::base::OS::PRINTF_FORMAT ( 1 ,
2  ) const
static

◆ PRINTF_FORMAT() [5/8]

static const char static v8::base::OS::PRINTF_FORMAT ( 2 ,
0  )
static

◆ PRINTF_FORMAT() [6/8]

static v8::base::OS::PRINTF_FORMAT ( 2 ,
3  )
static

◆ PRINTF_FORMAT() [7/8]

static int const char static v8::base::OS::PRINTF_FORMAT ( 3 ,
0  )
static

◆ PRINTF_FORMAT() [8/8]

static v8::base::OS::PRINTF_FORMAT ( 3 ,
4  )
static

◆ RecommitPages()

bool v8::base::OS::RecommitPages ( void * address,
size_t size,
MemoryPermission access )
staticprivate

Definition at line 176 of file platform-cygwin.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Release()

void v8::base::OS::Release ( void * address,
size_t size )
staticprivate

Definition at line 158 of file platform-cygwin.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemapPages()

bool v8::base::OS::RemapPages ( const void * address,
size_t size,
void * new_address,
MemoryPermission access )
static

Definition at line 184 of file platform-darwin.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemapShared()

void * v8::base::OS::RemapShared ( void * old_address,
void * new_address,
size_t size )
staticprivate

Definition at line 79 of file platform-linux.cc.

Here is the caller graph for this function:

◆ Remove()

bool v8::base::OS::Remove ( const char * path)
static

Definition at line 950 of file platform-posix.cc.

◆ SealPages()

bool v8::base::OS::SealPages ( void * address,
size_t size )
staticprivate

Definition at line 208 of file platform-cygwin.cc.

Here is the caller graph for this function:

◆ SetDataReadOnly()

void v8::base::OS::SetDataReadOnly ( void * address,
size_t size )
static

Definition at line 308 of file platform-fuchsia.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetPermissions()

bool v8::base::OS::SetPermissions ( void * address,
size_t size,
MemoryPermission access )
staticprivate

Definition at line 165 of file platform-cygwin.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetRandomMmapSeed()

void v8::base::OS::SetRandomMmapSeed ( int64_t seed)
staticprivate

Definition at line 311 of file platform-posix.cc.

Here is the caller graph for this function:

◆ SignalCodeMovingGC()

void v8::base::OS::SignalCodeMovingGC ( )
static

Definition at line 128 of file platform-aix.cc.

Here is the caller graph for this function:

◆ Sleep()

void v8::base::OS::Sleep ( TimeDelta interval)
static

Definition at line 719 of file platform-posix.cc.

Here is the caller graph for this function:

◆ StrNCpy()

void v8::base::OS::StrNCpy ( char * dest,
int length,
const char * src,
size_t n )
static

Definition at line 1050 of file platform-posix.cc.

Here is the caller graph for this function:

◆ TimeCurrentMillis()

double v8::base::OS::TimeCurrentMillis ( )
static

Definition at line 912 of file platform-posix.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ AddressSpaceReservation

friend class AddressSpaceReservation
friend

Definition at line 364 of file platform.h.

◆ MemoryMappedFile

friend class MemoryMappedFile
friend

Definition at line 365 of file platform.h.

◆ PosixMemoryMappedFile

friend class PosixMemoryMappedFile
friend

Definition at line 366 of file platform.h.

◆ v8::base::PageAllocator

friend class v8::base::PageAllocator
friend

Definition at line 367 of file platform.h.

◆ v8::base::VirtualAddressSpace

friend class v8::base::VirtualAddressSpace
friend

Definition at line 368 of file platform.h.

◆ v8::base::VirtualAddressSubspace

friend class v8::base::VirtualAddressSubspace
friend

Definition at line 369 of file platform.h.

Member Data Documentation

◆ args [1/3]

static static va_list v8::base::OS::args

Definition at line 200 of file platform.h.

◆ args [2/3]

const char static const char va_list v8::base::OS::args

Definition at line 205 of file platform.h.

◆ args [3/3]

int const char static int const char va_list v8::base::OS::args

Definition at line 270 of file platform.h.

◆ format [1/4]

const char* v8::base::OS::format

Definition at line 203 of file platform.h.

◆ format [2/4]

const char static const char* v8::base::OS::format

Definition at line 204 of file platform.h.

◆ format [3/4]

int const char* v8::base::OS::format

Definition at line 268 of file platform.h.

◆ format [4/4]

int const char static int const char* v8::base::OS::format

Definition at line 270 of file platform.h.

◆ kStackWalkError

const int v8::base::OS::kStackWalkError = -1
static

Definition at line 243 of file platform.h.

◆ kStackWalkMaxNameLen

const int v8::base::OS::kStackWalkMaxNameLen = 256
static

Definition at line 244 of file platform.h.

◆ kStackWalkMaxTextLen

const int v8::base::OS::kStackWalkMaxTextLen = 256
static

Definition at line 245 of file platform.h.

◆ length [1/2]

int v8::base::OS::length

Definition at line 267 of file platform.h.

◆ length [2/2]

int const char static int v8::base::OS::length

Definition at line 269 of file platform.h.

◆ LogFileOpenMode

const char *const v8::base::OS::LogFileOpenMode = "w+"
static

Definition at line 194 of file platform.h.

◆ msPerSecond

const int v8::base::OS::msPerSecond = 1000
staticprivate

Definition at line 422 of file platform.h.


The documentation for this class was generated from the following files: