コード例 #1
0
ファイル: Tableswitch.py プロジェクト: xailocker/JVMByPython
 def execute(self, frame):
     # 先从操作数栈中弹出一个int变量
     index = frame.operand_stack.pop_numeric()
     # 然后看它是否在low和high给定的范围内
     if self.low <= index <= self.high:
         # 如果在,则从jump_offset表中查出偏移量进行跳转
         offset = self.jump_offsets[index - self.low]
     else:
         # 否则按照default_offset跳转
         offset = self.default_offset
     branch(frame, offset)
コード例 #2
0
 def execute(self, frame):
     # 先从操作数栈中弹出一个int变量
     key = frame.operand_stack.pop_numeric()
     # 然后用它查找match_offsets,看能否找到匹配的key
     for i in range(0, self.n_pairs * 2, 2):
         if self.match_offsets[i] == key:
             # 如果能,则按照value给出的偏移量跳转
             offset = self.match_offsets[i + 1]
             branch(frame, ctypes.c_int(offset).value)
             return
     # 否则按照default_offset跳转
     branch(frame, ctypes.c_int(self.default_offset).value)
コード例 #3
0
 def execute(self, frame):
     ref = frame.operand_stack.pop_ref()
     if ref:
         branch(frame, self.offset)
コード例 #4
0
 def execute(self, frame):
     branch(frame, self.offset)
コード例 #5
0
ファイル: Ifcond.py プロジェクト: xailocker/JVMByPython
 def execute(self, frame):
     val = frame.operand_stack.pop_numeric()
     if val >= 0:
         branch(frame, self.offset)
コード例 #6
0
ファイル: Ifacmp.py プロジェクト: xailocker/JVMByPython
 def execute(self, frame):
     val1, val2 = _acmpPop(frame)
     if val1 is not val2:
         branch(frame, self.offset)
コード例 #7
0
 def execute(self, frame):
     val1, val2 = _icmpPop(frame)
     if val1 >= val2:
         branch(frame, self.offset)