removed redundant definitions for opcodeEncodingLength
This commit is contained in:
parent
74f52c3c35
commit
6346cb237b
@ -96,40 +96,7 @@ className classFile = let
|
||||
|
||||
|
||||
opcodeEncodingLength :: Operation -> Word16
|
||||
opcodeEncodingLength Opiadd = 1
|
||||
opcodeEncodingLength Opisub = 1
|
||||
opcodeEncodingLength Opimul = 1
|
||||
opcodeEncodingLength Opidiv = 1
|
||||
opcodeEncodingLength Opirem = 1
|
||||
opcodeEncodingLength Opiand = 1
|
||||
opcodeEncodingLength Opior = 1
|
||||
opcodeEncodingLength Opixor = 1
|
||||
opcodeEncodingLength Opineg = 1
|
||||
opcodeEncodingLength Opdup = 1
|
||||
opcodeEncodingLength (Opnew _) = 3
|
||||
opcodeEncodingLength (Opif_icmplt _) = 3
|
||||
opcodeEncodingLength (Opif_icmple _) = 3
|
||||
opcodeEncodingLength (Opif_icmpgt _) = 3
|
||||
opcodeEncodingLength (Opif_icmpge _) = 3
|
||||
opcodeEncodingLength (Opif_icmpeq _) = 3
|
||||
opcodeEncodingLength (Opif_icmpne _) = 3
|
||||
opcodeEncodingLength Opaconst_null = 1
|
||||
opcodeEncodingLength Opreturn = 1
|
||||
opcodeEncodingLength Opireturn = 1
|
||||
opcodeEncodingLength Opareturn = 1
|
||||
opcodeEncodingLength Opdup_x1 = 1
|
||||
opcodeEncodingLength Oppop = 1
|
||||
opcodeEncodingLength (Opinvokespecial _) = 3
|
||||
opcodeEncodingLength (Opinvokevirtual _) = 3
|
||||
opcodeEncodingLength (Opgoto _) = 3
|
||||
opcodeEncodingLength (Opsipush _) = 3
|
||||
opcodeEncodingLength (Opldc_w _) = 3
|
||||
opcodeEncodingLength (Opaload _) = 4
|
||||
opcodeEncodingLength (Opiload _) = 4
|
||||
opcodeEncodingLength (Opastore _) = 4
|
||||
opcodeEncodingLength (Opistore _) = 4
|
||||
opcodeEncodingLength (Opputfield _) = 3
|
||||
opcodeEncodingLength (Opgetfield _) = 3
|
||||
opcodeEncodingLength op = fromIntegral . length . serialize $ op
|
||||
|
||||
class Serializable a where
|
||||
serialize :: a -> [Word8]
|
||||
|
Loading…
Reference in New Issue
Block a user