![]() |
v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
|
#include <atomic>
#include <cstddef>
#include <functional>
#include <list>
#include <memory>
#include <optional>
#include <queue>
#include <unordered_map>
#include <vector>
#include "include/v8-context.h"
#include "include/v8-internal.h"
#include "include/v8-isolate.h"
#include "include/v8-metrics.h"
#include "include/v8-snapshot.h"
#include "src/base/macros.h"
#include "src/base/platform/mutex.h"
#include "src/base/platform/platform-posix.h"
#include "src/builtins/builtins.h"
#include "src/common/globals.h"
#include "src/common/ptr-compr.h"
#include "src/common/thread-local-storage.h"
#include "src/debug/interface-types.h"
#include "src/execution/execution.h"
#include "src/execution/futex-emulation.h"
#include "src/execution/isolate-data.h"
#include "src/execution/messages.h"
#include "src/execution/mutex-guard-if-off-thread.h"
#include "src/execution/stack-guard.h"
#include "src/handles/handles.h"
#include "src/handles/traced-handles.h"
#include "src/heap/factory.h"
#include "src/heap/heap.h"
#include "src/heap/read-only-heap.h"
#include "src/init/isolate-group.h"
#include "src/objects/code.h"
#include "src/objects/contexts.h"
#include "src/objects/debug-objects.h"
#include "src/objects/js-objects.h"
#include "src/objects/tagged.h"
#include "src/runtime/runtime.h"
#include "src/sandbox/code-pointer-table.h"
#include "src/sandbox/external-pointer-table.h"
#include "src/sandbox/trusted-pointer-table.h"
#include "src/utils/allocation.h"
Go to the source code of this file.
Namespaces | |
namespace | v8_inspector |
namespace | v8 |
namespace | v8::base |
namespace | v8::bigint |
namespace | v8::debug |
namespace | v8::internal |
namespace | v8::internal::heap |
namespace | v8::internal::maglev |
namespace | v8::internal::baseline |
namespace | v8::internal::interpreter |
namespace | v8::internal::compiler |
namespace | v8::internal::compiler::turboshaft |
namespace | v8::internal::win64_unwindinfo |
namespace | v8::internal::metrics |
namespace | v8::internal::wasm |
namespace | v8::internal::detail |
Macros | |
#define | RETURN_FAILURE_IF_EXCEPTION(isolate) |
#define | RETURN_FAILURE_IF_EXCEPTION_DETECTOR(isolate, detector) |
#define | RETURN_VALUE_IF_EXCEPTION(isolate, value) |
#define | RETURN_VALUE_IF_EXCEPTION_DETECTOR(isolate, detector, value) |
#define | RETURN_EXCEPTION_IF_EXCEPTION(isolate) |
#define | MAYBE_RETURN_ON_EXCEPTION_VALUE(isolate, call, value) |
#define | RETURN_RESULT_OR_FAILURE(isolate, call) |
#define | ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) |
#define | ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) |
#define | ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call) |
#define | THROW_NEW_ERROR_RETURN_FAILURE(isolate, call) |
#define | THROW_NEW_ERROR_RETURN_VALUE(isolate, call, value) |
#define | THROW_NEW_ERROR(isolate, call) |
#define | RETURN_ON_EXCEPTION_VALUE(isolate, call, value) |
#define | RETURN_FAILURE_ON_EXCEPTION(isolate, call) |
#define | RETURN_ON_EXCEPTION(isolate, call) |
#define | RETURN_FAILURE(isolate, should_throw, call) |
#define | MAYBE_RETURN(call, value) |
#define | MAYBE_RETURN_NULL(call) |
#define | API_ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) |
#define | MAYBE_RETURN_ON_EXCEPTION_VALUE(isolate, call, value) |
#define | MAYBE_RETURN_FAILURE_ON_EXCEPTION(isolate, call) |
#define | MAYBE_ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) |
#define | MAYBE_ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) |
#define | FOR_WITH_HANDLE_SCOPE(isolate, loop_var_type, init, loop_var, limit_check, increment, body) |
#define | WHILE_WITH_HANDLE_SCOPE(isolate, limit_check, body) |
#define | FIELD_ACCESSOR(type, name) |
#define | ISOLATE_INIT_DEBUG_ARRAY_LIST(V) |
#define | ISOLATE_INIT_ARRAY_LIST(V) |
#define | ISOLATE_INIT_LIST(V) |
#define | THREAD_LOCAL_TOP_ACCESSOR(type, name) |
#define | THREAD_LOCAL_TOP_ADDRESS(type, name) |
#define | GLOBAL_ACCESSOR(type, name, initialvalue) |
#define | GLOBAL_ARRAY_ACCESSOR(type, name, length) |
#define | NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) |
#define | GLOBAL_BACKING_STORE(type, name, initialvalue) |
#define | GLOBAL_ARRAY_BACKING_STORE(type, name, length) |
#define | STACK_CHECK(isolate, result_value) |
Typedefs | |
using | v8::internal::DebugObjectCache = std::vector<Handle<HeapObject>> |
Functions | |
void | v8::internal::DefaultWasmAsyncResolvePromiseCallback (v8::Isolate *isolate, v8::Local< v8::Context > context, v8::Local< v8::Promise::Resolver > resolver, v8::Local< v8::Value > result, WasmAsyncSuccess success) |
void | v8::internal::DisableEmbeddedBlobRefcounting () |
void | v8::internal::FreeCurrentEmbeddedBlob () |
v8::internal::__attribute__ ((tls_model(V8_TLS_MODEL))) extern thread_local Isolate *g_current_isolate_ V8_CONSTINIT | |
#define API_ASSIGN_RETURN_ON_EXCEPTION_VALUE | ( | isolate, | |
dst, | |||
call, | |||
value ) |
#define ASSIGN_RETURN_FAILURE_ON_EXCEPTION | ( | isolate, | |
dst, | |||
call ) |
#define ASSIGN_RETURN_ON_EXCEPTION | ( | isolate, | |
dst, | |||
call ) |
#define ASSIGN_RETURN_ON_EXCEPTION_VALUE | ( | isolate, | |
dst, | |||
call, | |||
value ) |
#define FIELD_ACCESSOR | ( | type, | |
name ) |
#define FOR_WITH_HANDLE_SCOPE | ( | isolate, | |
loop_var_type, | |||
init, | |||
loop_var, | |||
limit_check, | |||
increment, | |||
body ) |
#define GLOBAL_ACCESSOR | ( | type, | |
name, | |||
initialvalue ) |
#define GLOBAL_ARRAY_ACCESSOR | ( | type, | |
name, | |||
length ) |
#define GLOBAL_ARRAY_BACKING_STORE | ( | type, | |
name, | |||
length ) |
#define GLOBAL_BACKING_STORE | ( | type, | |
name, | |||
initialvalue ) |
#define ISOLATE_INIT_ARRAY_LIST | ( | V | ) |
#define MAYBE_ASSIGN_RETURN_FAILURE_ON_EXCEPTION | ( | isolate, | |
dst, | |||
call ) |
#define MAYBE_ASSIGN_RETURN_ON_EXCEPTION_VALUE | ( | isolate, | |
dst, | |||
call, | |||
value ) |
#define MAYBE_RETURN | ( | call, | |
value ) |
#define MAYBE_RETURN_FAILURE_ON_EXCEPTION | ( | isolate, | |
call ) |
#define MAYBE_RETURN_NULL | ( | call | ) |
#define MAYBE_RETURN_ON_EXCEPTION_VALUE | ( | isolate, | |
call, | |||
value ) |
#define MAYBE_RETURN_ON_EXCEPTION_VALUE | ( | isolate, | |
call, | |||
value ) |
#define NATIVE_CONTEXT_FIELD_ACCESSOR | ( | index, | |
type, | |||
name ) |
#define RETURN_EXCEPTION_IF_EXCEPTION | ( | isolate | ) |
#define RETURN_FAILURE | ( | isolate, | |
should_throw, | |||
call ) |
#define RETURN_FAILURE_IF_EXCEPTION | ( | isolate | ) |
#define RETURN_FAILURE_IF_EXCEPTION_DETECTOR | ( | isolate, | |
detector ) |
#define RETURN_FAILURE_ON_EXCEPTION | ( | isolate, | |
call ) |
RETURN_FAILURE_ON_EXCEPTION conditionally returns the "exception" sentinel if the given MaybeHandle is empty; so it can only be used in functions with return type Object, such as RUNTIME_FUNCTION(...) {...} or BUILTIN(...) {...}. Example usage:
RUNTIME_FUNCTION(Runtime_Func) { ... RETURN_FAILURE_ON_EXCEPTION( isolate, FunctionWithReturnTypeMaybeHandleX(...)); // code to handle non exception ... }
If inside a function with return type MaybeHandle<X>, use RETURN_ON_EXCEPTION instead. If inside a function with return type Maybe<X> or Handle<X>, use RETURN_ON_EXCEPTION_VALUE instead.
#define RETURN_ON_EXCEPTION | ( | isolate, | |
call ) |
RETURN_ON_EXCEPTION conditionally returns an empty MaybeHandle<T> if the given MaybeHandle is empty. Use it to return immediately from a function with return type MaybeHandle when an exception was thrown. Example usage:
MaybeHandle<X> Func() { ... RETURN_ON_EXCEPTION( isolate, FunctionWithReturnTypeMaybeHandleY(...), X); // code to handle non exception ... }
If inside a function with return type Object, use RETURN_FAILURE_ON_EXCEPTION instead. If inside a function with return type Maybe<X> or Handle<X>, use RETURN_ON_EXCEPTION_VALUE instead.
#define RETURN_ON_EXCEPTION_VALUE | ( | isolate, | |
call, | |||
value ) |
RETURN_ON_EXCEPTION_VALUE conditionally returns the given value when the given MaybeHandle is empty. It is typically used in functions with return type Maybe<X> or Handle<X>. Example usage:
Handle<X> Func() { ... RETURN_ON_EXCEPTION_VALUE( isolate, FunctionWithReturnTypeMaybeHandleX(...), Handle<X>()); // code to handle non exception ... }
Maybe<bool> Func() { .. RETURN_ON_EXCEPTION_VALUE( isolate, FunctionWithReturnTypeMaybeHandleX(...), Nothing<bool>); // code to handle non exception return Just(true); }
If inside a function with return type MaybeHandle<X>, use RETURN_ON_EXCEPTION instead. If inside a function with return type Object, use RETURN_FAILURE_ON_EXCEPTION instead.
#define RETURN_RESULT_OR_FAILURE | ( | isolate, | |
call ) |
RETURN_RESULT_OR_FAILURE is used in functions with return type Object (such as "RUNTIME_FUNCTION(...) {...}" or "BUILTIN(...) {...}" ) to return either the contents of a MaybeHandle<X>, or the "exception" sentinel value. Example usage:
RUNTIME_FUNCTION(Runtime_Func) { ... RETURN_RESULT_OR_FAILURE( isolate, FunctionWithReturnTypeMaybeHandleX(...)); }
If inside a function with return type MaybeHandle<X> use RETURN_ON_EXCEPTION instead. If inside a function with return type Handle<X>, or Maybe<X> use RETURN_ON_EXCEPTION_VALUE instead.
#define RETURN_VALUE_IF_EXCEPTION | ( | isolate, | |
value ) |
#define RETURN_VALUE_IF_EXCEPTION_DETECTOR | ( | isolate, | |
detector, | |||
value ) |
#define STACK_CHECK | ( | isolate, | |
result_value ) |
#define THREAD_LOCAL_TOP_ACCESSOR | ( | type, | |
name ) |
#define THREAD_LOCAL_TOP_ADDRESS | ( | type, | |
name ) |
#define THROW_NEW_ERROR | ( | isolate, | |
call ) |
#define THROW_NEW_ERROR_RETURN_FAILURE | ( | isolate, | |
call ) |
#define THROW_NEW_ERROR_RETURN_VALUE | ( | isolate, | |
call, | |||
value ) |
#define WHILE_WITH_HANDLE_SCOPE | ( | isolate, | |
limit_check, | |||
body ) |