!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                          !(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduSafe2T A BitSet using a 16 bit word0A sized bytestring using a 16 bit word as length0A sized bytestring using a 32 bit word as length*A sized list using a 16 bit word as lengthA bit set of size wAn Enumish value, all maps to a number, but not all integers maps to a enumsish value. There is no guarantee that the integers will be subsequent.yThe only needed implementation is a list of integer-enum pairs in ascending order, corresponding to their integer value. A byte string with a size w.^SizedList is a binary type, that reads a list of elements. It first reads a length N of type w and then N items of type a.Get the size of the sized list.!Get the size of a SizedByteString$Takes the third element of a triple.      !(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduSafe5OT!A ConstantPool is just an IntMap. A IntMapC is used, because constants are accessed after their byte-offset. 5$'A constant is a multi word item in the !J. Each of the constructors are pretty much self expiatory from the types.3nA constant is referenced by the ConstantRef data type. It is just a 16 bit word, but wrapped for type safety.5 Some of the $Cs take up more space in the constant pool than other. Notice that % and 1F is not of size 32, but is still awarded value 1. This is due to an  Hhttp://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.4.5 inconsistency in JVM.6*Return a list of reference-constant pairs.7 Lookup a $ in the !.8 Lookup a  in the ! , returns e if the reference does not point to something in the ConstantPool, if it points to something not a %1 Constant, or if it is impossible to decode the  ByteString as Utf8.9Lookup a class name in the ! , returns  otherwise.!"#$%&'()*+,-./0123456789:;<!"#$')&%(*+,-./0123456789$%&'()*+,-./012534!"#7896 !"#$%&'()*+,-./0123456789:;<!(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduSafe5D&The types info of the stack map frame.NAn stack map frame typeTAn stack map frameXA delta offsetYHAn Exceptions attribute is a list of references into the constant pool.DEFGHIJKLMNOPQRSTUVWXYZ[\]^DEFGHIJKLMNOPQRSTUVWXYZ[YZ[XTUVWNOPQRSDEFGHIJKLMD EFGHIJKLMNOPQRSTUVWXYZ[\]^!(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduSafe5hHAn Exceptions attribute is a list of references into the constant pool.k#Get the constant refs that points .hijklhijkhijkhijkl!(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduSafe5p8A constant value is just a index into the constant pool.pqrspqrpqrpqrs!(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduNone5xaaload baload ...yaastore bastore ...{aload_0, bload_2, iload 5 ...|aload, bload ...}iadd ...~ineg ...8Exclusively on int and long, identified by the word-size$Only works on ints, increment local 1, with 2Only valid on different typesOnly valid on different typesCompare two floating values, 1 indicates if greater-than, (2 is if float or double should be used.acompare with 0 if #2 is False, and two ints from the stack if True. the last value is the offsetPcheck if two objects are equal, or not equal. If #2 is True, compare with null.a table switch has 3 values  `default` low high and a list of offets.a lookup switch has a  `default` value and a list of pairs.True => Enter, False => ExitCreate a new multi array of  1 and with  2 dimensionsInclusive program counter into codeExclusive program counter into codeA program counter into code indicating the handler.wxyz{|}~    wzxy{|}~wxyz{|}~w&xyz{|}~     !(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduSafe5=A bootstraped methods.A"Is a list of bootstrapped methods.DThe methods as listEThe arguments is a cool =>?@ABCDEFG =>?@ABCDE ABCD=>?@E=>?@ABCDEFG!(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduNone59;TNCCode is redefined with Attribute, as it is recursively containing T!. This is a small hack to fix it.O(A class-type that describes a data-type a0 as an Attribute. Most notable it provides the R= method that enables converting an Attribute to a data-type a.PThe name of the attribute.Q Generate a a from an Attribute.S(Create a type dependent on another type b", used for accessing the correct P in O.TJAn Attribute, simply contains of a reference to a name and contains info.X7A small helper function to extract the info as a lazy .YHExtracts the name from the attribute, if it exists in the ConstantPool.ZThe a attribute of the code is the StackMapTable. There can be at most one. If the version number of the file is more than 50, and there is no StackMapTable. there is an implicit empty StackMapTable.[A is an Attribute.\Y is an Attribute.]h is an Attribute.^p is an Attribute._N is an Attribute.NOPQRSTUVWXYZ[\]^_`YhpANORPQSTUVWXYZTUVWXYOPQRNZphYASNOPQRSTUVWXYZ[\]^_` !(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduSafedAccess flags for the  pAccess flags for the  xAccess flags for the  The  mapping of the xThe  mapping of the pThe  mapping of the d'defghijklmnopqrstuvwxyz{|}~$defghijklmnopqrstuvwxyz{|}~$xyz{|}~defghijklmnopqrstuvw d efghijklmnopqrstuvwx yz{|}~ !(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduNone5)A Field in the class-file, as described  Fhttp://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.5here. Fetch the pG attribute. There can only one be one exceptions attribute on a field. !(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduNone5*A Method in the class-file, as described  Fhttp://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.6here.3Unpack the BitSet and get the AccessFlags as a Set.6Unpack the SizedList and get the attributes as a List.%Lookup the name of the method in the !.+Lookup the descriptor of the method in the !. Fetch the NJ attribute, if any. There can only one be one code attribute on a method. Fetch the hH attribute. There can only one be one exceptions attribute on a method.    !(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduNone5A  as described  =http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.htmlhere.Get a list of 3s to interfaces.Get a list of s of a ClassFile.Get a list of s of a ClassFile.'Lookup the this class in a ConstantPool*Lookup the super class in the ConstantPoolGet a list of Ts of a ClassFile. Fetch the AL attribute. There can only one be one exceptions attribute on a class-file.   !(c) Christian Gram Kalhauge, 2017MITkalhuage@cs.ucla.eduNone Create a class file from a lazy R!"#$')&%(*+,-./0123456789YhpANORPQSTUVWXYZ !"#$%&'()*+,-./01123456789:;<=>?@ABBCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abbcdeffghijklmnopqrsttuvwxyz{{|}~3      !"#$%&'()*NO+,-./0123456789:;<=>??@ABBCDEFGHIJKLMNOPQRSSTUVWXYZ[\]^_`a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~                                                                       R'jvm-binary-0.0.2-GeL1rLcsq7015yP1ec12qbLanguage.JVM.UtilsLanguage.JVM.Constant$Language.JVM.Attribute.StackMapTable!Language.JVM.Attribute.Exceptions$Language.JVM.Attribute.ConstantValueLanguage.JVM.Attribute.Code'Language.JVM.Attribute.BootstrapMethodsLanguage.JVM.AttributeLanguage.JVM.AccessFlagLanguage.JVM.FieldLanguage.JVM.MethodLanguage.JVM.ClassFile Language.JVMData.ByteString.Lazy ByteStringField ClassFileMethodBitSet16SizedByteString16SizedByteString32 SizedList16BitSettoSetEnumishinOrder fromEnumish toEnumishSizedByteStringunSizedByteString SizedList unSizedListlistSizebyteStringSizetrd$fBinaryBitSet$fBinarySizedByteString$fBinarySizedList$fTraversableSizedList$fFoldableSizedList$fShowSizedList $fEqSizedList$fFunctorSizedList$fShowSizedByteString$fEqSizedByteString $fOrdBitSet $fShowBitSet $fEqBitSet ConstantPoolunConstantPoolConstantStringIntegerFloatLongDoubleClassRef StringRefFieldRef MethodRefInterfaceMethodRef NameAndType MethodHandle MethodType InvokeDynamic ConstantRef constantSizetoListOfConstantslookupConstant lookupTextlookupClassName$fBinaryConstantPool$fBinaryConstant$fBinaryConstantRef$fEqConstantRef$fShowConstantRef$fGenericConstantRef$fShowConstant $fEqConstant$fShowConstantPool$fEqConstantPoolVerificationTypeInfoVTopVIntegerVFloatVLongVDoubleVNullVUninitializedThisVObjectVUninitializedStackMapFrameType SameFrameSameLocals1StackItemFrame ChopFrame AppendFrame FullFrame StackMapFrame deltaOffset frameType DeltaOffset StackMapTable stackMapTable$fBinaryVerificationTypeInfo$fBinaryStackMapFrame$fBinaryStackMapTable$fShowVerificationTypeInfo$fEqVerificationTypeInfo$fShowStackMapFrameType$fEqStackMapFrameType$fShowStackMapFrame$fEqStackMapFrame$fShowStackMapTable$fEqStackMapTable$fGenericStackMapTable ExceptionsexceptionIndexTable'exceptionIndexTable$fBinaryExceptions$fShowExceptions$fEqExceptions$fGenericExceptions ConstantValueconstantValueIndex$fBinaryConstantValue$fShowConstantValue$fEqConstantValue$fGenericConstantValue ByteCodeOpr ArrayLoad ArrayStorePushLoadStore BinaryOprNegBitOpr IncrLocalCastCastDown CompareLongsCompareFloatingIfIfRefGotoJsrRet TableSwitch LookupSwitchGetPutInvokeNewNewArray ArrayLengthThrow CheckCast InstanceOfMonitor MultiNewArrayReturnNopPopDupDupX1DupX2SwapCmpOprCEqCNeCLtCGeCGtCLeIncrementAmountIWideISingle LocalAddressLWideLSingle LongOffsetOffsetShLShRUShRAndOrXOrBinOprAddSubMulDivRemCNullCIntM1CInt0CInt1CInt2CInt3CInt4CInt5CLong0CLong1CFloat0CFloat1CFloat2CDouble0CDouble1CByteCShortCHalfRefCRefWordSizeOneOrTwoOneTwo FieldAccess FldStaticFldField Invokation InvkSpecial InvkVirtual InvkStatic InvkInterface InvkDynamic ArrayTypeABooleanAByteACharAShortAIntALongAFloatADoubleARef LocalTypeLIntLLongLFloatLDoubleLRefSmallArithmeticTypeMByteMCharMShortArithmeticTypeMIntMLongMFloatMDouble ByteCodeInstoffsetopcodeExceptionTablestartendhandler catchTypeByteCode unByteCodeCodemaxStack maxLocalsbytecodeexceptionTable attributes$fBinaryByteCodeOpr$fBinaryByteCodeInst$fBinaryExceptionTable$fBinaryByteCode $fBinaryCode$fShowExceptionTable$fEqExceptionTable$fGenericExceptionTable$fShowArithmeticType$fEqArithmeticType$fEnumArithmeticType$fBoundedArithmeticType$fShowSmallArithmeticType$fEqSmallArithmeticType$fEnumSmallArithmeticType$fBoundedSmallArithmeticType$fShowLocalType $fEqLocalType$fEnumLocalType$fBoundedLocalType$fShowArrayType $fEqArrayType$fShowInvokation$fEqInvokation$fShowFieldAccess$fEqFieldAccess$fShowOneOrTwo $fOrdOneOrTwo$fBoundedOneOrTwo $fEqOneOrTwo$fEnumOneOrTwo $fShowBinOpr $fEqBinOpr $fShowBitOpr $fEqBitOpr$fShowLocalAddress$fEqLocalAddress$fShowIncrementAmount$fEqIncrementAmount $fShowCmpOpr $fEqCmpOpr$fShowByteCodeOpr$fEqByteCodeOpr$fShowByteCodeInst$fEqByteCodeInst$fGenericByteCodeInst$fShowByteCode $fEqByteCode $fShowCode$fEqCode $fGenericCodeBootstrapMethod methodIndex arguments'BootstrapMethodsmethods'methods arguments$fBinaryBootstrapMethod$fBinaryBootstrapMethods$fShowBootstrapMethod$fEqBootstrapMethod$fGenericBootstrapMethod$fShowBootstrapMethods$fEqBootstrapMethods$fGenericBootstrapMethods IsAttributeattrName fromAttributefromAttribute'Const Attribute aNameIndexaInfo'aInfoaNamecodeStackMapTable$fIsAttributeBootstrapMethods$fIsAttributeStackMapTable$fIsAttributeExceptions$fIsAttributeConstantValue$fIsAttributeCode$fBinaryAttribute$fShowAttribute $fEqAttribute$fGenericAttribute FAccessFlagFPublicFPrivate FProtectedFStaticFFinal FSynchronizedFUnused6 FVolatile FTransient FSyntheticFEnum CAccessFlagCPublicCFinalCSuper CAbstract CSynthetic CAnnotationCEnum MAccessFlagMPublicMPrivate MProtectedMStaticMFinal MSynchronizedMBridgeMVarargsMNative MAbstract MStrictFP MSyntheticmflagscflagsfflags$fEnumishFAccessFlag$fEnumishCAccessFlag$fEnumishMAccessFlag$fOrdMAccessFlag$fShowMAccessFlag$fEqMAccessFlag$fOrdCAccessFlag$fShowCAccessFlag$fEqCAccessFlag$fOrdFAccessFlag$fShowFAccessFlag$fEqFAccessFlag fAccessFlags fNameIndexfDescriptorIndex fAttributesfConstantValue $fBinaryField $fShowField $fEqField$fGenericField mAccessFlags' mNameIndexmDescriptorIndex mAttributes' mAccessFlags mAttributesmName mDescriptormCode mExceptions$fBinaryMethod $fShowMethod $fEqMethod$fGenericMethod cMagicNumber cMinorVersion cMajorVersion cConstantPool cAccessFlagscThisClassIndexcSuperClassIndex cInterfaces'cFields' cMethods' cAttributes' cInterfacescFieldscMethods cThisClass cSuperClass cAttributescBootstrapMethods$fBinaryClassFile$fShowClassFile $fEqClassFile$fGenericClassFiledecodeClassFile#text-1.2.2.2-KC7dWoG09dA1F6jKj5GSqhData.Text.InternalTextbaseGHC.BaseNothingunConstreadFromStrictbytestring-0.10.8.1Data.ByteString.Lazy.Internal