File tree Expand file tree Collapse file tree 2 files changed +12
-18
lines changed
Sources/WasmKit/Execution Expand file tree Collapse file tree 2 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -1767,15 +1767,12 @@ extension Execution {
17671767import _CWasmKit. InlineCode
17681768
17691769extension Instruction {
1770- private static let handlers : [ UInt64 ] = withUnsafePointer ( to: wasmkit_tc_exec_handlers) {
1771- let count = MemoryLayout . size ( ofValue: wasmkit_tc_exec_handlers) / MemoryLayout< wasmkit_tc_exec> . size
1772- return $0. withMemoryRebound ( to: UInt64 . self, capacity: count) {
1773- Array ( UnsafeBufferPointer ( start: $0, count: count) )
1774- }
1775- }
1776-
1777- @inline ( never)
17781770 var handler : UInt64 {
1779- return Self . handlers [ Int ( self . opcodeID) ]
1771+ return withUnsafePointer ( to: wasmkit_tc_exec_handlers) {
1772+ let count = MemoryLayout . size ( ofValue: wasmkit_tc_exec_handlers) / MemoryLayout< wasmkit_tc_exec> . size
1773+ return $0. withMemoryRebound ( to: UInt64 . self, capacity: count) {
1774+ $0 [ Int ( self . opcodeID) ]
1775+ }
1776+ }
17801777 }
17811778}
Original file line number Diff line number Diff line change @@ -436,16 +436,13 @@ enum VMGen {
436436 import _CWasmKit.InlineCode
437437
438438 extension Instruction {
439- private static let handlers: [UInt64] = withUnsafePointer(to: wasmkit_tc_exec_handlers) {
440- let count = MemoryLayout.size(ofValue: wasmkit_tc_exec_handlers) / MemoryLayout<wasmkit_tc_exec>.size
441- return $0.withMemoryRebound(to: UInt64.self, capacity: count) {
442- Array(UnsafeBufferPointer(start: $0, count: count))
443- }
444- }
445-
446- @inline(never)
447439 var handler: UInt64 {
448- return Self.handlers[Int(self.opcodeID)]
440+ return withUnsafePointer(to: wasmkit_tc_exec_handlers) {
441+ let count = MemoryLayout.size(ofValue: wasmkit_tc_exec_handlers) / MemoryLayout<wasmkit_tc_exec>.size
442+ return $0.withMemoryRebound(to: UInt64.self, capacity: count) {
443+ $0[Int(self.opcodeID)]
444+ }
445+ }
449446 }
450447 }
451448
You can’t perform that action at this time.
0 commit comments