From c3bc5f2de65cc823f1de282c6a6791836d712aca Mon Sep 17 00:00:00 2001 From: karurochari Date: Wed, 18 Dec 2024 20:14:56 +0000 Subject: [PATCH] Cleanup of special props for container tags, cleanup of the ui-tree interface, fixing example syntax for xml --- examples/example-0.xml | 18 ++++---- include/components/containers.hpp | 25 ++++++++++- include/ui-tree.hpp | 27 +++++++++--- include/ui-tree.xml.hpp | 22 ++++------ meson.build | 32 ++++++++++---- schemas/components/fl:base.json | 2 +- src/loader.cpp | 8 ++-- src/pipelines/tcc-c.cpp | 37 +++++++++------- src/ui-tree.xml.cpp | 71 ++++++++++++++++--------------- 9 files changed, 149 insertions(+), 93 deletions(-) diff --git a/examples/example-0.xml b/examples/example-0.xml index e59ce0cd..9ac79ecd 100644 --- a/examples/example-0.xml +++ b/examples/example-0.xml @@ -1,7 +1,11 @@ - + @@ -30,10 +34,8 @@ development--> - + @@ -198,13 +200,13 @@ development--> - + - + - + diff --git a/include/components/containers.hpp b/include/components/containers.hpp index c53856d7..c9314428 100644 --- a/include/components/containers.hpp +++ b/include/components/containers.hpp @@ -22,7 +22,14 @@ class ui_root_thin_component : public ui_base{ virtual frame_type_t default_frame_type() override {return frame_type_t::CONTAINER;} virtual const char* class_name() override{return "component.thin";} - int apply_prop(const char *prop, const char *value) override{if(local_frame!=nullptr)return local_frame->call_dispatcher(prop,value);return 1;} + int apply_prop(const char *prop, const char *value) override{ + if(strncmp(prop, "xmlns:", sizeof("xmlns:")-1)==0){return 0;} + else if(strcmp(prop, "name")==0){return 0;} + else if(strncmp(prop, "frame.", sizeof("frame.")-1)==0){return 0;} + if(local_frame!=nullptr)return local_frame->call_dispatcher(prop,value); + return 1; + } + int get_computed(const char *prop, const char **value) override{return 1;} }; @@ -43,6 +50,14 @@ class ui_root_app :public ui_root_component{ ui_root_app(frame_mode_t MODE):ui_root_component(MODE){} virtual const char* class_name() override{return "app";} + int apply_prop(const char *prop, const char *value) override{ + if(strncmp(prop, "xmlns:", sizeof("xmlns:")-1)==0){return 0;} + else if(strncmp(prop, "link-with.", sizeof("link-with.")-1)==0){return 0;} + else if(strncmp(prop, "frame.", sizeof("frame.")-1)==0){return 0;} + if(local_frame!=nullptr)return local_frame->call_dispatcher(prop,value); + return 1; + } + }; @@ -59,7 +74,13 @@ class ui_namespace : public ui_base{ virtual frame_type_t default_frame_type() override {return frame_type_t::NODE;} virtual const char* class_name() override{return "namespace";} - int apply_prop(const char *prop, const char *value) override{if(local_frame!=nullptr)return local_frame->call_dispatcher(prop,value);return 1;} + int apply_prop(const char *prop, const char *value) override{ + if(strcmp(prop, "name")==0){return 0;} + else if(strncmp(prop, "frame.", sizeof("frame.")-1)==0){return 0;} + if(local_frame!=nullptr)return local_frame->call_dispatcher(prop,value); + return 1; + } + int get_computed(const char *prop, const char **value) override{return 1;} }; diff --git a/include/ui-tree.hpp b/include/ui-tree.hpp index 9b1995aa..0089dc84 100644 --- a/include/ui-tree.hpp +++ b/include/ui-tree.hpp @@ -1,6 +1,7 @@ #pragma once #include "globals.hpp" +#include "pipelines/commons.hpp" #include "ui-frame.hpp" #include #include @@ -15,21 +16,23 @@ struct ui_tree { //Define the embedded mode supported. frame_mode_t mode = frame_mode_t::AUTO; - global_ctx_t& globals; //Just for book-keeping + //Book-keeping. Duplicated info on nested structures, but they are short lived, and it is better compared to unrolling the stack each time. + global_ctx_t* globals; + //Book-keeping. Duplicated info on nested structures, but they are short lived, and it is better compared to unrolling the stack each time. + pipelines::link_with_t link_with = {nullptr, nullptr}; ui_tree* parent = nullptr; //Set if there is an explict owner of this root, for example a viewport/app. ui_base* caller_ui_node=nullptr; //Element from a parent tree calling me ui_base* root = nullptr; //Base element of this tree policies_t policies; //Computed policies for this tree - scoped_rpath_t local; //Full path for the location of this component. - scoped_rpath_t fullname; //Full path for the location of this component. + scoped_rpath_t local; //Full path for the location of this component. Redundant but used to make some operations faster. + scoped_rpath_t fullname; //Full path with name for the location of this component. size_t local_unique_counter = 0; // Globals - std::string basename; - std::map> modules; - // TODO Add policies + std::map imports; + std::map> props_from_above; std::map *, std::less<>> slots_from_above; @@ -48,7 +51,17 @@ struct ui_tree { virtual void cleanup(); virtual int runtime_testsuite(); - inline ui_tree(global_ctx_t& g, ui_tree* parent, ui_base* caller_ui_node):globals(g){this->parent=parent;this->caller_ui_node=caller_ui_node;} + virtual int build() = 0; + virtual int load(const char* file, type_t type) = 0; + + inline ui_tree(ui_tree* parent, ui_base* caller_ui_node){ + this->parent=parent; + if(parent!=nullptr){ + link_with=parent->link_with; + globals=parent->globals; + } + this->caller_ui_node=caller_ui_node; + } }; diff --git a/include/ui-tree.xml.hpp b/include/ui-tree.xml.hpp index bd769c66..7b154dd5 100644 --- a/include/ui-tree.xml.hpp +++ b/include/ui-tree.xml.hpp @@ -30,9 +30,12 @@ struct ui_tree_xml : ui_tree { pugi::xml_document doc; //Handle of the xml parser - std::map imports; + template T> + T *build_base_widget(const pugi::xml_node &root, ui_base * root_ui = nullptr); + void _build_base_widget_extended_attr(const pugi::xml_node &root, ui_base * current); + void _build(const pugi::xml_node &root, ui_base *root_ui = nullptr); public: void set_namespace(namespaces_t n, const char* prefix){ @@ -41,20 +44,13 @@ struct ui_tree_xml : ui_tree { else if(n==namespaces_t::s){if(prefix[0]==0)ns.s="";else ns.s=std::string(prefix)+":";} } - template T> - T *build_base_widget(const pugi::xml_node &root, ui_base * root_ui = nullptr); - - void _build_base_widget_extended_attr(const pugi::xml_node &root, ui_base * current); - void _build(const pugi::xml_node &root, ui_base *root_ui = nullptr); - - int build(); - - int load(const char* file, type_t type); + virtual int build() override; + virtual int load(const char* file, type_t type) override; - inline ui_tree_xml(global_ctx_t& g, ui_tree* parent, ui_base* caller_ui_node, const pugi::xml_node* caller_xml_node):ui_tree(g,parent,caller_ui_node){this->caller_xml_node=caller_xml_node;} + inline ui_tree_xml(ui_tree* parent, ui_base* caller_ui_node, const pugi::xml_node* caller_xml_node):ui_tree(parent,caller_ui_node){this->caller_xml_node=caller_xml_node;} virtual ~ui_tree_xml(); - virtual void cleanup(); - virtual int runtime_testsuite(){if(this->root!=nullptr)return this->root->all_tests();return 0;} + virtual void cleanup() override; + virtual int runtime_testsuite() override{if(this->root!=nullptr)return this->root->all_tests();return 0;} // Logging diff --git a/meson.build b/meson.build index 3506e710..0f0acead 100644 --- a/meson.build +++ b/meson.build @@ -21,8 +21,14 @@ vs_fltk_deps = [] # Process options -add_global_arguments(['-DVS_COMMONS_DIR="'+join_paths(get_option('prefix'),get_option('datadir'),'vs-fltk')+'/"'], language: ['cpp', 'c']) - +add_global_arguments( + [ + '-DVS_COMMONS_DIR="' + + join_paths(get_option('prefix'), get_option('datadir'), 'vs-fltk') + + '/"', + ], + language: ['cpp', 'c'], +) if get_option('use_tcc') add_global_arguments(['-DVS_USE_TCC'], language: ['cpp', 'c']) @@ -64,7 +70,12 @@ if need_pugixml or get_option('use_system_pugixml') == false endif if get_option('use_system_fltk') - libfltk_dep = dependency('FLTK', version: '>=1.4.0', modules: ['fltk::fltk', 'fltk::images', 'fltk::forms'], required: false) + libfltk_dep = dependency( + 'FLTK', + version: '>=1.4.0', + modules: ['fltk::fltk', 'fltk::images', 'fltk::forms'], + required: false, + ) if libfltk_dep.found() == false #For MacOS14 assuming a brew dependency because there is something broken in there. libfltk_dep = dependency('fltk', required: false) @@ -83,7 +94,7 @@ if need_fltk == true or get_option('use_system_fltk') == false 'FLTK_BUILD_OPTIONS': false, 'FLTK_BUILD_SHARED_LIBS': true, 'CMAKE_POSITION_INDEPENDENT_CODE': true, - 'CMAKE_INSTALL_LIBDIR': get_option('libdir') + 'CMAKE_INSTALL_LIBDIR': get_option('libdir'), }, ) @@ -92,7 +103,11 @@ if need_fltk == true or get_option('use_system_fltk') == false endif libfltk_proj = cmake.subproject('libfltk', options: opt_fltk) - libfltk_dep = [ libfltk_proj.dependency(['fltk-shared']), libfltk_proj.dependency(['fltk-images-shared']), libfltk_proj.dependency(['fltk-forms-shared'])] + libfltk_dep = [ + libfltk_proj.dependency(['fltk-shared']), + libfltk_proj.dependency(['fltk-images-shared']), + libfltk_proj.dependency(['fltk-forms-shared']), + ] #libfltk_gl_dep = libfltk_proj.dependency(['fltk-gl']) endif @@ -102,7 +117,7 @@ if get_option('use_wamr') { 'WAMR_BUILD_INTERP': 1, 'WAMR_BUILD_PLATFORM': target_machine.system(), - 'CMAKE_INSTALL_LIBDIR': get_option('libdir') + 'CMAKE_INSTALL_LIBDIR': get_option('libdir'), }, ) wamr_proj = cmake.subproject('wamr', options: opt_wamr) @@ -117,7 +132,7 @@ if get_option('use_quickjs') opt_quickjs.add_cmake_defines( { 'CMAKE_POSITION_INDEPENDENT_CODE': true, - 'CMAKE_INSTALL_LIBDIR': get_option('libdir') + 'CMAKE_INSTALL_LIBDIR': get_option('libdir'), }, ) @@ -144,7 +159,7 @@ opt_fmt.add_cmake_defines( { 'CMAKE_POSITION_INDEPENDENT_CODE': true, 'BUILD_SHARED_LIBS': false, - 'CMAKE_INSTALL_LIBDIR': get_option('libdir') + 'CMAKE_INSTALL_LIBDIR': get_option('libdir'), }, ) fmt_proj = cmake.subproject('fmt', options: opt_fmt) @@ -347,7 +362,6 @@ subdir(['./experiments/']) subdir(['./metadata/']) - if get_option('tests') subdir(['./test/']) subdir(['./benchmark/']) diff --git a/schemas/components/fl:base.json b/schemas/components/fl:base.json index ea95b7e0..33f122fb 100644 --- a/schemas/components/fl:base.json +++ b/schemas/components/fl:base.json @@ -5,7 +5,7 @@ "type": "node", "headers": ["FL/Fl_Group.H"], "codegen": { "extends": "ui" }, - "skip_fields": ["name", "frame.*", "xsml", "xsml:*"], + "skip_fields": ["name", "frame.*", "xmlns", "xmlns:*"], "fields": { "mixin": { "type": "string", diff --git a/src/loader.cpp b/src/loader.cpp index badb7a99..0cb41dd8 100644 --- a/src/loader.cpp +++ b/src/loader.cpp @@ -37,7 +37,9 @@ app_loader::app_loader(global_ctx_t& globals, const char *profile, const char *p doc.load_string(embedded_profile); } - root = new ui_tree_xml(globals,nullptr,nullptr,nullptr); + root = new ui_tree_xml(nullptr,nullptr,nullptr); + root->globals=&globals; + if (root->load(path, ui_tree::type_t::APP) != 0) { throw "Unable to process file"; } else { @@ -52,9 +54,9 @@ int app_loader::test() { } int app_loader::run() { - root->globals.mem_storage.cleanup(); + root->globals->mem_storage.cleanup(); root->cleanup(); - if (!root->globals.env.computed_policies.headless) { + if (!root->globals->env.computed_policies.headless) { auto t = Fl::run(); delete root; root = nullptr; diff --git a/src/pipelines/tcc-c.cpp b/src/pipelines/tcc-c.cpp index 8c4c2984..49a1b753 100644 --- a/src/pipelines/tcc-c.cpp +++ b/src/pipelines/tcc-c.cpp @@ -64,7 +64,7 @@ std::shared_ptr tcc_c_pipeline(global_ctx_t& globals, bool is_runtime, vs:: auto script = std::make_shared(); //This part is a bit of a mess. - //Without libc.so and libtcc1.a (not sure which) dynamic linking is not working as expected. I would really like to remove the libc dependency. + // I would really like to remove the libc dependency. script->set_error_fn(ctx,error_fn); script->set_opts("-nostdlib"); //-fno-builtin @@ -76,31 +76,38 @@ std::shared_ptr tcc_c_pipeline(global_ctx_t& globals, bool is_runtime, vs:: //- The location where it s headers are placed. //- The path for bindings shall be computed as absolute based on VS_SHARE or whatever it is called. - //script->add_lib_path("/usr/lib/x86_64-linux-gnu/"); //I dont' want to hardcode this one. - //script->add_lib_path("./subprojects/libtcc"); + //script->add_lib_path("/usr/lib/x86_64-linux-gnu/"); //TODO: set it via a macro passed by meson. - script->set_out_type(tcc::memory); + script->add_lib_path((globals.path_env.root.location+"./bindings/native/tcc/lib").c_str()); script->add_sysinclude_path((globals.path_env.root.location+"./bindings/native/tcc/include").c_str()); + script->add_include_path((globals.path_env.root.location+"./bindings/native/include").c_str()); - //script->add_lib("ld"); + //script->add_lib("dl"); //script->add_lib("tcc1"); //script->add_lib("c"); + script->set_out_type(tcc::memory); - /*if(link_with!=nullptr){ - //TODO: Split in the last "/" position. Left is path for include and libraries to link, the remaining tag is the name it has. - std::string link_header=(std::string(link_with)); - link_header.append(".h"); - std::string link_lib=(std::string(link_with)); - script->add_lib_path("/home/checkroom/Documents/projects/vs-fltk/examples/native-app/"); - script->add_include_path("/home/checkroom/Documents/projects/vs-fltk/examples/native-app/"); - script->add_lib("app"); - }*/ + if(link_with.header!=nullptr){ + { + std::string h = link_with.header; + auto const pos = h.find_last_of('/'); + std::string path = h.substr(0,pos ); + std::string file = h.substr(pos + 1); + script->add_include_path(path.c_str()); + } + } + /* + if(link_with.lib!=nullptr){ + script->add_lib_path("/"); + script->add_lib(link_with.lib); + } + */ + // Custom symbol - //script->add_sym("vs_self", (void *)obj==0?(void*)-1:obj); //Needed as obj nullptr would remove the symbol for some stupid reason. script->add_sym("vs_debug", (void *)vs_debug); script->add_sym("vs_log", (void *)vs_log); script->add_sym("vs_resolve_name", (void *)+[](ui_base* w,const char* s){if(w==nullptr)return (const ui_base*)nullptr;return w->resolve_name(s, true); }); diff --git a/src/ui-tree.xml.cpp b/src/ui-tree.xml.cpp index 8652d899..d02e8aaf 100755 --- a/src/ui-tree.xml.cpp +++ b/src/ui-tree.xml.cpp @@ -93,11 +93,11 @@ int ui_tree_xml::load(const char* file, type_t type) { //TODO: As part of this process, policies should be aligned with what defined in the base config, //and not just one single set of options, so that we can pattern match paths. - policies.inherit(globals.env.computed_policies); + policies.inherit(globals->env.computed_policies); if(parent!=nullptr)policies.inherit(parent->policies); - resolve_path resolver(policies,globals.path_env,(parent==nullptr)?globals.path_env.cwd:parent->local); - auto buffer = fetcher(globals,resolver,resolve_path::from_t::NATIVE_CODE,file); + resolve_path resolver(policies,globals->path_env,(parent==nullptr)?globals->path_env.cwd:parent->local); + auto buffer = fetcher(*globals,resolver,resolve_path::from_t::NATIVE_CODE,file); if(std::get<0>(buffer)==resolve_path::reason_t::OK){ this->local=std::get<2>(buffer).base_dir(); @@ -145,9 +145,9 @@ int ui_tree_xml::load(const char* file, type_t type) pugi::xml_document datadoc; auto tplt = root_data.attribute("template"); //TODO: Adapt to use the proper syntax. I cannot remember which one was it - resolve_path resolver(policies,globals.path_env,this->local); + resolve_path resolver(policies,globals->path_env,this->local); - auto buffer = fetcher(globals,resolver,resolve_path::from_t::NATIVE_CODE,tplt.as_string()); + auto buffer = fetcher(*globals,resolver,resolve_path::from_t::NATIVE_CODE,tplt.as_string()); if(std::get<0>(buffer)!=resolve_path::reason_t::OK){ //TODO: error handling return 2; @@ -200,6 +200,30 @@ int ui_tree_xml::build(){ //cache_ctx.computed_key = key256compose(token, cache_ctx.computed_key); tmp_app->local_env.page_tag = xml_root.attribute("page").as_string(""); } + + link_with = { + doc.first_child().attribute("link-with.lib").as_string(nullptr), + doc.first_child().attribute("link-with.header").as_string(nullptr) + }; + + std::string tmp_link_lib, tmp_link_header; + if(link_with.lib!=nullptr && link_with.header!=nullptr){ + resolve_path resolver(policies,globals->path_env,local); + auto computed_path_lib = resolver(resolve_path::from_t::NATIVE_CODE,link_with.lib); + auto computed_path_header = resolver(resolve_path::from_t::NATIVE_CODE,link_with.header); + if(computed_path_lib.first==resolve_path::reason_t::OK && computed_path_header.first==resolve_path::reason_t::OK){ + //TODO: For now I am assuming it is on the fs. I should resolve it to tmp if remote for example + //The issue is tcc capabilities in handling dynamic linking from a buffer sourced from memory. + //This is why for now it will only be assumed to be on the fs. + //Hopefully this restriction will never apply to native components for example. + tmp_link_lib=computed_path_lib.second.location; + tmp_link_header=computed_path_header.second.location; + link_with.lib = tmp_link_lib.c_str(); + link_with.header = tmp_link_header.c_str(); + log(severety_t::INFO, root, "Requested linking with `%s`", link_with); + } + } + } else if(type==type_t::COMPONENT && (!autoprune || !thin)){ base = thin?(ui_base*)new ui_root_thin_component(frame_mode_t::AUTO):(ui_base*)new ui_root_component(frame_mode_t::AUTO); @@ -231,7 +255,7 @@ void ui_tree_xml::_build(const pugi::xml_node& root, ui_base* root_ui){ } else{ log(severety_t::INFO,root,"Loading component %s", src.as_string()); //TODO: How is it possible that this shows file:// in place of the actual one? - ui_tree_xml component_tree(globals,this,root_ui,&root); + ui_tree_xml component_tree(this,root_ui,&root); if(component_tree.load(src.as_string(),type_t::COMPONENT)!=0){ log(severety_t::INFO,root,"Loading failed, file cannot be opened %s", src); } @@ -343,7 +367,7 @@ void ui_tree_xml::_build(const pugi::xml_node& root, ui_base* root_ui){ else if(imports.contains(root.name())){ auto it = imports.find(root.name()); log(severety_t::INFO,root,"Loading component %s", it->second.c_str()); //TODO: How is it possible that this shows file:// in place of the actual one? - ui_tree_xml component_tree(globals,this,root_ui,&root); + ui_tree_xml component_tree(this,root_ui,&root); if(component_tree.load(it->second.c_str(),type_t::COMPONENT)!=0){ log(severety_t::INFO,root,"Loading failed, file cannot be opened %s", it->second.c_str()); } @@ -406,7 +430,7 @@ void ui_tree_xml::_build_base_widget_extended_attr(const pugi::xml_node &root, u is_module=true; auto filename = this->fullname.as_string(); - auto found = globals.mem_storage.get({filename.c_str(),this->local_unique_counter+1,cache::resource_t::SCRIPT}); + auto found = globals->mem_storage.get({filename.c_str(),this->local_unique_counter+1,cache::resource_t::SCRIPT}); if(found!=nullptr){ current->set_mode(((cache::script_t*)found->ref.get())->mode); current->attach_script(((cache::script_t*)found->ref.get())->script,is_module); @@ -420,29 +444,6 @@ void ui_tree_xml::_build_base_widget_extended_attr(const pugi::xml_node &root, u //They can be used to write code which is much more compact. } - //Information for linking - pipelines::link_with_t link_with = { - doc.first_child().attribute("link-with.lib").as_string(nullptr), - doc.first_child().attribute("link-with.header").as_string(nullptr) - }; - - std::string tmp_link_lib, tmp_link_header; - if(link_with.lib!=nullptr && link_with.header!=nullptr){ - resolve_path resolver(policies,globals.path_env,local); - auto computed_path_lib = resolver(resolve_path::from_t::NATIVE_CODE,link_with.lib); - auto computed_path_header = resolver(resolve_path::from_t::NATIVE_CODE,link_with.header); - if(computed_path_lib.first==resolve_path::reason_t::OK && computed_path_header.first==resolve_path::reason_t::OK){ - //TODO: For now I am assuming it is on the fs. I should resolve it to tmp if remote for example - //The issue is tcc capabilities in handling dynamic linking from a buffer sourced from memory. - //This is why for now it will only be assumed to be on the fs. - //Hopefully this restriction will never apply to native components for example. - tmp_link_lib=computed_path_lib.second.location; - tmp_link_header=computed_path_header.second.location; - link_with.lib = tmp_link_lib.c_str(); - link_with.header = tmp_link_header.c_str(); - log(severety_t::INFO, root, "Requested linking with `%s`", link_with); - } - } auto mode =current->get_local_frame()->get_mode(); @@ -450,7 +451,7 @@ void ui_tree_xml::_build_base_widget_extended_attr(const pugi::xml_node &root, u const auto &lang = root.attribute("lang").as_string(mode==frame_mode_t::NATIVE?"c":""); if (strcmp(lang, "c") == 0) { #ifdef VS_USE_TCC - auto compiler = pipelines::tcc_c_pipeline_xml(globals,true, is_module?nullptr:current, root, compact, link_with); + auto compiler = pipelines::tcc_c_pipeline_xml(*globals,true, is_module?nullptr:current, root, compact, link_with); if(compiler!=nullptr){ current->set_mode(frame_mode_t::NATIVE); current->attach_script(compiler,is_module); @@ -460,7 +461,7 @@ void ui_tree_xml::_build_base_widget_extended_attr(const pugi::xml_node &root, u auto tmp = std::make_shared(cache::script_t{ compiler, symbols, frame_mode_t::NATIVE }); - globals.mem_storage.fetch_from_shared({this->fullname.as_string().c_str(),local_unique_counter+1,cache::resource_t::SCRIPT,false,false}, tmp, res::script_t::C); + globals->mem_storage.fetch_from_shared({this->fullname.as_string().c_str(),local_unique_counter+1,cache::resource_t::SCRIPT,false,false}, tmp, res::script_t::C); local_unique_counter++; } } @@ -472,7 +473,7 @@ void ui_tree_xml::_build_base_widget_extended_attr(const pugi::xml_node &root, u const auto &lang = root.attribute("lang").as_string(mode==frame_mode_t::QUICKJS?"js":""); if (strcmp(lang, "js") == 0) { #ifdef VS_USE_QJS - auto compiler = pipelines::qjs_js_pipeline_xml(globals,true, is_module?nullptr:current, root, link_with); + auto compiler = pipelines::qjs_js_pipeline_xml(*globals,true, is_module?nullptr:current, root, link_with); if(compiler!=nullptr){ current->set_mode(frame_mode_t::QUICKJS); current->attach_script(compiler,is_module); @@ -482,7 +483,7 @@ void ui_tree_xml::_build_base_widget_extended_attr(const pugi::xml_node &root, u auto tmp = std::make_shared(cache::script_t{ compiler, symbols, frame_mode_t::QUICKJS }); - globals.mem_storage.fetch_from_shared({this->fullname.as_string().c_str(),local_unique_counter+1,cache::resource_t::SCRIPT,false,false}, tmp, res::script_t::JS); + globals->mem_storage.fetch_from_shared({this->fullname.as_string().c_str(),local_unique_counter+1,cache::resource_t::SCRIPT,false,false}, tmp, res::script_t::JS); local_unique_counter++; } }