Namespaces | Data Structures | Typedefs | Enumerations | Functions

v8 Namespace Reference

Debugger support for the V8 JavaScript engine. More...

Namespaces

namespace  internal

Data Structures

class  AccessorInfo
 The information passed to an accessor callback about the context of the property access. More...
class  ActivityControl
 An interface for reporting progress and controlling long-running activities. More...
class  Arguments
 The argument information given to function call callbacks. More...
class  Array
 An instance of the built-in array constructor (ECMA-262, 15.4.2). More...
class  Boolean
 A primitive boolean value (ECMA-262, 4.3.14). More...
class  BooleanObject
 A Boolean object (ECMA-262, 4.3.15). More...
class  Context
 A sandboxed execution context with its own set of built-in objects and functions. More...
class  CpuProfile
 CpuProfile contains a CPU profile in a form of two call trees:

  • top-down (from main() down to functions that do all the work);
  • bottom-up call graph (in backward direction).
More...
class  CpuProfileNode
 CpuProfileNode represents a node in a call graph. More...
class  CpuProfiler
 Interface for controlling CPU profiling. More...
class  Data
 The superclass of values and API object templates. More...
class  Date
 An instance of the built-in Date constructor (ECMA-262, 15.9). More...
class  Debug
class  DeclareExtension
 Ignore. More...
class  Exception
 Create new error objects by calling the corresponding error object constructor with the message. More...
class  Extension
 Ignore. More...
class  ExtensionConfiguration
 Ignore. More...
class  External
 A JavaScript value that wraps a C++ void*. More...
class  Function
 A JavaScript function object (ECMA-262, 15.3). More...
class  FunctionTemplate
 A FunctionTemplate is used to create functions at runtime. More...
class  Handle
 An object reference managed by the v8 garbage collector. More...
class  HandleScope
 A stack-allocated class that governs a number of local handles. More...
class  HeapGraphEdge
 HeapSnapshotEdge represents a directed connection between heap graph nodes: from retainers to retained nodes. More...
class  HeapGraphNode
 HeapGraphNode represents a node in a heap graph. More...
class  HeapProfiler
 Interface for controlling heap profiling. More...
class  HeapSnapshot
 HeapSnapshots record the state of the JS heap at some moment. More...
class  HeapStatistics
 Collection of V8 heap information. More...
class  Int32
 A JavaScript value representing a 32-bit signed integer. More...
class  Integer
 A JavaScript value representing a signed integer. More...
class  Isolate
 Isolate represents an isolated instance of the V8 engine. More...
class  Local
 A light-weight stack-allocated object handle. More...
class  Locker
class  Message
 An error message. More...
class  Number
 A JavaScript number value (ECMA-262, 4.3.20). More...
class  NumberObject
 A Number object (ECMA-262, 4.3.21). More...
class  Object
 A JavaScript object (ECMA-262, 4.3.3). More...
class  ObjectTemplate
 An ObjectTemplate is used to create objects at runtime. More...
class  OutputStream
 An interface for exporting data from V8, using "push" model. More...
class  Persistent
 An object reference that is independent of any handle scope. More...
class  PreParserData
class  Primitive
 The superclass of primitive values. More...
class  RegExp
 An instance of the built-in RegExp constructor (ECMA-262, 15.10). More...
class  ResourceConstraints
 A set of constraints that specifies the limits of the runtime's memory use. More...
class  RetainedObjectInfo
 Interface for providing information about embedder's objects held by global handles. More...
class  Script
 A compiled JavaScript script. More...
class  ScriptData
 Pre-compilation data that can be associated with a script. More...
class  ScriptOrigin
 The origin, within a file, of a script. More...
class  Signature
 A Signature specifies which receivers and arguments a function can legally be called with. More...
class  StackFrame
 A single JavaScript stack frame. More...
class  StackTrace
 Representation of a JavaScript stack trace. More...
class  StartupData
class  StartupDataDecompressor
 A helper class for driving V8 startup data decompression. More...
class  String
 A JavaScript string value (ECMA-262, 4.3.17). More...
class  StringObject
 A String object (ECMA-262, 4.3.18). More...
class  Template
 The superclass of object and function templates. More...
class  TryCatch
 An external exception handler. More...
class  TypeSwitch
 A utility for determining the type of objects based on the template they were constructed from. More...
class  Uint32
 A JavaScript value representing a 32-bit unsigned integer. More...
class  UnicodeInputStream
class  Unlocker
 Multiple threads in V8 are allowed, but only one thread at a time is allowed to use any given V8 isolate. More...
class  V8
 Container class for static utility functions. More...
