mjbase is a cross-class JVM bytecode analysis and transformation library built
on libjbc: keys (cross-class identity),
class/method/field hierarchy, call graphs and reference indexing, instruction
engineering (the asm domain), mapping and remapping, an AIR/SIR tree IR, and
the pass pipeline that drives them.
The split with libjbc is deliberate: libjbc owns one class / one method (classfile DOM, CodeDom, CodeEditor, frame and dominator engines) while mjbase owns cross-class concerns. mjbase never re-implements what libjbc already provides, and never pushes global state back into libjbc.
Requires xmake 3.x and a C++17 compiler (MSVC on Windows, gcc/clang on Linux).
xmake repo --add luiox-repo https://github.com/luiox/luiox-repo.git
xmake f -p windows # use -p linux on Linux
xmake build mjbaseDependencies come from luiox-repo and xrepo: libca, libjbc, libjzip, libjstr, libgarena, libjclassfile, libjstd, libjhasm, libjblw, libjbytecode (link-level transitive dependency of the JASM text layer only), zlib.
xmake f --with_tests=y
xmake build mjbase_unittest
xmake run mjbase_unittest --gtest_brief=1Some cases need a JDK and GTEST_SKIP when one is missing. Artifacts land in
the test/ directory of the project root.
mjbase/src/mjbase/ library sources, one directory per module
mjbase/test/ unit tests (gtest)
mjbase/test_resource/ static test inputs
mjbase/doc_ai/ design notes
test_helper/ test scaffolding (gtest integration, JDK fixtures)
- No RTTI:
dynamic_cast/typeidare disabled; use the typed cast family - Types:
ca::u32/ca::usize/Result<T, E>; errors areResultvalues, never exceptions - Strings: borrowed views are
std::string_viewover pool-resident text (no extrastd::stringstorage) - Headers:
"file.hpp"within a module,"mjbase/module/file.hpp"across modules;../is forbidden - Comments: Doxygen
///;/** */is forbidden
See mjbase/AGENTS.md for the full development conventions.