MySQL 9.3.0
Source Code Documentation
shcore::polyglot::Polyglot_common_context Class Referenceabstract

Common context for GraalVM Languages. More...

#include <polyglot_common_context.h>

Inheritance diagram for shcore::polyglot::Polyglot_common_context:
[legend]

Public Member Functions

 Polyglot_common_context ()=default
 
virtual ~Polyglot_common_context ()=default
 
virtual void initialize (const std::vector< std::string > &isolate_args)
 
virtual void finalize ()
 
poly_reference engine () const
 
poly_isolate isolate () const
 
poly_thread thread () const
 
void clean_collectables ()
 
Collectable_registrycollectable_registry ()
 

Protected Attributes

poly_isolate m_isolate = nullptr
 
poly_thread m_thread = nullptr
 

Private Member Functions

void init_engine ()
 
virtual void fatal_error ()=0
 
virtual void flush ()=0
 
virtual void log (const char *bytes, size_t length)=0
 
virtual poly_engine create_engine ()
 
virtual Garbage_collector::Config gc_config ()
 

Static Private Member Functions

static void fatal_error_callback (void *data)
 
static void flush_callback (void *data)
 
static void log_callback (const char *bytes, size_t length, void *data)
 

Private Attributes

Store m_engine
 
std::unique_ptr< Polyglot_scopem_scope
 
Collectable_registry m_registry
 

Detailed Description

Common context for GraalVM Languages.

Encloses the following global routines/components:

  • Initialization/TearDown of the GraalVM Isolate.
  • Registration of global logging callbacks.
  • Setup of the global engine.
  • Provides access to the garbage collector for event registration.

This class can be specialized to:

  • Provide custom callbacks for the global logging functions.
  • Create a custom Engine to be used in the contexts created from this class.
  • Provide custom configuration for the garbage collector.

Constructor & Destructor Documentation

◆ Polyglot_common_context()

shcore::polyglot::Polyglot_common_context::Polyglot_common_context ( )
default

◆ ~Polyglot_common_context()

virtual shcore::polyglot::Polyglot_common_context::~Polyglot_common_context ( )
virtualdefault

Member Function Documentation

◆ clean_collectables()

void shcore::polyglot::Polyglot_common_context::clean_collectables ( )

◆ collectable_registry()

Collectable_registry * shcore::polyglot::Polyglot_common_context::collectable_registry ( )
inline

◆ create_engine()

virtual poly_engine shcore::polyglot::Polyglot_common_context::create_engine ( )
inlineprivatevirtual

Reimplemented in jit_executor::CommonContext.

◆ engine()

poly_reference shcore::polyglot::Polyglot_common_context::engine ( ) const
inline

◆ fatal_error()

virtual void shcore::polyglot::Polyglot_common_context::fatal_error ( )
privatepure virtual

Implemented in jit_executor::CommonContext.

◆ fatal_error_callback()

void shcore::polyglot::Polyglot_common_context::fatal_error_callback ( void *  data)
staticprivate

◆ finalize()

void shcore::polyglot::Polyglot_common_context::finalize ( )
virtual

Reimplemented in jit_executor::CommonContext.

◆ flush()

virtual void shcore::polyglot::Polyglot_common_context::flush ( )
privatepure virtual

Implemented in jit_executor::CommonContext.

◆ flush_callback()

void shcore::polyglot::Polyglot_common_context::flush_callback ( void *  data)
staticprivate

◆ gc_config()

virtual Garbage_collector::Config shcore::polyglot::Polyglot_common_context::gc_config ( )
inlineprivatevirtual

Reimplemented in jit_executor::CommonContext.

◆ init_engine()

void shcore::polyglot::Polyglot_common_context::init_engine ( )
private

◆ initialize()

void shcore::polyglot::Polyglot_common_context::initialize ( const std::vector< std::string > &  isolate_args)
virtual

Reimplemented in jit_executor::CommonContext.

◆ isolate()

poly_isolate shcore::polyglot::Polyglot_common_context::isolate ( ) const
inline

◆ log()

virtual void shcore::polyglot::Polyglot_common_context::log ( const char *  bytes,
size_t  length 
)
privatepure virtual

Implemented in jit_executor::CommonContext.

◆ log_callback()

void shcore::polyglot::Polyglot_common_context::log_callback ( const char *  bytes,
size_t  length,
void *  data 
)
staticprivate

◆ thread()

poly_thread shcore::polyglot::Polyglot_common_context::thread ( ) const
inline

Member Data Documentation

◆ m_engine

Store shcore::polyglot::Polyglot_common_context::m_engine
private

◆ m_isolate

poly_isolate shcore::polyglot::Polyglot_common_context::m_isolate = nullptr
protected

◆ m_registry

Collectable_registry shcore::polyglot::Polyglot_common_context::m_registry
private

◆ m_scope

std::unique_ptr<Polyglot_scope> shcore::polyglot::Polyglot_common_context::m_scope
private

◆ m_thread

poly_thread shcore::polyglot::Polyglot_common_context::m_thread = nullptr
protected

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