V8 Project
v8::internal::GCExtension Class Reference

#include <gc-extension.h>

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

Public Member Functions

 GCExtension (const char *fun_name)
 
virtual v8::Handle< v8::FunctionTemplateGetNativeFunctionTemplate (v8::Isolate *isolate, v8::Handle< v8::String > name)
 
- Public Member Functions inherited from v8::Extension
 Extension (const char *name, const char *source=0, int dep_count=0, const char **deps=0, int source_length=-1)
 
virtual ~Extension ()
 
const char * name () const
 
size_t source_length () const
 
const String::ExternalOneByteStringResourcesource () const
 
int dependency_count ()
 
const char ** dependencies ()
 
void set_auto_enable (bool value)
 
bool auto_enable ()
 

Static Public Member Functions

static void GC (const v8::FunctionCallbackInfo< v8::Value > &args)
 

Static Private Member Functions

static const char * BuildSource (char *buf, size_t size, const char *fun_name)
 

Private Attributes

char buffer_ [50]
 

Detailed Description

Definition at line 13 of file gc-extension.h.

Constructor & Destructor Documentation

◆ GCExtension()

v8::internal::GCExtension::GCExtension ( const char *  fun_name)
inlineexplicit

Definition at line 15 of file gc-extension.h.

16  : v8::Extension("v8/gc",
17  BuildSource(buffer_, sizeof(buffer_), fun_name)) {}
Ignore.
Definition: v8.h:4008
static const char * BuildSource(char *buf, size_t size, const char *fun_name)
Definition: gc-extension.h:24

Member Function Documentation

◆ BuildSource()

static const char* v8::internal::GCExtension::BuildSource ( char *  buf,
size_t  size,
const char *  fun_name 
)
inlinestaticprivate

Definition at line 24 of file gc-extension.h.

24  {
25  SNPrintF(Vector<char>(buf, static_cast<int>(size)),
26  "native function %s();", fun_name);
27  return buf;
28  }
enable harmony numeric enable harmony object literal extensions Optimize object size
int SNPrintF(Vector< char > str, const char *format,...)
Definition: utils.cc:105

References size, and v8::internal::SNPrintF().

+ Here is the call graph for this function:

◆ GC()

void v8::internal::GCExtension::GC ( const v8::FunctionCallbackInfo< v8::Value > &  args)
static

Definition at line 20 of file gc-extension.cc.

20  {
22  args[0]->BooleanValue() ? v8::Isolate::kMinorGarbageCollection
24 }
Isolate * GetIsolate() const
Definition: v8.h:6342
void RequestGarbageCollectionForTesting(GarbageCollectionType type)
Request garbage collection in this Isolate.
Definition: api.cc:6562
@ kFullGarbageCollection
Definition: v8.h:4477
@ kMinorGarbageCollection
Definition: v8.h:4478

References v8::FunctionCallbackInfo< T >::GetIsolate(), v8::Isolate::kFullGarbageCollection, v8::Isolate::kMinorGarbageCollection, and v8::Isolate::RequestGarbageCollectionForTesting().

Referenced by GetNativeFunctionTemplate().

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

◆ GetNativeFunctionTemplate()

v8::Handle< v8::FunctionTemplate > v8::internal::GCExtension::GetNativeFunctionTemplate ( v8::Isolate isolate,
v8::Handle< v8::String name 
)
virtual

Reimplemented from v8::Extension.

Definition at line 13 of file gc-extension.cc.

15  {
17 }
static Local< FunctionTemplate > New(Isolate *isolate, FunctionCallback callback=0, Handle< Value > data=Handle< Value >(), Handle< Signature > signature=Handle< Signature >(), int length=0)
Creates a function template.
Definition: api.cc:904
static void GC(const v8::FunctionCallbackInfo< v8::Value > &args)
Definition: gc-extension.cc:20

References GC(), and v8::FunctionTemplate::New().

+ Here is the call graph for this function:

Member Data Documentation

◆ buffer_

char v8::internal::GCExtension::buffer_[50]
private

Definition at line 30 of file gc-extension.h.


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