阶段2-6:V2 生成侧 bug 修复与验证收尾
- Codec:set_byte0 的 11/10 前缀位修正(0xC0/0x80);新增 JC 形态偏移 专用读写(off@55..24,字节 3..6)——修复 JF rd 被 off 覆盖 - Stb:offset_meta=0(空段)时值段大小校验按 SHA 尾计算(修复 values segment size mismatch) - Codegen:实例字段带 func(field_func),LOAD_OFF/STORE_OFF 按字段 类型设 func(pt=TIME → I64) - main.cpp:--disasm 按 instr_len 迭代变长字节码 - 验证:13 个正例全部编译出 V2 产物 + disasm 自读通过(RET/CAL.TON/ STORE_OFF.I64/JF 偏移等抽查正确);ctest 11/13(vm/cases 待阶段 4)
This commit is contained in:
@@ -60,8 +60,10 @@ namespace compiler {
|
||||
uint32_t imm32_of(const uint8_t* code);
|
||||
/// @brief 取 slot32(55..24,SLOT 形态)。
|
||||
uint32_t slot32_of(const uint8_t* code);
|
||||
/// @brief 取 off32(47..16,JMP/JC 形态,有符号字节偏移)。
|
||||
/// @brief 取 off32(47..16,JMP 形态,有符号字节偏移)。
|
||||
int32_t off32_of(const uint8_t* code);
|
||||
/// @brief 取 off32(55..24,JC 形态,有符号字节偏移)。
|
||||
int32_t off32_jc_of(const uint8_t* code);
|
||||
/// @brief 取 fn_id32(47..16,CALL 形态)。
|
||||
uint32_t fn_id32_of(const uint8_t* code);
|
||||
/// @brief 取 fb_id16(31..16,CAL 形态)。
|
||||
@@ -93,8 +95,10 @@ namespace compiler {
|
||||
void set_imm32(uint8_t* out, uint32_t v);
|
||||
/// @brief 写 slot32(55..24)。
|
||||
void set_slot32(uint8_t* out, uint32_t v);
|
||||
/// @brief 写 off32(47..16)。
|
||||
/// @brief 写 off32(47..16,JMP 形态)。
|
||||
void set_off32(uint8_t* out, int32_t v);
|
||||
/// @brief 写 off32(55..24,JC 形态)。
|
||||
void set_off32_jc(uint8_t* out, int32_t v);
|
||||
/// @brief 写 fn_id32(47..16)。
|
||||
void set_fn_id32(uint8_t* out, uint32_t v);
|
||||
/// @brief 写 fb_id16(31..16)。
|
||||
|
||||
Reference in New Issue
Block a user