@@ -14,7 +14,10 @@ use self::{
14
14
} ;
15
15
use crate :: {
16
16
core:: FuelCostsProvider ,
17
- engine:: { translator:: WasmTranslator , CompiledFuncEntity } ,
17
+ engine:: {
18
+ translator:: { LabelRegistry , WasmTranslator } ,
19
+ CompiledFuncEntity ,
20
+ } ,
18
21
module:: { FuncIdx , ModuleHeader , WasmiValueType } ,
19
22
Engine ,
20
23
Error ,
@@ -54,6 +57,8 @@ pub struct FuncTranslator {
54
57
stack : Stack ,
55
58
/// Wasm layout to map stack slots to Wasmi registers.
56
59
layout : StackLayout ,
60
+ /// Registers and pins labels and tracks their users.
61
+ labels : LabelRegistry ,
57
62
}
58
63
59
64
/// Heap allocated data structured used by the [`FuncTranslator`].
@@ -63,6 +68,8 @@ pub struct FuncTranslatorAllocations {
63
68
stack : Stack ,
64
69
/// Wasm layout to map stack slots to Wasmi registers.
65
70
layout : StackLayout ,
71
+ /// Registers and pins labels and tracks their users.
72
+ labels : LabelRegistry ,
66
73
}
67
74
68
75
impl WasmTranslator < ' _ > for FuncTranslator {
@@ -120,7 +127,11 @@ impl FuncTranslator {
120
127
. get_consume_fuel ( )
121
128
. then ( || config. fuel_costs ( ) )
122
129
. cloned ( ) ;
123
- let FuncTranslatorAllocations { stack, layout } = alloc;
130
+ let FuncTranslatorAllocations {
131
+ stack,
132
+ layout,
133
+ labels,
134
+ } = alloc;
124
135
Ok ( Self {
125
136
func,
126
137
engine,
@@ -129,6 +140,7 @@ impl FuncTranslator {
129
140
fuel_costs,
130
141
stack,
131
142
layout,
143
+ labels,
132
144
} )
133
145
}
134
146
@@ -137,6 +149,7 @@ impl FuncTranslator {
137
149
FuncTranslatorAllocations {
138
150
stack : self . stack ,
139
151
layout : self . layout ,
152
+ labels : self . labels ,
140
153
}
141
154
}
142
155
0 commit comments