v8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Typedefs | Enumerations | Functions
v8 Namespace Reference

Namespaces

 internal
 

Classes

class  AccessorSignature
 
class  Array
 
class  ArrayBuffer
 
class  ArrayBufferView
 
class  Boolean
 
class  BooleanObject
 
class  Context
 
struct  CopyablePersistentTraits
 
class  Data
 
class  DataView
 
class  Date
 
class  EscapableHandleScope
 
class  Eternal
 
class  Exception
 
class  Extension
 
class  ExtensionConfiguration
 
class  External
 
class  ExternalOneByteStringResourceImpl
 
class  ExternalResourceVisitor
 
class  Float32Array
 
class  Float64Array
 
class  Function
 
class  FunctionCallbackInfo
 
class  FunctionTemplate
 
class  Global
 
singleton  GlobalValueMap
 
class  HandleScope
 
class  HeapObjectStatistics
 
class  HeapSpaceStatistics
 
class  HeapStatistics
 
struct  IndexedPropertyHandlerConfiguration
 
class  Int16Array
 
class  Int32
 
class  Int32Array
 
class  Int8Array
 
class  Integer
 
class  Isolate
 
struct  JitCodeEvent
 
class  JSON
 
class  Local
 
class  Locker
 
class  Map
 
class  Maybe
 
class  MaybeLocal
 
class  Message
 
class  Name
 
struct  NamedPropertyHandlerConfiguration
 
class  NativeWeakMap
 
class  NonCopyablePersistentTraits
 
class  Number
 
class  NumberObject
 
class  Object
 
class  ObjectTemplate
 
class  Persistent
 
class  PersistentBase
 
class  PersistentHandleVisitor
 
singleton  PersistentValueMap
 
singleton  PersistentValueMapBase
 
singleton  PersistentValueVector
 
class  Primitive
 
class  Promise
 
class  PromiseRejectMessage
 
class  PropertyCallbackInfo
 
class  RegExp
 
struct  RegisterState
 
class  ResourceConstraints
 
class  ReturnValue
 
struct  SampleInfo
 
class  Script
 
class  ScriptCompiler
 
class  ScriptOrigin
 
class  ScriptOriginOptions
 
class  SealHandleScope
 
class  Set
 
class  SharedArrayBuffer
 
class  Signature
 
class  StackFrame
 
class  StackTrace
 
class  StartupData
 
class  String
 
class  StringObject
 
class  Symbol
 
class  SymbolObject
 
class  Template
 
class  TryCatch
 
class  TypedArray
 
class  TypeSwitch
 
class  Uint16Array
 
class  Uint32
 
class  Uint32Array
 
class  Uint8Array
 
class  Uint8ClampedArray
 
class  UnboundScript
 
class  UniqueId
 
class  Unlocker
 
class  V8
 
class  Value
 
class  WeakCallbackData
 
class  WeakCallbackInfo
 
singleton  WeakCallbackObject
 

Typedefs

template<class T >
using Handle = Local< T >
 
template<class T >
using PhantomCallbackData = WeakCallbackInfo< T >
 
template<class T >
using UniquePersistent = Global< T >
 
typedef void(* AccessorGetterCallback )(Local< String > property, const PropertyCallbackInfo< Value > &info)
 
typedef void(* AccessorNameGetterCallback )(Local< Name > property, const PropertyCallbackInfo< Value > &info)
 
