def assemble_loop(self, inputargs, operations, looptoken): """adds the following attributes to looptoken: _x86_loop_code (an integer giving an address) _x86_bootstrap_code (an integer giving an address) _x86_stack_depth _x86_arglocs """ self.make_sure_mc_exists() regalloc = RegAlloc(self, self.cpu.translate_support_code) arglocs = regalloc.prepare_loop(inputargs, operations, looptoken) looptoken._x86_arglocs = arglocs looptoken._x86_bootstrap_code = self.mc.tell() adr_stackadjust = self._assemble_bootstrap_code(inputargs, arglocs) looptoken._x86_loop_code = self.mc.tell() looptoken._x86_stack_depth = -1 # temporarily stack_depth = self._assemble(regalloc, operations) self._patch_stackadjust(adr_stackadjust, stack_depth) looptoken._x86_stack_depth = stack_depth
def assemble_loop(self, inputargs, operations, looptoken): """adds the following attributes to looptoken: _x86_loop_code (an integer giving an address) _x86_bootstrap_code (an integer giving an address) _x86_stack_depth _x86_arglocs """ self.make_sure_mc_exists() regalloc = RegAlloc(self, self.cpu.translate_support_code) arglocs = regalloc.prepare_loop(inputargs, operations, looptoken) looptoken._x86_arglocs = arglocs looptoken._x86_bootstrap_code = self.mc.tell() adr_stackadjust = self._assemble_bootstrap_code(inputargs, arglocs) looptoken._x86_loop_code = self.mc.tell() looptoken._x86_stack_depth = -1 # temporarily stack_depth = self._assemble(regalloc, operations) self._patch_stackadjust(adr_stackadjust, stack_depth) looptoken._x86_stack_depth = stack_depth
def prepare_loop(self, ops): loop = self.parse(ops) regalloc = RegAlloc(self.cpu.assembler, False) regalloc.prepare_loop(loop.inputargs, loop.operations, loop.original_jitcell_token, []) return regalloc