@@ -43,18 +43,18 @@ private enum Prefix: UInt8 {
4343
4444// This maps ILTypes to their respective binary encoding.
4545private let ILTypeMapping : [ ILType : Data ] = [
46- . wasmi32 : Data ( [ 0x7f ] ) ,
46+ . wasmi32 : Data ( [ 0x7F ] ) ,
4747 . wasmi64 : Data ( [ 0x7E ] ) ,
4848 . wasmf32 : Data ( [ 0x7D ] ) ,
4949 . wasmf64 : Data ( [ 0x7C ] ) ,
5050 . wasmSimd128: Data ( [ 0x7B ] ) ,
5151 . wasmPackedI8: Data ( [ 0x78 ] ) ,
5252 . wasmPackedI16: Data ( [ 0x77 ] ) ,
5353
54- . bigint : Data ( [ 0x7e ] ) , // Maps to .wasmi64
55- . jsAnything: Data ( [ 0x6f ] ) , // Maps to .wasmExternRef
56- . integer: Data ( [ 0x7f ] ) , // Maps to .wasmi32
57- . number: Data ( [ 0x7d ] ) // Maps to .wasmf32
54+ . bigint : Data ( [ 0x7E ] ) , // Maps to .wasmi64
55+ . jsAnything: Data ( [ 0x6F ] ) , // Maps to .wasmExternRef
56+ . integer: Data ( [ 0x7F ] ) , // Maps to .wasmi32
57+ . number: Data ( [ 0x7D ] ) // Maps to .wasmf32
5858]
5959
6060/// This is the main compiler for Wasm instructions.
@@ -531,19 +531,19 @@ public class WasmLifter {
531531 private func encodeAbstractHeapType( _ heapType: WasmAbstractHeapType ) -> Data {
532532 switch ( heapType) {
533533 case . WasmExtern:
534- return Data ( [ 0x6f ] )
534+ return Data ( [ 0x6F ] )
535535 case . WasmFunc:
536536 return Data ( [ 0x70 ] )
537537 case . WasmAny:
538- return Data ( [ 0x6e ] )
538+ return Data ( [ 0x6E ] )
539539 case . WasmEq:
540- return Data ( [ 0x6d ] )
540+ return Data ( [ 0x6D ] )
541541 case . WasmI31:
542- return Data ( [ 0x6c ] )
542+ return Data ( [ 0x6C ] )
543543 case . WasmStruct:
544- return Data ( [ 0x6b ] )
544+ return Data ( [ 0x6B ] )
545545 case . WasmArray:
546- return Data ( [ 0x6a ] )
546+ return Data ( [ 0x6A ] )
547547 case . WasmExn:
548548 return Data ( [ 0x69 ] )
549549 case . WasmNone:
@@ -595,11 +595,11 @@ public class WasmLifter {
595595
596596 private func buildTypeEntry( for desc: WasmTypeDescription , data: inout Data ) throws {
597597 if let arrayDesc = desc as? WasmArrayTypeDescription {
598- data += [ 0x5e ]
598+ data += [ 0x5E ]
599599 data += try encodeType ( arrayDesc. elementType)
600600 data += [ arrayDesc. mutability ? 1 : 0 ]
601601 } else if let structDesc = desc as? WasmStructTypeDescription {
602- data += [ 0x5f ]
602+ data += [ 0x5F ]
603603 data += Leb128 . unsignedEncode ( structDesc. fields. count)
604604 for field in structDesc. fields {
605605 data += try encodeType ( field. type)
@@ -639,7 +639,7 @@ public class WasmLifter {
639639 // these signatures could contain wasm-gc types.
640640 for typeGroupIndex in typeGroups. sorted ( ) {
641641 let typeGroup = typer. getTypeGroup ( typeGroupIndex)
642- temp += [ 0x4e ]
642+ temp += [ 0x4E ]
643643 temp += Leb128 . unsignedEncode ( typeGroup. count)
644644 for typeDef in typeGroup {
645645 try buildTypeEntry ( for: typer. getTypeDescription ( of: typeDef) , data: & temp)
@@ -894,7 +894,7 @@ public class WasmLifter {
894894 // Starting index. Assumes all entries are continuous.
895895 temp += table. isTable64 ? [ 0x42 ] : [ 0x41 ]
896896 temp += Leb128 . unsignedEncode ( definedEntries [ 0 ] . indexInTable)
897- temp += [ 0x0b ] // end
897+ temp += [ 0x0B ] // end
898898 // elemkind
899899 temp += [ 0x00 ]
900900 // entry count
@@ -955,7 +955,7 @@ public class WasmLifter {
955955 let localsDefSizeInBytes = funcTemp. count
956956 // append the actual code and the end marker
957957 funcTemp += functionInfo!. code
958- funcTemp += [ 0x0b ]
958+ funcTemp += [ 0x0B ]
959959
960960 // Append the function object to the section
961961 temp += Leb128 . unsignedEncode ( funcTemp. count)
@@ -1856,10 +1856,10 @@ public class WasmLifter {
18561856 case . wasmMemoryCopy( _) :
18571857 let dstMemIdx = try resolveIdx ( ofType: . memory, for: wasmInstruction. input ( 0 ) )
18581858 let srcMemIdx = try resolveIdx ( ofType: . memory, for: wasmInstruction. input ( 1 ) )
1859- return Data ( [ 0xFC , 0x0a ] ) + Leb128. unsignedEncode ( dstMemIdx) + Leb128. unsignedEncode ( srcMemIdx)
1859+ return Data ( [ 0xFC , 0x0A ] ) + Leb128. unsignedEncode ( dstMemIdx) + Leb128. unsignedEncode ( srcMemIdx)
18601860 case . wasmMemoryFill( _) :
18611861 let memoryIdx = try resolveIdx ( ofType: . memory, for: wasmInstruction. input ( 0 ) )
1862- return Data ( [ 0xFC , 0x0b ] ) + Leb128. unsignedEncode ( memoryIdx)
1862+ return Data ( [ 0xFC , 0x0B ] ) + Leb128. unsignedEncode ( memoryIdx)
18631863 case . wasmMemoryInit( _) :
18641864 let dataSegmentIdx = resolveDataSegmentIdx ( for: wasmInstruction. input ( 0 ) )
18651865 let memoryIdx = try resolveIdx ( ofType: . memory, for: wasmInstruction. input ( 1 ) )
@@ -1948,7 +1948,7 @@ public class WasmLifter {
19481948 case . wasmThrow( _) :
19491949 return Data ( [ 0x08 ] + Leb128. unsignedEncode ( try resolveIdx ( ofType: . tag, for: wasmInstruction. input ( 0 ) ) ) )
19501950 case . wasmThrowRef( _) :
1951- return Data ( [ 0x0a ] )
1951+ return Data ( [ 0x0A ] )
19521952 case . wasmRethrow( _) :
19531953 let blockDepth = try branchDepthFor ( label: wasmInstruction. input ( 0 ) )
19541954 return Data ( [ 0x09 ] + Leb128. unsignedEncode ( blockDepth) )
0 commit comments