typedef void(* AccessorSetterCallback )(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
 
typedef void(* AccessorNameSetterCallback )(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
 
typedef void(* FunctionCallback )(const FunctionCallbackInfo< Value > &info)
 
typedef void(* NamedPropertyGetterCallback )(Local< String > property, const PropertyCallbackInfo< Value > &info)
 
typedef void(* NamedPropertySetterCallback )(Local< String > property, Local< Value > value, const PropertyCallbackInfo< Value > &info)
 
typedef void(* NamedPropertyQueryCallback )(Local< String > property, const PropertyCallbackInfo< Integer > &info)
 
typedef void(* NamedPropertyDeleterCallback )(Local< String > property, const PropertyCallbackInfo< Boolean > &info)
 
typedef void(* NamedPropertyEnumeratorCallback )(const PropertyCallbackInfo< Array > &info)
 
typedef void(* GenericNamedPropertyGetterCallback )(Local< Name > property, const PropertyCallbackInfo< Value > &info)
 
typedef void(* GenericNamedPropertySetterCallback )(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info)
 
typedef void(* GenericNamedPropertyQueryCallback )(Local< Name > property, const PropertyCallbackInfo< Integer > &info)
 
typedef void(* GenericNamedPropertyDeleterCallback )(Local< Name > property, const PropertyCallbackInfo< Boolean > &info)
 
typedef void(* GenericNamedPropertyEnumeratorCallback )(const PropertyCallbackInfo< Array > &info)
 
typedef void(* IndexedPropertyGetterCallback )(uint32_t index, const PropertyCallbackInfo< Value > &info)
 
typedef void(* IndexedPropertySetterCallback )(uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info)
 
typedef void(* IndexedPropertyQueryCallback )(uint32_t index, const PropertyCallbackInfo< Integer > &info)
 
typedef void(* IndexedPropertyDeleterCallback )(uint32_t index, const PropertyCallbackInfo< Boolean > &info)
 
typedef void(* IndexedPropertyEnumeratorCallback )(const PropertyCallbackInfo< Array > &info)
 
typedef bool(* NamedSecurityCallback )(Local< Object > host, Local< Value > key, AccessType type, Local< Value > data)
 
typedef bool(* IndexedSecurityCallback )(Local< Object > host, uint32_t index, AccessType type, Local< Value > data)
 
typedef void(* FatalErrorCallback )(const char *location, const char *message)
 
typedef void(* MessageCallback )(Handle< Message > message, Handle< Value > error)
 
typedef void(* LogEventCallback )(const char *name, int event)
 
typedef int *(* CounterLookupCallback )(const char *name)
 
typedef void *(* CreateHistogramCallback )(const char *name, int min, int max, size_t buckets)
 
typedef void(* AddHistogramSampleCallback )(void *histogram, int sample)
 
typedef void(* MemoryAllocationCallback )(ObjectSpace space, AllocationAction action, int size)
 
typedef void(* CallCompletedCallback )()
 
typedef void(* PromiseRejectCallback )(PromiseRejectMessage message)
 
typedef void(* MicrotaskCallback )(void *data)
 
typedef void(* FailedAccessCheckCallback )(Local< Object > target, AccessType type, Local< Value > data)
 
typedef bool(* AllowCodeGenerationFromStringsCallback )(Local< Context > context)
 
typedef void(* GCPrologueCallback )(GCType type, GCCallbackFlags flags)
 
typedef void(* GCEpilogueCallback )(GCType type, GCCallbackFlags flags)
 
typedef void(* InterruptCallback )(Isolate *isolate, void *data)
 
typedef void(* FunctionEntryHook )(uintptr_t function, uintptr_t return_addr_location)
 
typedef void(* JitCodeEventHandler )(const JitCodeEvent *event)
 
typedef bool(* EntropySource )(unsigned char *buffer, size_t length)
 
typedef uintptr_t(* ReturnAddressLocationResolver )(uintptr_t return_addr_location)
 

Enumerations

enum  WeakCallbackType { WeakCallbackType::kParameter, WeakCallbackType::kInternalFields }
 
enum  StateTag {
  JS, GC, COMPILER, OTHER,
  EXTERNAL, IDLE
}
 
enum  NewStringType { NewStringType::kNormal, NewStringType::kInternalized }
 
enum  PropertyAttribute { None = 0, ReadOnly = 1 << 0, DontEnum = 1 << 1, DontDelete = 1 << 2 }
 
enum  AccessControl { DEFAULT = 0, ALL_CAN_READ = 1, ALL_CAN_WRITE = 1 << 1, PROHIBITS_OVERWRITING = 1 << 2 }
 
enum  ArrayBufferCreationMode { ArrayBufferCreationMode::kInternalized, ArrayBufferCreationMode::kExternalized }
 
enum  AccessType {
  ACCESS_GET, ACCESS_SET, ACCESS_HAS, ACCESS_DELETE,
  ACCESS_KEYS
}
 
enum  PropertyHandlerFlags { PropertyHandlerFlags::kNone = 0, PropertyHandlerFlags::kAllCanRead = 1, PropertyHandlerFlags::kNonMasking = 1 << 1, PropertyHandlerFlags::kOnlyInterceptStrings = 1 << 2 }
 
enum  ObjectSpace {
  kObjectSpaceNewSpace = 1 << 0, kObjectSpaceOldSpace = 1 << 1, kObjectSpaceCodeSpace = 1 << 2, kObjectSpaceMapSpace = 1 << 3,
  kObjectSpaceLoSpace = 1 << 4, kObjectSpaceAll
}
 
enum  AllocationAction { kAllocationActionAllocate = 1 << 0, kAllocationActionFree = 1 << 1, kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree }
 
enum  PromiseRejectEvent { kPromiseRejectWithNoHandler = 0, kPromiseHandlerAddedAfterReject = 1 }
 
enum  GCType { kGCTypeScavenge = 1 << 0, kGCTypeMarkSweepCompact = 1 << 1, kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact }
 
enum  GCCallbackFlags { kNoGCCallbackFlags = 0, kGCCallbackFlagCompacted = 1 << 0, kGCCallbackFlagConstructRetainedObjectInfos = 1 << 1, kGCCallbackFlagForced = 1 << 2 }
 
enum  JitCodeEventOptions { kJitCodeEventDefault = 0, kJitCodeEventEnumExisting = 1 }
 

Functions

void V8_EXPORT RegisterExtension (Extension *extension)
 
V8_INLINE Handle< PrimitiveUndefined (Isolate *isolate)
 
V8_INLINE Handle< PrimitiveNull (Isolate *isolate)
 
V8_INLINE Handle< BooleanTrue (Isolate *isolate)
 
V8_INLINE Handle< BooleanFalse (Isolate *isolate)
 
template<class T >
Maybe< T > Nothing ()
 
template<class T >
Maybe< T > Just (const T &t)
 

Detailed Description

The v8 JavaScript engine.

Typedef Documentation

typedef void(* v8::AccessorGetterCallback)(Local< String > property, const PropertyCallbackInfo< Value > &info)

Accessor[Getter|Setter] are used as callback functions when setting|getting a particular property. See Object and ObjectTemplate's method SetAccessor.

typedef void(* v8::AccessorNameGetterCallback)(Local< Name > property, const PropertyCallbackInfo< Value > &info)
typedef void(* v8::AccessorNameSetterCallback)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
typedef void(* v8::AccessorSetterCallback)(Local< String > property, Local< Value > value, const PropertyCallbackInfo< void > &info)
typedef void(* v8::AddHistogramSampleCallback)(void *histogram, int sample)
typedef bool(* v8::AllowCodeGenerationFromStringsCallback)(Local< Context > context)

Callback to check if code generation from strings is allowed. See Context::AllowCodeGenerationFromStrings.

typedef void(* v8::CallCompletedCallback)()
typedef int*(* v8::CounterLookupCallback)(const char *name)
typedef void*(* v8::CreateHistogramCallback)(const char *name, int min, int max, size_t buckets)
typedef bool(* v8::EntropySource)(unsigned char *buffer, size_t length)

EntropySource is used as a callback function when v8 needs a source of entropy.

typedef void(* v8::FailedAccessCheckCallback)(Local< Object > target, AccessType type, Local< Value > data)
typedef void(* v8::FatalErrorCallback)(const char *location, const char *message)
typedef void(* v8::FunctionCallback)(const FunctionCallbackInfo< Value > &info)
typedef void(* v8::FunctionEntryHook)(uintptr_t function, uintptr_t return_addr_location)

FunctionEntryHook is the type of the profile entry hook called at entry to any generated function when function-level profiling is enabled.

Parameters
functionthe address of the function that's being entered.
return_addr_locationpoints to a location on stack where the machine return address resides. This can be used to identify the caller of function, and/or modified to divert execution when function exits.
Note
the entry hook must not cause garbage collection.
typedef void(* v8::GCEpilogueCallback)(GCType type, GCCallbackFlags flags)
typedef void(* v8::GCPrologueCallback)(GCType type, GCCallbackFlags flags)
typedef void(* v8::GenericNamedPropertyDeleterCallback)(Local< Name > property, const PropertyCallbackInfo< Boolean > &info)

Returns a non-empty handle if the deleter intercepts the request. The return value is true if the property could be deleted and false otherwise.

typedef void(* v8::GenericNamedPropertyEnumeratorCallback)(const PropertyCallbackInfo< Array > &info)

Returns an array containing the names of the properties the named property getter intercepts.

typedef void(* v8::GenericNamedPropertyGetterCallback)(Local< Name > property, const PropertyCallbackInfo< Value > &info)

GenericNamedProperty[Getter|Setter] are used as interceptors on object. See ObjectTemplate::SetNamedPropertyHandler.

typedef void(* v8::GenericNamedPropertyQueryCallback)(Local< Name > property, const PropertyCallbackInfo< Integer > &info)

Returns a non-empty handle if the interceptor intercepts the request. The result is an integer encoding property attributes (like v8::None, v8::DontEnum, etc.)

typedef void(* v8::GenericNamedPropertySetterCallback)(Local< Name > property, Local< Value > value, const PropertyCallbackInfo< Value > &info)

Returns the value if the setter intercepts the request. Otherwise, returns an empty handle.

template<class T >
using v8::Handle = typedef Local<T>
typedef void(* v8::IndexedPropertyDeleterCallback)(uint32_t index, const PropertyCallbackInfo< Boolean > &info)

Returns a non-empty handle if the deleter intercepts the request. The return value is true if the property could be deleted and false otherwise.

typedef void(* v8::IndexedPropertyEnumeratorCallback)(const PropertyCallbackInfo< Array > &info)

Returns an array containing the indices of the properties the indexed property getter intercepts.

typedef void(* v8::IndexedPropertyGetterCallback)(uint32_t index, const PropertyCallbackInfo< Value > &info)

Returns the value of the property if the getter intercepts the request. Otherwise, returns an empty handle.

typedef void(* v8::IndexedPropertyQueryCallback)(uint32_t index, const PropertyCallbackInfo< Integer > &info)

Returns a non-empty handle if the interceptor intercepts the request. The result is an integer encoding property attributes.

typedef void(* v8::IndexedPropertySetterCallback)(uint32_t index, Local< Value > value, const PropertyCallbackInfo< Value > &info)

Returns the value if the setter intercepts the request. Otherwise, returns an empty handle.

typedef bool(* v8::IndexedSecurityCallback)(Local< Object > host, uint32_t index, AccessType type, Local< Value > data)

Returns true if cross-context access should be allowed to the indexed property with the given index on the host object.

typedef void(* v8::InterruptCallback)(Isolate *isolate, void *data)
typedef void(* v8::JitCodeEventHandler)(const JitCodeEvent *event)

Callback function passed to SetJitCodeEventHandler.

Parameters
eventcode add, move or removal event.
typedef void(* v8::LogEventCallback)(const char *name, int event)
typedef void(* v8::MemoryAllocationCallback)(ObjectSpace space, AllocationAction action, int size)
typedef void(* v8::MessageCallback)(Handle< Message > message, Handle< Value > error)
typedef void(* v8::MicrotaskCallback)(void *data)
typedef void(* v8::NamedPropertyDeleterCallback)(Local< String > property, const PropertyCallbackInfo< Boolean > &info)

Returns a non-empty handle if the deleter intercepts the request. The return value is true if the property could be deleted and false otherwise.

typedef void(* v8::NamedPropertyEnumeratorCallback)(const PropertyCallbackInfo< Array > &info)

Returns an array containing the names of the properties the named property getter intercepts.

typedef void(* v8::NamedPropertyGetterCallback)(Local< String > property, const PropertyCallbackInfo< Value > &info)

NamedProperty[Getter|Setter] are used as interceptors on object. See ObjectTemplate::SetNamedPropertyHandler.

typedef void(* v8::NamedPropertyQueryCallback)(Local< String > property, const PropertyCallbackInfo< Integer > &info)

Returns a non-empty handle if the interceptor intercepts the request. The result is an integer encoding property attributes (like v8::None, v8::DontEnum, etc.)

typedef void(* v8::NamedPropertySetterCallback)(Local< String > property, Local< Value > value, const PropertyCallbackInfo< Value > &info)

Returns the value if the setter intercepts the request. Otherwise, returns an empty handle.

typedef bool(* v8::NamedSecurityCallback)(Local< Object > host, Local< Value > key, AccessType type, Local< Value > data)

Returns true if cross-context access should be allowed to the named property with the given key on the host object.

template<class T >
using v8::PhantomCallbackData = typedef WeakCallbackInfo<T>
typedef void(* v8::PromiseRejectCallback)(PromiseRejectMessage message)
typedef uintptr_t(* v8::ReturnAddressLocationResolver)(uintptr_t return_addr_location)

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 whereever the profiler stashed the original return address.

Parameters
return_addr_locationpoints to a location on stack where a machine return address resides.
Returns
either return_addr_location, or else a pointer to the profiler's copy of the original return address.
Note
the resolver function must not cause garbage collection.
template<class T >
using v8::UniquePersistent = typedef Global<T>

Enumeration Type Documentation

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.

TODO(dcarney): Remove PROHIBITS_OVERWRITING as it is now unused.

Enumerator
DEFAULT 
ALL_CAN_READ 
ALL_CAN_WRITE 
PROHIBITS_OVERWRITING 

Access type specification.

Enumerator
ACCESS_GET 
ACCESS_SET 
ACCESS_HAS 
ACCESS_DELETE 
ACCESS_KEYS 
Enumerator
kAllocationActionAllocate 
kAllocationActionFree 
kAllocationActionAll 
Enumerator
kInternalized 
kExternalized 
Enumerator
kNoGCCallbackFlags 
kGCCallbackFlagCompacted 
kGCCallbackFlagConstructRetainedObjectInfos 
kGCCallbackFlagForced 
enum v8::GCType

Applications can register callback functions which will be called before and after a garbage collection. 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.

Enumerator
kGCTypeScavenge 
kGCTypeMarkSweepCompact 
kGCTypeAll 

Option flags passed to the SetJitCodeEventHandler function.

Enumerator
kJitCodeEventDefault 
kJitCodeEventEnumExisting 
enum v8::NewStringType
strong
Enumerator
kNormal 
kInternalized 
Enumerator
kObjectSpaceNewSpace 
kObjectSpaceOldSpace 
kObjectSpaceCodeSpace 
kObjectSpaceMapSpace 
kObjectSpaceLoSpace 
kObjectSpaceAll 
Enumerator
kPromiseRejectWithNoHandler 
kPromiseHandlerAddedAfterReject 
Enumerator
None 
ReadOnly 
DontEnum 
DontDelete 
Enumerator
kNone 
kAllCanRead 
kNonMasking 
kOnlyInterceptStrings 
Enumerator
JS 
GC 
COMPILER 
OTHER 
EXTERNAL 
IDLE 
enum v8::WeakCallbackType
strong
Enumerator
kParameter 
kInternalFields 

Function Documentation

Handle< Boolean > v8::False ( Isolate *  isolate)
template<class T >
Maybe<T> v8::Just ( const T &  t)
inline
template<class T >
Maybe<T> v8::Nothing ( )
inline
Handle< Primitive > v8::Null ( Isolate *  isolate)
void V8_EXPORT v8::RegisterExtension ( Extension *  extension)
Handle< Boolean > v8::True ( Isolate *  isolate)
Handle< Primitive > v8::Undefined ( Isolate *  isolate)