From db0bb1378cb02d1e7f6a52f6378db0f0e3bf63a7 Mon Sep 17 00:00:00 2001 From: dzaima Date: Fri, 24 Nov 2023 15:51:10 +0200 Subject: [PATCH] rearrange Body fields to pack better --- src/vm.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/vm.h b/src/vm.h index 03ac341b..353ace4a 100644 --- a/src/vm.h +++ b/src/vm.h @@ -120,22 +120,20 @@ struct Block { }; struct Body { struct Value; + Block* bl; // non-owned pointer to corresponding block + union { u32* bc; i32 bcTmp; }; // pointer in bl->bc; bcTmp to make ubsan happy while this is reused as an offset + NSDesc* nsDesc; #if JIT_START != -1 u8* nvm; // either NULL or a pointer to machine code + B nvmRefs; #endif + u32 maxStack; #if JIT_START > 0 u16 callCount; #endif - union { u32* bc; i32 bcTmp; }; // pointer in bl->bc; bcTmp to make ubsan happy (god dammit C) - u32 maxStack; u16 maxPSC; - bool exists; -#if JIT_START != -1 - B nvmRefs; -#endif - Block* bl; // non-owned pointer to corresponding block - NSDesc* nsDesc; u16 varAm; + bool exists; // whether this body represents a non-existing inverse i32 varData[]; // length varAm*2; first half is a gid per var (or -1 if not calculated yet), second half is indexes into nameList };