Skip to content

Commit 2a6d0d7

Browse files
add CFA op to the bytecode
1 parent a1884aa commit 2a6d0d7

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

src/lib_rdi/rdi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ sizeof(RDI_NameMapNode),
5858
sizeof(RDI_U8),
5959
};
6060

61-
RDI_U16 rdi_eval_op_ctrlbits_table[53] =
61+
RDI_U16 rdi_eval_op_ctrlbits_table[54] =
6262
{
6363
RDI_EVAL_CTRLBITS(0, 0, 0),
6464
RDI_EVAL_CTRLBITS(0, 0, 0),
@@ -112,6 +112,7 @@ RDI_EVAL_CTRLBITS(4, 0, 0),
112112
RDI_EVAL_CTRLBITS(4, 0, 0),
113113
RDI_EVAL_CTRLBITS(8, 0, 0),
114114
RDI_EVAL_CTRLBITS(0, 2, 2),
115+
RDI_EVAL_CTRLBITS(0, 0, 1),
115116
RDI_EVAL_CTRLBITS(0, 0, 0),
116117
};
117118

src/lib_rdi/rdi.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,8 @@ RDI_EvalOp_CallSiteValue = 48,
531531
RDI_EvalOp_PartialValue = 49,
532532
RDI_EvalOp_PartialValueBit = 50,
533533
RDI_EvalOp_Swap = 51,
534-
RDI_EvalOp_COUNT = 52,
534+
RDI_EvalOp_PushCfa = 52,
535+
RDI_EvalOp_COUNT = 53,
535536
} RDI_EvalOpEnum;
536537

537538
typedef RDI_U8 RDI_EvalTypeGroup;
@@ -1136,6 +1137,7 @@ X(CallSiteValue)\
11361137
X(PartialValue)\
11371138
X(PartialValueBit)\
11381139
X(Swap)\
1140+
X(PushCfa)\
11391141

11401142
#define RDI_EvalTypeGroup_XList \
11411143
X(Other)\
@@ -1638,6 +1640,6 @@ RDI_PROC RDI_S32 rdi_eval_op_typegroup_are_compatible(RDI_EvalOp op, RDI_EvalTyp
16381640
RDI_PROC RDI_U8 *rdi_explanation_string_from_eval_conversion_kind(RDI_EvalConversionKind kind, RDI_U64 *size_out);
16391641

16401642
extern RDI_U16 rdi_section_element_size_table[44];
1641-
extern RDI_U16 rdi_eval_op_ctrlbits_table[53];
1643+
extern RDI_U16 rdi_eval_op_ctrlbits_table[54];
16421644

16431645
#endif // RDI_H

src/rdi/rdi.mdesk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1358,7 +1358,8 @@ RDI_EvalOpTable:
13581358
{PartialValue 49 4 0 0}
13591359
{PartialValueBit 50 8 0 0}
13601360
{Swap 51 0 2 2} // swaps the top two entries on the stack
1361-
{COUNT 52 0 0 0}
1361+
{PushCfa 52 0 0 1} // push canonical frame address on the stack
1362+
{COUNT 53 0 0 0}
13621363
}
13631364

13641365
// NOTE(rjf): "ck" -> "conversion kind, when converted to type group", used in square matrix form

src/rdi_from_dwarf/rdi_from_dwarf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ d2r_bytecode_from_expression(Arena *arena,
12611261
}
12621262
} break;
12631263
case DW_ExprOp_CallFrameCfa: {
1264-
rdim_bytecode_push_op(arena, &bc, RDI_EvalOp_FrameOff, 0);
1264+
rdim_bytecode_push_op(arena, &bc, RDI_EvalOp_PushCfa, 0);
12651265
d2r_value_type_stack_push(scratch.arena, stack, D2R_ValueType_Address);
12661266
} break;
12671267
case DW_ExprOp_PushObjectAddress: {

0 commit comments

Comments
 (0)