Skip to content

Commit 7c4c316

Browse files
WasmParser: Specialize parseExpression for Translator
1 parent 61233ec commit 7c4c316

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Sources/WasmParser/Stream/ByteStream.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public final class StaticByteStream: ByteStream {
99
currentIndex = bytes.startIndex
1010
}
1111

12-
init(bytes: ArraySlice<UInt8>) {
12+
public init(bytes: ArraySlice<UInt8>) {
1313
self.bytes = bytes
1414
currentIndex = bytes.startIndex
1515
}

Sources/WasmParser/WasmParser.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ extension Code {
113113
/// }
114114
/// }
115115
/// ````
116+
@inlinable
116117
public func parseExpression<V: InstructionVisitor>(visitor: inout V) throws {
117118
let parser = Parser(stream: StaticByteStream(bytes: self.expression), features: self.features, hasDataCount: self.hasDataCount)
118119
var lastCode: InstructionCode?

Sources/WasmParser/WasmTypes.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ public struct Code {
1010
public let expression: ArraySlice<UInt8>
1111

1212
// Parser state used to parse the expression body lazily
13+
@usableFromInline
1314
internal let hasDataCount: Bool
15+
@usableFromInline
1416
internal let features: WasmFeatureSet
1517
}
1618

0 commit comments

Comments
 (0)