v8  3.11.10(node0.8.26)
V8 is Google's open source JavaScript engine
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
v8 Namespace Reference

Namespaces

 internal
 
 preparser
 

Data Structures

class  Debug
 
class  PreParserData
 
class  UnicodeInputStream
 
class  CpuProfileNode
 
class  CpuProfile
 
class  CpuProfiler
 
class  HeapGraphEdge
 
class  HeapGraphNode
 
class  HeapSnapshot
 
class  HeapProfiler
 
class  RetainedObjectInfo
 
struct  HeapStatsUpdate
 
class  Testing
 
class  Handle
 
class  Local
 
class  Persistent
 
class  HandleScope
 
class  Data
 
class  ScriptData
 
class  ScriptOrigin
 
class  Script
 
class  Message
 
class  StackTrace
 
class  StackFrame
 
class  Value
 
class  Primitive
 
class  Boolean
 
class  String
 
class  Number
 
class  Integer
 
class  Int32
 
class  Uint32
 
class  Object
 
class  Array
 
class  Function
 
class  Date
 
class  NumberObject
 
class  BooleanObject
 
class  StringObject
 
class  RegExp
 
class  External
 
class  Template
 
class  Arguments
 
class  AccessorInfo
 
class  FunctionTemplate
 
class  ObjectTemplate
 
class  Signature
 
class  AccessorSignature
 
class  TypeSwitch
 
class  ExternalAsciiStringResourceImpl
 
class  Extension
 
class  DeclareExtension
 
class  ResourceConstraints
 
class  Exception
 
class  HeapStatistics
 
class  Isolate
 
class  StartupData
 
class  StartupDataDecompressor
 
class  ExternalResourceVisitor
 
class  V8
 
class  TryCatch
 
class  ExtensionConfiguration
 
class  Context
 
class  Unlocker
 
class  Locker
 
class  OutputStream
 
class  ActivityControl
 
class  Consts
 
class  NeanderObject
 
class  NeanderArray
 
class  ApiFunction
 
class  RegisteredExtension
 
class  Utils
 
class  ImplementationUtilities
 
class  RemoteDebugger
 
class  ReceiverThread
 
class  KeyboardThread
 
class  RemoteDebuggerEvent
 
class  ZombieProtector
 
class  OpenFDCloser
 
class  ExecArgs
 
class  ReadLineEditor
 
class  DumbLineEditor
 
struct  CounterAndKey
 
class  ShellThread
 
class  Counter
 
class  CounterCollection
 
class  CounterMap
 
class  LineEditor
 
class  SourceGroup
 
class  BinaryResource
 
class  ShellOptions
 
class  Shell
 

Typedefs

typedef uint32_t SnapshotObjectId
 
typedef void(* WeakReferenceCallback )(Persistent< Value > object, void *parameter)
 
typedef Handle< Value >(* AccessorGetter )(Local< String > property, const AccessorInfo &info)
 
typedef void(* AccessorSetter )(Local< String > property, Local< Value > value, const AccessorInfo &info)
 
typedef Handle< Value >(* InvocationCallback )(const Arguments &args)
 
typedef Handle< Value >(* NamedPropertyGetter )(Local< String > property, const AccessorInfo &info)
 
typedef Handle< Value >(* NamedPropertySetter )(Local< String > property, Local< Value > value, const AccessorInfo &info)
 
typedef Handle< Integer >(* NamedPropertyQuery )(Local< String > property, const AccessorInfo &info)
 
typedef Handle< Boolean >(* NamedPropertyDeleter )(Local< String > property, const AccessorInfo &info)
 
typedef Handle< Array >(* NamedPropertyEnumerator )(const AccessorInfo &info)
 
typedef Handle< Value >(* IndexedPropertyGetter )(uint32_t index, const AccessorInfo &info)
 
typedef Handle< Value >(* IndexedPropertySetter )(uint32_t index, Local< Value > value, const AccessorInfo &info)
 
typedef Handle< Integer >(* IndexedPropertyQuery )(uint32_t index, const AccessorInfo &info)
 
typedef Handle< Boolean >(* IndexedPropertyDeleter )(uint32_t index, const AccessorInfo &info)
 
