How to use get_output method in lisa

Best Python code snippet using lisa_python

opcode_ins.py

Source:opcode_ins.py Github

copy

Full Screen

...96def nop(ins, vmap):97 return NopExpression()98# move vA, vB ( 4b, 4b )99def move(ins, vmap):100 logger.debug('Move %s', ins.get_output())101 reg_a, reg_b = get_variables(vmap, ins.A, ins.B)102 return MoveExpression(reg_a, reg_b)103# move/from16 vAA, vBBBB ( 8b, 16b )104def movefrom16(ins, vmap):105 logger.debug('MoveFrom16 %s', ins.get_output())106 reg_a, reg_b = get_variables(vmap, ins.AA, ins.BBBB)107 return MoveExpression(reg_a, reg_b)108# move/16 vAAAA, vBBBB ( 16b, 16b )109def move16(ins, vmap):110 logger.debug('Move16 %s', ins.get_output())111 reg_a, reg_b = get_variables(vmap, ins.AAAA, ins.BBBB)112 return MoveExpression(reg_a, reg_b)113# move-wide vA, vB ( 4b, 4b )114def movewide(ins, vmap):115 logger.debug('MoveWide %s', ins.get_output())116 reg_a, reg_b = get_variables(vmap, ins.A, ins.B)117 return MoveExpression(reg_a, reg_b)118# move-wide/from16 vAA, vBBBB ( 8b, 16b )119def movewidefrom16(ins, vmap):120 logger.debug('MoveWideFrom16 : %s', ins.get_output())121 reg_a, reg_b = get_variables(vmap, ins.AA, ins.BBBB)122 return MoveExpression(reg_a, reg_b)123# move-wide/16 vAAAA, vBBBB ( 16b, 16b )124def movewide16(ins, vmap):125 logger.debug('MoveWide16 %s', ins.get_output())126 reg_a, reg_b = get_variables(vmap, ins.AAAA, ins.BBBB)127 return MoveExpression(reg_a, reg_b)128# move-object vA, vB ( 4b, 4b )129def moveobject(ins, vmap):130 logger.debug('MoveObject %s', ins.get_output())131 reg_a, reg_b = get_variables(vmap, ins.A, ins.B)132 return MoveExpression(reg_a, reg_b)133# move-object/from16 vAA, vBBBB ( 8b, 16b )134def moveobjectfrom16(ins, vmap):135 logger.debug('MoveObjectFrom16 : %s', ins.get_output())136 reg_a, reg_b = get_variables(vmap, ins.AA, ins.BBBB)137 return MoveExpression(reg_a, reg_b)138# move-object/16 vAAAA, vBBBB ( 16b, 16b )139def moveobject16(ins, vmap):140 logger.debug('MoveObject16 : %s', ins.get_output())141 reg_a, reg_b = get_variables(vmap, ins.AAAA, ins.BBBB)142 return MoveExpression(reg_a, reg_b)143# move-result vAA ( 8b )144def moveresult(ins, vmap, ret):145 logger.debug('MoveResult : %s', ins.get_output())146 return MoveResultExpression(get_variables(vmap, ins.AA), ret)147# move-result-wide vAA ( 8b )148def moveresultwide(ins, vmap, ret):149 logger.debug('MoveResultWide : %s', ins.get_output())150 return MoveResultExpression(get_variables(vmap, ins.AA), ret)151# move-result-object vAA ( 8b )152def moveresultobject(ins, vmap, ret):153 logger.debug('MoveResultObject : %s', ins.get_output())154 return MoveResultExpression(get_variables(vmap, ins.AA), ret)155# move-exception vAA ( 8b )156def moveexception(ins, vmap, _type):157 logger.debug('MoveException : %s', ins.get_output())158 return MoveExceptionExpression(get_variables(vmap, ins.AA), _type)159# return-void160def returnvoid(ins, vmap):161 logger.debug('ReturnVoid')162 return ReturnInstruction(None)163# return vAA ( 8b )164def return_reg(ins, vmap):165 logger.debug('Return : %s', ins.get_output())166 return ReturnInstruction(get_variables(vmap, ins.AA))167# return-wide vAA ( 8b )168def returnwide(ins, vmap):169 logger.debug('ReturnWide : %s', ins.get_output())170 return ReturnInstruction(get_variables(vmap, ins.AA))171# return-object vAA ( 8b )172def returnobject(ins, vmap):173 logger.debug('ReturnObject : %s', ins.get_output())174 return ReturnInstruction(get_variables(vmap, ins.AA))175# const/4 vA, #+B ( 4b, 4b )176def const4(ins, vmap):177 logger.debug('Const4 : %s', ins.get_output())178 cst = Constant(ins.B, 'I')179 return assign_const(ins.A, cst, vmap)180# const/16 vAA, #+BBBB ( 8b, 16b )181def const16(ins, vmap):182 logger.debug('Const16 : %s', ins.get_output())183 cst = Constant(ins.BBBB, 'I')184 return assign_const(ins.AA, cst, vmap)185# const vAA, #+BBBBBBBB ( 8b, 32b )186def const(ins, vmap):187 logger.debug('Const : %s', ins.get_output())188 value = unpack("=f", pack("=i", ins.BBBBBBBB))[0]189 cst = Constant(value, 'I', ins.BBBBBBBB)190 return assign_const(ins.AA, cst, vmap)191# const/high16 vAA, #+BBBB0000 ( 8b, 16b )192def consthigh16(ins, vmap):193 logger.debug('ConstHigh16 : %s', ins.get_output())194 value = unpack('=f', '\x00\x00' + pack('=h', ins.BBBB))[0]195 cst = Constant(value, 'I', ins.BBBB)196 return assign_const(ins.AA, cst, vmap)197# const-wide/16 vAA, #+BBBB ( 8b, 16b )198def constwide16(ins, vmap):199 logger.debug('ConstWide16 : %s', ins.get_output())200 value = unpack('=d', pack('=d', ins.BBBB))[0]201 cst = Constant(value, 'J', ins.BBBB)202 return assign_const(ins.AA, cst, vmap)203# const-wide/32 vAA, #+BBBBBBBB ( 8b, 32b )204def constwide32(ins, vmap):205 logger.debug('ConstWide32 : %s', ins.get_output())206 value = unpack('=d', pack('=d', ins.BBBBBBBB))[0]207 cst = Constant(value, 'J', ins.BBBBBBBB)208 return assign_const(ins.AA, cst, vmap)209# const-wide vAA, #+BBBBBBBBBBBBBBBB ( 8b, 64b )210def constwide(ins, vmap):211 logger.debug('ConstWide : %s', ins.get_output())212 value = unpack('=d', pack('=q', ins.BBBBBBBBBBBBBBBB))[0]213 cst = Constant(value, 'D', ins.BBBBBBBBBBBBBBBB)214 return assign_const(ins.AA, cst, vmap)215# const-wide/high16 vAA, #+BBBB000000000000 ( 8b, 16b )216def constwidehigh16(ins, vmap):217 logger.debug('ConstWideHigh16 : %s', ins.get_output())218 value = unpack('=d',219 '\x00\x00\x00\x00\x00\x00' + pack('=h', ins.BBBB))[0]220 cst = Constant(value, 'D', ins.BBBB)221 return assign_const(ins.AA, cst, vmap)222# const-string vAA ( 8b )223def conststring(ins, vmap):224 logger.debug('ConstString : %s', ins.get_output())225 cst = Constant(ins.get_raw_string(), 'STR')226 return assign_const(ins.AA, cst, vmap)227# const-string/jumbo vAA ( 8b )228def conststringjumbo(ins, vmap):229 logger.debug('ConstStringJumbo %s', ins.get_output())230 cst = Constant(ins.get_raw_string(), 'STR')231 return assign_const(ins.AA, cst, vmap)232# const-class vAA, type@BBBB ( 8b )233def constclass(ins, vmap):234 logger.debug('ConstClass : %s', ins.get_output())235 cst = Constant(util.get_type(ins.get_string()), 'class')236 return assign_const(ins.AA, cst, vmap)237# monitor-enter vAA ( 8b )238def monitorenter(ins, vmap):239 logger.debug('MonitorEnter : %s', ins.get_output())240 return MonitorEnterExpression(get_variables(vmap, ins.AA))241# monitor-exit vAA ( 8b )242def monitorexit(ins, vmap):243 logger.debug('MonitorExit : %s', ins.get_output())244 a = get_variables(vmap, ins.AA)245 return MonitorExitExpression(a)246# check-cast vAA ( 8b )247def checkcast(ins, vmap):248 logger.debug('CheckCast: %s', ins.get_output())249 cast_type = util.get_type(ins.get_translated_kind())250 cast_var = get_variables(vmap, ins.AA)251 return AssignExpression(cast_var, CheckCastExpression(cast_var, cast_type))252# instance-of vA, vB ( 4b, 4b )253def instanceof(ins, vmap):254 logger.debug('InstanceOf : %s', ins.get_output())255 reg_a, reg_b = get_variables(vmap, ins.A, ins.B)256 reg_c = BaseClass(util.get_type(ins.get_translated_kind()))257 exp = BinaryExpression('instanceof', reg_b, reg_c, 'Z')258 return AssignExpression(reg_a, exp)259# array-length vA, vB ( 4b, 4b )260def arraylength(ins, vmap):261 logger.debug('ArrayLength: %s', ins.get_output())262 reg_a, reg_b = get_variables(vmap, ins.A, ins.B)263 return AssignExpression(reg_a, ArrayLengthExpression(reg_b))264# new-instance vAA ( 8b )265def newinstance(ins, vmap):266 logger.debug('NewInstance : %s', ins.get_output())267 reg_a = get_variables(vmap, ins.AA)268 ins_type = ins.cm.get_type(ins.BBBB)269 return AssignExpression(reg_a, NewInstance(ins_type))270# new-array vA, vB ( 8b, size )271def newarray(ins, vmap):272 logger.debug('NewArray : %s', ins.get_output())273 a, b = get_variables(vmap, ins.A, ins.B)274 exp = NewArrayExpression(b, ins.cm.get_type(ins.CCCC))275 return AssignExpression(a, exp)276# filled-new-array {vD, vE, vF, vG, vA} ( 4b each )277def fillednewarray(ins, vmap, ret):278 logger.debug('FilledNewArray : %s', ins.get_output())279 c, d, e, f, g = get_variables(vmap, ins.C, ins.D,280 ins.E, ins.F, ins.G)281 array_type = ins.cm.get_type(ins.BBBB)282 exp = FilledArrayExpression(ins.A, array_type, [c, d, e, f, g][:ins.A])283 return AssignExpression(ret, exp)284# filled-new-array/range {vCCCC..vNNNN} ( 16b )285def fillednewarrayrange(ins, vmap, ret):286 logger.debug('FilledNewArrayRange : %s', ins.get_output())287 a, c, n = get_variables(vmap, ins.AA, ins.CCCC, ins.NNNN)288 array_type = ins.cm.get_type(ins.BBBB)289 exp = FilledArrayExpression(a, array_type, [c, n])290 return AssignExpression(ret, exp)291# fill-array-data vAA, +BBBBBBBB ( 8b, 32b )292def fillarraydata(ins, vmap, value):293 logger.debug('FillArrayData : %s', ins.get_output())294 return FillArrayExpression(get_variables(vmap, ins.AA), value)295# fill-array-data-payload vAA, +BBBBBBBB ( 8b, 32b )296def fillarraydatapayload(ins, vmap):297 logger.debug('FillArrayDataPayload : %s', ins.get_output())298 return FillArrayExpression(None)299# throw vAA ( 8b )300def throw(ins, vmap):301 logger.debug('Throw : %s', ins.get_output())302 return ThrowExpression(get_variables(vmap, ins.AA))303# goto +AA ( 8b )304def goto(ins, vmap):305 return NopExpression()306# goto/16 +AAAA ( 16b )307def goto16(ins, vmap):308 return NopExpression()309# goto/32 +AAAAAAAA ( 32b )310def goto32(ins, vmap):311 return NopExpression()312# packed-switch vAA, +BBBBBBBB ( reg to test, 32b )313def packedswitch(ins, vmap):314 logger.debug('PackedSwitch : %s', ins.get_output())315 reg_a = get_variables(vmap, ins.AA)316 return SwitchExpression(reg_a, ins.BBBBBBBB)317# sparse-switch vAA, +BBBBBBBB ( reg to test, 32b )318def sparseswitch(ins, vmap):319 logger.debug('SparseSwitch : %s', ins.get_output())320 reg_a = get_variables(vmap, ins.AA)321 return SwitchExpression(reg_a, ins.BBBBBBBB)322# cmpl-float vAA, vBB, vCC ( 8b, 8b, 8b )323def cmplfloat(ins, vmap):324 logger.debug('CmpglFloat : %s', ins.get_output())325 return assign_cmp(ins.AA, ins.BB, ins.CC, 'F', vmap)326# cmpg-float vAA, vBB, vCC ( 8b, 8b, 8b )327def cmpgfloat(ins, vmap):328 logger.debug('CmpgFloat : %s', ins.get_output())329 return assign_cmp(ins.AA, ins.BB, ins.CC, 'F', vmap)330# cmpl-double vAA, vBB, vCC ( 8b, 8b, 8b )331def cmpldouble(ins, vmap):332 logger.debug('CmplDouble : %s', ins.get_output())333 return assign_cmp(ins.AA, ins.BB, ins.CC, 'D', vmap)334# cmpg-double vAA, vBB, vCC ( 8b, 8b, 8b )335def cmpgdouble(ins, vmap):336 logger.debug('CmpgDouble : %s', ins.get_output())337 return assign_cmp(ins.AA, ins.BB, ins.CC, 'D', vmap)338# cmp-long vAA, vBB, vCC ( 8b, 8b, 8b )339def cmplong(ins, vmap):340 logger.debug('CmpLong : %s', ins.get_output())341 return assign_cmp(ins.AA, ins.BB, ins.CC, 'J', vmap)342# if-eq vA, vB, +CCCC ( 4b, 4b, 16b )343def ifeq(ins, vmap):344 logger.debug('IfEq : %s', ins.get_output())345 a, b = get_variables(vmap, ins.A, ins.B)346 return ConditionalExpression(Op.EQUAL, a, b)347# if-ne vA, vB, +CCCC ( 4b, 4b, 16b )348def ifne(ins, vmap):349 logger.debug('IfNe : %s', ins.get_output())350 a, b = get_variables(vmap, ins.A, ins.B)351 return ConditionalExpression(Op.NEQUAL, a, b)352# if-lt vA, vB, +CCCC ( 4b, 4b, 16b )353def iflt(ins, vmap):354 logger.debug('IfLt : %s', ins.get_output())355 a, b = get_variables(vmap, ins.A, ins.B)356 return ConditionalExpression(Op.LOWER, a, b)357# if-ge vA, vB, +CCCC ( 4b, 4b, 16b )358def ifge(ins, vmap):359 logger.debug('IfGe : %s', ins.get_output())360 a, b = get_variables(vmap, ins.A, ins.B)361 return ConditionalExpression(Op.GEQUAL, a, b)362# if-gt vA, vB, +CCCC ( 4b, 4b, 16b )363def ifgt(ins, vmap):364 logger.debug('IfGt : %s', ins.get_output())365 a, b = get_variables(vmap, ins.A, ins.B)366 return ConditionalExpression(Op.GREATER, a, b)367# if-le vA, vB, +CCCC ( 4b, 4b, 16b )368def ifle(ins, vmap):369 logger.debug('IfLe : %s', ins.get_output())370 a, b = get_variables(vmap, ins.A, ins.B)371 return ConditionalExpression(Op.LEQUAL, a, b)372# if-eqz vAA, +BBBB ( 8b, 16b )373def ifeqz(ins, vmap):374 logger.debug('IfEqz : %s', ins.get_output())375 return ConditionalZExpression(Op.EQUAL, get_variables(vmap, ins.AA))376# if-nez vAA, +BBBB ( 8b, 16b )377def ifnez(ins, vmap):378 logger.debug('IfNez : %s', ins.get_output())379 return ConditionalZExpression(Op.NEQUAL, get_variables(vmap, ins.AA))380# if-ltz vAA, +BBBB ( 8b, 16b )381def ifltz(ins, vmap):382 logger.debug('IfLtz : %s', ins.get_output())383 return ConditionalZExpression(Op.LOWER, get_variables(vmap, ins.AA))384# if-gez vAA, +BBBB ( 8b, 16b )385def ifgez(ins, vmap):386 logger.debug('IfGez : %s', ins.get_output())387 return ConditionalZExpression(Op.GEQUAL, get_variables(vmap, ins.AA))388# if-gtz vAA, +BBBB ( 8b, 16b )389def ifgtz(ins, vmap):390 logger.debug('IfGtz : %s', ins.get_output())391 return ConditionalZExpression(Op.GREATER, get_variables(vmap, ins.AA))392# if-lez vAA, +BBBB (8b, 16b )393def iflez(ins, vmap):394 logger.debug('IfLez : %s', ins.get_output())395 return ConditionalZExpression(Op.LEQUAL, get_variables(vmap, ins.AA))396#TODO: check type for all aget397# aget vAA, vBB, vCC ( 8b, 8b, 8b )398def aget(ins, vmap):399 logger.debug('AGet : %s', ins.get_output())400 return load_array_exp(ins.AA, ins.BB, ins.CC, None, vmap)401# aget-wide vAA, vBB, vCC ( 8b, 8b, 8b )402def agetwide(ins, vmap):403 logger.debug('AGetWide : %s', ins.get_output())404 return load_array_exp(ins.AA, ins.BB, ins.CC, 'W', vmap)405# aget-object vAA, vBB, vCC ( 8b, 8b, 8b )406def agetobject(ins, vmap):407 logger.debug('AGetObject : %s', ins.get_output())408 return load_array_exp(ins.AA, ins.BB, ins.CC, 'O', vmap)409# aget-boolean vAA, vBB, vCC ( 8b, 8b, 8b )410def agetboolean(ins, vmap):411 logger.debug('AGetBoolean : %s', ins.get_output())412 return load_array_exp(ins.AA, ins.BB, ins.CC, 'Z', vmap)413# aget-byte vAA, vBB, vCC ( 8b, 8b, 8b )414def agetbyte(ins, vmap):415 logger.debug('AGetByte : %s', ins.get_output())416 return load_array_exp(ins.AA, ins.BB, ins.CC, 'B', vmap)417# aget-char vAA, vBB, vCC ( 8b, 8b, 8b )418def agetchar(ins, vmap):419 logger.debug('AGetChar : %s', ins.get_output())420 return load_array_exp(ins.AA, ins.BB, ins.CC, 'C', vmap)421# aget-short vAA, vBB, vCC ( 8b, 8b, 8b )422def agetshort(ins, vmap):423 logger.debug('AGetShort : %s', ins.get_output())424 return load_array_exp(ins.AA, ins.BB, ins.CC, 'S', vmap)425# aput vAA, vBB, vCC426def aput(ins, vmap):427 logger.debug('APut : %s', ins.get_output())428 return store_array_inst(ins.AA, ins.BB, ins.CC, None, vmap)429# aput-wide vAA, vBB, vCC ( 8b, 8b, 8b )430def aputwide(ins, vmap):431 logger.debug('APutWide : %s', ins.get_output())432 return store_array_inst(ins.AA, ins.BB, ins.CC, 'W', vmap)433# aput-object vAA, vBB, vCC ( 8b, 8b, 8b )434def aputobject(ins, vmap):435 logger.debug('APutObject : %s', ins.get_output())436 return store_array_inst(ins.AA, ins.BB, ins.CC, 'O', vmap)437# aput-boolean vAA, vBB, vCC ( 8b, 8b, 8b )438def aputboolean(ins, vmap):439 logger.debug('APutBoolean : %s', ins.get_output())440 return store_array_inst(ins.AA, ins.BB, ins.CC, 'Z', vmap)441# aput-byte vAA, vBB, vCC ( 8b, 8b, 8b )442def aputbyte(ins, vmap):443 logger.debug('APutByte : %s', ins.get_output())444 return store_array_inst(ins.AA, ins.BB, ins.CC, 'B', vmap)445# aput-char vAA, vBB, vCC ( 8b, 8b, 8b )446def aputchar(ins, vmap):447 logger.debug('APutChar : %s', ins.get_output())448 return store_array_inst(ins.AA, ins.BB, ins.CC, 'C', vmap)449# aput-short vAA, vBB, vCC ( 8b, 8b, 8b )450def aputshort(ins, vmap):451 logger.debug('APutShort : %s', ins.get_output())452 return store_array_inst(ins.AA, ins.BB, ins.CC, 'S', vmap)453# iget vA, vB ( 4b, 4b )454def iget(ins, vmap):455 logger.debug('IGet : %s', ins.get_output())456 klass, ftype, name = ins.cm.get_field(ins.CCCC)457 klass = util.get_type(klass)458 a, b = get_variables(vmap, ins.A, ins.B)459 exp = InstanceExpression(b, klass, ftype, name)460 return AssignExpression(a, exp)461# iget-wide vA, vB ( 4b, 4b )462def igetwide(ins, vmap):463 logger.debug('IGetWide : %s', ins.get_output())464 klass, ftype, name = ins.cm.get_field(ins.CCCC)465 klass = util.get_type(klass)466 a, b = get_variables(vmap, ins.A, ins.B)467 exp = InstanceExpression(b, klass, ftype, name)468 return AssignExpression(a, exp)469# iget-object vA, vB ( 4b, 4b )470def igetobject(ins, vmap):471 logger.debug('IGetObject : %s', ins.get_output())472 klass, ftype, name = ins.cm.get_field(ins.CCCC)473 klass = util.get_type(klass)474 a, b = get_variables(vmap, ins.A, ins.B)475 exp = InstanceExpression(b, klass, ftype, name)476 return AssignExpression(a, exp)477# iget-boolean vA, vB ( 4b, 4b )478def igetboolean(ins, vmap):479 logger.debug('IGetBoolean : %s', ins.get_output())480 klass, ftype, name = ins.cm.get_field(ins.CCCC)481 klass = util.get_type(klass)482 a, b = get_variables(vmap, ins.A, ins.B)483 exp = InstanceExpression(b, klass, ftype, name)484 return AssignExpression(a, exp)485# iget-byte vA, vB ( 4b, 4b )486def igetbyte(ins, vmap):487 logger.debug('IGetByte : %s', ins.get_output())488 klass, ftype, name = ins.cm.get_field(ins.CCCC)489 klass = util.get_type(klass)490 a, b = get_variables(vmap, ins.A, ins.B)491 exp = InstanceExpression(b, klass, ftype, name)492 return AssignExpression(a, exp)493# iget-char vA, vB ( 4b, 4b )494def igetchar(ins, vmap):495 logger.debug('IGetChar : %s', ins.get_output())496 klass, ftype, name = ins.cm.get_field(ins.CCCC)497 klass = util.get_type(klass)498 a, b = get_variables(vmap, ins.A, ins.B)499 exp = InstanceExpression(b, klass, ftype, name)500 return AssignExpression(a, exp)501# iget-short vA, vB ( 4b, 4b )502def igetshort(ins, vmap):503 logger.debug('IGetShort : %s', ins.get_output())504 klass, ftype, name = ins.cm.get_field(ins.CCCC)505 klass = util.get_type(klass)506 a, b = get_variables(vmap, ins.A, ins.B)507 exp = InstanceExpression(b, klass, ftype, name)508 return AssignExpression(a, exp)509# iput vA, vB ( 4b, 4b )510def iput(ins, vmap):511 logger.debug('IPut %s', ins.get_output())512 klass, atype, name = ins.cm.get_field(ins.CCCC)513 klass = util.get_type(klass)514 a, b = get_variables(vmap, ins.A, ins.B)515 return InstanceInstruction(a, b, klass, atype, name)516# iput-wide vA, vB ( 4b, 4b )517def iputwide(ins, vmap):518 logger.debug('IPutWide %s', ins.get_output())519 klass, atype, name = ins.cm.get_field(ins.CCCC)520 klass = util.get_type(klass)521 a, b = get_variables(vmap, ins.A, ins.B)522 return InstanceInstruction(a, b, klass, atype, name)523# iput-object vA, vB ( 4b, 4b )524def iputobject(ins, vmap):525 logger.debug('IPutObject %s', ins.get_output())526 klass, atype, name = ins.cm.get_field(ins.CCCC)527 klass = util.get_type(klass)528 a, b = get_variables(vmap, ins.A, ins.B)529 return InstanceInstruction(a, b, klass, atype, name)530# iput-boolean vA, vB ( 4b, 4b )531def iputboolean(ins, vmap):532 logger.debug('IPutBoolean %s', ins.get_output())533 klass, atype, name = ins.cm.get_field(ins.CCCC)534 klass = util.get_type(klass)535 a, b = get_variables(vmap, ins.A, ins.B)536 return InstanceInstruction(a, b, klass, atype, name)537# iput-byte vA, vB ( 4b, 4b )538def iputbyte(ins, vmap):539 logger.debug('IPutByte %s', ins.get_output())540 klass, atype, name = ins.cm.get_field(ins.CCCC)541 klass = util.get_type(klass)542 a, b = get_variables(vmap, ins.A, ins.B)543 return InstanceInstruction(a, b, klass, atype, name)544# iput-char vA, vB ( 4b, 4b )545def iputchar(ins, vmap):546 logger.debug('IPutChar %s', ins.get_output())547 klass, atype, name = ins.cm.get_field(ins.CCCC)548 klass = util.get_type(klass)549 a, b = get_variables(vmap, ins.A, ins.B)550 return InstanceInstruction(a, b, klass, atype, name)551# iput-short vA, vB ( 4b, 4b )552def iputshort(ins, vmap):553 logger.debug('IPutShort %s', ins.get_output())554 klass, atype, name = ins.cm.get_field(ins.CCCC)555 klass = util.get_type(klass)556 a, b = get_variables(vmap, ins.A, ins.B)557 return InstanceInstruction(a, b, klass, atype, name)558# sget vAA ( 8b )559def sget(ins, vmap):560 logger.debug('SGet : %s', ins.get_output())561 klass, atype, name = ins.cm.get_field(ins.BBBB)562 klass = util.get_type(klass)563 exp = StaticExpression(klass, atype, name)564 a = get_variables(vmap, ins.AA)565 return AssignExpression(a, exp)566# sget-wide vAA ( 8b )567def sgetwide(ins, vmap):568 logger.debug('SGetWide : %s', ins.get_output())569 klass, atype, name = ins.cm.get_field(ins.BBBB)570 klass = util.get_type(klass)571 exp = StaticExpression(klass, atype, name)572 a = get_variables(vmap, ins.AA)573 return AssignExpression(a, exp)574# sget-object vAA ( 8b )575def sgetobject(ins, vmap):576 logger.debug('SGetObject : %s', ins.get_output())577 klass, atype, name = ins.cm.get_field(ins.BBBB)578 klass = util.get_type(klass)579 exp = StaticExpression(klass, atype, name)580 a = get_variables(vmap, ins.AA)581 return AssignExpression(a, exp)582# sget-boolean vAA ( 8b )583def sgetboolean(ins, vmap):584 logger.debug('SGetBoolean : %s', ins.get_output())585 klass, atype, name = ins.cm.get_field(ins.BBBB)586 klass = util.get_type(klass)587 exp = StaticExpression(klass, atype, name)588 a = get_variables(vmap, ins.AA)589 return AssignExpression(a, exp)590# sget-byte vAA ( 8b )591def sgetbyte(ins, vmap):592 logger.debug('SGetByte : %s', ins.get_output())593 klass, atype, name = ins.cm.get_field(ins.BBBB)594 klass = util.get_type(klass)595 exp = StaticExpression(klass, atype, name)596 a = get_variables(vmap, ins.AA)597 return AssignExpression(a, exp)598# sget-char vAA ( 8b )599def sgetchar(ins, vmap):600 logger.debug('SGetChar : %s', ins.get_output())601 klass, atype, name = ins.cm.get_field(ins.BBBB)602 klass = util.get_type(klass)603 exp = StaticExpression(klass, atype, name)604 a = get_variables(vmap, ins.AA)605 return AssignExpression(a, exp)606# sget-short vAA ( 8b )607def sgetshort(ins, vmap):608 logger.debug('SGetShort : %s', ins.get_output())609 klass, atype, name = ins.cm.get_field(ins.BBBB)610 klass = util.get_type(klass)611 exp = StaticExpression(klass, atype, name)612 a = get_variables(vmap, ins.AA)613 return AssignExpression(a, exp)614# sput vAA ( 8b )615def sput(ins, vmap):616 logger.debug('SPut : %s', ins.get_output())617 klass, ftype, name = ins.cm.get_field(ins.BBBB)618 klass = util.get_type(klass)619 a = get_variables(vmap, ins.AA)620 return StaticInstruction(a, klass, ftype, name)621# sput-wide vAA ( 8b )622def sputwide(ins, vmap):623 logger.debug('SPutWide : %s', ins.get_output())624 klass, ftype, name = ins.cm.get_field(ins.BBBB)625 klass = util.get_type(klass)626 a = get_variables(vmap, ins.AA)627 return StaticInstruction(a, klass, ftype, name)628# sput-object vAA ( 8b )629def sputobject(ins, vmap):630 logger.debug('SPutObject : %s', ins.get_output())631 klass, ftype, name = ins.cm.get_field(ins.BBBB)632 klass = util.get_type(klass)633 a = get_variables(vmap, ins.AA)634 return StaticInstruction(a, klass, ftype, name)635# sput-boolean vAA ( 8b )636def sputboolean(ins, vmap):637 logger.debug('SPutBoolean : %s', ins.get_output())638 klass, ftype, name = ins.cm.get_field(ins.BBBB)639 klass = util.get_type(klass)640 a = get_variables(vmap, ins.AA)641 return StaticInstruction(a, klass, ftype, name)642# sput-wide vAA ( 8b )643def sputbyte(ins, vmap):644 logger.debug('SPutByte : %s', ins.get_output())645 klass, ftype, name = ins.cm.get_field(ins.BBBB)646 klass = util.get_type(klass)647 a = get_variables(vmap, ins.AA)648 return StaticInstruction(a, klass, ftype, name)649# sput-char vAA ( 8b )650def sputchar(ins, vmap):651 logger.debug('SPutChar : %s', ins.get_output())652 klass, ftype, name = ins.cm.get_field(ins.BBBB)653 klass = util.get_type(klass)654 a = get_variables(vmap, ins.AA)655 return StaticInstruction(a, klass, ftype, name)656# sput-short vAA ( 8b )657def sputshort(ins, vmap):658 logger.debug('SPutShort : %s', ins.get_output())659 klass, ftype, name = ins.cm.get_field(ins.BBBB)660 klass = util.get_type(klass)661 a = get_variables(vmap, ins.AA)662 return StaticInstruction(a, klass, ftype, name)663def get_args(vmap, param_type, largs):664 num_param = 0665 args = []666 for type_ in param_type:667 param = largs[num_param]668 args.append(param)669 num_param += util.get_type_size(type_)670 if len(param_type) == 1:671 return [get_variables(vmap, *args)]672 return get_variables(vmap, *args)673# invoke-virtual {vD, vE, vF, vG, vA} ( 4b each )674def invokevirtual(ins, vmap, ret):675 logger.debug('InvokeVirtual : %s', ins.get_output())676 method = ins.cm.get_method_ref(ins.BBBB)677 cls_name = util.get_type(method.get_class_name())678 name = method.get_name()679 param_type, ret_type = method.get_proto()680 param_type = util.get_params_type(param_type)681 largs = [ins.D, ins.E, ins.F, ins.G]682 args = get_args(vmap, param_type, largs)683 c = get_variables(vmap, ins.C)684 returned = None if ret_type == 'V' else ret.new()685 exp = InvokeInstruction(cls_name, name, c, ret_type,686 param_type, args)687 return AssignExpression(returned, exp)688# invoke-super {vD, vE, vF, vG, vA} ( 4b each )689def invokesuper(ins, vmap, ret):690 logger.debug('InvokeSuper : %s', ins.get_output())691 method = ins.cm.get_method_ref(ins.BBBB)692 cls_name = util.get_type(method.get_class_name())693 name = method.get_name()694 param_type, ret_type = method.get_proto()695 param_type = util.get_params_type(param_type)696 largs = [ins.D, ins.E, ins.F, ins.G]697 args = get_args(vmap, param_type, largs)698 superclass = BaseClass('super')699 returned = None if ret_type == 'V' else ret.new()700 exp = InvokeInstruction(cls_name, name, superclass, ret_type,701 param_type, args)702 return AssignExpression(returned, exp)703# invoke-direct {vD, vE, vF, vG, vA} ( 4b each )704def invokedirect(ins, vmap, ret):705 logger.debug('InvokeDirect : %s', ins.get_output())706 method = ins.cm.get_method_ref(ins.BBBB)707 cls_name = util.get_type(method.get_class_name())708 name = method.get_name()709 param_type, ret_type = method.get_proto()710 param_type = util.get_params_type(param_type)711 largs = [ins.D, ins.E, ins.F, ins.G]712 args = get_args(vmap, param_type, largs)713 base = get_variables(vmap, ins.C)714 if ret_type == 'V':715 if isinstance(base, ThisParam):716 returned = None717 else:718 returned = base719 ret.set_to(base)720 else:721 returned = ret.new()722 exp = InvokeDirectInstruction(cls_name, name, base, ret_type,723 param_type, args)724 return AssignExpression(returned, exp)725# invoke-static {vD, vE, vF, vG, vA} ( 4b each )726def invokestatic(ins, vmap, ret):727 logger.debug('InvokeStatic : %s', ins.get_output())728 method = ins.cm.get_method_ref(ins.BBBB)729 cls_name = util.get_type(method.get_class_name())730 name = method.get_name()731 param_type, ret_type = method.get_proto()732 param_type = util.get_params_type(param_type)733 largs = [ins.C, ins.D, ins.E, ins.F, ins.G]734 args = get_args(vmap, param_type, largs)735 base = BaseClass(cls_name)736 returned = None if ret_type == 'V' else ret.new()737 exp = InvokeStaticInstruction(cls_name, name, base, ret_type,738 param_type, args)739 return AssignExpression(returned, exp)740# invoke-interface {vD, vE, vF, vG, vA} ( 4b each )741def invokeinterface(ins, vmap, ret):742 logger.debug('InvokeInterface : %s', ins.get_output())743 method = ins.cm.get_method_ref(ins.BBBB)744 cls_name = util.get_type(method.get_class_name())745 name = method.get_name()746 param_type, ret_type = method.get_proto()747 param_type = util.get_params_type(param_type)748 largs = [ins.D, ins.E, ins.F, ins.G]749 args = get_args(vmap, param_type, largs)750 c = get_variables(vmap, ins.C)751 returned = None if ret_type == 'V' else ret.new()752 exp = InvokeInstruction(cls_name, name, c, ret_type,753 param_type, args)754 return AssignExpression(returned, exp)755# invoke-virtual/range {vCCCC..vNNNN} ( 16b each )756def invokevirtualrange(ins, vmap, ret):757 logger.debug('InvokeVirtualRange : %s', ins.get_output())758 method = ins.cm.get_method_ref(ins.BBBB)759 cls_name = util.get_type(method.get_class_name())760 name = method.get_name()761 param_type, ret_type = method.get_proto()762 param_type = util.get_params_type(param_type)763 largs = range(ins.CCCC, ins.NNNN + 1)764 this_arg = get_variables(vmap, largs[0])765 args = get_args(vmap, param_type, largs[1:])766 returned = None if ret_type == 'V' else ret.new()767 exp = InvokeRangeInstruction(cls_name, name, ret_type,768 param_type, [this_arg] + args)769 return AssignExpression(returned, exp)770# invoke-super/range {vCCCC..vNNNN} ( 16b each )771def invokesuperrange(ins, vmap, ret):772 logger.debug('InvokeSuperRange : %s', ins.get_output())773 method = ins.cm.get_method_ref(ins.BBBB)774 cls_name = util.get_type(method.get_class_name())775 name = method.get_name()776 param_type, ret_type = method.get_proto()777 param_type = util.get_params_type(param_type)778 largs = range(ins.CCCC, ins.NNNN + 1)779 args = get_args(vmap, param_type, largs[1:])780 base = get_variables(vmap, ins.CCCC)781 if ret_type != 'V':782 returned = ret.new()783 else:784 returned = base785 ret.set_to(base)786 superclass = BaseClass('super')787 exp = InvokeRangeInstruction(cls_name, name, ret_type,788 param_type, [superclass] + args)789 return AssignExpression(returned, exp)790# invoke-direct/range {vCCCC..vNNNN} ( 16b each )791def invokedirectrange(ins, vmap, ret):792 logger.debug('InvokeDirectRange : %s', ins.get_output())793 method = ins.cm.get_method_ref(ins.BBBB)794 cls_name = util.get_type(method.get_class_name())795 name = method.get_name()796 param_type, ret_type = method.get_proto()797 param_type = util.get_params_type(param_type)798 largs = range(ins.CCCC, ins.NNNN + 1)799 this_arg = get_variables(vmap, largs[0])800 args = get_args(vmap, param_type, largs[1:])801 base = get_variables(vmap, ins.CCCC)802 if ret_type != 'V':803 returned = ret.new()804 else:805 returned = base806 ret.set_to(base)807 exp = InvokeRangeInstruction(cls_name, name, ret_type,808 param_type, [this_arg] + args)809 return AssignExpression(returned, exp)810# invoke-static/range {vCCCC..vNNNN} ( 16b each )811def invokestaticrange(ins, vmap, ret):812 logger.debug('InvokeStaticRange : %s', ins.get_output())813 method = ins.cm.get_method_ref(ins.BBBB)814 cls_name = util.get_type(method.get_class_name())815 name = method.get_name()816 param_type, ret_type = method.get_proto()817 param_type = util.get_params_type(param_type)818 largs = range(ins.CCCC, ins.NNNN + 1)819 args = get_args(vmap, param_type, largs)820 base = BaseClass(cls_name)821 returned = None if ret_type == 'V' else ret.new()822 exp = InvokeStaticInstruction(cls_name, name, base, ret_type,823 param_type, args)824 return AssignExpression(returned, exp)825# invoke-interface/range {vCCCC..vNNNN} ( 16b each )826def invokeinterfacerange(ins, vmap, ret):827 logger.debug('InvokeInterfaceRange : %s', ins.get_output())828 method = ins.cm.get_method_ref(ins.BBBB)829 cls_name = util.get_type(method.get_class_name())830 name = method.get_name()831 param_type, ret_type = method.get_proto()832 param_type = util.get_params_type(param_type)833 largs = range(ins.CCCC, ins.NNNN + 1)834 base_arg = get_variables(vmap, largs[0])835 args = get_args(vmap, param_type, largs[1:])836 returned = None if ret_type == 'V' else ret.new()837 exp = InvokeRangeInstruction(cls_name, name, ret_type,838 param_type, [base_arg] + args)839 return AssignExpression(returned, exp)840# neg-int vA, vB ( 4b, 4b )841def negint(ins, vmap):842 logger.debug('NegInt : %s', ins.get_output())843 a, b = get_variables(vmap, ins.A, ins.B)844 exp = UnaryExpression(Op.NEG, b, 'I')845 return AssignExpression(a, exp)846# not-int vA, vB ( 4b, 4b )847def notint(ins, vmap):848 logger.debug('NotInt : %s', ins.get_output())849 a, b = get_variables(vmap, ins.A, ins.B)850 exp = UnaryExpression(Op.NOT, b, 'I')851 return AssignExpression(a, exp)852# neg-long vA, vB ( 4b, 4b )853def neglong(ins, vmap):854 logger.debug('NegLong : %s', ins.get_output())855 a, b = get_variables(vmap, ins.A, ins.B)856 exp = UnaryExpression(Op.NEG, b, 'J')857 return AssignExpression(a, exp)858# not-long vA, vB ( 4b, 4b )859def notlong(ins, vmap):860 logger.debug('NotLong : %s', ins.get_output())861 a, b = get_variables(vmap, ins.A, ins.B)862 exp = UnaryExpression(Op.NOT, b, 'J')863 return AssignExpression(a, exp)864# neg-float vA, vB ( 4b, 4b )865def negfloat(ins, vmap):866 logger.debug('NegFloat : %s', ins.get_output())867 a, b = get_variables(vmap, ins.A, ins.B)868 exp = UnaryExpression(Op.NEG, b, 'F')869 return AssignExpression(a, exp)870# neg-double vA, vB ( 4b, 4b )871def negdouble(ins, vmap):872 logger.debug('NegDouble : %s', ins.get_output())873 a, b = get_variables(vmap, ins.A, ins.B)874 exp = UnaryExpression(Op.NEG, b, 'D')875 return AssignExpression(a, exp)876# int-to-long vA, vB ( 4b, 4b )877def inttolong(ins, vmap):878 logger.debug('IntToLong : %s', ins.get_output())879 return assign_cast_exp(ins.A, ins.B, '(long)', 'J', vmap)880# int-to-float vA, vB ( 4b, 4b )881def inttofloat(ins, vmap):882 logger.debug('IntToFloat : %s', ins.get_output())883 return assign_cast_exp(ins.A, ins.B, '(float)', 'F', vmap)884# int-to-double vA, vB ( 4b, 4b )885def inttodouble(ins, vmap):886 logger.debug('IntToDouble : %s', ins.get_output())887 return assign_cast_exp(ins.A, ins.B, '(double)', 'D', vmap)888# long-to-int vA, vB ( 4b, 4b )889def longtoint(ins, vmap):890 logger.debug('LongToInt : %s', ins.get_output())891 return assign_cast_exp(ins.A, ins.B, '(int)', 'I', vmap)892# long-to-float vA, vB ( 4b, 4b )893def longtofloat(ins, vmap):894 logger.debug('LongToFloat : %s', ins.get_output())895 return assign_cast_exp(ins.A, ins.B, '(float)', 'F', vmap)896# long-to-double vA, vB ( 4b, 4b )897def longtodouble(ins, vmap):898 logger.debug('LongToDouble : %s', ins.get_output())899 return assign_cast_exp(ins.A, ins.B, '(double)', 'D', vmap)900# float-to-int vA, vB ( 4b, 4b )901def floattoint(ins, vmap):902 logger.debug('FloatToInt : %s', ins.get_output())903 return assign_cast_exp(ins.A, ins.B, '(int)', 'I', vmap)904# float-to-long vA, vB ( 4b, 4b )905def floattolong(ins, vmap):906 logger.debug('FloatToLong : %s', ins.get_output())907 return assign_cast_exp(ins.A, ins.B, '(long)', 'J', vmap)908# float-to-double vA, vB ( 4b, 4b )909def floattodouble(ins, vmap):910 logger.debug('FloatToDouble : %s', ins.get_output())911 return assign_cast_exp(ins.A, ins.B, '(double)', 'D', vmap)912# double-to-int vA, vB ( 4b, 4b )913def doubletoint(ins, vmap):914 logger.debug('DoubleToInt : %s', ins.get_output())915 return assign_cast_exp(ins.A, ins.B, '(int)', 'I', vmap)916# double-to-long vA, vB ( 4b, 4b )917def doubletolong(ins, vmap):918 logger.debug('DoubleToLong : %s', ins.get_output())919 return assign_cast_exp(ins.A, ins.B, '(long)', 'J', vmap)920# double-to-float vA, vB ( 4b, 4b )921def doubletofloat(ins, vmap):922 logger.debug('DoubleToFloat : %s', ins.get_output())923 return assign_cast_exp(ins.A, ins.B, '(float)', 'F', vmap)924# int-to-byte vA, vB ( 4b, 4b )925def inttobyte(ins, vmap):926 logger.debug('IntToByte : %s', ins.get_output())927 return assign_cast_exp(ins.A, ins.B, '(byte)', 'B', vmap)928# int-to-char vA, vB ( 4b, 4b )929def inttochar(ins, vmap):930 logger.debug('IntToChar : %s', ins.get_output())931 return assign_cast_exp(ins.A, ins.B, '(char)', 'C', vmap)932# int-to-short vA, vB ( 4b, 4b )933def inttoshort(ins, vmap):934 logger.debug('IntToShort : %s', ins.get_output())935 return assign_cast_exp(ins.A, ins.B, '(short)', 'S', vmap)936# add-int vAA, vBB, vCC ( 8b, 8b, 8b )937def addint(ins, vmap):938 logger.debug('AddInt : %s', ins.get_output())939 return assign_binary_exp(ins, Op.ADD, 'I', vmap)940# sub-int vAA, vBB, vCC ( 8b, 8b, 8b )941def subint(ins, vmap):942 logger.debug('SubInt : %s', ins.get_output())943 return assign_binary_exp(ins, Op.SUB, 'I', vmap)944# mul-int vAA, vBB, vCC ( 8b, 8b, 8b )945def mulint(ins, vmap):946 logger.debug('MulInt : %s', ins.get_output())947 return assign_binary_exp(ins, Op.MUL, 'I', vmap)948# div-int vAA, vBB, vCC ( 8b, 8b, 8b )949def divint(ins, vmap):950 logger.debug('DivInt : %s', ins.get_output())951 return assign_binary_exp(ins, Op.DIV, 'I', vmap)952# rem-int vAA, vBB, vCC ( 8b, 8b, 8b )953def remint(ins, vmap):954 logger.debug('RemInt : %s', ins.get_output())955 return assign_binary_exp(ins, Op.MOD, 'I', vmap)956# and-int vAA, vBB, vCC ( 8b, 8b, 8b )957def andint(ins, vmap):958 logger.debug('AndInt : %s', ins.get_output())959 return assign_binary_exp(ins, Op.AND, 'I', vmap)960# or-int vAA, vBB, vCC ( 8b, 8b, 8b )961def orint(ins, vmap):962 logger.debug('OrInt : %s', ins.get_output())963 return assign_binary_exp(ins, Op.OR, 'I', vmap)964# xor-int vAA, vBB, vCC ( 8b, 8b, 8b )965def xorint(ins, vmap):966 logger.debug('XorInt : %s', ins.get_output())967 return assign_binary_exp(ins, Op.XOR, 'I', vmap)968# shl-int vAA, vBB, vCC ( 8b, 8b, 8b )969def shlint(ins, vmap):970 logger.debug('ShlInt : %s', ins.get_output())971 return assign_binary_exp(ins, Op.INTSHL, 'I', vmap)972# shr-int vAA, vBB, vCC ( 8b, 8b, 8b )973def shrint(ins, vmap):974 logger.debug('ShrInt : %s', ins.get_output())975 return assign_binary_exp(ins, Op.INTSHR, 'I', vmap)976# ushr-int vAA, vBB, vCC ( 8b, 8b, 8b )977def ushrint(ins, vmap):978 logger.debug('UShrInt : %s', ins.get_output())979 return assign_binary_exp(ins, Op.INTSHR, 'I', vmap)980# add-long vAA, vBB, vCC ( 8b, 8b, 8b )981def addlong(ins, vmap):982 logger.debug('AddLong : %s', ins.get_output())983 return assign_binary_exp(ins, Op.ADD, 'J', vmap)984# sub-long vAA, vBB, vCC ( 8b, 8b, 8b )985def sublong(ins, vmap):986 logger.debug('SubLong : %s', ins.get_output())987 return assign_binary_exp(ins, Op.SUB, 'J', vmap)988# mul-long vAA, vBB, vCC ( 8b, 8b, 8b )989def mullong(ins, vmap):990 logger.debug('MulLong : %s', ins.get_output())991 return assign_binary_exp(ins, Op.MUL, 'J', vmap)992# div-long vAA, vBB, vCC ( 8b, 8b, 8b )993def divlong(ins, vmap):994 logger.debug('DivLong : %s', ins.get_output())995 return assign_binary_exp(ins, Op.DIV, 'J', vmap)996# rem-long vAA, vBB, vCC ( 8b, 8b, 8b )997def remlong(ins, vmap):998 logger.debug('RemLong : %s', ins.get_output())999 return assign_binary_exp(ins, Op.MOD, 'J', vmap)1000# and-long vAA, vBB, vCC ( 8b, 8b, 8b )1001def andlong(ins, vmap):1002 logger.debug('AndLong : %s', ins.get_output())1003 return assign_binary_exp(ins, Op.AND, 'J', vmap)1004# or-long vAA, vBB, vCC ( 8b, 8b, 8b )1005def orlong(ins, vmap):1006 logger.debug('OrLong : %s', ins.get_output())1007 return assign_binary_exp(ins, Op.OR, 'J', vmap)1008# xor-long vAA, vBB, vCC ( 8b, 8b, 8b )1009def xorlong(ins, vmap):1010 logger.debug('XorLong : %s', ins.get_output())1011 return assign_binary_exp(ins, Op.XOR, 'J', vmap)1012# shl-long vAA, vBB, vCC ( 8b, 8b, 8b )1013def shllong(ins, vmap):1014 logger.debug('ShlLong : %s', ins.get_output())1015 return assign_binary_exp(ins, Op.LONGSHL, 'J', vmap)1016# shr-long vAA, vBB, vCC ( 8b, 8b, 8b )1017def shrlong(ins, vmap):1018 logger.debug('ShrLong : %s', ins.get_output())1019 return assign_binary_exp(ins, Op.LONGSHR, 'J', vmap)1020# ushr-long vAA, vBB, vCC ( 8b, 8b, 8b )1021def ushrlong(ins, vmap):1022 logger.debug('UShrLong : %s', ins.get_output())1023 return assign_binary_exp(ins, Op.LONGSHR, 'J', vmap)1024# add-float vAA, vBB, vCC ( 8b, 8b, 8b )1025def addfloat(ins, vmap):1026 logger.debug('AddFloat : %s', ins.get_output())1027 return assign_binary_exp(ins, Op.ADD, 'F', vmap)1028# sub-float vAA, vBB, vCC ( 8b, 8b, 8b )1029def subfloat(ins, vmap):1030 logger.debug('SubFloat : %s', ins.get_output())1031 return assign_binary_exp(ins, Op.SUB, 'F', vmap)1032# mul-float vAA, vBB, vCC ( 8b, 8b, 8b )1033def mulfloat(ins, vmap):1034 logger.debug('MulFloat : %s', ins.get_output())1035 return assign_binary_exp(ins, Op.MUL, 'F', vmap)1036# div-float vAA, vBB, vCC ( 8b, 8b, 8b )1037def divfloat(ins, vmap):1038 logger.debug('DivFloat : %s', ins.get_output())1039 return assign_binary_exp(ins, Op.DIV, 'F', vmap)1040# rem-float vAA, vBB, vCC ( 8b, 8b, 8b )1041def remfloat(ins, vmap):1042 logger.debug('RemFloat : %s', ins.get_output())1043 return assign_binary_exp(ins, Op.MOD, 'F', vmap)1044# add-double vAA, vBB, vCC ( 8b, 8b, 8b )1045def adddouble(ins, vmap):1046 logger.debug('AddDouble : %s', ins.get_output())1047 return assign_binary_exp(ins, Op.ADD, 'D', vmap)1048# sub-double vAA, vBB, vCC ( 8b, 8b, 8b )1049def subdouble(ins, vmap):1050 logger.debug('SubDouble : %s', ins.get_output())1051 return assign_binary_exp(ins, Op.SUB, 'D', vmap)1052# mul-double vAA, vBB, vCC ( 8b, 8b, 8b )1053def muldouble(ins, vmap):1054 logger.debug('MulDouble : %s', ins.get_output())1055 return assign_binary_exp(ins, Op.MUL, 'D', vmap)1056# div-double vAA, vBB, vCC ( 8b, 8b, 8b )1057def divdouble(ins, vmap):1058 logger.debug('DivDouble : %s', ins.get_output())1059 return assign_binary_exp(ins, Op.DIV, 'D', vmap)1060# rem-double vAA, vBB, vCC ( 8b, 8b, 8b )1061def remdouble(ins, vmap):1062 logger.debug('RemDouble : %s', ins.get_output())1063 return assign_binary_exp(ins, Op.MOD, 'D', vmap)1064# add-int/2addr vA, vB ( 4b, 4b )1065def addint2addr(ins, vmap):1066 logger.debug('AddInt2Addr : %s', ins.get_output())1067 return assign_binary_2addr_exp(ins, Op.ADD, 'I', vmap)1068# sub-int/2addr vA, vB ( 4b, 4b )1069def subint2addr(ins, vmap):1070 logger.debug('SubInt2Addr : %s', ins.get_output())1071 return assign_binary_2addr_exp(ins, Op.SUB, 'I', vmap)1072# mul-int/2addr vA, vB ( 4b, 4b )1073def mulint2addr(ins, vmap):1074 logger.debug('MulInt2Addr : %s', ins.get_output())1075 return assign_binary_2addr_exp(ins, Op.MUL, 'I', vmap)1076# div-int/2addr vA, vB ( 4b, 4b )1077def divint2addr(ins, vmap):1078 logger.debug('DivInt2Addr : %s', ins.get_output())1079 return assign_binary_2addr_exp(ins, Op.DIV, 'I', vmap)1080# rem-int/2addr vA, vB ( 4b, 4b )1081def remint2addr(ins, vmap):1082 logger.debug('RemInt2Addr : %s', ins.get_output())1083 return assign_binary_2addr_exp(ins, Op.MOD, 'I', vmap)1084# and-int/2addr vA, vB ( 4b, 4b )1085def andint2addr(ins, vmap):1086 logger.debug('AndInt2Addr : %s', ins.get_output())1087 return assign_binary_2addr_exp(ins, Op.AND, 'I', vmap)1088# or-int/2addr vA, vB ( 4b, 4b )1089def orint2addr(ins, vmap):1090 logger.debug('OrInt2Addr : %s', ins.get_output())1091 return assign_binary_2addr_exp(ins, Op.OR, 'I', vmap)1092# xor-int/2addr vA, vB ( 4b, 4b )1093def xorint2addr(ins, vmap):1094 logger.debug('XorInt2Addr : %s', ins.get_output())1095 return assign_binary_2addr_exp(ins, Op.XOR, 'I', vmap)1096# shl-int/2addr vA, vB ( 4b, 4b )1097def shlint2addr(ins, vmap):1098 logger.debug('ShlInt2Addr : %s', ins.get_output())1099 return assign_binary_2addr_exp(ins, Op.INTSHL, 'I', vmap)1100# shr-int/2addr vA, vB ( 4b, 4b )1101def shrint2addr(ins, vmap):1102 logger.debug('ShrInt2Addr : %s', ins.get_output())1103 return assign_binary_2addr_exp(ins, Op.INTSHR, 'I', vmap)1104# ushr-int/2addr vA, vB ( 4b, 4b )1105def ushrint2addr(ins, vmap):1106 logger.debug('UShrInt2Addr : %s', ins.get_output())1107 return assign_binary_2addr_exp(ins, Op.INTSHR, 'I', vmap)1108# add-long/2addr vA, vB ( 4b, 4b )1109def addlong2addr(ins, vmap):1110 logger.debug('AddLong2Addr : %s', ins.get_output())1111 return assign_binary_2addr_exp(ins, Op.ADD, 'J', vmap)1112# sub-long/2addr vA, vB ( 4b, 4b )1113def sublong2addr(ins, vmap):1114 logger.debug('SubLong2Addr : %s', ins.get_output())1115 return assign_binary_2addr_exp(ins, Op.SUB, 'J', vmap)1116# mul-long/2addr vA, vB ( 4b, 4b )1117def mullong2addr(ins, vmap):1118 logger.debug('MulLong2Addr : %s', ins.get_output())1119 return assign_binary_2addr_exp(ins, Op.MUL, 'J', vmap)1120# div-long/2addr vA, vB ( 4b, 4b )1121def divlong2addr(ins, vmap):1122 logger.debug('DivLong2Addr : %s', ins.get_output())1123 return assign_binary_2addr_exp(ins, Op.DIV, 'J', vmap)1124# rem-long/2addr vA, vB ( 4b, 4b )1125def remlong2addr(ins, vmap):1126 logger.debug('RemLong2Addr : %s', ins.get_output())1127 return assign_binary_2addr_exp(ins, Op.MOD, 'J', vmap)1128# and-long/2addr vA, vB ( 4b, 4b )1129def andlong2addr(ins, vmap):1130 logger.debug('AndLong2Addr : %s', ins.get_output())1131 return assign_binary_2addr_exp(ins, Op.AND, 'J', vmap)1132# or-long/2addr vA, vB ( 4b, 4b )1133def orlong2addr(ins, vmap):1134 logger.debug('OrLong2Addr : %s', ins.get_output())1135 return assign_binary_2addr_exp(ins, Op.OR, 'J', vmap)1136# xor-long/2addr vA, vB ( 4b, 4b )1137def xorlong2addr(ins, vmap):1138 logger.debug('XorLong2Addr : %s', ins.get_output())1139 return assign_binary_2addr_exp(ins, Op.XOR, 'J', vmap)1140# shl-long/2addr vA, vB ( 4b, 4b )1141def shllong2addr(ins, vmap):1142 logger.debug('ShlLong2Addr : %s', ins.get_output())1143 return assign_binary_2addr_exp(ins, Op.LONGSHL, 'J', vmap)1144# shr-long/2addr vA, vB ( 4b, 4b )1145def shrlong2addr(ins, vmap):1146 logger.debug('ShrLong2Addr : %s', ins.get_output())1147 return assign_binary_2addr_exp(ins, Op.LONGSHR, 'J', vmap)1148# ushr-long/2addr vA, vB ( 4b, 4b )1149def ushrlong2addr(ins, vmap):1150 logger.debug('UShrLong2Addr : %s', ins.get_output())1151 return assign_binary_2addr_exp(ins, Op.LONGSHR, 'J', vmap)1152# add-float/2addr vA, vB ( 4b, 4b )1153def addfloat2addr(ins, vmap):1154 logger.debug('AddFloat2Addr : %s', ins.get_output())1155 return assign_binary_2addr_exp(ins, Op.ADD, 'F', vmap)1156# sub-float/2addr vA, vB ( 4b, 4b )1157def subfloat2addr(ins, vmap):1158 logger.debug('SubFloat2Addr : %s', ins.get_output())1159 return assign_binary_2addr_exp(ins, Op.SUB, 'F', vmap)1160# mul-float/2addr vA, vB ( 4b, 4b )1161def mulfloat2addr(ins, vmap):1162 logger.debug('MulFloat2Addr : %s', ins.get_output())1163 return assign_binary_2addr_exp(ins, Op.MUL, 'F', vmap)1164# div-float/2addr vA, vB ( 4b, 4b )1165def divfloat2addr(ins, vmap):1166 logger.debug('DivFloat2Addr : %s', ins.get_output())1167 return assign_binary_2addr_exp(ins, Op.DIV, 'F', vmap)1168# rem-float/2addr vA, vB ( 4b, 4b )1169def remfloat2addr(ins, vmap):1170 logger.debug('RemFloat2Addr : %s', ins.get_output())1171 return assign_binary_2addr_exp(ins, Op.MOD, 'F', vmap)1172# add-double/2addr vA, vB ( 4b, 4b )1173def adddouble2addr(ins, vmap):1174 logger.debug('AddDouble2Addr : %s', ins.get_output())1175 return assign_binary_2addr_exp(ins, Op.ADD, 'D', vmap)1176# sub-double/2addr vA, vB ( 4b, 4b )1177def subdouble2addr(ins, vmap):1178 logger.debug('subDouble2Addr : %s', ins.get_output())1179 return assign_binary_2addr_exp(ins, Op.SUB, 'D', vmap)1180# mul-double/2addr vA, vB ( 4b, 4b )1181def muldouble2addr(ins, vmap):1182 logger.debug('MulDouble2Addr : %s', ins.get_output())1183 return assign_binary_2addr_exp(ins, Op.MUL, 'D', vmap)1184# div-double/2addr vA, vB ( 4b, 4b )1185def divdouble2addr(ins, vmap):1186 logger.debug('DivDouble2Addr : %s', ins.get_output())1187 return assign_binary_2addr_exp(ins, Op.DIV, 'D', vmap)1188# rem-double/2addr vA, vB ( 4b, 4b )1189def remdouble2addr(ins, vmap):1190 logger.debug('RemDouble2Addr : %s', ins.get_output())1191 return assign_binary_2addr_exp(ins, Op.MOD, 'D', vmap)1192# add-int/lit16 vA, vB, #+CCCC ( 4b, 4b, 16b )1193def addintlit16(ins, vmap):1194 logger.debug('AddIntLit16 : %s', ins.get_output())1195 return assign_lit(Op.ADD, ins.CCCC, ins.A, ins.B, vmap)1196# rsub-int vA, vB, #+CCCC ( 4b, 4b, 16b )1197def rsubint(ins, vmap):1198 logger.debug('RSubInt : %s', ins.get_output())1199 var_a, var_b = get_variables(vmap, ins.A, ins.B)1200 cst = Constant(ins.CCCC, 'I')1201 return AssignExpression(var_a, BinaryExpressionLit(Op.SUB, cst, var_b))1202# mul-int/lit16 vA, vB, #+CCCC ( 4b, 4b, 16b )1203def mulintlit16(ins, vmap):1204 logger.debug('MulIntLit16 : %s', ins.get_output())1205 return assign_lit(Op.MUL, ins.CCCC, ins.A, ins.B, vmap)1206# div-int/lit16 vA, vB, #+CCCC ( 4b, 4b, 16b )1207def divintlit16(ins, vmap):1208 logger.debug('DivIntLit16 : %s', ins.get_output())1209 return assign_lit(Op.DIV, ins.CCCC, ins.A, ins.B, vmap)1210# rem-int/lit16 vA, vB, #+CCCC ( 4b, 4b, 16b )1211def remintlit16(ins, vmap):1212 logger.debug('RemIntLit16 : %s', ins.get_output())1213 return assign_lit(Op.MOD, ins.CCCC, ins.A, ins.B, vmap)1214# and-int/lit16 vA, vB, #+CCCC ( 4b, 4b, 16b )1215def andintlit16(ins, vmap):1216 logger.debug('AndIntLit16 : %s', ins.get_output())1217 return assign_lit(Op.AND, ins.CCCC, ins.A, ins.B, vmap)1218# or-int/lit16 vA, vB, #+CCCC ( 4b, 4b, 16b )1219def orintlit16(ins, vmap):1220 logger.debug('OrIntLit16 : %s', ins.get_output())1221 return assign_lit(Op.OR, ins.CCCC, ins.A, ins.B, vmap)1222# xor-int/lit16 vA, vB, #+CCCC ( 4b, 4b, 16b )1223def xorintlit16(ins, vmap):1224 logger.debug('XorIntLit16 : %s', ins.get_output())1225 return assign_lit(Op.XOR, ins.CCCC, ins.A, ins.B, vmap)1226# add-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1227def addintlit8(ins, vmap):1228 logger.debug('AddIntLit8 : %s', ins.get_output())1229 literal, op = [(ins.CC, Op.ADD), (-ins.CC, Op.SUB)][ins.CC < 0]1230 return assign_lit(op, literal, ins.AA, ins.BB, vmap)1231# rsub-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1232def rsubintlit8(ins, vmap):1233 logger.debug('RSubIntLit8 : %s', ins.get_output())1234 var_a, var_b = get_variables(vmap, ins.AA, ins.BB)1235 cst = Constant(ins.CC, 'I')1236 return AssignExpression(var_a, BinaryExpressionLit(Op.SUB, cst, var_b))1237# mul-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1238def mulintlit8(ins, vmap):1239 logger.debug('MulIntLit8 : %s', ins.get_output())1240 return assign_lit(Op.MUL, ins.CC, ins.AA, ins.BB, vmap)1241# div-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1242def divintlit8(ins, vmap):1243 logger.debug('DivIntLit8 : %s', ins.get_output())1244 return assign_lit(Op.DIV, ins.CC, ins.AA, ins.BB, vmap)1245# rem-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1246def remintlit8(ins, vmap):1247 logger.debug('RemIntLit8 : %s', ins.get_output())1248 return assign_lit(Op.MOD, ins.CC, ins.AA, ins.BB, vmap)1249# and-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1250def andintlit8(ins, vmap):1251 logger.debug('AndIntLit8 : %s', ins.get_output())1252 return assign_lit(Op.AND, ins.CC, ins.AA, ins.BB, vmap)1253# or-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1254def orintlit8(ins, vmap):1255 logger.debug('OrIntLit8 : %s', ins.get_output())1256 return assign_lit(Op.OR, ins.CC, ins.AA, ins.BB, vmap)1257# xor-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1258def xorintlit8(ins, vmap):1259 logger.debug('XorIntLit8 : %s', ins.get_output())1260 return assign_lit(Op.XOR, ins.CC, ins.AA, ins.BB, vmap)1261# shl-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1262def shlintlit8(ins, vmap):1263 logger.debug('ShlIntLit8 : %s', ins.get_output())1264 return assign_lit(Op.INTSHL, ins.CC, ins.AA, ins.BB, vmap)1265# shr-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1266def shrintlit8(ins, vmap):1267 logger.debug('ShrIntLit8 : %s', ins.get_output())1268 return assign_lit(Op.INTSHR, ins.CC, ins.AA, ins.BB, vmap)1269# ushr-int/lit8 vAA, vBB, #+CC ( 8b, 8b, 8b )1270def ushrintlit8(ins, vmap):1271 logger.debug('UShrIntLit8 : %s', ins.get_output())1272 return assign_lit(Op.INTSHR, ins.CC, ins.AA, ins.BB, vmap)1273INSTRUCTION_SET = [1274 # 0x001275 nop, # nop1276 move, # move1277 movefrom16, # move/from161278 move16, # move/161279 movewide, # move-wide1280 movewidefrom16, # move-wide/from161281 movewide16, # move-wide/161282 moveobject, # move-object1283 moveobjectfrom16, # move-object/from161284 moveobject16, # move-object/161285 moveresult, # move-result...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lisa automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful