![]() |
v8 13.6.233 (node 24.1.0)
V8 is Google's open source JavaScript engine
|
Namespaces | |
namespace | api_internal |
namespace | base |
namespace | debug |
namespace | detail |
namespace | internal |
namespace | metrics |
namespace | platform |
Functions | |
void V8_EXPORT | RegisterExtension (std::unique_ptr< Extension >) |
template<CTypeInfo::Identifier type_info_id, typename T> | |
bool V8_EXPORT V8_WARN_UNUSED_RESULT | TryToCopyAndConvertArrayToCppBuffer (Local< Array > src, T *dst, uint32_t max_length) |
template<class T> | |
Maybe< T > | Nothing () |
template<class T> | |
Maybe< T > | Just (const T &t) |
template<class T, std::enable_if_t<!std::is_lvalue_reference_v< T > > * = nullptr> | |
Maybe< T > | Just (T &&t) |
Maybe< void > | JustVoid () |
template<class T, std::size_t N> | |
constexpr std::array< std::remove_cv_t< T >, N > | to_array (T(&a)[N]) |
template<class T, std::size_t N> | |
constexpr std::array< std::remove_cv_t< T >, N > | to_array (T(&&a)[N]) |
enum | V8_DEPRECATE_SOON ("This enum is no longer used and will be removed in V8 12.9.") AccessControl |
PlatformSharedMemoryHandle | SharedMemoryHandleFromFileDescriptor (int fd) |
int | FileDescriptorFromSharedMemoryHandle (PlatformSharedMemoryHandle handle) |
V8_INLINE Local< Primitive > | Undefined (Isolate *isolate) |
V8_INLINE Local< Primitive > | Null (Isolate *isolate) |
V8_INLINE Local< Boolean > | True (Isolate *isolate) |
V8_INLINE Local< Boolean > | False (Isolate *isolate) |
constexpr CppHeapPointerTagRange | kAnyCppHeapPointer (CppHeapPointerTag::kFirstTag, CppHeapPointerTag::kLastTag) |
V8_INLINE bool | operator== (const TracedReferenceBase &lhs, const TracedReferenceBase &rhs) |
template<typename U> | |
V8_INLINE bool | operator== (const TracedReferenceBase &lhs, const v8::Local< U > &rhs) |
template<typename U> | |
V8_INLINE bool | operator== (const v8::Local< U > &lhs, const TracedReferenceBase &rhs) |
V8_INLINE bool | operator!= (const TracedReferenceBase &lhs, const TracedReferenceBase &rhs) |
template<typename U> | |
V8_INLINE bool | operator!= (const TracedReferenceBase &lhs, const v8::Local< U > &rhs) |
template<typename U> | |
V8_INLINE bool | operator!= (const v8::Local< U > &lhs, const TracedReferenceBase &rhs) |
constexpr uint32_t | CurrentValueSerializerFormatVersion () |
V8_EXPORT bool | TryHandleWebAssemblyTrapPosix (int sig_code, siginfo_t *info, void *context) |
V8_EXPORT bool | TryHandleWebAssemblyTrapWindows (EXCEPTION_POINTERS *exception) |
This file provides additional API on top of the default one for making API calls, which come from embedder C++ functions. The functions are being called directly from optimized code, doing all the necessary typechecks in the compiler itself, instead of on the embedder side. Hence the "fast" in the name. Example usage might look like:
By design, fast calls are limited by the following requirements, which the embedder should enforce themselves:
Due to these limitations, it's not directly possible to report errors by throwing a JS exception or to otherwise do an allocation. There is an alternative way of creating fast calls that supports falling back to the slow call and then performing the necessary allocation. When one creates the fast method by using CFunction::MakeWithFallbackSupport instead of CFunction::Make, the fast callback gets as last parameter an output variable, through which it can request falling back to the slow call. So one might declare their method like:
If the callback wants to signal an error condition or to perform an allocation, it must set options.fallback to true and do an early return from the fast method. Then V8 checks the value of options.fallback and if it's true, falls back to executing the SlowCallback, which is capable of reporting the error (either by throwing a JS exception or logging to the console) or doing the allocation. It's the embedder's responsibility to ensure that the fast callback is idempotent up to the point where error and fallback conditions are checked, because otherwise executing the slow callback might produce visible side-effects twice.
An example for custom embedder type support might employ a way to wrap/ unwrap various C++ types in JSObject instances, e.g:
For instance if {object} is exposed via a global "obj" variable, one could write in JS: function hot_func() { obj.method(42); } and once {hot_func} gets optimized, CustomEmbedderType::FastMethod will be called instead of the slow version, with the following arguments: receiver := the {embedder_object} from above param := 42
Currently supported return types:
pointer to an embedder type
The 64-bit integer types currently have the IDL (unsigned) long long semantics: https://heycam.github.io/webidl/#abstract-opdef-converttoint In the future we'll extend the API to also provide conversions from/to BigInt to preserve full precision. The floating point types currently have the IDL (unrestricted) semantics, which is the only one used by WebGL. We plan to add support also for restricted floats/doubles, similarly to the BigInt conversion policies. We also differ from the specific NaN bit pattern that WebIDL prescribes (https://heycam.github.io/webidl/#es-unrestricted-float) in that Blink passes NaN values as-is, i.e. doesn't normalize them.
To be supported types:
The API offers a limited support for function overloads:
In this example a single FunctionTemplate is associated to multiple C++ functions. The overload resolution is currently only based on the number of arguments passed in a call. For example, if this method_template is registered with a wrapper JS object as described above, a call with two arguments: obj.method(42, true); will result in a fast call to FastMethod_2Args, while a call with three or more arguments: obj.method(42, true, 11); will result in a fast call to FastMethod_3Args. Instead a call with less than two arguments, like: obj.method(42); would not result in a fast call but would fall back to executing the associated SlowCallback.
The v8 JavaScript engine.
Profiler support for the V8 JavaScript engine.
Support for Persistent containers.
C++11 embedders can use STL containers with Global values, but pre-C++11 does not support the required move semantic and hence may want these container classes.
Compile-time constants.
This header provides access to information about the value serializer at compile time, without declaring or defining any symbols that require linking to V8.
using AccessCheckCallback |
Returns true if the given context should be allowed to access the given object.
Definition at line 457 of file v8-template.h.
Accessor[Getter|Setter] are used as callback functions when setting|getting a particular data property. See Object::SetNativeDataProperty and ObjectTemplate::SetNativeDataProperty methods.
Definition at line 155 of file v8-object.h.
Definition at line 158 of file v8-object.h.
using AddCrashKeyCallback = void (*)(CrashKeyId id, const std::string& value) |
Definition at line 256 of file v8-callbacks.h.
using AddHistogramSampleCallback = void (*)(void* histogram, int sample) |
Definition at line 221 of file v8-callbacks.h.
Definition at line 303 of file v8-callbacks.h.
using ApiImplementationCallback = void (*)(const FunctionCallbackInfo<Value>&) |
Definition at line 308 of file v8-callbacks.h.
Definition at line 123 of file v8-array-buffer.h.
using BeforeCallEnteredCallback = void (*)(Isolate*) |
Definition at line 259 of file v8-callbacks.h.
using CallCompletedCallback = void (*)(Isolate*) |
Definition at line 260 of file v8-callbacks.h.
Definition at line 771 of file v8-fast-api-calls.h.
using CompileHintCallback = bool (*)(int, void*) |
Callback for requesting a compile hint for a function from the embedder. The first parameter is the position of the function in source code and the second parameter is embedder data to be passed back.
Definition at line 423 of file v8-callbacks.h.
using CounterLookupCallback = int* (*)(const char* name) |
Callback function passed to SetUnhandledExceptionCallback.
Definition at line 216 of file v8-callbacks.h.
using CreateHistogramCallback |
Definition at line 218 of file v8-callbacks.h.
using DcheckErrorCallback |
Definition at line 52 of file v8-initialization.h.
using EntropySource = bool (*)(unsigned char* buffer, size_t length) |
EntropySource is used as a callback function when v8 needs a source of entropy.
Definition at line 34 of file v8-initialization.h.
Definition at line 132 of file v8-exception.h.
using ExtensionCallback = bool (*)(const FunctionCallbackInfo<Value>&) |
Definition at line 301 of file v8-callbacks.h.
Definition at line 297 of file v8-callbacks.h.
using FatalErrorCallback = void (*)(const char* location, const char* message) |
Definition at line 225 of file v8-callbacks.h.
using FunctionCallback = void (*)(const FunctionCallbackInfo<Value>& info) |
Definition at line 314 of file v8-function-callback.h.
using GCCallback = void (*)(GCType type, GCCallbackFlags flags) |
Definition at line 189 of file v8-callbacks.h.
Definition at line 344 of file v8-template.h.
Definition at line 299 of file v8-template.h.
Definition at line 380 of file v8-template.h.
Definition at line 312 of file v8-template.h.
Definition at line 191 of file v8-template.h.
Definition at line 262 of file v8-template.h.
Definition at line 224 of file v8-template.h.
Definition at line 621 of file v8-local-handle.h.
HostCreateShadowRealmContextCallback is called each time a ShadowRealm is being constructed in the initiator_context.
The method combines Context creation and implementation defined abstract operation HostInitializeShadowRealm into one.
The embedder should use v8::Context::New or v8::Context:NewFromSnapshot to create a new context. If the creation fails, the embedder must propagate that exception by returning an empty MaybeLocal.
Definition at line 450 of file v8-callbacks.h.
HostImportModuleDynamicallyCallback is called when we require the embedder to load a module. This is used as part of the dynamic import syntax.
The referrer contains metadata about the script/module that calls import.
The specifier is the name of the module that should be imported.
The import_attributes are import attributes for this request in the form: [key1, value1, key2, value2, ...] where the keys and values are of type v8::String. Note, unlike the FixedArray passed to ResolveModuleCallback and returned from ModuleRequest::GetImportAttributes(), this array does not contain the source Locations of the attributes.
The embedder must compile, instantiate, evaluate the Module, and obtain its namespace object.
The Promise returned from this function is forwarded to userland JavaScript. The embedder must resolve this promise with the module namespace object. In case of an exception, the embedder must reject this promise with the exception. If the promise creation itself fails (e.g. due to stack overflow), the embedder must propagate that exception by returning an empty MaybeLocal.
Definition at line 372 of file v8-callbacks.h.
HostImportModuleWithPhaseDynamicallyCallback is called when we require the embedder to load a module with a specific phase. This is used as part of the dynamic import syntax.
The referrer contains metadata about the script/module that calls import.
The specifier is the name of the module that should be imported.
The phase is the phase of the import requested.
The import_attributes are import attributes for this request in the form: [key1, value1, key2, value2, ...] where the keys and values are of type v8::String. Note, unlike the FixedArray passed to ResolveModuleCallback and returned from ModuleRequest::GetImportAttributes(), this array does not contain the source Locations of the attributes.
The Promise returned from this function is forwarded to userland JavaScript. The embedder must resolve this promise according to the phase requested:
In case of an exception, the embedder must reject this promise with the exception. If the promise creation itself fails (e.g. due to stack overflow), the embedder must propagate that exception by returning an empty MaybeLocal.
This callback is still experimental and is only invoked for source phase imports.
Definition at line 413 of file v8-callbacks.h.
HostInitializeImportMetaObjectCallback is called the first time import.meta is accessed for a module. Subsequent access will reuse the same value.
The method combines two implementation-defined abstract operations into one: HostGetImportMetaProperties and HostFinalizeImportMeta.
The embedder should use v8::Object::CreateDataProperty to add properties on the meta object.
Definition at line 435 of file v8-callbacks.h.
Definition at line 440 of file v8-template.h.
See v8::NamedPropertyDefinerCallback
.
Definition at line 436 of file v8-template.h.
Definition at line 421 of file v8-template.h.
Definition at line 450 of file v8-template.h.
See v8::NamedPropertyDescriptorCallback
.
Definition at line 447 of file v8-template.h.
Returns an array containing the indices of the properties the indexed property getter intercepts.
Note: The values in the array must be uint32_t.
Definition at line 430 of file v8-template.h.
Definition at line 393 of file v8-template.h.
Definition at line 412 of file v8-template.h.
Definition at line 402 of file v8-template.h.
See v8::NamedPropertySetterCallback
.
Definition at line 399 of file v8-template.h.
using InterruptCallback = void (*)(Isolate* isolate, void* data) |
Definition at line 191 of file v8-callbacks.h.
IsJSApiWrapperNativeErrorCallback is called on an JSApiWrapper object to determine if Error.isError should return true or false. For instance, in an HTML embedder, DOMExceptions return true when passed to Error.isError.
Definition at line 458 of file v8-callbacks.h.
Definition at line 332 of file v8-callbacks.h.
using JitCodeEventHandler = void (*)(const JitCodeEvent* event) |
Callback function passed to SetJitCodeEventHandler.
event | code add, move or removal event. |
Definition at line 142 of file v8-callbacks.h.
using LogEventCallback |
Definition at line 240 of file v8-callbacks.h.
using MessageCallback = void (*)(Local<Message> message, Local<Value> data) |
Definition at line 235 of file v8-callbacks.h.
using MicrotaskCallback = void (*)(void* data) |
Definition at line 14 of file v8-microtask.h.
using MicrotasksCompletedCallbackWithData = void (*)(Isolate*, void*) |
Definition at line 13 of file v8-microtask.h.
Callback to check if codegen is allowed from a source object, and convert the source to string if necessary. See: ModifyCodeGenerationFromStrings.
Definition at line 276 of file v8-callbacks.h.
Definition at line 279 of file v8-callbacks.h.
Interceptor for defineProperty requests on an object.
If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should return Intercepted::kYes
. If the interceptor does not handle the request it must return Intercepted::kNo
and it must not produce side effects.
property | The name of the property for which the request was intercepted. |
desc | The property descriptor which is used to define the property if the request is not intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
See also ObjectTemplate::SetHandler
.
Definition at line 333 of file v8-template.h.
Interceptor for delete requests on an object.
If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should
info.GetReturnValue().Set()
to set to a Boolean value indicating whether the property deletion was successful or not,Intercepted::kYes
. If the interceptor does not handle the request it must return Intercepted::kNo
and it must not produce side effects.property | The name of the property for which the request was intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
delete
, i.e., throw in strict mode instead of returning false, use info.ShouldThrowOnError()
to determine if you are in strict mode.See also ObjectTemplate::SetHandler.
Definition at line 289 of file v8-template.h.
Interceptor for getOwnPropertyDescriptor requests on an object.
If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should
info.GetReturnValue().Set()
to set the return value which must be object that can be converted to a PropertyDescriptor (for example, a value returned by v8::Object::getOwnPropertyDescriptor
),Intercepted::kYes
. If the interceptor does not handle the request it must return Intercepted::kNo
and it must not produce side effects.property | The name of the property for which the request was intercepted. \info Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
See also ObjectTemplate::SetHandler
.
Definition at line 372 of file v8-template.h.
Returns an array containing the names of the properties the named property getter intercepts.
Note: The values in the array must be of type v8::Name.
Definition at line 308 of file v8-template.h.
Interceptor for get requests on an object.
If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should
to set the return value (by default the result is set to v8::Undefined),
return
Intercepted::kYes. If the interceptor does not handle the request it must return
Intercepted::kNo` and it must not produce side effects.property | The name of the property for which the request was intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
See also ObjectTemplate::SetHandler
.
Definition at line 184 of file v8-template.h.
Intercepts all requests that query the attributes of the property, e.g., getOwnPropertyDescriptor(), propertyIsEnumerable(), and defineProperty().
If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should
info.GetReturnValue().Set()
to set to an Integer value encoding a v8::PropertyAttribute
bits,Intercepted::kYes
. If the interceptor does not handle the request it must return Intercepted::kNo
and it must not produce side effects.property | The name of the property for which the request was intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
hasOwnProperty()
can trigger this interceptor depending on the state of the object.See also ObjectTemplate::SetHandler.
Definition at line 254 of file v8-template.h.
Interceptor for set requests on an object.
If the interceptor handles the request (i.e. the property should not be looked up beyond the interceptor or in case an exception was thrown) it should return Intercepted::kYes
. If the interceptor does not handle the request it must return Intercepted::kNo
and it must not produce side effects.
property | The name of the property for which the request was intercepted. |
value | The value which the property will have if the request is not intercepted. |
info | Information about the intercepted request, such as isolate, receiver, return value, or whether running in ‘'use strict’mode. See PropertyCallbackInfo`. |
See also ObjectTemplate::SetHandler.
Definition at line 213 of file v8-template.h.
using NativeObject = void* |
Definition at line 30 of file v8-profiler.h.
using NearHeapLimitCallback |
This callback is invoked when the heap size is close to the heap limit and V8 is likely to abort with out-of-memory error. The callback can extend the heap limit by returning a value that is greater than the current_heap_limit. The initial heap limit is the limit that was set after heap setup.
Definition at line 203 of file v8-callbacks.h.
using OOMErrorCallback |
Definition at line 232 of file v8-callbacks.h.
typedef uintptr_t PersistentContainerValue |
using PlatformSharedMemoryHandle = intptr_t |
Definition at line 669 of file v8-platform.h.
PrepareStackTraceCallback is called when the stack property of an error is first accessed. The return value will be used as the stack value. If this callback is registed, the |Error.prepareStackTrace| API will be disabled. |sites| is an array of call sites, specified in https://v8.dev/docs/stack-trace-api
Definition at line 468 of file v8-callbacks.h.
Definition at line 193 of file v8-callbacks.h.
using ProfilerId = uint32_t |
Definition at line 32 of file v8-profiler.h.
using PromiseHook |
Definition at line 143 of file v8-promise.h.
using PromiseRejectCallback = void (*)(PromiseRejectMessage message) |
Definition at line 170 of file v8-promise.h.
ReturnAddressLocationResolver is used as a callback function when v8 is resolving the location of a return address on the stack. Profilers that change the return address on the stack can use this to resolve the stack location to wherever the profiler stashed the original return address.
return_addr_location | A location on stack where a machine return address resides. |
Definition at line 49 of file v8-initialization.h.
Definition at line 328 of file v8-callbacks.h.
using SnapshotObjectId = uint32_t |
Definition at line 31 of file v8-profiler.h.
using StackState = cppgc::EmbedderStackState |
Indicator for the stack state.
Definition at line 192 of file v8-isolate.h.
using UniquePersistent = Global<T> |
Definition at line 411 of file v8-persistent-handle.h.
using V8FatalErrorCallback |
Definition at line 55 of file v8-initialization.h.
Definition at line 316 of file v8-callbacks.h.
using WasmImportedStringsEnabledCallback = bool (*)(Local<Context> context) |
Definition at line 325 of file v8-callbacks.h.
using WasmJSPIEnabledCallback = bool (*)(Local<Context> context) |
Definition at line 336 of file v8-callbacks.h.
Definition at line 321 of file v8-callbacks.h.
using WasmStreamingCallback = void (*)(const FunctionCallbackInfo<Value>&) |
Definition at line 311 of file v8-callbacks.h.
enum AccessType |
Access type specification.
Enumerator | |
---|---|
ACCESS_GET | |
ACCESS_SET | |
ACCESS_HAS | |
ACCESS_DELETE | |
ACCESS_KEYS |
Definition at line 289 of file v8-callbacks.h.
|
strong |
Enumerator | |
---|---|
kInternalized | |
kExternalized |
Definition at line 32 of file v8-array-buffer.h.
|
strong |
Enumerator | |
---|---|
kZeroInitialized | |
kUninitialized |
Definition at line 33 of file v8-array-buffer.h.
|
strong |
Enumerator | |
---|---|
kReturnNull | |
kOutOfMemory |
Definition at line 34 of file v8-array-buffer.h.
|
strong |
A "blocking call" refers to any call that causes the calling thread to wait off-CPU. It includes but is not limited to calls that wait on synchronous file I/O operations: read or write a file from disk, interact with a pipe or a socket, rename or delete a file, enumerate files in a directory, etc. Acquiring a low contention lock is not considered a blocking call. BlockingType indicates the likelihood that a blocking call will actually block.
Enumerator | |
---|---|
kMayBlock | |
kWillBlock |
Definition at line 332 of file v8-platform.h.
enum CodeEventType |
Note that this enum may be extended in the future. Please include a default case if this enum is used in a switch statement.
Enumerator | |
---|---|
kUnknownType |
Definition at line 1275 of file v8-profiler.h.
|
strong |
Enumerator | |
---|---|
kThrow | |
kAllow |
Definition at line 461 of file v8-template.h.
|
strong |
Signal for dependants of contexts. Useful for ContextDisposedNotification()
to implement different strategies.
Enumerator | |
---|---|
kNoDependants | Context has no dependants. These are usually top-level contexts. |
kSomeDependants | Context has some dependants, i.e., it may depend on other contexts. This is usually the case for inner contexts. |
Definition at line 181 of file v8-isolate.h.
|
strong |
A pointer tag used for wrapping and unwrapping CppHeap
pointers as used with JS API wrapper objects that rely on v8::Object::Wrap()
and v8::Object::Unwrap()
.
The CppHeapPointers use a range-based type checking scheme, where on access to a pointer, the actual type of the pointer is checked to be within a specified range of types. This allows supporting type hierarchies, where a type check for a supertype must succeed for any subtype.
The tag is currently in practice limited to 15 bits since it needs to fit together with a marking bit into the unused parts of a pointer.
Definition at line 28 of file v8-sandbox.h.
Enumerator | |
---|---|
kLazyLogging | |
kEagerLogging |
Definition at line 308 of file v8-profiler.h.
enum CpuProfilingMode |
Enumerator | |
---|---|
kLeafNodeLineNumbers | |
kCallerLineNumbers |
Definition at line 289 of file v8-profiler.h.
Enumerator | |
---|---|
kStandardNaming | |
kDebugNaming |
Definition at line 300 of file v8-profiler.h.
|
strong |
Enumerator | |
---|---|
kStarted | |
kAlreadyStarted | |
kErrorTooManyProfilers |
Definition at line 320 of file v8-profiler.h.
|
strong |
Definition at line 244 of file v8-callbacks.h.
|
strong |
Enumerator | |
---|---|
EMPTY | |
OTHER |
Definition at line 22 of file v8-embedder-state-scope.h.
|
strong |
This is a part of experimental Api and might be changed without further notice. Do not use it.
Definition at line 78 of file v8-exception.h.
enum GCCallbackFlags |
GCCallbackFlags is used to notify additional information about the GC callback.
Definition at line 179 of file v8-callbacks.h.
enum GCType |
Applications can register callback functions which will be called before and after certain garbage collection operations. Allocations are not allowed in the callback functions, you therefore cannot manipulate objects (set or delete properties for example) since it is possible such operations will result in the allocation of objects. TODO(v8:12612): Deprecate kGCTypeMinorMarkSweep after updating blink.
Enumerator | |
---|---|
kGCTypeScavenge | |
kGCTypeMinorMarkSweep | |
kGCTypeMarkSweepCompact | |
kGCTypeIncrementalMarking | |
kGCTypeProcessWeakCallbacks | |
kGCTypeAll |
Definition at line 154 of file v8-callbacks.h.
|
strong |
kIncludesIndices allows for integer indices to be collected, while kSkipIndices will exclude integer indices from being collected.
Enumerator | |
---|---|
kIncludeIndices | |
kSkipIndices |
Definition at line 217 of file v8-object.h.
|
strong |
|
strong |
Interceptor callbacks use this value to indicate whether the request was intercepted or not.
Enumerator | |
---|---|
kNo | |
kYes |
Definition at line 139 of file v8-template.h.
enum Intrinsic |
Definition at line 41 of file v8-template.h.
enum JitCodeEventOptions |
Option flags passed to the SetJitCodeEventHandler function.
Enumerator | |
---|---|
kJitCodeEventDefault | |
kJitCodeEventEnumExisting | |
kLastJitCodeEventOption |
Definition at line 129 of file v8-callbacks.h.
|
strong |
Keys/Properties filter enums:
KeyCollectionMode limits the range of collected properties. kOwnOnly limits the collected properties to the given Object only. kIncludesPrototypes will include all keys of the objects's prototype chain as well.
Enumerator | |
---|---|
kOwnOnly | |
kIncludePrototypes |
Definition at line 211 of file v8-object.h.
|
strong |
kConvertToString will convert integer indices to strings. kKeepNumbers will return numbers for integer indices.
Enumerator | |
---|---|
kConvertToString | |
kKeepNumbers | |
kNoNumbers |
Definition at line 223 of file v8-object.h.
enum LogEventStatus : int |
Enumerator | |
---|---|
kStart | |
kEnd | |
kLog |
Definition at line 239 of file v8-callbacks.h.
|
strong |
Controls how promptly a memory measurement request is executed. By default the measurement is folded with the next scheduled GC which may happen after a while and is forced after some timeout. The kEager mode starts incremental GC right away and is useful for testing. The kLazy mode does not force GC.
Enumerator | |
---|---|
kDefault | |
kEager | |
kLazy |
Definition at line 43 of file v8-statistics.h.
|
strong |
Controls how the default MeasureMemoryDelegate reports the result of the memory measurement to JS. With kSummary only the total size is reported. With kDetailed the result includes the size of each native context.
Enumerator | |
---|---|
kSummary | |
kDetailed |
Definition at line 34 of file v8-statistics.h.
|
strong |
Memory pressure level for the MemoryPressureNotification. kNone hints V8 that there is no memory pressure. kModerate hints V8 to speed up incremental garbage collection at the cost of of higher latency due to garbage collection pauses. kCritical hints V8 to free memory as soon as possible. Garbage collection pauses at this level will be large.
Enumerator | |
---|---|
kNone | |
kModerate | |
kCritical |
Definition at line 175 of file v8-isolate.h.
|
strong |
Policy for running microtasks:
Enumerator | |
---|---|
kExplicit | |
kScoped | |
kAuto |
Definition at line 24 of file v8-microtask.h.
|
strong |
Import phases in import requests.
Enumerator | |
---|---|
kSource | |
kEvaluation |
Definition at line 341 of file v8-callbacks.h.
|
strong |
A flag describing different modes of string creation.
Aside from performance implications there are no differences between the two creation modes.
Definition at line 107 of file v8-primitive.h.
|
strong |
Possible permissions for memory pages.
Enumerator | |
---|---|
kNoAccess | |
kRead | |
kReadWrite | |
kReadWriteExecute | |
kReadExecute |
Definition at line 722 of file v8-platform.h.
|
strong |
PromiseHook with type kInit is called when a new promise is created. When a new promise is created as part of the chain in the case of Promise.then or in the intermediate promises created by Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise otherwise we pass undefined.
PromiseHook with type kResolve is called at the beginning of resolve or reject function defined by CreateResolvingFunctions.
PromiseHook with type kBefore is called at the beginning of the PromiseReactionJob.
PromiseHook with type kAfter is called right at the end of the PromiseReactionJob.
Enumerator | |
---|---|
kInit | |
kResolve | |
kBefore | |
kAfter |
Definition at line 141 of file v8-promise.h.
enum PromiseRejectEvent |
Enumerator | |
---|---|
kPromiseRejectWithNoHandler | |
kPromiseHandlerAddedAfterReject | |
kPromiseRejectAfterResolved | |
kPromiseResolveAfterResolved |
Definition at line 147 of file v8-promise.h.
enum PropertyAttribute |
Enumerator | |
---|---|
None | None. |
ReadOnly | ReadOnly, i.e., not writable. |
DontEnum | DontEnum, i.e., not enumerable. |
DontDelete | DontDelete, i.e., not configurable. |
Definition at line 139 of file v8-object.h.
enum PropertyFilter |
Property filter bits. They can be or'ed to build a composite filter.
Enumerator | |
---|---|
ALL_PROPERTIES | |
ONLY_WRITABLE | |
ONLY_ENUMERABLE | |
ONLY_CONFIGURABLE | |
SKIP_STRINGS | |
SKIP_SYMBOLS |
Definition at line 179 of file v8-object.h.
|
strong |
Configuration flags for v8::NamedPropertyHandlerConfiguration or v8::IndexedPropertyHandlerConfiguration.
Definition at line 726 of file v8-template.h.
|
strong |
Enumerator | |
---|---|
kClassic | |
kModule |
Definition at line 397 of file v8-script.h.
|
strong |
Options for marking whether callbacks may trigger JS-observable side effects. Side-effect-free callbacks are allowlisted during debug evaluation with throwOnSideEffect. It applies when calling a Function, FunctionTemplate, or an Accessor callback. For Interceptors, please see PropertyHandlerFlags's kHasNoSideEffect. Callbacks that only cause side effects to the receiver are allowlisted if invoked on receiver objects that are created within the same debug-evaluate call, as these objects are temporary and the side effect does not escape.
Enumerator | |
---|---|
kHasSideEffect | |
kHasNoSideEffect | |
kHasSideEffectToReceiver |
Definition at line 198 of file v8-object.h.
enum StateTag : uint16_t |
Enumerator | |
---|---|
JS | |
GC | |
PARSER | |
BYTECODE_COMPILER | |
COMPILER | |
OTHER | |
EXTERNAL | |
ATOMICS_WAIT | |
IDLE | |
LOGGING |
Definition at line 36 of file v8-unwinder.h.
|
strong |
Definition at line 24 of file v8-platform.h.
|
strong |
Enumerator | |
---|---|
kSuccess | |
kFail |
Definition at line 313 of file v8-callbacks.h.
|
strong |
Weakness type for weak handles.
Enumerator | |
---|---|
kParameter | Passes a user-defined void* parameter back to the callback. |
kInternalFields | Passes the first two internal fields of the object back to the callback. |
Definition at line 65 of file v8-weak-callback-info.h.
|
constexpr |
Definition at line 20 of file v8-value-serializer-version.h.
Definition at line 1079 of file v8-primitive.h.
Referenced by Boolean::New().
|
inline |
Definition at line 713 of file v8-platform.h.
|
inline |
Definition at line 117 of file v8-maybe.h.
|
inline |
Definition at line 125 of file v8-maybe.h.
|
inline |
Definition at line 157 of file v8-maybe.h.
|
constexpr |
|
inline |
Definition at line 112 of file v8-maybe.h.
Definition at line 1063 of file v8-primitive.h.
V8_INLINE bool operator!= | ( | const TracedReferenceBase & | lhs, |
const TracedReferenceBase & | rhs ) |
Definition at line 334 of file v8-traced-handle.h.
References V8_INLINE.
V8_INLINE bool operator!= | ( | const TracedReferenceBase & | lhs, |
const v8::Local< U > & | rhs ) |
Definition at line 340 of file v8-traced-handle.h.
References V8_INLINE.
V8_INLINE bool operator!= | ( | const v8::Local< U > & | lhs, |
const TracedReferenceBase & | rhs ) |
Definition at line 346 of file v8-traced-handle.h.
References V8_INLINE.
V8_INLINE bool operator== | ( | const TracedReferenceBase & | lhs, |
const TracedReferenceBase & | rhs ) |
Definition at line 317 of file v8-traced-handle.h.
V8_INLINE bool operator== | ( | const TracedReferenceBase & | lhs, |
const v8::Local< U > & | rhs ) |
Definition at line 323 of file v8-traced-handle.h.
V8_INLINE bool operator== | ( | const v8::Local< U > & | lhs, |
const TracedReferenceBase & | rhs ) |
Definition at line 329 of file v8-traced-handle.h.
References V8_INLINE.
|
inline |
Definition at line 710 of file v8-platform.h.
|
nodiscardconstexpr |
Definition at line 316 of file v8-memory-span.h.
References v8::detail::to_array_rvalue_impl().
|
nodiscardconstexpr |
Definition at line 311 of file v8-memory-span.h.
References v8::detail::to_array_lvalue_impl().
Definition at line 1071 of file v8-primitive.h.
Referenced by Boolean::New().
V8_EXPORT bool TryHandleWebAssemblyTrapPosix | ( | int | sig_code, |
siginfo_t * | info, | ||
void * | context ) |
This function determines whether a memory access violation has been an out-of-bounds memory access in WebAssembly. If so, it will modify the context parameter and add a return address where the execution can continue after the signal handling, and return true. Otherwise, false will be returned.
The parameters to this function correspond to those passed to a Posix signal handler. Use this function only on Linux and Mac.
sig_code | The signal code, e.g. SIGSEGV. |
info | A pointer to the siginfo_t struct provided to the signal handler. |
context | A pointer to a ucontext_t struct provided to the signal handler. |
References V8_EXPORT.
V8_EXPORT bool TryHandleWebAssemblyTrapWindows | ( | EXCEPTION_POINTERS * | exception | ) |
This function determines whether a memory access violation has been an out-of-bounds memory access in WebAssembly. If so, it will modify the exception parameter and add a return address where the execution can continue after the exception handling, and return true. Otherwise the return value will be false.
The parameter to this function corresponds to the one passed to a Windows vectored exception handler. Use this function only on Windows.
exception | An EXCEPTION_POINTERS* as provided to the exception handler. |
References V8_EXPORT.
bool V8_EXPORT V8_WARN_UNUSED_RESULT TryToCopyAndConvertArrayToCppBuffer | ( | Local< Array > | src, |
T * | dst, | ||
uint32_t | max_length ) |
Copies the contents of this JavaScript array to a C++ buffer with a given max_length. A CTypeInfo is passed as an argument, instructing different rules for conversion (e.g. restricted float/double). The element type T of the destination array must match the C type corresponding to the CTypeInfo (specified by CTypeInfoTraits). If the array length is larger than max_length or the array is of unsupported type, the operation will fail, returning false. Generally, an array which contains objects, undefined, null or anything not convertible to the requested destination type, is considered unsupported. The operation returns true on success. type_info
will be used for conversions.
References TryToCopyAndConvertArrayToCppBuffer(), V8_EXPORT, and V8_WARN_UNUSED_RESULT.
Referenced by TryToCopyAndConvertArrayToCppBuffer().
Definition at line 1055 of file v8-primitive.h.
Referenced by FunctionCallbackInfo< T >::operator[]().
enum V8_DEPRECATE_SOON | ( | "This enum is no longer used and will be removed in V8 12.9." | ) |
Access control specifications.
Some accessors should be accessible across contexts. These accessors have an explicit access control parameter which specifies the kind of cross-context access that should be allowed.
Definition at line 91 of file v8-object.h.
References PropertyDescriptor::PropertyDescriptor(), and V8_EXPORT.
Referenced by Isolate::ContextDisposedNotification(), Isolate::IsolateInForegroundNotification(), String::NewExternalOneByte(), and SnapshotCreator::SnapshotCreator().