V8 Project
v8::FunctionCallbackInfo< T > Class Template Reference

The argument information given to function call callbacks. More...

#include <v8.h>

+ Collaboration diagram for v8::FunctionCallbackInfo< T >:

Public Member Functions

int Length () const
 
Local< Valueoperator[] (int i) const
 
Local< FunctionCallee () const
 
Local< ObjectThis () const
 
Local< ObjectHolder () const
 
bool IsConstructCall () const
 
Local< ValueData () const
 
IsolateGetIsolate () const
 
ReturnValue< TGetReturnValue () const
 

Static Public Attributes

static const int kArgsLength = 7
 

Protected Member Functions

 FunctionCallbackInfo (internal::Object **implicit_args, internal::Object **values, int length, bool is_construct_call)
 

Protected Attributes

internal::Object ** implicit_args_
 
internal::Object ** values_
 
int length_
 
bool is_construct_call_
 

Static Protected Attributes

static const int kHolderIndex = 0
 
static const int kIsolateIndex = 1
 
static const int kReturnValueDefaultValueIndex = 2
 
static const int kReturnValueIndex = 3
 
static const int kDataIndex = 4
 
static const int kCalleeIndex = 5
 
static const int kContextSaveIndex = 6
 

Friends

class internal::FunctionCallbackArguments
 
class internal::CustomArguments< FunctionCallbackInfo >
 

Detailed Description

template<typename T>
class v8::FunctionCallbackInfo< T >

The argument information given to function call callbacks.

This class provides access to information about the context of the call, including the receiver, the number and values of arguments, and the holder of the function.

Definition at line 2650 of file v8.h.

Constructor & Destructor Documentation

◆ FunctionCallbackInfo()

template<typename T >
v8::FunctionCallbackInfo< T >::FunctionCallbackInfo ( internal::Object **  implicit_args,
internal::Object **  values,
int  length,
bool  is_construct_call 
)
inlineprotected

Definition at line 6298 of file v8.h.

6302  : implicit_args_(implicit_args),
6303  values_(values),
6304  length_(length),
6305  is_construct_call_(is_construct_call) { }
internal::Object ** values_
Definition: v8.h:2680
internal::Object ** implicit_args_
Definition: v8.h:2679

Member Function Documentation

◆ Callee()

template<typename T >
Local< Function > v8::FunctionCallbackInfo< T >::Callee
inline

Definition at line 6316 of file v8.h.

6316  {
6317  return Local<Function>(reinterpret_cast<Function*>(
6319 }
static const int kCalleeIndex
Definition: v8.h:2672

◆ Data()

template<typename T >
Local< Value > v8::FunctionCallbackInfo< T >::Data
inline

Definition at line 6336 of file v8.h.

6336  {
6337  return Local<Value>(reinterpret_cast<Value*>(&implicit_args_[kDataIndex]));
6338 }
static const int kDataIndex
Definition: v8.h:2671

◆ GetIsolate()

◆ GetReturnValue()

template<typename T >
ReturnValue< T > v8::FunctionCallbackInfo< T >::GetReturnValue
inline

Definition at line 6348 of file v8.h.

6348  {
6349  return ReturnValue<T>(&implicit_args_[kReturnValueIndex]);
6350 }
static const int kReturnValueIndex
Definition: v8.h:2670

Referenced by v8::internal::StatisticsExtension::GetCounters(), v8::internal::ExternalizeStringExtension::IsOneByte(), v8::Shell::PerformanceNow(), v8::Shell::Read(), v8::Shell::ReadBuffer(), v8::Shell::ReadLine(), v8::Shell::RealmCreate(), v8::Shell::RealmCurrent(), v8::Shell::RealmEval(), v8::Shell::RealmGlobal(), v8::Shell::RealmOwner(), v8::Shell::SetUMask(), v8::Shell::System(), and v8::Shell::Version().

+ Here is the caller graph for this function:

◆ Holder()

template<typename T >
Local< Object > v8::FunctionCallbackInfo< T >::Holder
inline

Definition at line 6329 of file v8.h.

6329  {
6330  return Local<Object>(reinterpret_cast<Object*>(
6332 }
static const int kHolderIndex
Definition: v8.h:2667
kSerializedDataOffset Object
Definition: objects-inl.h:5322

◆ IsConstructCall()

template<typename T >
bool v8::FunctionCallbackInfo< T >::IsConstructCall
inline

Definition at line 6354 of file v8.h.

6354  {
6355  return is_construct_call_;
6356 }

◆ Length()

◆ operator[]()

template<typename T >
Local< Value > v8::FunctionCallbackInfo< T >::operator[] ( int  i) const
inline

Definition at line 6309 of file v8.h.

6309  {
6310  if (i < 0 || length_ <= i) return Local<Value>(*Undefined(GetIsolate()));
6311  return Local<Value>(reinterpret_cast<Value*>(values_ - i));
6312 }
Isolate * GetIsolate() const
Definition: v8.h:6342
Handle< Primitive > Undefined(Isolate *isolate)
Definition: v8.h:6836

References v8::Undefined().

+ Here is the call graph for this function:

◆ This()

template<typename T >
Local< Object > v8::FunctionCallbackInfo< T >::This
inline

Definition at line 6323 of file v8.h.

6323  {
6324  return Local<Object>(reinterpret_cast<Object*>(values_ + 1));
6325 }

Friends And Related Function Documentation

◆ internal::CustomArguments< FunctionCallbackInfo >

template<typename T >
friend class internal::CustomArguments< FunctionCallbackInfo >
friend

Definition at line 2665 of file v8.h.

◆ internal::FunctionCallbackArguments

template<typename T >
friend class internal::FunctionCallbackArguments
friend

Definition at line 2665 of file v8.h.

Member Data Documentation

◆ implicit_args_

template<typename T >
internal::Object** v8::FunctionCallbackInfo< T >::implicit_args_
protected

Definition at line 2679 of file v8.h.

◆ is_construct_call_

template<typename T >
bool v8::FunctionCallbackInfo< T >::is_construct_call_
protected

Definition at line 2682 of file v8.h.

◆ kArgsLength

template<typename T >
const int v8::FunctionCallbackInfo< T >::kArgsLength = 7
static

Definition at line 2662 of file v8.h.

◆ kCalleeIndex

template<typename T >
const int v8::FunctionCallbackInfo< T >::kCalleeIndex = 5
staticprotected

◆ kContextSaveIndex

template<typename T >
const int v8::FunctionCallbackInfo< T >::kContextSaveIndex = 6
staticprotected

◆ kDataIndex

template<typename T >
const int v8::FunctionCallbackInfo< T >::kDataIndex = 4
staticprotected

◆ kHolderIndex

template<typename T >
const int v8::FunctionCallbackInfo< T >::kHolderIndex = 0
staticprotected

◆ kIsolateIndex

template<typename T >
const int v8::FunctionCallbackInfo< T >::kIsolateIndex = 1
staticprotected

◆ kReturnValueDefaultValueIndex

template<typename T >
const int v8::FunctionCallbackInfo< T >::kReturnValueDefaultValueIndex = 2
staticprotected

◆ kReturnValueIndex

template<typename T >
const int v8::FunctionCallbackInfo< T >::kReturnValueIndex = 3
staticprotected

◆ length_

template<typename T >
int v8::FunctionCallbackInfo< T >::length_
protected

Definition at line 2681 of file v8.h.

◆ values_

template<typename T >
internal::Object** v8::FunctionCallbackInfo< T >::values_
protected

Definition at line 2680 of file v8.h.


The documentation for this class was generated from the following file: