From 159c4aee2311668c440e5142fc0a5ea05ffcb3a5 Mon Sep 17 00:00:00 2001 From: zleyyij <75810274+zleyyij@users.noreply.github.com> Date: Tue, 2 Jul 2024 09:02:28 -0600 Subject: [PATCH] vault backup: 2024-07-02 09:02:28 --- notes/Copy-and-Patch Compilation.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/notes/Copy-and-Patch Compilation.md b/notes/Copy-and-Patch Compilation.md index 9460292..4d5d00d 100644 --- a/notes/Copy-and-Patch Compilation.md +++ b/notes/Copy-and-Patch Compilation.md @@ -20,12 +20,15 @@ At a broad level, copy and patch code compilation works by having a pre-built li First, prior to compilation, MetaVar generates a stencil library. -That stencil library is used as input for a copy and patch code generator, alongside a bytecode sequence or AST node. In the copy step, stencils are copied from the stencil library that implement the bytecode/AST node. In the patch step, pre-determined places in the binary code are +That stencil library is used as input for a copy and patch code generator, alongside a bytecode sequence or AST node. In the copy step, stencils are copied from the stencil library that implement the bytecode/AST node. In the patch step, pre-determined places in the binary code (Operands of machine instructions, jump addresses, the values of constants). + +Even though machine code is patched, a copy and patch compiler doesn't need to have knowledge of platform specific machine instructions, and is portable across architectures supported by the patch library. + ## MetaVar MetaVar generates binary stencils, which allows the user to systematically generate the binary stencil variants in clean and pure C++, and leverages the Clang + LLVM compiler infrastructure to hide all platform-specific low-level detail. -The MetaVar compiler generates binary stencils of different optimization levels for every bytecode or AST node. +MetaVar can generate binary stencils of different optimization levels for every bytecode or AST node, which the generator can select from at generation time. # Terminology | Phrase | Definition |