Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/node/v8-platform.h
$ cat -n /usr/include/node/v8-platform.h 1 // Copyright 2013 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_V8_PLATFORM_H_ 6 #define V8_V8_PLATFORM_H_ 7 8 #include
9 #include
10 #include
11 #include
// For abort. 12 13 #include
14 #include
15 16 #include "v8-source-location.h" // NOLINT(build/include_directory) 17 #include "v8config.h" // NOLINT(build/include_directory) 18 19 namespace v8 { 20 21 class Isolate; 22 23 // Valid priorities supported by the task scheduling infrastructure. 24 enum class TaskPriority : uint8_t { 25 /** 26 * Best effort tasks are not critical for performance of the application. The 27 * platform implementation should preempt such tasks if higher priority tasks 28 * arrive. 29 */ 30 kBestEffort, 31 /** 32 * User visible tasks are long running background tasks that will 33 * improve performance and memory usage of the application upon completion. 34 * Example: background compilation and garbage collection. 35 */ 36 kUserVisible, 37 /** 38 * User blocking tasks are highest priority tasks that block the execution 39 * thread (e.g. major garbage collection). They must be finished as soon as 40 * possible. 41 */ 42 kUserBlocking, 43 kMaxPriority = kUserBlocking 44 }; 45 46 /** 47 * A Task represents a unit of work. 48 */ 49 class Task { 50 public: 51 virtual ~Task() = default; 52 53 virtual void Run() = 0; 54 }; 55 56 /** 57 * An IdleTask represents a unit of work to be performed in idle time. 58 * The Run method is invoked with an argument that specifies the deadline in 59 * seconds returned by MonotonicallyIncreasingTime(). 60 * The idle task is expected to complete by this deadline. 61 */ 62 class IdleTask { 63 public: 64 virtual ~IdleTask() = default; 65 virtual void Run(double deadline_in_seconds) = 0; 66 }; 67 68 /** 69 * A TaskRunner allows scheduling of tasks. The TaskRunner may still be used to 70 * post tasks after the isolate gets destructed, but these tasks may not get 71 * executed anymore. All tasks posted to a given TaskRunner will be invoked in 72 * sequence. Tasks can be posted from any thread. 73 */ 74 class TaskRunner { 75 public: 76 /** 77 * Schedules a task to be invoked by this TaskRunner. The TaskRunner 78 * implementation takes ownership of |task|. 79 * 80 * Embedders should override PostTaskImpl instead of this. 81 */ 82 virtual void PostTask(std::unique_ptr
task) { 83 PostTaskImpl(std::move(task), SourceLocation::Current()); 84 } 85 86 /** 87 * Schedules a task to be invoked by this TaskRunner. The TaskRunner 88 * implementation takes ownership of |task|. The |task| cannot be nested 89 * within other task executions. 90 * 91 * Tasks which shouldn't be interleaved with JS execution must be posted with 92 * |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the 93 * embedder may process tasks in a callback which is called during JS 94 * execution. 95 * 96 * In particular, tasks which execute JS must be non-nestable, since JS 97 * execution is not allowed to nest. 98 * 99 * Requires that |TaskRunner::NonNestableTasksEnabled()| is true. 100 * 101 * Embedders should override PostNonNestableTaskImpl instead of this. 102 */ 103 virtual void PostNonNestableTask(std::unique_ptr
task) { 104 PostNonNestableTaskImpl(std::move(task), SourceLocation::Current()); 105 } 106 107 /** 108 * Schedules a task to be invoked by this TaskRunner. The task is scheduled 109 * after the given number of seconds |delay_in_seconds|. The TaskRunner 110 * implementation takes ownership of |task|. 111 * 112 * Embedders should override PostDelayedTaskImpl instead of this. 113 */ 114 virtual void PostDelayedTask(std::unique_ptr
task, 115 double delay_in_seconds) { 116 PostDelayedTaskImpl(std::move(task), delay_in_seconds, 117 SourceLocation::Current()); 118 } 119 120 /** 121 * Schedules a task to be invoked by this TaskRunner. The task is scheduled 122 * after the given number of seconds |delay_in_seconds|. The TaskRunner 123 * implementation takes ownership of |task|. The |task| cannot be nested 124 * within other task executions. 125 * 126 * Tasks which shouldn't be interleaved with JS execution must be posted with 127 * |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the 128 * embedder may process tasks in a callback which is called during JS 129 * execution. 130 * 131 * In particular, tasks which execute JS must be non-nestable, since JS 132 * execution is not allowed to nest. 133 * 134 * Requires that |TaskRunner::NonNestableDelayedTasksEnabled()| is true. 135 * 136 * Embedders should override PostNonNestableDelayedTaskImpl instead of this. 137 */ 138 virtual void PostNonNestableDelayedTask(std::unique_ptr
task, 139 double delay_in_seconds) { 140 PostNonNestableDelayedTaskImpl(std::move(task), delay_in_seconds, 141 SourceLocation::Current()); 142 } 143 144 /** 145 * Schedules an idle task to be invoked by this TaskRunner. The task is 146 * scheduled when the embedder is idle. Requires that 147 * |TaskRunner::IdleTasksEnabled()| is true. Idle tasks may be reordered 148 * relative to other task types and may be starved for an arbitrarily long 149 * time if no idle time is available. The TaskRunner implementation takes 150 * ownership of |task|. 151 * 152 * Embedders should override PostIdleTaskImpl instead of this. 153 */ 154 virtual void PostIdleTask(std::unique_ptr
task) { 155 PostIdleTaskImpl(std::move(task), SourceLocation::Current()); 156 } 157 158 /** 159 * Returns true if idle tasks are enabled for this TaskRunner. 160 */ 161 virtual bool IdleTasksEnabled() = 0; 162 163 /** 164 * Returns true if non-nestable tasks are enabled for this TaskRunner. 165 */ 166 virtual bool NonNestableTasksEnabled() const { return false; } 167 168 /** 169 * Returns true if non-nestable delayed tasks are enabled for this TaskRunner. 170 */ 171 virtual bool NonNestableDelayedTasksEnabled() const { return false; } 172 173 TaskRunner() = default; 174 virtual ~TaskRunner() = default; 175 176 TaskRunner(const TaskRunner&) = delete; 177 TaskRunner& operator=(const TaskRunner&) = delete; 178 179 protected: 180 /** 181 * Implementation of above methods with an additional `location` argument. 182 */ 183 virtual void PostTaskImpl(std::unique_ptr
task, 184 const SourceLocation& location) {} 185 virtual void PostNonNestableTaskImpl(std::unique_ptr
task, 186 const SourceLocation& location) {} 187 virtual void PostDelayedTaskImpl(std::unique_ptr
task, 188 double delay_in_seconds, 189 const SourceLocation& location) {} 190 virtual void PostNonNestableDelayedTaskImpl(std::unique_ptr
task, 191 double delay_in_seconds, 192 const SourceLocation& location) {} 193 virtual void PostIdleTaskImpl(std::unique_ptr
task, 194 const SourceLocation& location) {} 195 }; 196 197 /** 198 * Delegate that's passed to Job's worker task, providing an entry point to 199 * communicate with the scheduler. 200 */ 201 class JobDelegate { 202 public: 203 /** 204 * Returns true if this thread *must* return from the worker task on the 205 * current thread ASAP. Workers should periodically invoke ShouldYield (or 206 * YieldIfNeeded()) as often as is reasonable. 207 * After this method returned true, ShouldYield must not be called again. 208 */ 209 virtual bool ShouldYield() = 0; 210 211 /** 212 * Notifies the scheduler that max concurrency was increased, and the number 213 * of worker should be adjusted accordingly. See Platform::PostJob() for more 214 * details. 215 */ 216 virtual void NotifyConcurrencyIncrease() = 0; 217 218 /** 219 * Returns a task_id unique among threads currently running this job, such 220 * that GetTaskId() < worker count. To achieve this, the same task_id may be 221 * reused by a different thread after a worker_task returns. 222 */ 223 virtual uint8_t GetTaskId() = 0; 224 225 /** 226 * Returns true if the current task is called from the thread currently 227 * running JobHandle::Join(). 228 */ 229 virtual bool IsJoiningThread() const = 0; 230 }; 231 232 /** 233 * Handle returned when posting a Job. Provides methods to control execution of 234 * the posted Job. 235 */ 236 class JobHandle { 237 public: 238 virtual ~JobHandle() = default; 239 240 /** 241 * Notifies the scheduler that max concurrency was increased, and the number 242 * of worker should be adjusted accordingly. See Platform::PostJob() for more 243 * details. 244 */ 245 virtual void NotifyConcurrencyIncrease() = 0; 246 247 /** 248 * Contributes to the job on this thread. Doesn't return until all tasks have 249 * completed and max concurrency becomes 0. When Join() is called and max 250 * concurrency reaches 0, it should not increase again. This also promotes 251 * this Job's priority to be at least as high as the calling thread's 252 * priority. 253 */ 254 virtual void Join() = 0; 255 256 /** 257 * Forces all existing workers to yield ASAP. Waits until they have all 258 * returned from the Job's callback before returning. 259 */ 260 virtual void Cancel() = 0; 261 262 /* 263 * Forces all existing workers to yield ASAP but doesn’t wait for them. 264 * Warning, this is dangerous if the Job's callback is bound to or has access 265 * to state which may be deleted after this call. 266 */ 267 virtual void CancelAndDetach() = 0; 268 269 /** 270 * Returns true if there's any work pending or any worker running. 271 */ 272 virtual bool IsActive() = 0; 273 274 /** 275 * Returns true if associated with a Job and other methods may be called. 276 * Returns false after Join() or Cancel() was called. This may return true 277 * even if no workers are running and IsCompleted() returns true 278 */ 279 virtual bool IsValid() = 0; 280 281 /** 282 * Returns true if job priority can be changed. 283 */ 284 virtual bool UpdatePriorityEnabled() const { return false; } 285 286 /** 287 * Update this Job's priority. 288 */ 289 virtual void UpdatePriority(TaskPriority new_priority) {} 290 }; 291 292 /** 293 * A JobTask represents work to run in parallel from Platform::PostJob(). 294 */ 295 class JobTask { 296 public: 297 virtual ~JobTask() = default; 298 299 virtual void Run(JobDelegate* delegate) = 0; 300 301 /** 302 * Controls the maximum number of threads calling Run() concurrently, given 303 * the number of threads currently assigned to this job and executing Run(). 304 * Run() is only invoked if the number of threads previously running Run() was 305 * less than the value returned. In general, this should return the latest 306 * number of incomplete work items (smallest unit of work) left to process, 307 * including items that are currently in progress. |worker_count| is the 308 * number of threads currently assigned to this job which some callers may 309 * need to determine their return value. Since GetMaxConcurrency() is a leaf 310 * function, it must not call back any JobHandle methods. 311 */ 312 virtual size_t GetMaxConcurrency(size_t worker_count) const = 0; 313 }; 314 315 /** 316 * A "blocking call" refers to any call that causes the calling thread to wait 317 * off-CPU. It includes but is not limited to calls that wait on synchronous 318 * file I/O operations: read or write a file from disk, interact with a pipe or 319 * a socket, rename or delete a file, enumerate files in a directory, etc. 320 * Acquiring a low contention lock is not considered a blocking call. 321 */ 322 323 /** 324 * BlockingType indicates the likelihood that a blocking call will actually 325 * block. 326 */ 327 enum class BlockingType { 328 // The call might block (e.g. file I/O that might hit in memory cache). 329 kMayBlock, 330 // The call will definitely block (e.g. cache already checked and now pinging 331 // server synchronously). 332 kWillBlock 333 }; 334 335 /** 336 * This class is instantiated with CreateBlockingScope() in every scope where a 337 * blocking call is made and serves as a precise annotation of the scope that 338 * may/will block. May be implemented by an embedder to adjust the thread count. 339 * CPU usage should be minimal within that scope. ScopedBlockingCalls can be 340 * nested. 341 */ 342 class ScopedBlockingCall { 343 public: 344 virtual ~ScopedBlockingCall() = default; 345 }; 346 347 /** 348 * The interface represents complex arguments to trace events. 349 */ 350 class ConvertableToTraceFormat { 351 public: 352 virtual ~ConvertableToTraceFormat() = default; 353 354 /** 355 * Append the class info to the provided |out| string. The appended 356 * data must be a valid JSON object. Strings must be properly quoted, and 357 * escaped. There is no processing applied to the content after it is 358 * appended. 359 */ 360 virtual void AppendAsTraceFormat(std::string* out) const = 0; 361 }; 362 363 /** 364 * V8 Tracing controller. 365 * 366 * Can be implemented by an embedder to record trace events from V8. 367 * 368 * Will become obsolete in Perfetto SDK build (v8_use_perfetto = true). 369 */ 370 class TracingController { 371 public: 372 virtual ~TracingController() = default; 373 374 // In Perfetto mode, trace events are written using Perfetto's Track Event 375 // API directly without going through the embedder. However, it is still 376 // possible to observe tracing being enabled and disabled. 377 #if !defined(V8_USE_PERFETTO) 378 /** 379 * Called by TRACE_EVENT* macros, don't call this directly. 380 * The name parameter is a category group for example: 381 * TRACE_EVENT0("v8,parse", "V8.Parse") 382 * The pointer returned points to a value with zero or more of the bits 383 * defined in CategoryGroupEnabledFlags. 384 **/ 385 virtual const uint8_t* GetCategoryGroupEnabled(const char* name) { 386 static uint8_t no = 0; 387 return &no; 388 } 389 390 /** 391 * Adds a trace event to the platform tracing system. These function calls are 392 * usually the result of a TRACE_* macro from trace_event_common.h when 393 * tracing and the category of the particular trace are enabled. It is not 394 * advisable to call these functions on their own; they are really only meant 395 * to be used by the trace macros. The returned handle can be used by 396 * UpdateTraceEventDuration to update the duration of COMPLETE events. 397 */ 398 virtual uint64_t AddTraceEvent( 399 char phase, const uint8_t* category_enabled_flag, const char* name, 400 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args, 401 const char** arg_names, const uint8_t* arg_types, 402 const uint64_t* arg_values, 403 std::unique_ptr
* arg_convertables, 404 unsigned int flags) { 405 return 0; 406 } 407 virtual uint64_t AddTraceEventWithTimestamp( 408 char phase, const uint8_t* category_enabled_flag, const char* name, 409 const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args, 410 const char** arg_names, const uint8_t* arg_types, 411 const uint64_t* arg_values, 412 std::unique_ptr
* arg_convertables, 413 unsigned int flags, int64_t timestamp) { 414 return 0; 415 } 416 417 /** 418 * Sets the duration field of a COMPLETE trace event. It must be called with 419 * the handle returned from AddTraceEvent(). 420 **/ 421 virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, 422 const char* name, uint64_t handle) {} 423 #endif // !defined(V8_USE_PERFETTO) 424 425 class TraceStateObserver { 426 public: 427 virtual ~TraceStateObserver() = default; 428 virtual void OnTraceEnabled() = 0; 429 virtual void OnTraceDisabled() = 0; 430 }; 431 432 /** 433 * Adds tracing state change observer. 434 * Does nothing in Perfetto SDK build (v8_use_perfetto = true). 435 */ 436 virtual void AddTraceStateObserver(TraceStateObserver*) {} 437 438 /** 439 * Removes tracing state change observer. 440 * Does nothing in Perfetto SDK build (v8_use_perfetto = true). 441 */ 442 virtual void RemoveTraceStateObserver(TraceStateObserver*) {} 443 }; 444 445 /** 446 * A V8 memory page allocator. 447 * 448 * Can be implemented by an embedder to manage large host OS allocations. 449 */ 450 class PageAllocator { 451 public: 452 virtual ~PageAllocator() = default; 453 454 /** 455 * Gets the page granularity for AllocatePages and FreePages. Addresses and 456 * lengths for those calls should be multiples of AllocatePageSize(). 457 */ 458 virtual size_t AllocatePageSize() = 0; 459 460 /** 461 * Gets the page granularity for SetPermissions and ReleasePages. Addresses 462 * and lengths for those calls should be multiples of CommitPageSize(). 463 */ 464 virtual size_t CommitPageSize() = 0; 465 466 /** 467 * Sets the random seed so that GetRandomMmapAddr() will generate repeatable 468 * sequences of random mmap addresses. 469 */ 470 virtual void SetRandomMmapSeed(int64_t seed) = 0; 471 472 /** 473 * Returns a randomized address, suitable for memory allocation under ASLR. 474 * The address will be aligned to AllocatePageSize. 475 */ 476 virtual void* GetRandomMmapAddr() = 0; 477 478 /** 479 * Memory permissions. 480 */ 481 enum Permission { 482 kNoAccess, 483 kRead, 484 kReadWrite, 485 kReadWriteExecute, 486 kReadExecute, 487 // Set this when reserving memory that will later require kReadWriteExecute 488 // permissions. The resulting behavior is platform-specific, currently 489 // this is used to set the MAP_JIT flag on Apple Silicon. 490 // TODO(jkummerow): Remove this when Wasm has a platform-independent 491 // w^x implementation. 492 // TODO(saelo): Remove this once all JIT pages are allocated through the 493 // VirtualAddressSpace API. 494 kNoAccessWillJitLater 495 }; 496 497 /** 498 * Allocates memory in range with the given alignment and permission. 499 */ 500 virtual void* AllocatePages(void* address, size_t length, size_t alignment, 501 Permission permissions) = 0; 502 503 /** 504 * Frees memory in a range that was allocated by a call to AllocatePages. 505 */ 506 virtual bool FreePages(void* address, size_t length) = 0; 507 508 /** 509 * Releases memory in a range that was allocated by a call to AllocatePages. 510 */ 511 virtual bool ReleasePages(void* address, size_t length, 512 size_t new_length) = 0; 513 514 /** 515 * Sets permissions on pages in an allocated range. 516 */ 517 virtual bool SetPermissions(void* address, size_t length, 518 Permission permissions) = 0; 519 520 /** 521 * Recommits discarded pages in the given range with given permissions. 522 * Discarded pages must be recommitted with their original permissions 523 * before they are used again. 524 */ 525 virtual bool RecommitPages(void* address, size_t length, 526 Permission permissions) { 527 // TODO(v8:12797): make it pure once it's implemented on Chromium side. 528 return false; 529 } 530 531 /** 532 * Frees memory in the given [address, address + size) range. address and size 533 * should be operating system page-aligned. The next write to this 534 * memory area brings the memory transparently back. This should be treated as 535 * a hint to the OS that the pages are no longer needed. It does not guarantee 536 * that the pages will be discarded immediately or at all. 537 */ 538 virtual bool DiscardSystemPages(void* address, size_t size) { return true; } 539 540 /** 541 * Decommits any wired memory pages in the given range, allowing the OS to 542 * reclaim them, and marks the region as inacessible (kNoAccess). The address 543 * range stays reserved and can be accessed again later by changing its 544 * permissions. However, in that case the memory content is guaranteed to be 545 * zero-initialized again. The memory must have been previously allocated by a 546 * call to AllocatePages. Returns true on success, false otherwise. 547 */ 548 virtual bool DecommitPages(void* address, size_t size) = 0; 549 550 /** 551 * INTERNAL ONLY: This interface has not been stabilised and may change 552 * without notice from one release to another without being deprecated first. 553 */ 554 class SharedMemoryMapping { 555 public: 556 // Implementations are expected to free the shared memory mapping in the 557 // destructor. 558 virtual ~SharedMemoryMapping() = default; 559 virtual void* GetMemory() const = 0; 560 }; 561 562 /** 563 * INTERNAL ONLY: This interface has not been stabilised and may change 564 * without notice from one release to another without being deprecated first. 565 */ 566 class SharedMemory { 567 public: 568 // Implementations are expected to free the shared memory in the destructor. 569 virtual ~SharedMemory() = default; 570 virtual std::unique_ptr
RemapTo( 571 void* new_address) const = 0; 572 virtual void* GetMemory() const = 0; 573 virtual size_t GetSize() const = 0; 574 }; 575 576 /** 577 * INTERNAL ONLY: This interface has not been stabilised and may change 578 * without notice from one release to another without being deprecated first. 579 * 580 * Reserve pages at a fixed address returning whether the reservation is 581 * possible. The reserved memory is detached from the PageAllocator and so 582 * should not be freed by it. It's intended for use with 583 * SharedMemory::RemapTo, where ~SharedMemoryMapping would free the memory. 584 */ 585 virtual bool ReserveForSharedMemoryMapping(void* address, size_t size) { 586 return false; 587 } 588 589 /** 590 * INTERNAL ONLY: This interface has not been stabilised and may change 591 * without notice from one release to another without being deprecated first. 592 * 593 * Allocates shared memory pages. Not all PageAllocators need support this and 594 * so this method need not be overridden. 595 * Allocates a new read-only shared memory region of size |length| and copies 596 * the memory at |original_address| into it. 597 */ 598 virtual std::unique_ptr
AllocateSharedPages( 599 size_t length, const void* original_address) { 600 return {}; 601 } 602 603 /** 604 * INTERNAL ONLY: This interface has not been stabilised and may change 605 * without notice from one release to another without being deprecated first. 606 * 607 * If not overridden and changed to return true, V8 will not attempt to call 608 * AllocateSharedPages or RemapSharedPages. If overridden, AllocateSharedPages 609 * and RemapSharedPages must also be overridden. 610 */ 611 virtual bool CanAllocateSharedPages() { return false; } 612 }; 613 614 /** 615 * An allocator that uses per-thread permissions to protect the memory. 616 * 617 * The implementation is platform/hardware specific, e.g. using pkeys on x64. 618 * 619 * INTERNAL ONLY: This interface has not been stabilised and may change 620 * without notice from one release to another without being deprecated first. 621 */ 622 class ThreadIsolatedAllocator { 623 public: 624 virtual ~ThreadIsolatedAllocator() = default; 625 626 virtual void* Allocate(size_t size) = 0; 627 628 virtual void Free(void* object) = 0; 629 630 enum class Type { 631 kPkey, 632 }; 633 634 virtual Type Type() const = 0; 635 636 /** 637 * Return the pkey used to implement the thread isolation if Type == kPkey. 638 */ 639 virtual int Pkey() const { return -1; } 640 641 /** 642 * Per-thread permissions can be reset on signal handler entry. Even reading 643 * ThreadIsolated memory will segfault in that case. 644 * Call this function on signal handler entry to ensure that read permissions 645 * are restored. 646 */ 647 static void SetDefaultPermissionsForSignalHandler(); 648 }; 649 650 // Opaque type representing a handle to a shared memory region. 651 using PlatformSharedMemoryHandle = intptr_t; 652 static constexpr PlatformSharedMemoryHandle kInvalidSharedMemoryHandle = -1; 653 654 // Conversion routines from the platform-dependent shared memory identifiers 655 // into the opaque PlatformSharedMemoryHandle type. These use the underlying 656 // types (e.g. unsigned int) instead of the typedef'd ones (e.g. mach_port_t) 657 // to avoid pulling in large OS header files into this header file. Instead, 658 // the users of these routines are expected to include the respecitve OS 659 // headers in addition to this one. 660 #if V8_OS_DARWIN 661 // Convert between a shared memory handle and a mach_port_t referencing a memory 662 // entry object. 663 inline PlatformSharedMemoryHandle SharedMemoryHandleFromMachMemoryEntry( 664 unsigned int port) { 665 return static_cast
(port); 666 } 667 inline unsigned int MachMemoryEntryFromSharedMemoryHandle( 668 PlatformSharedMemoryHandle handle) { 669 return static_cast
(handle); 670 } 671 #elif V8_OS_FUCHSIA 672 // Convert between a shared memory handle and a zx_handle_t to a VMO. 673 inline PlatformSharedMemoryHandle SharedMemoryHandleFromVMO(uint32_t handle) { 674 return static_cast
(handle); 675 } 676 inline uint32_t VMOFromSharedMemoryHandle(PlatformSharedMemoryHandle handle) { 677 return static_cast
(handle); 678 } 679 #elif V8_OS_WIN 680 // Convert between a shared memory handle and a Windows HANDLE to a file mapping 681 // object. 682 inline PlatformSharedMemoryHandle SharedMemoryHandleFromFileMapping( 683 void* handle) { 684 return reinterpret_cast
(handle); 685 } 686 inline void* FileMappingFromSharedMemoryHandle( 687 PlatformSharedMemoryHandle handle) { 688 return reinterpret_cast
(handle); 689 } 690 #else 691 // Convert between a shared memory handle and a file descriptor. 692 inline PlatformSharedMemoryHandle SharedMemoryHandleFromFileDescriptor(int fd) { 693 return static_cast
(fd); 694 } 695 inline int FileDescriptorFromSharedMemoryHandle( 696 PlatformSharedMemoryHandle handle) { 697 return static_cast
(handle); 698 } 699 #endif 700 701 /** 702 * Possible permissions for memory pages. 703 */ 704 enum class PagePermissions { 705 kNoAccess, 706 kRead, 707 kReadWrite, 708 kReadWriteExecute, 709 kReadExecute, 710 }; 711 712 /** 713 * Class to manage a virtual memory address space. 714 * 715 * This class represents a contiguous region of virtual address space in which 716 * sub-spaces and (private or shared) memory pages can be allocated, freed, and 717 * modified. This interface is meant to eventually replace the PageAllocator 718 * interface, and can be used as an alternative in the meantime. 719 * 720 * This API is not yet stable and may change without notice! 721 */ 722 class VirtualAddressSpace { 723 public: 724 using Address = uintptr_t; 725 726 VirtualAddressSpace(size_t page_size, size_t allocation_granularity, 727 Address base, size_t size, 728 PagePermissions max_page_permissions) 729 : page_size_(page_size), 730 allocation_granularity_(allocation_granularity), 731 base_(base), 732 size_(size), 733 max_page_permissions_(max_page_permissions) {} 734 735 virtual ~VirtualAddressSpace() = default; 736 737 /** 738 * The page size used inside this space. Guaranteed to be a power of two. 739 * Used as granularity for all page-related operations except for allocation, 740 * which use the allocation_granularity(), see below. 741 * 742 * \returns the page size in bytes. 743 */ 744 size_t page_size() const { return page_size_; } 745 746 /** 747 * The granularity of page allocations and, by extension, of subspace 748 * allocations. This is guaranteed to be a power of two and a multiple of the 749 * page_size(). In practice, this is equal to the page size on most OSes, but 750 * on Windows it is usually 64KB, while the page size is 4KB. 751 * 752 * \returns the allocation granularity in bytes. 753 */ 754 size_t allocation_granularity() const { return allocation_granularity_; } 755 756 /** 757 * The base address of the address space managed by this instance. 758 * 759 * \returns the base address of this address space. 760 */ 761 Address base() const { return base_; } 762 763 /** 764 * The size of the address space managed by this instance. 765 * 766 * \returns the size of this address space in bytes. 767 */ 768 size_t size() const { return size_; } 769 770 /** 771 * The maximum page permissions that pages allocated inside this space can 772 * obtain. 773 * 774 * \returns the maximum page permissions. 775 */ 776 PagePermissions max_page_permissions() const { return max_page_permissions_; } 777 778 /** 779 * Whether the |address| is inside the address space managed by this instance. 780 * 781 * \returns true if it is inside the address space, false if not. 782 */ 783 bool Contains(Address address) const { 784 return (address >= base()) && (address < base() + size()); 785 } 786 787 /** 788 * Sets the random seed so that GetRandomPageAddress() will generate 789 * repeatable sequences of random addresses. 790 * 791 * \param The seed for the PRNG. 792 */ 793 virtual void SetRandomSeed(int64_t seed) = 0; 794 795 /** 796 * Returns a random address inside this address space, suitable for page 797 * allocations hints. 798 * 799 * \returns a random address aligned to allocation_granularity(). 800 */ 801 virtual Address RandomPageAddress() = 0; 802 803 /** 804 * Allocates private memory pages with the given alignment and permissions. 805 * 806 * \param hint If nonzero, the allocation is attempted to be placed at the 807 * given address first. If that fails, the allocation is attempted to be 808 * placed elsewhere, possibly nearby, but that is not guaranteed. Specifying 809 * zero for the hint always causes this function to choose a random address. 810 * The hint, if specified, must be aligned to the specified alignment. 811 * 812 * \param size The size of the allocation in bytes. Must be a multiple of the 813 * allocation_granularity(). 814 * 815 * \param alignment The alignment of the allocation in bytes. Must be a 816 * multiple of the allocation_granularity() and should be a power of two. 817 * 818 * \param permissions The page permissions of the newly allocated pages. 819 * 820 * \returns the start address of the allocated pages on success, zero on 821 * failure. 822 */ 823 static constexpr Address kNoHint = 0; 824 virtual V8_WARN_UNUSED_RESULT Address 825 AllocatePages(Address hint, size_t size, size_t alignment, 826 PagePermissions permissions) = 0; 827 828 /** 829 * Frees previously allocated pages. 830 * 831 * This function will terminate the process on failure as this implies a bug 832 * in the client. As such, there is no return value. 833 * 834 * \param address The start address of the pages to free. This address must 835 * have been obtained through a call to AllocatePages. 836 * 837 * \param size The size in bytes of the region to free. This must match the 838 * size passed to AllocatePages when the pages were allocated. 839 */ 840 virtual void FreePages(Address address, size_t size) = 0; 841 842 /** 843 * Sets permissions of all allocated pages in the given range. 844 * 845 * This operation can fail due to OOM, in which case false is returned. If 846 * the operation fails for a reason other than OOM, this function will 847 * terminate the process as this implies a bug in the client. 848 * 849 * \param address The start address of the range. Must be aligned to 850 * page_size(). 851 * 852 * \param size The size in bytes of the range. Must be a multiple 853 * of page_size(). 854 * 855 * \param permissions The new permissions for the range. 856 * 857 * \returns true on success, false on OOM. 858 */ 859 virtual V8_WARN_UNUSED_RESULT bool SetPagePermissions( 860 Address address, size_t size, PagePermissions permissions) = 0; 861 862 /** 863 * Creates a guard region at the specified address. 864 * 865 * Guard regions are guaranteed to cause a fault when accessed and generally 866 * do not count towards any memory consumption limits. Further, allocating 867 * guard regions can usually not fail in subspaces if the region does not 868 * overlap with another region, subspace, or page allocation. 869 * 870 * \param address The start address of the guard region. Must be aligned to 871 * the allocation_granularity(). 872 * 873 * \param size The size of the guard region in bytes. Must be a multiple of 874 * the allocation_granularity(). 875 * 876 * \returns true on success, false otherwise. 877 */ 878 virtual V8_WARN_UNUSED_RESULT bool AllocateGuardRegion(Address address, 879 size_t size) = 0; 880 881 /** 882 * Frees an existing guard region. 883 * 884 * This function will terminate the process on failure as this implies a bug 885 * in the client. As such, there is no return value. 886 * 887 * \param address The start address of the guard region to free. This address 888 * must have previously been used as address parameter in a successful 889 * invocation of AllocateGuardRegion. 890 * 891 * \param size The size in bytes of the guard region to free. This must match 892 * the size passed to AllocateGuardRegion when the region was created. 893 */ 894 virtual void FreeGuardRegion(Address address, size_t size) = 0; 895 896 /** 897 * Allocates shared memory pages with the given permissions. 898 * 899 * \param hint Placement hint. See AllocatePages. 900 * 901 * \param size The size of the allocation in bytes. Must be a multiple of the 902 * allocation_granularity(). 903 * 904 * \param permissions The page permissions of the newly allocated pages. 905 * 906 * \param handle A platform-specific handle to a shared memory object. See 907 * the SharedMemoryHandleFromX routines above for ways to obtain these. 908 * 909 * \param offset The offset in the shared memory object at which the mapping 910 * should start. Must be a multiple of the allocation_granularity(). 911 * 912 * \returns the start address of the allocated pages on success, zero on 913 * failure. 914 */ 915 virtual V8_WARN_UNUSED_RESULT Address 916 AllocateSharedPages(Address hint, size_t size, PagePermissions permissions, 917 PlatformSharedMemoryHandle handle, uint64_t offset) = 0; 918 919 /** 920 * Frees previously allocated shared pages. 921 * 922 * This function will terminate the process on failure as this implies a bug 923 * in the client. As such, there is no return value. 924 * 925 * \param address The start address of the pages to free. This address must 926 * have been obtained through a call to AllocateSharedPages. 927 * 928 * \param size The size in bytes of the region to free. This must match the 929 * size passed to AllocateSharedPages when the pages were allocated. 930 */ 931 virtual void FreeSharedPages(Address address, size_t size) = 0; 932 933 /** 934 * Whether this instance can allocate subspaces or not. 935 * 936 * \returns true if subspaces can be allocated, false if not. 937 */ 938 virtual bool CanAllocateSubspaces() = 0; 939 940 /* 941 * Allocate a subspace. 942 * 943 * The address space of a subspace stays reserved in the parent space for the 944 * lifetime of the subspace. As such, it is guaranteed that page allocations 945 * on the parent space cannot end up inside a subspace. 946 * 947 * \param hint Hints where the subspace should be allocated. See 948 * AllocatePages() for more details. 949 * 950 * \param size The size in bytes of the subspace. Must be a multiple of the 951 * allocation_granularity(). 952 * 953 * \param alignment The alignment of the subspace in bytes. Must be a multiple 954 * of the allocation_granularity() and should be a power of two. 955 * 956 * \param max_page_permissions The maximum permissions that pages allocated in 957 * the subspace can obtain. 958 * 959 * \returns a new subspace or nullptr on failure. 960 */ 961 virtual std::unique_ptr
AllocateSubspace( 962 Address hint, size_t size, size_t alignment, 963 PagePermissions max_page_permissions) = 0; 964 965 // 966 // TODO(v8) maybe refactor the methods below before stabilizing the API. For 967 // example by combining them into some form of page operation method that 968 // takes a command enum as parameter. 969 // 970 971 /** 972 * Recommits discarded pages in the given range with given permissions. 973 * Discarded pages must be recommitted with their original permissions 974 * before they are used again. 975 * 976 * \param address The start address of the range. Must be aligned to 977 * page_size(). 978 * 979 * \param size The size in bytes of the range. Must be a multiple 980 * of page_size(). 981 * 982 * \param permissions The permissions for the range that the pages must have. 983 * 984 * \returns true on success, false otherwise. 985 */ 986 virtual V8_WARN_UNUSED_RESULT bool RecommitPages( 987 Address address, size_t size, PagePermissions permissions) = 0; 988 989 /** 990 * Frees memory in the given [address, address + size) range. address and 991 * size should be aligned to the page_size(). The next write to this memory 992 * area brings the memory transparently back. This should be treated as a 993 * hint to the OS that the pages are no longer needed. It does not guarantee 994 * that the pages will be discarded immediately or at all. 995 * 996 * \returns true on success, false otherwise. Since this method is only a 997 * hint, a successful invocation does not imply that pages have been removed. 998 */ 999 virtual V8_WARN_UNUSED_RESULT bool DiscardSystemPages(Address address, 1000 size_t size) { 1001 return true; 1002 } 1003 /** 1004 * Decommits any wired memory pages in the given range, allowing the OS to 1005 * reclaim them, and marks the region as inacessible (kNoAccess). The address 1006 * range stays reserved and can be accessed again later by changing its 1007 * permissions. However, in that case the memory content is guaranteed to be 1008 * zero-initialized again. The memory must have been previously allocated by a 1009 * call to AllocatePages. 1010 * 1011 * \returns true on success, false otherwise. 1012 */ 1013 virtual V8_WARN_UNUSED_RESULT bool DecommitPages(Address address, 1014 size_t size) = 0; 1015 1016 private: 1017 const size_t page_size_; 1018 const size_t allocation_granularity_; 1019 const Address base_; 1020 const size_t size_; 1021 const PagePermissions max_page_permissions_; 1022 }; 1023 1024 /** 1025 * V8 Allocator used for allocating zone backings. 1026 */ 1027 class ZoneBackingAllocator { 1028 public: 1029 using MallocFn = void* (*)(size_t); 1030 using FreeFn = void (*)(void*); 1031 1032 virtual MallocFn GetMallocFn() const { return ::malloc; } 1033 virtual FreeFn GetFreeFn() const { return ::free; } 1034 }; 1035 1036 /** 1037 * Observer used by V8 to notify the embedder about entering/leaving sections 1038 * with high throughput of malloc/free operations. 1039 */ 1040 class HighAllocationThroughputObserver { 1041 public: 1042 virtual void EnterSection() {} 1043 virtual void LeaveSection() {} 1044 }; 1045 1046 /** 1047 * V8 Platform abstraction layer. 1048 * 1049 * The embedder has to provide an implementation of this interface before 1050 * initializing the rest of V8. 1051 */ 1052 class Platform { 1053 public: 1054 virtual ~Platform() = default; 1055 1056 /** 1057 * Allows the embedder to manage memory page allocations. 1058 * Returning nullptr will cause V8 to use the default page allocator. 1059 */ 1060 virtual PageAllocator* GetPageAllocator() = 0; 1061 1062 /** 1063 * Allows the embedder to provide an allocator that uses per-thread memory 1064 * permissions to protect allocations. 1065 * Returning nullptr will cause V8 to disable protections that rely on this 1066 * feature. 1067 */ 1068 virtual ThreadIsolatedAllocator* GetThreadIsolatedAllocator() { 1069 return nullptr; 1070 } 1071 1072 /** 1073 * Allows the embedder to specify a custom allocator used for zones. 1074 */ 1075 virtual ZoneBackingAllocator* GetZoneBackingAllocator() { 1076 static ZoneBackingAllocator default_allocator; 1077 return &default_allocator; 1078 } 1079 1080 /** 1081 * Enables the embedder to respond in cases where V8 can't allocate large 1082 * blocks of memory. V8 retries the failed allocation once after calling this 1083 * method. On success, execution continues; otherwise V8 exits with a fatal 1084 * error. 1085 * Embedder overrides of this function must NOT call back into V8. 1086 */ 1087 virtual void OnCriticalMemoryPressure() {} 1088 1089 /** 1090 * Gets the max number of worker threads that may be used to execute 1091 * concurrent work scheduled for any single TaskPriority by 1092 * Call(BlockingTask)OnWorkerThread() or PostJob(). This can be used to 1093 * estimate the number of tasks a work package should be split into. A return 1094 * value of 0 means that there are no worker threads available. Note that a 1095 * value of 0 won't prohibit V8 from posting tasks using |CallOnWorkerThread|. 1096 */ 1097 virtual int NumberOfWorkerThreads() = 0; 1098 1099 /** 1100 * Returns a TaskRunner which can be used to post a task on the foreground. 1101 * The TaskRunner's NonNestableTasksEnabled() must be true. This function 1102 * should only be called from a foreground thread. 1103 * TODO(chromium:1448758): Deprecate once |GetForegroundTaskRunner(Isolate*, 1104 * TaskPriority)| is ready. 1105 */ 1106 virtual std::shared_ptr
GetForegroundTaskRunner( 1107 Isolate* isolate) { 1108 return GetForegroundTaskRunner(isolate, TaskPriority::kUserBlocking); 1109 } 1110 1111 /** 1112 * Returns a TaskRunner with a specific |priority| which can be used to post a 1113 * task on the foreground thread. The TaskRunner's NonNestableTasksEnabled() 1114 * must be true. This function should only be called from a foreground thread. 1115 * TODO(chromium:1448758): Make pure virtual once embedders implement it. 1116 */ 1117 virtual std::shared_ptr
GetForegroundTaskRunner( 1118 Isolate* isolate, TaskPriority priority) { 1119 return nullptr; 1120 } 1121 1122 /** 1123 * Schedules a task to be invoked on a worker thread. 1124 * Embedders should override PostTaskOnWorkerThreadImpl() instead of 1125 * CallOnWorkerThread(). 1126 */ 1127 void CallOnWorkerThread( 1128 std::unique_ptr
task, 1129 const SourceLocation& location = SourceLocation::Current()) { 1130 PostTaskOnWorkerThreadImpl(TaskPriority::kUserVisible, std::move(task), 1131 location); 1132 } 1133 1134 /** 1135 * Schedules a task that blocks the main thread to be invoked with 1136 * high-priority on a worker thread. 1137 * Embedders should override PostTaskOnWorkerThreadImpl() instead of 1138 * CallBlockingTaskOnWorkerThread(). 1139 */ 1140 void CallBlockingTaskOnWorkerThread( 1141 std::unique_ptr
task, 1142 const SourceLocation& location = SourceLocation::Current()) { 1143 // Embedders may optionally override this to process these tasks in a high 1144 // priority pool. 1145 PostTaskOnWorkerThreadImpl(TaskPriority::kUserBlocking, std::move(task), 1146 location); 1147 } 1148 1149 /** 1150 * Schedules a task to be invoked with low-priority on a worker thread. 1151 * Embedders should override PostTaskOnWorkerThreadImpl() instead of 1152 * CallLowPriorityTaskOnWorkerThread(). 1153 */ 1154 void CallLowPriorityTaskOnWorkerThread( 1155 std::unique_ptr
task, 1156 const SourceLocation& location = SourceLocation::Current()) { 1157 // Embedders may optionally override this to process these tasks in a low 1158 // priority pool. 1159 PostTaskOnWorkerThreadImpl(TaskPriority::kBestEffort, std::move(task), 1160 location); 1161 } 1162 1163 /** 1164 * Schedules a task to be invoked on a worker thread after |delay_in_seconds| 1165 * expires. 1166 * Embedders should override PostDelayedTaskOnWorkerThreadImpl() instead of 1167 * CallDelayedOnWorkerThread(). 1168 */ 1169 void CallDelayedOnWorkerThread( 1170 std::unique_ptr
task, double delay_in_seconds, 1171 const SourceLocation& location = SourceLocation::Current()) { 1172 PostDelayedTaskOnWorkerThreadImpl(TaskPriority::kUserVisible, 1173 std::move(task), delay_in_seconds, 1174 location); 1175 } 1176 1177 /** 1178 * Returns true if idle tasks are enabled for the given |isolate|. 1179 */ 1180 virtual bool IdleTasksEnabled(Isolate* isolate) { return false; } 1181 1182 /** 1183 * Posts |job_task| to run in parallel. Returns a JobHandle associated with 1184 * the Job, which can be joined or canceled. 1185 * This avoids degenerate cases: 1186 * - Calling CallOnWorkerThread() for each work item, causing significant 1187 * overhead. 1188 * - Fixed number of CallOnWorkerThread() calls that split the work and might 1189 * run for a long time. This is problematic when many components post 1190 * "num cores" tasks and all expect to use all the cores. In these cases, 1191 * the scheduler lacks context to be fair to multiple same-priority requests 1192 * and/or ability to request lower priority work to yield when high priority 1193 * work comes in. 1194 * A canonical implementation of |job_task| looks like: 1195 * class MyJobTask : public JobTask { 1196 * public: 1197 * MyJobTask(...) : worker_queue_(...) {} 1198 * // JobTask: 1199 * void Run(JobDelegate* delegate) override { 1200 * while (!delegate->ShouldYield()) { 1201 * // Smallest unit of work. 1202 * auto work_item = worker_queue_.TakeWorkItem(); // Thread safe. 1203 * if (!work_item) return; 1204 * ProcessWork(work_item); 1205 * } 1206 * } 1207 * 1208 * size_t GetMaxConcurrency() const override { 1209 * return worker_queue_.GetSize(); // Thread safe. 1210 * } 1211 * }; 1212 * auto handle = PostJob(TaskPriority::kUserVisible, 1213 * std::make_unique
(...)); 1214 * handle->Join(); 1215 * 1216 * PostJob() and methods of the returned JobHandle/JobDelegate, must never be 1217 * called while holding a lock that could be acquired by JobTask::Run or 1218 * JobTask::GetMaxConcurrency -- that could result in a deadlock. This is 1219 * because [1] JobTask::GetMaxConcurrency may be invoked while holding 1220 * internal lock (A), hence JobTask::GetMaxConcurrency can only use a lock (B) 1221 * if that lock is *never* held while calling back into JobHandle from any 1222 * thread (A=>B/B=>A deadlock) and [2] JobTask::Run or 1223 * JobTask::GetMaxConcurrency may be invoked synchronously from JobHandle 1224 * (B=>JobHandle::foo=>B deadlock). 1225 * Embedders should override CreateJobImpl() instead of PostJob(). 1226 */ 1227 std::unique_ptr
PostJob( 1228 TaskPriority priority, std::unique_ptr
job_task, 1229 const SourceLocation& location = SourceLocation::Current()) { 1230 auto handle = CreateJob(priority, std::move(job_task), location); 1231 handle->NotifyConcurrencyIncrease(); 1232 return handle; 1233 } 1234 1235 /** 1236 * Creates and returns a JobHandle associated with a Job. Unlike PostJob(), 1237 * this doesn't immediately schedules |worker_task| to run; the Job is then 1238 * scheduled by calling either NotifyConcurrencyIncrease() or Join(). 1239 * 1240 * A sufficient CreateJob() implementation that uses the default Job provided 1241 * in libplatform looks like: 1242 * std::unique_ptr
CreateJob( 1243 * TaskPriority priority, std::unique_ptr
job_task) override { 1244 * return v8::platform::NewDefaultJobHandle( 1245 * this, priority, std::move(job_task), NumberOfWorkerThreads()); 1246 * } 1247 * 1248 * Embedders should override CreateJobImpl() instead of CreateJob(). 1249 */ 1250 std::unique_ptr
CreateJob( 1251 TaskPriority priority, std::unique_ptr
job_task, 1252 const SourceLocation& location = SourceLocation::Current()) { 1253 return CreateJobImpl(priority, std::move(job_task), location); 1254 } 1255 1256 /** 1257 * Instantiates a ScopedBlockingCall to annotate a scope that may/will block. 1258 */ 1259 virtual std::unique_ptr
CreateBlockingScope( 1260 BlockingType blocking_type) { 1261 return nullptr; 1262 } 1263 1264 /** 1265 * Monotonically increasing time in seconds from an arbitrary fixed point in 1266 * the past. This function is expected to return at least 1267 * millisecond-precision values. For this reason, 1268 * it is recommended that the fixed point be no further in the past than 1269 * the epoch. 1270 **/ 1271 virtual double MonotonicallyIncreasingTime() = 0; 1272 1273 /** 1274 * Current wall-clock time in milliseconds since epoch. Use 1275 * CurrentClockTimeMillisHighResolution() when higher precision is 1276 * required. 1277 */ 1278 virtual int64_t CurrentClockTimeMilliseconds() { 1279 return static_cast
(floor(CurrentClockTimeMillis())); 1280 } 1281 1282 /** 1283 * This function is deprecated and will be deleted. Use either 1284 * CurrentClockTimeMilliseconds() or 1285 * CurrentClockTimeMillisecondsHighResolution(). 1286 */ 1287 virtual double CurrentClockTimeMillis() = 0; 1288 1289 /** 1290 * Same as CurrentClockTimeMilliseconds(), but with more precision. 1291 */ 1292 virtual double CurrentClockTimeMillisecondsHighResolution() { 1293 return CurrentClockTimeMillis(); 1294 } 1295 1296 typedef void (*StackTracePrinter)(); 1297 1298 /** 1299 * Returns a function pointer that print a stack trace of the current stack 1300 * on invocation. Disables printing of the stack trace if nullptr. 1301 */ 1302 virtual StackTracePrinter GetStackTracePrinter() { return nullptr; } 1303 1304 /** 1305 * Returns an instance of a v8::TracingController. This must be non-nullptr. 1306 */ 1307 virtual TracingController* GetTracingController() = 0; 1308 1309 /** 1310 * Tells the embedder to generate and upload a crashdump during an unexpected 1311 * but non-critical scenario. 1312 */ 1313 virtual void DumpWithoutCrashing() {} 1314 1315 /** 1316 * Allows the embedder to observe sections with high throughput allocation 1317 * operations. 1318 */ 1319 virtual HighAllocationThroughputObserver* 1320 GetHighAllocationThroughputObserver() { 1321 static HighAllocationThroughputObserver default_observer; 1322 return &default_observer; 1323 } 1324 1325 protected: 1326 /** 1327 * Default implementation of current wall-clock time in milliseconds 1328 * since epoch. Useful for implementing |CurrentClockTimeMillis| if 1329 * nothing special needed. 1330 */ 1331 V8_EXPORT static double SystemClockTimeMillis(); 1332 1333 /** 1334 * Creates and returns a JobHandle associated with a Job. 1335 */ 1336 virtual std::unique_ptr
CreateJobImpl( 1337 TaskPriority priority, std::unique_ptr
job_task, 1338 const SourceLocation& location) = 0; 1339 1340 /** 1341 * Schedules a task with |priority| to be invoked on a worker thread. 1342 */ 1343 virtual void PostTaskOnWorkerThreadImpl(TaskPriority priority, 1344 std::unique_ptr
task, 1345 const SourceLocation& location) = 0; 1346 1347 /** 1348 * Schedules a task with |priority| to be invoked on a worker thread after 1349 * |delay_in_seconds| expires. 1350 */ 1351 virtual void PostDelayedTaskOnWorkerThreadImpl( 1352 TaskPriority priority, std::unique_ptr
task, 1353 double delay_in_seconds, const SourceLocation& location) = 0; 1354 }; 1355 1356 } // namespace v8 1357 1358 #endif // V8_V8_PLATFORM_H_
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™