// Copyright 2012 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/** \mainpage V8 API Reference Guide
*
* V8 is Google's open source JavaScript engine.
*
* This set of documents provides reference material generated from the
* V8 header file, include/v8.h.
*
* For other documentation see https://v8.dev/.
*/
#ifndef INCLUDE_V8_H_
#define INCLUDE_V8_H_
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <memory>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "cppgc/common.h"
#include "v8-internal.h" // NOLINT(build/include_directory)
#include "v8-version.h" // NOLINT(build/include_directory)
#include "v8config.h" // NOLINT(build/include_directory)
// We reserve the V8_* prefix for macros defined in V8 public API and
// assume there are no name conflicts with the embedder's code.
/**
* The v8 JavaScript engine.
*/
namespace v8 {
class AccessorSignature;
class Array;
class ArrayBuffer;
class BigInt;
class BigIntObject;
class Boolean;
class BooleanObject;
class Context;
class Data;
class Date;
class External;
class Function;
class FunctionTemplate;
class HeapProfiler;
class ImplementationUtilities;
class Int32;
class Integer;
class Isolate;
template <class T>
class Maybe;
class MicrotaskQueue;
class Name;
class Number;
class NumberObject;
class Object;
class ObjectOperationDescriptor;
class ObjectTemplate;
class Platform;
class Primitive;
class Promise;
class PropertyDescriptor;
class Proxy;
class RawOperationDescriptor;
class Script;
class SharedArrayBuffer;
class Signature;
class StartupData;
class StackFrame;
class StackTrace;
class String;
class StringObject;
class Symbol;
class SymbolObject;
class PrimitiveArray;
class Private;
class Uint32;
class Utils;
class Value;
class WasmModuleObject;
template <class T> class Local;
template <class T>
class MaybeLocal;
template <class T> class Eternal;
template<class T> class NonCopyablePersistentTraits;
template<class T> class PersistentBase;
template <class T, class M = NonCopyablePersistentTraits<T> >
class Persistent;
template <class T>
class Global;
template <class T>
class TracedGlobal;
template <class T>
class TracedReference;
template <class T>
class TracedReferenceBase;
template<class K, class V, class T> class PersistentValueMap;
template <class K, class V, class T>
class PersistentValueMapBase;
template <class K, class V, class T>
class GlobalValueMap;
template<class V, class T> class PersistentValueVector;
template<class T, class P> class WeakCallbackObject;
class FunctionTemplate;
class ObjectTemplate;
template<typename T> class FunctionCallbackInfo;
template<typename T> class PropertyCallbackInfo;
class StackTrace;
class StackFrame;
class Isolate;
class CallHandlerHelper;
class EscapableHandleScope;
template<typename T> class ReturnValue;
namespace internal {
enum class ArgumentsType;
template <ArgumentsType>
class Arguments;
template <typename T>
class CustomArguments;
class DeferredHandles;
class FunctionCallbackArguments;
class GlobalHandles;
class Heap;
class HeapObject;
class ExternalString;
class Isolate;
class LocalEmbedderHeapTracer;
class MicrotaskQueue;
class PropertyCallbackArguments;
class ReadOnlyHeap;
class ScopedExternalStringLock;
struct ScriptStreamingData;
class ThreadLocalTop;
namespace wasm {
class NativeModule;
class StreamingDecoder;
} // namespace wasm
} // namespace internal
namespace debug {
class ConsoleCallArguments;
} // namespace debug
// --- Handles ---
/**
* An object reference managed by the v8 garbage collector.
*
* All objects returned from v8 have to be tracked by the garbage
* collector so that it knows that the objects are still alive. Also,
* because the garbage collector may move objects, it is unsafe to
* point directly to an object. Instead, all objects are stored in
* handles which are known by the garbage collector and updated
* whenever an object moves. Handles should always be passed by value
* (except in cases like out-parameters) and they should never be
* allocated on the heap.
*
* There are two types of handles: local and persistent handles.
*
* Local handles are light-weight and transient and typically used in
* local operations. They are managed by HandleScopes. That means that a
* HandleScope must exist on the stack when they are created and that they are
* only valid inside of the HandleScope active during their creation.
* For passing a local handle to an outer HandleScope, an EscapableHandleScope
* and its Escape() method must be used.
*
* Persistent handles can be used when storing objects across several
* independent operations and have to be explicitly deallocated when they're no
* longer used.
*
* It is safe to extract the object stored in the handle by
* dereferencing the handle (for instance, to extract the Object* from
* a Local<Object>); the value will still be governed by a handle
* behind the scenes and the same rules apply to these values as to
* their handles.
*/
template <class T>
class Local {
public:
V8_INLINE Local() : val_(nullptr) {}
template <class S>
V8_INLINE Local(Local<S> that)
: val_(reinterpret_cast<T*>(*that)) {
/**
* This check fails when trying to convert between incompatible
* handles. For example, converting from a Local<String> to a
* Local<Number>.
*/
static_assert(std::is_base_of<T, S>::value, "type check");
}
/**
* Returns true if the handle is empty.
*/
V8_INLINE bool IsEmpty() const { return val_ == nullptr; }
/**
* Sets the handle to be empty. IsEmpty() will then return true.
*/
V8_INLINE void Clear() { val_ = nullptr; }
V8_INLINE T* operator->() const { return val_; }
V8_INLINE T* operator*() const { return val_; }
/**
* Checks whether two handles are the same.
* Returns true if both are empty, or if the objects to which they refer
* are identical.
*
* If both handles refer to JS objects, this is the same as strict equality.
* For primitives, such as numbers or strings, a `false` return value does not
* indicate that the values aren't equal in the JavaScript sense.
* Use `Value::StrictEquals()` to check primitives for equality.
*/
template <class S>
V8_INLINE bool operator==(const Local<S>& that) const {
internal::Address* a = reinterpret_cast<internal::Address*>(this->val_);
internal::Address* b = reinterpret_cast<internal::Address*>(that.val_);
if (a == nullptr) return b == nullptr;
if (b == nullptr) return false;
return *a == *b;
}
template <class S> V8_INLINE bool operator==(
const PersistentBase<S>& that) const {
internal::Address* a = reinterpret_cast<internal::Address*>(this->val_);
internal::Address* b = reinterpret_cast<internal::Address*>(that.val_);
if (a == nullptr) return b == nullptr;
if (b == nullptr) return false;
return *a == *b;
}
/**
* Checks whether two handles are different.
* Returns true if only one of the handles is empty, or if
* the objects to which they refer are different.
*
* If both handles refer to JS objects, this is the same as strict
* non-equality. For primitives, such as numbers or strings, a `true` return
* value does not indicate that the values aren't equal in the JavaScript
* sense. Use `Value::StrictEquals()` to check primitives for equality.
*/
template <class S>
V8_INLINE bool operator!=(const Local<S>& that) const {
return !operator==(that);
}
template <class S> V8_INLINE bool operator!=(
const Persistent<S>& that) const {
return !operator==(that);
}
/**
* Cast a handle to a subclass, e.g. Local<Value> to Local<Object>.
* This is only valid if the handle actually refers to a value of the
* target type.
*/
template <class S> V8_INLINE static Local<T> Cast(Local<S> that) {
#ifdef V8_ENABLE_CHECKS
// If we're goin
没有合适的资源?快使用搜索试试~ 我知道了~
node-v14.6.0-headers.tar.gz
0 下载量 4 浏览量
2024-05-19
22:07:38
上传
评论
收藏 570KB GZ 举报
温馨提示
Node.js,简称Node,是一个开源且跨平台的JavaScript运行时环境,它允许在浏览器外运行JavaScript代码。Node.js于2009年由Ryan Dahl创立,旨在创建高性能的Web服务器和网络应用程序。它基于Google Chrome的V8 JavaScript引擎,可以在Windows、Linux、Unix、Mac OS X等操作系统上运行。 Node.js的特点之一是事件驱动和非阻塞I/O模型,这使得它非常适合处理大量并发连接,从而在构建实时应用程序如在线游戏、聊天应用以及实时通讯服务时表现卓越。此外,Node.js使用了模块化的架构,通过npm(Node package manager,Node包管理器),社区成员可以共享和复用代码,极大地促进了Node.js生态系统的发展和扩张。 Node.js不仅用于服务器端开发。随着技术的发展,它也被用于构建工具链、开发桌面应用程序、物联网设备等。Node.js能够处理文件系统、操作数据库、处理网络请求等,因此,开发者可以用JavaScript编写全栈应用程序,这一点大大提高了开发效率和便捷性。 在实践中,许多大型企业和组织已经采用Node.js作为其Web应用程序的开发平台,如Netflix、PayPal和Walmart等。它们利用Node.js提高了应用性能,简化了开发流程,并且能更快地响应市场需求。
资源推荐
资源详情
资源评论
收起资源包目录
node-v14.6.0-headers.tar.gz (499个子文件)
common.gypi 18KB
config.gypi 3KB
v8.h 394KB
obj_mac.h 212KB
ssl.h 109KB
zlib.h 94KB
evp.h 75KB
tls1.h 71KB
uv.h 64KB
ec.h 62KB
tree.h 52KB
sslerr.h 46KB
node.h 44KB
x509.h 42KB
bio.h 34KB
engine.h 34KB
v8-profiler.h 33KB
asn1.h 33KB
x509v3.h 33KB
asn1t.h 32KB
win.h 32KB
x509_vfy.h 31KB
js_native_api.h 27KB
ts.h 22KB
rsa.h 22KB
bn.h 22KB
v8-util.h 20KB
unix.h 19KB
v8-platform.h 19KB
crypto.h 17KB
zconf.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
progs.h 16KB
cms.h 16KB
ui.h 16KB
ct.h 16KB
v8-internal.h 15KB
ecerr.h 15KB
共 499 条
- 1
- 2
- 3
- 4
- 5
资源评论
程序员Chino的日记
- 粉丝: 3719
- 资源: 5万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- RTP Payload Format for Scalable Video Coding
- 移树机模型sw16可编辑全套技术开发资料100%好用.zip
- 小型桌面插四方针设备(含工程图sw12可编辑)全套技术开发资料100%好用.zip
- java项目,毕业设计-沁园健身房预约管理系统
- HTML CSS JavaScript 实现3D动态圣诞树网页效果
- ★单片机串口实现字符串命令解析-使用函数指针(类似哈希表)
- 自动驾驶横纵向控制,纵向采用pid控制,横向采用mpc控制,根据的是车辆二自由度车辆动力学模型,得到各矩阵之后在S函数里面进行编写,纵向参考百度Apollo纵向双环PID控制算法,横向参考百度Apol
- C# FPC上料机配套软件源码WPF
- 裂缝检测21-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- C++控制台应用中圣诞树图案绘制程序
- 电子秤实物量产资料 原理图和PCB文件及BOM,源码HEX 量产HX711电子秤采集模块全套资料 1.串口波特率19200; 2.上电后直接串口打印称重数据; 3.可以发指令校零传感器,读取称重数值
- java项目,毕业设计-时间管理系统
- 一个基于C#开发的上位机数据转换库.zipwinform
- C语言实现控制台打印圣诞树程序详解
- CC工具箱Arcgispro版
- A星算法 A*算法 自己研究编写的Matlab路径规划算法 Astar算法走迷宫 可自行设置起始点,目标点,自由更地图 - 可以和人工势场法融合 动态障碍物(默认
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功