V8 Project
v8::internal::FunctionCallbackArguments Class Reference

#include <arguments.h>

+ Inheritance diagram for v8::internal::FunctionCallbackArguments:
+ Collaboration diagram for v8::internal::FunctionCallbackArguments:

Public Types

typedef FunctionCallbackInfo< ValueT
 
typedef CustomArguments< TSuper
 
- Public Types inherited from v8::internal::CustomArguments< FunctionCallbackInfo< Value > >
typedef CustomArgumentsBase< T::kArgsLength > Super
 

Public Member Functions

 FunctionCallbackArguments (internal::Isolate *isolate, internal::Object *data, internal::JSFunction *callee, internal::Object *holder, internal::Object **argv, int argc, bool is_construct_call)
 
v8::Handle< v8::ValueCall (FunctionCallback f)
 
- Public Member Functions inherited from v8::internal::CustomArguments< FunctionCallbackInfo< Value > >
 ~CustomArguments ()
 
- Public Member Functions inherited from v8::internal::CustomArgumentsBase< T::kArgsLength >
virtual void IterateInstance (ObjectVisitor *v)
 

Static Public Attributes

static const int kArgsLength = T::kArgsLength
 
static const int kHolderIndex = T::kHolderIndex
 
static const int kDataIndex = T::kDataIndex
 
static const int kReturnValueDefaultValueIndex
 
static const int kIsolateIndex = T::kIsolateIndex
 
static const int kCalleeIndex = T::kCalleeIndex
 
static const int kContextSaveIndex = T::kContextSaveIndex
 
- Static Public Attributes inherited from v8::internal::CustomArguments< FunctionCallbackInfo< Value > >
static const int kReturnValueOffset
 

Private Attributes

internal::Object ** argv_
 
int argc_
 
bool is_construct_call_
 

Additional Inherited Members

- Protected Member Functions inherited from v8::internal::CustomArguments< FunctionCallbackInfo< Value > >
 CustomArguments (Isolate *isolate)
 
v8::Handle< VGetReturnValue (Isolate *isolate)
 
Isolateisolate ()
 
- Protected Member Functions inherited from v8::internal::CustomArgumentsBase< T::kArgsLength >
Object ** begin ()
 
 CustomArgumentsBase (Isolate *isolate)
 
- Protected Attributes inherited from v8::internal::CustomArgumentsBase< T::kArgsLength >
Objectvalues_ [kArrayLength]
 

Detailed Description

Definition at line 215 of file arguments.h.

Member Typedef Documentation

◆ Super

◆ T

Constructor & Destructor Documentation

◆ FunctionCallbackArguments()

v8::internal::FunctionCallbackArguments::FunctionCallbackArguments ( internal::Isolate isolate,
internal::Object data,
internal::JSFunction callee,
internal::Object holder,
internal::Object **  argv,
int  argc,
bool  is_construct_call 
)
inline

Definition at line 229 of file arguments.h.

236  : Super(isolate),
237  argv_(argv),
238  argc_(argc),
239  is_construct_call_(is_construct_call) {
240  Object** values = begin();
241  values[T::kDataIndex] = data;
242  values[T::kCalleeIndex] = callee;
243  values[T::kHolderIndex] = holder;
244  values[T::kContextSaveIndex] = isolate->heap()->the_hole_value();
245  values[T::kIsolateIndex] = reinterpret_cast<internal::Object*>(isolate);
246  // Here the hole is set as default value.
247  // It cannot escape into js as it's remove in Call below.
249  isolate->heap()->the_hole_value();
250  values[T::kReturnValueIndex] = isolate->heap()->the_hole_value();
251  DCHECK(values[T::kCalleeIndex]->IsJSFunction());
252  DCHECK(values[T::kHolderIndex]->IsHeapObject());
253  DCHECK(values[T::kIsolateIndex]->IsSmi());
254  }
static const int kHolderIndex
Definition: v8.h:2667
static const int kCalleeIndex
Definition: v8.h:2672
static const int kReturnValueDefaultValueIndex
Definition: v8.h:2669
static const int kIsolateIndex
Definition: v8.h:2668
static const int kDataIndex
Definition: v8.h:2671
static const int kContextSaveIndex
Definition: v8.h:2673
static const int kReturnValueIndex
Definition: v8.h:2670
#define DCHECK(condition)
Definition: logging.h:205
kSerializedDataOffset Object
Definition: objects-inl.h:5322

