![]() |
MySQL 9.3.0
Source Code Documentation
|
Specialization of the Polyglot_common_context to provide MRS specific logging functions as well as the MRS specific engine to be used across the different contexts. More...
#include <jit_executor_common_context.h>
Public Member Functions | |
CommonContext (const std::shared_ptr< shcore::polyglot::IFile_system > &fs, const std::vector< std::string > &module_files, const shcore::Dictionary_t &globals, const std::vector< std::string > &isolate_args) | |
~CommonContext () override | |
void | initialize (const std::vector< std::string > &isolate_args) override |
void | finalize () override |
bool | start () |
bool | got_fatal_error () const |
std::string | error () const |
const std::shared_ptr< shcore::polyglot::IFile_system > & | file_system () const |
const shcore::Dictionary_t & | globals () const |
![]() | |
Polyglot_common_context ()=default | |
virtual | ~Polyglot_common_context ()=default |
poly_reference | engine () const |
poly_isolate | isolate () const |
poly_thread | thread () const |
void | clean_collectables () |
Collectable_registry * | collectable_registry () |
Private Member Functions | |
void | life_cycle_thread () |
When persisting objects in GraalVM (creating references so they are available across threads/contexts), a reference should be created. More... | |
void | fatal_error () override |
void | flush () override |
void | log (const char *bytes, size_t length) override |
shcore::polyglot::Garbage_collector::Config | gc_config () override |
poly_engine | create_engine () override |
Creates the shared engine for the different contexts created with this handler. More... | |
Private Attributes | |
std::shared_ptr< JavaScript > | m_base_context |
std::shared_ptr< shcore::polyglot::IFile_system > | m_file_system |
std::vector< std::string > | m_module_files |
std::vector< shcore::polyglot::Store > | m_cached_sources |
shcore::Dictionary_t | m_globals |
std::unique_ptr< std::thread > | m_life_cycle_thread |
std::mutex | m_mutex |
std::condition_variable | m_init_condition |
bool | m_initialized = false |
bool | m_terminated = false |
std::mutex | m_finish_mutex |
std::condition_variable | m_finish_condition |
bool | m_fatal_error |
std::string | m_fatal_error_description |
std::vector< std::string > | m_isolate_args |
Static Private Attributes | |
static bool | m_global_fatal_error = false |
Additional Inherited Members | |
![]() | |
poly_isolate | m_isolate = nullptr |
poly_thread | m_thread = nullptr |
Specialization of the Polyglot_common_context to provide MRS specific logging functions as well as the MRS specific engine to be used across the different contexts.
NOTE: Using a shared engine across contexts is meant to enable code sharing, however, even it is enabled, the module files are being loaded on every created context.
jit_executor::CommonContext::CommonContext | ( | const std::shared_ptr< shcore::polyglot::IFile_system > & | fs, |
const std::vector< std::string > & | module_files, | ||
const shcore::Dictionary_t & | globals, | ||
const std::vector< std::string > & | isolate_args | ||
) |
|
override |
|
overrideprivatevirtual |
Creates the shared engine for the different contexts created with this handler.
Returning nullptr (or removing this implementation) would enable the default behavior for Graal which is to create an engine for every context.
Reimplemented from shcore::polyglot::Polyglot_common_context.
|
inline |
|
overrideprivatevirtual |
Implements shcore::polyglot::Polyglot_common_context.
|
inline |
|
overridevirtual |
Reimplemented from shcore::polyglot::Polyglot_common_context.
|
overrideprivatevirtual |
Implements shcore::polyglot::Polyglot_common_context.
|
inlineoverrideprivatevirtual |
Reimplemented from shcore::polyglot::Polyglot_common_context.
|
inline |
|
inline |
|
overridevirtual |
Reimplemented from shcore::polyglot::Polyglot_common_context.
|
private |
When persisting objects in GraalVM (creating references so they are available across threads/contexts), a reference should be created.
Releasing the references should be done on the same thread where they were created.
This function controls the life cycle of the common context, to guarantee the above condition.
|
overrideprivatevirtual |
Implements shcore::polyglot::Polyglot_common_context.
bool jit_executor::CommonContext::start | ( | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |