Exemplo n.º 1
0
 def execute(self, frame):
     stack = frame.operand_stack
     slot1 = stack.pop_slot()
     slot2 = stack.pop_slot()
     stack.push_slot(slot2)
     stack.push_slot(slot1)
     stack.push_slot(copy_slot(slot2))
     stack.push_slot(copy_slot(slot1))
Exemplo n.º 2
0
 def clone_data(self):
     if not isinstance(self.data, Slots):
         new_data = list(self.data)
         return new_data
     else:
         new_data = Slots(len(self.data))
         for i, slot in enumerate(self.data):
             new_data[i] = copy_slot(slot)
         return new_data
Exemplo n.º 3
0
 def execute(self, frame):
     stack = frame.operand_stack
     slot = stack.pop_slot()
     stack.push_slot(slot)
     # 采用自定义的对象深拷贝,复制slot
     stack.push_slot(copy_slot(slot))