References v8::internal::CustomArgumentsBase< T::kArgsLength >::begin(), DCHECK, v8::internal::Isolate::heap(), v8::internal::CustomArguments< FunctionCallbackInfo< Value > >::isolate(), v8::FunctionCallbackInfo< T >::kCalleeIndex, v8::FunctionCallbackInfo< T >::kContextSaveIndex, v8::FunctionCallbackInfo< T >::kDataIndex, v8::FunctionCallbackInfo< T >::kHolderIndex, v8::FunctionCallbackInfo< T >::kIsolateIndex, v8::FunctionCallbackInfo< T >::kReturnValueDefaultValueIndex, and v8::FunctionCallbackInfo< T >::kReturnValueIndex.

+ Here is the call graph for this function:

Member Function Documentation

◆ Call()

v8::Handle< v8::Value > v8::internal::FunctionCallbackArguments::Call ( FunctionCallback  f)

Definition at line 25 of file arguments.cc.

25  {
26  Isolate* isolate = this->isolate();
27  VMState<EXTERNAL> state(isolate);
28  ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f));
29  FunctionCallbackInfo<v8::Value> info(begin(),
30  argv_,
31  argc_,
33  f(info);
34  return GetReturnValue<v8::Value>(isolate);
35 }
#define FUNCTION_ADDR(f)
Definition: globals.h:195

References argc_, argv_, v8::internal::CustomArgumentsBase< T::kArgsLength >::begin(), FUNCTION_ADDR, is_construct_call_, and v8::internal::CustomArguments< FunctionCallbackInfo< Value > >::isolate().

Referenced by v8::internal::HandleApiCallAsFunctionOrConstructor(), and v8::internal::HandleApiCallHelper().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ argc_

int v8::internal::FunctionCallbackArguments::argc_
private

Definition at line 268 of file arguments.h.

Referenced by Call().

◆ argv_

internal::Object** v8::internal::FunctionCallbackArguments::argv_
private

Definition at line 267 of file arguments.h.

Referenced by Call().

◆ is_construct_call_

bool v8::internal::FunctionCallbackArguments::is_construct_call_
private

Definition at line 269 of file arguments.h.

Referenced by Call().

◆ kArgsLength

const int v8::internal::FunctionCallbackArguments::kArgsLength = T::kArgsLength
static

Definition at line 220 of file arguments.h.

◆ kCalleeIndex

const int v8::internal::FunctionCallbackArguments::kCalleeIndex = T::kCalleeIndex
static

Definition at line 226 of file arguments.h.

◆ kContextSaveIndex

const int v8::internal::FunctionCallbackArguments::kContextSaveIndex = T::kContextSaveIndex
static

Definition at line 227 of file arguments.h.

◆ kDataIndex

const int v8::internal::FunctionCallbackArguments::kDataIndex = T::kDataIndex
static

Definition at line 222 of file arguments.h.

◆ kHolderIndex

const int v8::internal::FunctionCallbackArguments::kHolderIndex = T::kHolderIndex
static

Definition at line 221 of file arguments.h.

◆ kIsolateIndex

const int v8::internal::FunctionCallbackArguments::kIsolateIndex = T::kIsolateIndex
static

Definition at line 225 of file arguments.h.

◆ kReturnValueDefaultValueIndex

const int v8::internal::FunctionCallbackArguments::kReturnValueDefaultValueIndex
static
Initial value:

Definition at line 223 of file arguments.h.


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