typedef Handle< Array >(* IndexedPropertyEnumerator )(const AccessorInfo &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 > data)
 
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(* 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(* GCCallback )()
 
typedef bool(* EntropySource )(unsigned char *buffer, size_t length)
 
typedef uintptr_t(* ReturnAddressLocationResolver )(uintptr_t return_addr_location)
 

Enumerations

enum  DebugEvent {
  Break = 1, Exception = 2, NewFunction = 3, BeforeCompile = 4,
  AfterCompile = 5, ScriptCollected = 6, BreakForCommand = 7
}
 
enum  PropertyAttribute { None = 0, ReadOnly = 1 << 0, DontEnum = 1 << 1, DontDelete = 1 << 2 }
 
enum  ExternalArrayType {
  kExternalByteArray = 1, kExternalUnsignedByteArray, kExternalShortArray, kExternalUnsignedShortArray,
  kExternalIntArray, kExternalUnsignedIntArray, kExternalFloatArray, kExternalDoubleArray,
  kExternalPixelArray
}
 
enum  AccessControl { DEFAULT = 0, ALL_CAN_READ = 1, ALL_CAN_WRITE = 1 << 1, PROHIBITS_OVERWRITING = 1 << 2 }
 
enum  AccessType {
  ACCESS_GET, ACCESS_SET, ACCESS_HAS, ACCESS_DELETE,
  ACCESS_KEYS
}
 
enum  ObjectSpace {
  kObjectSpaceNewSpace = 1 << 0, kObjectSpaceOldPointerSpace = 1 << 1, kObjectSpaceOldDataSpace = 1 << 2, kObjectSpaceCodeSpace = 1 << 3,
  kObjectSpaceMapSpace = 1 << 4, kObjectSpaceLoSpace = 1 << 5, kObjectSpaceAll
}
 
enum  AllocationAction { kAllocationActionAllocate = 1 << 0, kAllocationActionFree = 1 << 1, kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree }
 
enum  GCType { kGCTypeScavenge = 1 << 0, kGCTypeMarkSweepCompact = 1 << 1, kGCTypeAll = kGCTypeScavenge | kGCTypeMarkSweepCompact }
 
enum  GCCallbackFlags { kNoGCCallbackFlags = 0, kGCCallbackFlagCompacted = 1 << 0 }
 
enum  CompressedStartupDataItems {
  kSnapshot = 0, kSnapshotContext, kLibraries, kExperimentalLibraries,
  kCompressedStartupDataCount
}
 

Functions

PreParserData V8EXPORT Preparse (UnicodeInputStream *input, size_t max_stack_size)
 
void V8EXPORT RegisterExtension (Extension *extension)
 
Handle< Primitive > V8EXPORT Undefined ()
 
Handle< Primitive > V8EXPORT Null ()
 
Handle< Boolean > V8EXPORT True ()
 
Handle< Boolean > V8EXPORT False ()
 
Handle< PrimitiveUndefined (Isolate *isolate)
 
Handle< PrimitiveNull (Isolate *isolate)
 
Handle< BooleanTrue (Isolate *isolate)
 
Handle< BooleanFalse (Isolate *isolate)
 
bool V8EXPORT SetResourceConstraints (ResourceConstraints *constraints)
 
Handle< Value > V8EXPORT ThrowException (Handle< Value > exception)
 
i::Handle< i::StringNewExternalStringHandle (i::Isolate *isolate, v8::String::ExternalStringResource *resource)
 
i::Handle< i::StringNewExternalAsciiStringHandle (i::Isolate *isolate, v8::String::ExternalAsciiStringResource *resource)
 
 REGEXP_FLAG_ASSERT_EQ (kNone, NONE)
 
 REGEXP_FLAG_ASSERT_EQ (kGlobal, GLOBAL)
 
 REGEXP_FLAG_ASSERT_EQ (kIgnoreCase, IGNORE_CASE)
 
 REGEXP_FLAG_ASSERT_EQ (kMultiline, MULTILINE)
 
template<typename T >
T ToCData (v8::internal::Object *obj)
 
template<typename T >
v8::internal::Handle
< v8::internal::Object
FromCData (T obj)
 
template<class T >
TToApi (v8::internal::Handle< v8::internal::Object > obj)
 
void HandleDebugEvent (DebugEvent event, Handle< Object > exec_state, Handle< Object > event_data, Handle< Value > data)
 
void RunRemoteDebugger (int port)
 
int CompareKeys (const void *a, const void *b)
 
int isfinite (double x)
 

Variables

const int MB = 1024 * 1024
 
const char kArrayBufferMarkerPropName [] = "d8::_is_array_buffer_"
 

Detailed Description

Debugger support for the V8 JavaScript engine.

Profiler support for the V8 JavaScript engine.

Testing support for the V8 JavaScript engine.

The v8 JavaScript engine.

Typedef Documentation

typedef Handle<Value>(* 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 1424 of file v8.h.

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

Definition at line 1428 of file v8.h.

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

Definition at line 2667 of file v8.h.

typedef bool(* AllowCodeGenerationFromStringsCallback)(Local< Context > context)

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

Definition at line 2707 of file v8.h.

typedef void(* CallCompletedCallback)()

Definition at line 2694 of file v8.h.

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

Definition at line 2660 of file v8.h.

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

Definition at line 2662 of file v8.h.

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

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

Definition at line 2904 of file v8.h.

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

Definition at line 2697 of file v8.h.

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

Definition at line 2630 of file v8.h.

typedef void(* GCCallback)()

Definition at line 2732 of file v8.h.

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

Definition at line 2730 of file v8.h.

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

Definition at line 2729 of file v8.h.

typedef Handle<Boolean>(* 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 2088 of file v8.h.

typedef Handle<Array>(* IndexedPropertyEnumerator)(const AccessorInfo &info)

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

Definition at line 2095 of file v8.h.

typedef Handle<Value>(* 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 2063 of file v8.h.

typedef Handle<Integer>(* 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 2080 of file v8.h.

typedef Handle<Value>(* 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 2071 of file v8.h.

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.

Definition at line 2124 of file v8.h.

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

Definition at line 2017 of file v8.h.

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

Definition at line 2689 of file v8.h.

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

Definition at line 2633 of file v8.h.

typedef Handle<Boolean>(* 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 2049 of file v8.h.

typedef Handle<Array>(* NamedPropertyEnumerator)(const AccessorInfo &info)

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

Definition at line 2056 of file v8.h.

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

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

Definition at line 2023 of file v8.h.

typedef Handle<Integer>(* 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 2040 of file v8.h.

typedef Handle<Value>(* 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 2031 of file v8.h.

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.

Definition at line 2114 of file v8.h.

typedef uintptr_t(* 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. When invoked, return_addr_location will point to a location on stack where a machine return address resides, this function should return either the same pointer, or a pointer to the profiler's copy of the original return address.

Definition at line 2917 of file v8.h.

typedef uint32_t SnapshotObjectId

Definition at line 67 of file v8-profiler.h.

typedef void(* 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
objectthe weak global object to be reclaimed by the garbage collector
parameterthe value passed in when making the weak global object

Definition at line 137 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 1446 of file v8.h.

enum AccessType

Access type specification.

Enumerator
ACCESS_GET 
ACCESS_SET 
ACCESS_HAS 
ACCESS_DELETE 
ACCESS_KEYS 

Definition at line 2101 of file v8.h.

Enumerator
kAllocationActionAllocate 
kAllocationActionFree 
kAllocationActionAll 

Definition at line 2683 of file v8.h.

Enumerator
kSnapshot 
kSnapshotContext 
kLibraries 
kExperimentalLibraries 
kCompressedStartupDataCount 

Definition at line 377 of file api.cc.

enum DebugEvent
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 1407 of file v8.h.

Enumerator
kNoGCCallbackFlags 
kGCCallbackFlagCompacted 

Definition at line 2724 of file v8.h.

enum 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 2718 of file v8.h.

Enumerator
kObjectSpaceNewSpace 
kObjectSpaceOldPointerSpace 
kObjectSpaceOldDataSpace 
kObjectSpaceCodeSpace 
kObjectSpaceMapSpace 
kObjectSpaceLoSpace 
kObjectSpaceAll 

Definition at line 2670 of file v8.h.

Enumerator
None 
ReadOnly 
DontEnum 
DontDelete 

Definition at line 1400 of file v8.h.

Function Documentation

int v8::CompareKeys ( const void *  a,
const void *  b 
)

Definition at line 937 of file d8.cc.

Referenced by Shell::OnExit().

v8::Handle< Boolean > False ( )
Handle< Boolean > False ( Isolate *  isolate)
inline

Definition at line 4465 of file v8.h.

References False(), I, and S.

v8::internal::Handle<v8::internal::Object> v8::FromCData ( T  obj)
inline

Definition at line 128 of file api.h.

References FACTORY, STATIC_ASSERT, and T.

void v8::HandleDebugEvent ( DebugEvent  event,
Handle< Object >  exec_state,
Handle< Object >  event_data,
Handle< Value >  data 
)
i::Handle<i::String> v8::NewExternalAsciiStringHandle ( i::Isolate isolate,
v8::String::ExternalAsciiStringResource resource 
)

Definition at line 4739 of file api.cc.

References Isolate::factory(), and Factory::NewExternalStringFromAscii().

Referenced by String::NewExternal().

i::Handle<i::String> v8::NewExternalStringHandle ( i::Isolate isolate,
v8::String::ExternalStringResource resource 
)

Definition at line 4731 of file api.cc.

References Isolate::factory(), and Factory::NewExternalStringFromTwoByte().

Referenced by String::NewExternal().

v8::Handle< Primitive > Null ( )

Definition at line 556 of file api.cc.

References Isolate::factory().

Referenced by Null(), TEST(), and THREADED_TEST().

Handle< Primitive > Null ( Isolate *  isolate)
inline

Definition at line 4447 of file v8.h.

References I, Null(), and S.

v8::REGEXP_FLAG_ASSERT_EQ ( kNone  ,
NONE   
)
v8::REGEXP_FLAG_ASSERT_EQ ( kGlobal  ,
GLOBAL   
)
v8::REGEXP_FLAG_ASSERT_EQ ( kIgnoreCase  ,
IGNORE_CASE   
)
v8::REGEXP_FLAG_ASSERT_EQ ( kMultiline  ,
MULTILINE   
)
void RegisterExtension ( Extension *  extension)

Definition at line 525 of file api.cc.

References RegisteredExtension::Register().

Referenced by DeclareExtension::DeclareExtension(), TEST(), and THREADED_TEST().

void v8::RunRemoteDebugger ( int  port)

Referenced by Shell::Main().

v8::Handle< Value > 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.

Definition at line 485 of file api.cc.

References ENTER_V8, Isolate::heap(), Handle< T >::IsEmpty(), Utils::OpenHandle(), Isolate::ScheduleThrow(), and Undefined().

Referenced by Shell::ChangeDirectory(), CThrowCountDown(), ExternalizeStringExtension::Externalize(), ExecArgs::Init(), ExternalizeStringExtension::IsAscii(), Load(), Shell::Load(), Shell::MakeDirectory(), Read(), Shell::Read(), Shell::ReadBuffer(), ReadLine(), Shell::RemoveDirectory(), Shell::SetEnvironment(), Shell::SetUMask(), Shell::System(), ThrowFromC(), ThrowingDirectApiCallback(), ThrowingDirectGetterCallback(), ThrowValue(), Shell::UnsetEnvironment(), and TryCatch::~TryCatch().

T* v8::ToApi ( v8::internal::Handle< v8::internal::Object obj)
inline

Definition at line 248 of file api.h.

References Handle< T >::location(), and T.

T v8::ToCData ( v8::internal::Object obj)
inline

Definition at line 119 of file api.h.

References Foreign::cast(), Foreign::foreign_address(), STATIC_ASSERT, and T.

Handle< Boolean > True ( Isolate *  isolate)
inline

Definition at line 4456 of file v8.h.

References I, S, and True().

Handle< Primitive > Undefined ( Isolate *  isolate)
inline

Definition at line 4438 of file v8.h.

References I, S, and Undefined().

Variable Documentation

const char kArrayBufferMarkerPropName[] = "d8::_is_array_buffer_"

Definition at line 319 of file d8.cc.

Referenced by Shell::ReadBuffer().

const int MB = 1024 * 1024

Definition at line 124 of file d8.cc.

Referenced by TEST().