class  Value
 The superclass of all JavaScript values and objects. More...

Typedefs

typedef Handle< Value >(* AccessorGetter )(Local< String > property, const AccessorInfo &info)
 Accessor[Getter|Setter] are used as callback functions when setting|getting a particular property.
typedef void(* AccessorSetter )(Local< String > property, Local< Value > value, const AccessorInfo &info)
typedef void(* AddHistogramSampleCallback )(void *histogram, int sample)
typedef bool(* AllowCodeGenerationFromStringsCallback )(Local< Context > context)
 Callback to check if code generation from strings is allowed.
typedef int *(* CounterLookupCallback )(const char *name)
typedef void *(* CreateHistogramCallback )(const char *name, int min, int max, size_t buckets)
typedef bool(* EntropySource )(unsigned char *buffer, size_t length)
 EntropySource is used as a callback function when v8 needs a source of entropy.
typedef void(* FailedAccessCheckCallback )(Local< Object > target, AccessType type, Local< Value > data)
typedef void(* FatalErrorCallback )(const char *location, const char *message)
typedef void(* GCCallback )()
typedef void(* GCEpilogueCallback )(GCType type, GCCallbackFlags flags)
typedef void(* GCPrologueCallback )(GCType type, GCCallbackFlags flags)
typedef Handle< Boolean >(* IndexedPropertyDeleter )(uint32_t index, const AccessorInfo &info)
 Returns a non-empty handle if the deleter intercepts the request.
typedef Handle< Array >(* IndexedPropertyEnumerator )(const AccessorInfo &info)
 Returns an array containing the indices of the properties the indexed property getter intercepts.
typedef Handle< Value >(* IndexedPropertyGetter )(uint32_t index, const AccessorInfo &info)
 Returns the value of the property if the getter intercepts the request.
typedef Handle< Integer >(* IndexedPropertyQuery )(uint32_t index, const AccessorInfo &info)
 Returns a non-empty handle if the interceptor intercepts the request.
typedef Handle< Value >(* IndexedPropertySetter )(uint32_t index, Local< Value > value, const AccessorInfo &info)
 Returns the value if the setter intercepts the request.
