luaur_code_gen/methods/
assembly_builder_x_64_place_label.rs1use crate::records::assembly_builder_x_64::AssemblyBuilderX64;
2use crate::records::label::Label;
3
4impl AssemblyBuilderX64 {
5 pub fn place_label(&mut self, label: &mut Label) {
6 if label.location == !0u32 {
7 if label.id == 0 {
8 label.id = self.next_label;
9 self.next_label = self.next_label.wrapping_add(1);
10 self.label_locations.push(!0u32);
15 }
16
17 self.pending_labels.push(Label {
18 id: label.id,
19 location: self.get_code_size(),
20 });
21 self.place_imm_32(0);
22 } else {
23 self.place_imm_32((label.location.wrapping_sub(4 + self.get_code_size())) as i32);
24 }
25 }
26}