xo-interpreter adds + explict mm arg to ctors (retiring Object::mm)

This commit is contained in:
Roland Conybeare 2025-11-16 20:10:23 -05:00
commit f3e7330d92
38 changed files with 664 additions and 103 deletions

View file

@ -39,10 +39,10 @@ namespace xo {
template<typename T>
static TypeDescrW establish() {
TypeDescrW td = TypeDescrBase::require(&typeid(T),
std::string(type_name<T>()),
nullptr /*tdextra*/,
nullptr /*invoker*/);
static TypeDescrW td = TypeDescrBase::require(&typeid(T),
std::string(type_name<T>()),
nullptr /*tdextra*/,
nullptr /*invoker*/);
#ifdef NOT_USING
std::function<TaggedPtr (void *)> to_self_tp;

View file

@ -13,7 +13,7 @@ set(SELF_SRCS
xo_add_shared_library4(${SELF_LIB} ${PROJECT_NAME}Targets ${PROJECT_VERSION} 1 ${SELF_SRCS})
xo_dependency(${SELF_LIB} refcnt)
xo_dependency(${SELF_LIB} indentlog)
xo_dependency(${SELF_LIB} subsys)
xo_headeronly_dependency(${SELF_LIB} subsys)
#xo_boost_dependency(${SELF_LIB})
# end CMakeLists.txt

View file

@ -57,6 +57,10 @@ namespace xo {
detail::Invoker * invoker,
std::unique_ptr<TypeDescrExtra> tdextra)
{
scope log(XO_DEBUG(false));
log && log(xtag("canonical_name", canonical_name));
if (native_tinfo) {
/* 1. lookup by tinfo hash_code in s_type_table_map
* Not available for manually-constructed type descriptions.
@ -64,19 +68,29 @@ namespace xo {
{
auto ix = s_native_type_table_map.find(TypeInfoRef(native_tinfo));
if ((ix != s_native_type_table_map.end()) && ix->second)
if ((ix != s_native_type_table_map.end()) && ix->second) {
log && log("TypeDescrBase::require"
": using s_native_type_table_map[TypeInfoRef(native_tinfo)]");
return ix->second;
}
}
/* 2. lookup by tinfo hash_code in s_coalesced_type_table_map */
{
auto ix = s_coalesced_type_table_map.find(TypeInfoRef(native_tinfo));
if ((ix != s_coalesced_type_table_map.end()) && ix->second)
if ((ix != s_coalesced_type_table_map.end()) && ix->second) {
log && log("TypeDescrBase::require"
": using s_coalesced_type_table_map[TypeInfoRef(native_tinfo)]");
return ix->second;
}
}
}
log && log("TypeDescrBase::require: try lookup by canonical name");
/* 3. lookup by canonical_name, before we create a new slot.
*
* Have to accept that on clang type_info objects aren't always unique (!$@#!!)
@ -85,6 +99,7 @@ namespace xo {
auto ix = s_canonical_type_table_map.find(canonical_name);
if (ix != s_canonical_type_table_map.end()) {
/** assume existing slot, with same canonical name,
* represents the same type as native_tinfo
**/
@ -145,6 +160,8 @@ namespace xo {
TypeId new_td_id = TypeId::allocate();
log && log("TypeDescrBase::require", xtag("new_td_id", new_td_id));
if (s_type_table_v.size() <= new_td_id.id())
s_type_table_v.resize(new_td_id.id() + 1);

View file

@ -7,17 +7,17 @@
#include "xo/subsys/Subsystem.hpp"
namespace xo {
void
InitSubsys<S_reflect_tag>::init()
{
/* placeholder -- expecting there to be non-trivial content soon */
} /*init*/
void
InitSubsys<S_reflect_tag>::init()
{
/* placeholder -- expecting there to be non-trivial content soon */
} /*init*/
InitEvidence
InitSubsys<S_reflect_tag>::require()
{
return Subsystem::provide<S_reflect_tag>("reflect", &init);
} /*require*/
InitEvidence
InitSubsys<S_reflect_tag>::require()
{
return Subsystem::provide<S_reflect_tag>("reflect", &init);
} /*require*/
} /*namespace xo*/
/* end init_reflect.cpp */