typedef bool(* 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 Handle< Value >(* InvocationCallback )(const Arguments &args)
typedef void(* MemoryAllocationCallback )(ObjectSpace space, AllocationAction action, int size)
typedef void(* MessageCallback )(Handle< Message > message, Handle< Value > data)
typedef Handle< Boolean >(* NamedPropertyDeleter )(Local< String > property, const AccessorInfo &info)
 Returns a non-empty handle if the deleter intercepts the request.
typedef Handle< Array >(* NamedPropertyEnumerator )(const AccessorInfo &info)
 Returns an array containing the names of the properties the named property getter intercepts.
typedef Handle< Value >(* NamedPropertyGetter )(Local< String > property, const AccessorInfo &info)
 NamedProperty[Getter|Setter] are used as interceptors on object.
typedef Handle< Integer >(* NamedPropertyQuery )(Local< String > property, const AccessorInfo &info)
 Returns a non-empty handle if the interceptor intercepts the request.
typedef Handle< Value >(* NamedPropertySetter )(Local< String > property, Local< Value > value, const AccessorInfo &info)
 Returns the value if the setter intercepts the request.
typedef bool(* 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.
typedef void(* WeakReferenceCallback )(Persistent< Value > object, void *parameter)
 A weak reference callback function.

Enumerations

enum  AccessControl {
  DEFAULT = 0,
  ALL_CAN_READ = 1,
  ALL_CAN_WRITE = 1 << 1,
  PROHIBITS_OVERWRITING = 1 << 2
}
 

Access control specifications.

More...
enum  AccessType {
  ACCESS_GET,
  ACCESS_SET,
  ACCESS_HAS,
  ACCESS_DELETE,
  ACCESS_KEYS
}
 

Access type specification.

More...
enum  AllocationAction {
  kAllocationActionAllocate = 1 << 0,
  kAllocationActionFree = 1 << 1,
  kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree
}
enum  DebugEvent {
  Break = 1,
  Exception = 2,
  NewFunction = 3,
  BeforeCompile = 4,
  AfterCompile = 5,
  ScriptCollected = 6,
  BreakForCommand = 7
}
enum  ExternalArrayType {
  kExternalByteArray = 1,
  kExternalUnsignedByteArray,
  kExternalShortArray,
  kExternalUnsignedShortArray,
  kExternalIntArray,
  kExternalUnsignedIntArray,
  kExternalFloatArray,
  kExternalDoubleArray,
  kExternalPixelArray
}
enum  GCCallbackFlags {
  kNoGCCallbackFlags = 0,
  kGCCallbackFlagCompacted = 1 << 0
}
enum  GCType {
  kGCTypeScavenge = 1 << 0,
  kGCTypeMarkSweepCompact = 1 << 1,
  kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact
}
 

Applications can register callback functions which will be called before and after a garbage collection.

More...
enum  ObjectSpace {
  kObjectSpaceNewSpace = 1 << 0,
  kObjectSpaceOldPointerSpace = 1 << 1,
  kObjectSpaceOldDataSpace = 1 << 2,
  kObjectSpaceCodeSpace = 1 << 3,
  kObjectSpaceMapSpace = 1 << 4,
  kObjectSpaceLoSpace = 1 << 5,
  kObjectSpaceAll
}
enum  PropertyAttribute {
  None = 0,
  ReadOnly = 1 << 0,
  DontEnum = 1 << 1,
  DontDelete = 1 << 2
}

Functions

Handle< Boolean > V8EXPORT False ()
Handle< Primitive > V8EXPORT Null ()
PreParserData V8EXPORT Preparse (UnicodeInputStream *input, size_t max_stack_size)
void V8EXPORT RegisterExtension (Extension *extension)
bool V8EXPORT SetResourceConstraints (ResourceConstraints *constraints)
Handle< Value > V8EXPORT ThrowException (Handle< Value > exception)
 Schedules an exception to be thrown when returning to JavaScript.
Handle< Boolean > V8EXPORT True ()
Handle< Primitive > V8EXPORT Undefined ()

Detailed Description

Debugger support for the V8 JavaScript engine.

The v8 JavaScript engine.

Profiler support for the V8 JavaScript engine.


Typedef Documentation

typedef Handle<Value>(* v8::AccessorGetter)(Local< String > property, const AccessorInfo &info)

Accessor[Getter|Setter] are used as callback functions when setting|getting a particular property.

See Object and ObjectTemplate's method SetAccessor.

Definition at line 1407 of file v8.h.

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

Definition at line 1411 of file v8.h.

typedef void(* v8::AddHistogramSampleCallback)(void *histogram, int sample)

Definition at line 2585 of file v8.h.

Callback to check if code generation from strings is allowed.

See Context::AllowCodeGenerationFromStrings.

Definition at line 2622 of file v8.h.

typedef int*(* v8::CounterLookupCallback)(const char *name)

Definition at line 2578 of file v8.h.

typedef void*(* v8::CreateHistogramCallback)(const char *name, int min, int max, size_t buckets)

Definition at line 2580 of file v8.h.

typedef bool(* v8::EntropySource)(unsigned char *buffer, size_t length)

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

Definition at line 2819 of file v8.h.

typedef void(* v8::FailedAccessCheckCallback)(Local< Object > target, AccessType type, Local< Value > data)

Definition at line 2612 of file v8.h.

typedef void(* v8::FatalErrorCallback)(const char *location, const char *message)

Definition at line 2548 of file v8.h.

typedef void(* v8::GCCallback)()

Definition at line 2647 of file v8.h.

typedef void(* v8::GCEpilogueCallback)(GCType type, GCCallbackFlags flags)

Definition at line 2645 of file v8.h.

typedef void(* v8::GCPrologueCallback)(GCType type, GCCallbackFlags flags)

Definition at line 2644 of file v8.h.

typedef Handle<Boolean>(* v8::IndexedPropertyDeleter)(uint32_t index, const AccessorInfo &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.

Definition at line 2051 of file v8.h.

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

Definition at line 2058 of file v8.h.

typedef Handle<Value>(* v8::IndexedPropertyGetter)(uint32_t index, const AccessorInfo &info)

Returns the value of the property if the getter intercepts the request.

Otherwise, returns an empty handle.

Definition at line 2026 of file v8.h.

typedef Handle<Integer>(* v8::IndexedPropertyQuery)(uint32_t index, const AccessorInfo &info)

Returns a non-empty handle if the interceptor intercepts the request.

The result is an integer encoding property attributes.

Definition at line 2043 of file v8.h.

typedef Handle<Value>(* v8::IndexedPropertySetter)(uint32_t index, Local< Value > value, const AccessorInfo &info)

Returns the value if the setter intercepts the request.

Otherwise, returns an empty handle.

Definition at line 2034 of file v8.h.

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.

Definition at line 2087 of file v8.h.

typedef Handle<Value>(* v8::InvocationCallback)(const Arguments &args)

Definition at line 1980 of file v8.h.

typedef void(* v8::MemoryAllocationCallback)(ObjectSpace space, AllocationAction action, int size)

Definition at line 2607 of file v8.h.

typedef void(* v8::MessageCallback)(Handle< Message > message, Handle< Value > data)

Definition at line 2551 of file v8.h.

typedef Handle<Boolean>(* v8::NamedPropertyDeleter)(Local< String > property, const AccessorInfo &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.

Definition at line 2012 of file v8.h.

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

Definition at line 2019 of file v8.h.

typedef Handle<Value>(* v8::NamedPropertyGetter)(Local< String > property, const AccessorInfo &info)

NamedProperty[Getter|Setter] are used as interceptors on object.

See ObjectTemplate::SetNamedPropertyHandler.

Definition at line 1986 of file v8.h.

typedef Handle<Integer>(* v8::NamedPropertyQuery)(Local< String > property, const AccessorInfo &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.)

Definition at line 2003 of file v8.h.

typedef Handle<Value>(* v8::NamedPropertySetter)(Local< String > property, Local< Value > value, const AccessorInfo &info)

Returns the value if the setter intercepts the request.

Otherwise, returns an empty handle.

Definition at line 1994 of file v8.h.

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.

Definition at line 2077 of file v8.h.

typedef void(* v8::WeakReferenceCallback)(Persistent< Value > object, void *parameter)

A weak reference callback function.

This callback should either explicitly invoke Dispose on |object| if V8 wrapper is not needed anymore, or 'revive' it by invocation of MakeWeak.

Parameters:
object the weak global object to be reclaimed by the garbage collector
parameter the value passed in when making the weak global object

Definition at line 133 of file v8.h.


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.

Additionally, for security, accessors can prohibit overwriting by accessors defined in JavaScript. For objects that have such accessors either locally or in their prototype chain it is not possible to overwrite the accessor by using __defineGetter__ or __defineSetter__ from JavaScript code.

Enumerator:
DEFAULT 
ALL_CAN_READ 
ALL_CAN_WRITE 
PROHIBITS_OVERWRITING 

Definition at line 1429 of file v8.h.

Access type specification.

Enumerator:
ACCESS_GET 
ACCESS_SET 
ACCESS_HAS 
ACCESS_DELETE 
ACCESS_KEYS 

Definition at line 2064 of file v8.h.

Enumerator:
kAllocationActionAllocate 
kAllocationActionFree 
kAllocationActionAll 

Definition at line 2601 of file v8.h.

Enumerator:
Break 
Exception 
NewFunction 
BeforeCompile 
AfterCompile 
ScriptCollected 
BreakForCommand 

Definition at line 73 of file v8-debug.h.

Enumerator:
kExternalByteArray 
kExternalUnsignedByteArray 
kExternalShortArray 
kExternalUnsignedShortArray 
kExternalIntArray 
kExternalUnsignedIntArray 
kExternalFloatArray 
kExternalDoubleArray 
kExternalPixelArray 

Definition at line 1390 of file v8.h.

Enumerator:
kNoGCCallbackFlags 
kGCCallbackFlagCompacted 

Definition at line 2639 of file v8.h.

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 

Definition at line 2633 of file v8.h.

Enumerator:
kObjectSpaceNewSpace 
kObjectSpaceOldPointerSpace 
kObjectSpaceOldDataSpace 
kObjectSpaceCodeSpace 
kObjectSpaceMapSpace 
kObjectSpaceLoSpace 
kObjectSpaceAll 

Definition at line 2588 of file v8.h.

Enumerator:
None 
ReadOnly 
DontEnum 
DontDelete 

Definition at line 1383 of file v8.h.


Function Documentation

Handle<Boolean> V8EXPORT v8::False (  ) 

Referenced by v8::Boolean::New().

Handle<Primitive> V8EXPORT v8::Null (  ) 
PreParserData V8EXPORT v8::Preparse ( UnicodeInputStream *  input,
size_t  max_stack_size 
)
void V8EXPORT v8::RegisterExtension ( Extension *  extension  ) 
bool V8EXPORT v8::SetResourceConstraints ( ResourceConstraints *  constraints  ) 
Handle<Value> V8EXPORT v8::ThrowException ( Handle< Value >  exception  ) 

Schedules an exception to be thrown when returning to JavaScript.

When an exception has been scheduled it is illegal to invoke any JavaScript operation; the caller must return immediately and only after the exception has been handled does it become legal to invoke JavaScript operations.

Examples:
shell.cc.
Handle<Boolean> V8EXPORT v8::True (  ) 

Referenced by v8::Boolean::New().

Handle<Primitive> V8EXPORT v8::Undefined (  ) 
Examples:
process.cc, and shell.cc.

Referenced by v8::Arguments::operator[]().