// 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 http://code.google.com/apis/v8/
*/
#ifndef V8_H_
#define V8_H_
#include "v8stdint.h"
// We reserve the V8_* prefix for macros defined in V8 public API and
// assume there are no name conflicts with the embedder's code.
#ifdef V8_OS_WIN
// Setup for Windows DLL export/import. When building the V8 DLL the
// BUILDING_V8_SHARED needs to be defined. When building a program which uses
// the V8 DLL USING_V8_SHARED needs to be defined. When either building the V8
// static library or building a program which uses the V8 static library neither
// BUILDING_V8_SHARED nor USING_V8_SHARED should be defined.
#if defined(BUILDING_V8_SHARED) && defined(USING_V8_SHARED)
#error both BUILDING_V8_SHARED and USING_V8_SHARED are set - please check the\
build configuration to ensure that at most one of these is set
#endif
#ifdef BUILDING_V8_SHARED
# define V8_EXPORT __declspec(dllexport)
#elif USING_V8_SHARED
# define V8_EXPORT __declspec(dllimport)
#else
# define V8_EXPORT
#endif // BUILDING_V8_SHARED
#else // V8_OS_WIN
// Setup for Linux shared library export.
#if V8_HAS_ATTRIBUTE_VISIBILITY && defined(V8_SHARED)
# ifdef BUILDING_V8_SHARED
# define V8_EXPORT __attribute__ ((visibility("default")))
# else
# define V8_EXPORT
# endif
#else
# define V8_EXPORT
#endif
#endif // V8_OS_WIN
/**
* The v8 JavaScript engine.
*/
namespace v8 {
class AccessorSignature;
class Array;
class Boolean;
class BooleanObject;
class Context;
class CpuProfiler;
class Data;
class Date;
class DeclaredAccessorDescriptor;
class External;
class Function;
class FunctionTemplate;
class HeapProfiler;
class ImplementationUtilities;
class Int32;
class Integer;
class Isolate;
class Number;
class NumberObject;
class Object;
class ObjectOperationDescriptor;
class ObjectTemplate;
class Platform;
class Primitive;
class RawOperationDescriptor;
class Script;
class Signature;
class StackFrame;
class StackTrace;
class String;
class StringObject;
class Symbol;
class SymbolObject;
class Private;
class Uint32;
class Utils;
class Value;
template <class T> class Handle;
template <class T> class Local;
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 UniquePersistent;
template<class K, class V, class T> class PersistentValueMap;
template<class V, class T> class PersistentValueVector;
template<class T, class P> class WeakCallbackObject;
class FunctionTemplate;
class ObjectTemplate;
class Data;
template<typename T> class FunctionCallbackInfo;
template<typename T> class PropertyCallbackInfo;
class StackTrace;
class StackFrame;
class Isolate;
class DeclaredAccessorDescriptor;
class ObjectOperationDescriptor;
class RawOperationDescriptor;
class CallHandlerHelper;
class EscapableHandleScope;
template<typename T> class ReturnValue;
namespace internal {
class Arguments;
class Heap;
class HeapObject;
class Isolate;
class Object;
template<typename T> class CustomArguments;
class PropertyCallbackArguments;
class FunctionCallbackArguments;
class GlobalHandles;
}
/**
* General purpose unique identifier.
*/
class UniqueId {
public:
explicit UniqueId(intptr_t data)
: data_(data) {}
bool operator==(const UniqueId& other) const {
return data_ == other.data_;
}
bool operator!=(const UniqueId& other) const {
return data_ != other.data_;
}
bool operator<(const UniqueId& other) const {
return data_ < other.data_;
}
private:
intptr_t data_;
};
// --- Handles ---
#define TYPE_CHECK(T, S) \
while (false) { \
*(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
}
/**
* 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. 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 Handle<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 Handle {
public:
/**
* Creates an empty handle.
*/
V8_INLINE Handle() : val_(0) {}
/**
* Creates a handle for the contents of the specified handle. This
* constructor allows you to pass handles as arguments by value and
* to assign between handles. However, if you try to assign between
* incompatible handles, for instance from a Handle<String> to a
* Handle<Number> it will cause a compile-time error. Assigning
* between compatible handles, for instance assigning a
* Handle<String> to a variable declared as Handle<Value>, is legal
* because String is a subclass of Value.
*/
template <class S> V8_INLINE Handle(Handle<S> that)
: val_(reinterpret_cast<T*>(*that)) {
/**
* This check fails when trying to convert between incompatible
* handles. For example, converting from a Handle<String> to a
* Handle<Number>.
*/
TYPE_CHECK(T, S);
}
/**
* Returns true if the handle is empty.
*/
V8_INLINE bool IsEmpty() const { return val_ == 0; }
/**
* Sets the handle to be empty. IsEmpty() will then return true.
*/
V8_INLINE void Clear() { val_ = 0; }
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.
* The handles' references are not checked.
*/
template <class S> V8_INLINE bool operator==(const Handle<S>& that) const {
internal::Object** a = reinterpret_cast<internal::Object**>(this->val_);
internal::Object** b = reinterpret_cast<internal::Object**>(that.val_);
if (a == 0) return b == 0;
if (b == 0) return false;
return *a == *b;
}
template <class S> V8_INLINE bool operator==(
const PersistentBase<S>& that) const {
internal::Object** a = reinterpret_cast<internal::Object**>(this->val_);
internal::Object** b = reinterpret_cast<internal::Object**>(that.val_);
if (a == 0) return b == 0;
if (b == 0) 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.
* The handles' references are not checked.
*/
template <class S> V8_INLINE bool operator!=(const Handle<S>& that) const {
return !operator==(that);
}
template <class S> V8_INLINE bool operator!=(
const Persistent<S>& that) const {
return !operator==(that);
}
temp
没有合适的资源?快使用搜索试试~ 我知道了~
node-v0.12.16-headers.tar.gz
0 下载量 141 浏览量
2024-05-20
23:33:44
上传
评论
收藏 434KB 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-v0.12.16-headers.tar.gz (112个子文件)
common.gypi 9KB
config.gypi 2KB
v8.h 206KB
safestack.h 183KB
obj_mac.h 164KB
ssl.h 127KB
zlib.h 86KB
evp.h 64KB
asn1.h 62KB
tree.h 52KB
uv.h 52KB
x509.h 51KB
ec.h 50KB
objects.h 46KB
engine.h 44KB
bn.h 41KB
x509v3.h 38KB
bio.h 38KB
tls1.h 38KB
ts.h 34KB
asn1t.h 34KB
ssl3.h 31KB
uv-win.h 30KB
crypto.h 27KB
x509_vfy.h 27KB
rsa.h 26KB
ocsp.h 26KB
symhacks.h 25KB
cms.h 25KB
pem.h 25KB
asn1_mac.h 24KB
ares.h 21KB
des_old.h 21KB
pkcs7.h 20KB
dso.h 20KB
v8-profiler.h 19KB
ui.h 18KB
node.h 17KB
err.h 16KB
uv-unix.h 16KB
v8config.h 16KB
zconf.h 15KB
pkcs12.h 15KB
v8-util.h 14KB
dsa.h 13KB
ssl2.h 12KB
des.h 12KB
conf.h 11KB
dh.h 11KB
e_os2.h 11KB
ecdsa.h 11KB
opensslconf.h 10KB
lhash.h 9KB
uv-errno.h 9KB
dtls1.h 9KB
v8-debug.h 9KB
node_internals.h 8KB
nameser.h 8KB
krb5_asn.h 8KB
sha.h 8KB
modes.h 8KB
ossl_typ.h 8KB
stdint-msvc2008.h 8KB
kssl.h 7KB
srtp.h 7KB
aes.h 6KB
seed.h 6KB
srp.h 6KB
rand.h 6KB
smalloc.h 6KB
camellia.h 5KB
blowfish.h 5KB
node_buffer.h 5KB
buffer.h 5KB
ecdh.h 5KB
md4.h 5KB
md5.h 5KB
idea.h 5KB
cast.h 5KB
txt_db.h 5KB
rc2.h 4KB
hmac.h 4KB
stack.h 4KB
ripemd.h 4KB
conf_api.h 4KB
node_object_wrap.h 4KB
mdc2.h 4KB
opensslv.h 4KB
rc4.h 4KB
ssl23.h 4KB
pqueue.h 4KB
ui_compat.h 3KB
cmac.h 3KB
uv-darwin.h 3KB
pthread-fixes.h 3KB
pem2.h 3KB
node_version.h 3KB
comp.h 2KB
uv-sunos.h 2KB
android-ifaddrs.h 2KB
共 112 条
- 1
- 2
资源评论
程序员Chino的日记
- 粉丝: 3664
- 资源: 5万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- chromedriver-win64-121版本所有资源打包下载
- C语言《基于STC8A8K64D4的AD电压表及温度计的设计与实现》+项目源码+文档说明
- java项目,课程设计-#-ssm-mysql-在线物业管理系统.zip
- 技术资料分享任天堂产品系统文件很好的技术资料.zip
- chromedriver-win64-120版本所有资源打包下载
- 1dewdwedewdwdwed
- BEV模型部署全栈教程(3D检测+车道线+Occ)
- chromedriver-win64-119版本所有资源打包下载
- 技术资料分享嵌入式实时操作系统μCOS-II原理及应用-任哲(高清版本)很好的技术资料.zip
- chromedriver-win64-118版本所有资源打包下载
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功