8 #include <sys/resource.h>
11 #include <sys/types.h>
16 #include <sys/sysctl.h>
31 int SysInfo::NumberOfProcessors() {
33 int mib[2] = {CTL_HW, HW_NCPU};
35 size_t len =
sizeof(ncpu);
42 long result = sysconf(_SC_NPROCESSORS_ONLN);
47 return static_cast<int>(result);
49 SYSTEM_INFO system_info = {0};
50 ::GetNativeSystemInfo(&system_info);
51 return static_cast<int>(system_info.dwNumberOfProcessors);
57 int64_t SysInfo::AmountOfPhysicalMemory() {
59 int mib[2] = {CTL_HW, HW_MEMSIZE};
61 size_t len =
sizeof(memsize);
62 if (sysctl(mib,
arraysize(mib), &memsize, &len,
NULL, 0) != 0) {
69 size_t size =
sizeof(pages);
70 sysctlbyname(
"vm.stats.vm.v_page_count", &pages, &
size,
NULL, 0);
71 sysctlbyname(
"vm.stats.vm.v_page_size", &page_size, &
size,
NULL, 0);
72 if (pages == -1 || page_size == -1) {
76 return static_cast<int64_t
>(pages) * page_size;
77 #elif V8_OS_CYGWIN || V8_OS_WIN
78 MEMORYSTATUSEX memory_info;
79 memory_info.dwLength =
sizeof(memory_info);
80 if (!GlobalMemoryStatusEx(&memory_info)) {
84 int64_t result =
static_cast<int64_t
>(memory_info.ullTotalPhys);
85 if (result < 0) result = std::numeric_limits<int64_t>::max();
89 if (stat(
"/proc", &stat_buf) != 0) {
93 return static_cast<int64_t
>(stat_buf.st_size);
96 return static_cast<int64_t
>(1) << 31;
98 long pages = sysconf(_SC_PHYS_PAGES);
99 long page_size = sysconf(_SC_PAGESIZE);
100 if (pages == -1 || page_size == -1) {
104 return static_cast<int64_t
>(pages) * page_size;
110 int64_t SysInfo::AmountOfVirtualMemory() {
111 #if V8_OS_NACL || V8_OS_WIN
115 int result = getrlimit(RLIMIT_DATA, &rlim);
120 return (rlim.rlim_cur == RLIM_INFINITY) ? 0 : rlim.rlim_cur;
enable harmony numeric enable harmony object literal extensions Optimize object size
enable harmony numeric enable harmony object literal extensions Optimize object Array DOM strings and string trace pretenuring decisions of HAllocate instructions Enables optimizations which favor memory size over execution speed maximum source size in bytes considered for a single inlining maximum cumulative number of AST nodes considered for inlining trace the tracking of allocation sites deoptimize every n garbage collections perform array bounds checks elimination analyze liveness of environment slots and zap dead values flushes the cache of optimized code for closures on every GC allow uint32 values on optimize frames if they are used only in safe operations track concurrent recompilation artificial compilation delay in ms do not emit check maps for constant values that have a leaf deoptimize the optimized code if the layout of the maps changes enable context specialization in TurboFan execution budget before interrupt is triggered max percentage of megamorphic generic ICs to allow optimization enable use of SAHF instruction if enable use of VFP3 instructions if available enable use of NEON instructions if enable use of SDIV and UDIV instructions if enable use of MLS instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of d16 d31 registers on ARM this requires VFP3 force all emitted branches to be in long enable alignment of csp to bytes on platforms which prefer the register to always be NULL
Debugger support for the V8 JavaScript engine.