Skip to content

Commit 03790c6

Browse files
author
dudcom
committed
remove shizo async
1 parent be3061f commit 03790c6

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

Package.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,10 @@ let package = Package(
6363
"Protobuf/README.md",
6464
"Protobuf/gen_programproto.py"],
6565
resources: [
66-
// The ast.proto file is required by the node.js parser and stuff
6766
.copy("Protobuf/ast.proto"),
68-
.copy("Compiler/Parser")]),
67+
.copy("Compiler/Parser/parser.js"),
68+
.copy("Compiler/Parser/package.json"),
69+
.copy("Compiler/Parser/README.md")]),
6970

7071
.executableTarget(name: "REPRLRun",
7172
dependencies: ["libreprl"]),

Sources/Fuzzilli/Compiler/JavaScriptParser.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public class JavaScriptParser {
3636

3737
// This will only work if the executor is node as we will need to use node modules.
3838

39-
// The Parser/ subdirectory is copied verbatim into the module bundle, see Package.swift.
40-
self.parserScriptPath = Bundle.module.path(forResource: "parser", ofType: "js", inDirectory: "Parser")!
39+
// Parser files are in Compiler/Parser in the module bundle, see Package.swift.
40+
self.parserScriptPath = Bundle.module.path(forResource: "parser", ofType: "js", inDirectory: "Compiler/Parser")!
4141

4242
// Check if the parser works. If not, it's likely because its node.js dependencies have not been installed.
4343
do {

Sources/Fuzzilli/Minimization/DeduplicatingReducer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// Attempts deduplicate variables containing the same values.
1616
struct DeduplicatingReducer: Reducer {
17-
func reduce(with helper: MinimizationHelper) async {
17+
func reduce(with helper: MinimizationHelper) {
1818
// Currently we only handle CreateNamedVariable, but the code could easily be
1919
// extended to cover other types of values as well.
2020
// It's not obvious however which other values would benefit from this.
@@ -66,7 +66,7 @@ struct DeduplicatingReducer: Reducer {
6666
}
6767

6868
if !replacements.isEmpty {
69-
await helper.tryReplacements(replacements)
69+
helper.tryReplacements(replacements)
7070
}
7171
}
7272
}

Sources/Fuzzilli/Minimization/GenericInstructionReducer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
/// Removes simple instructions from a program if they are not required.
1616
struct GenericInstructionReducer: Reducer {
17-
func reduce(with helper: MinimizationHelper) async {
17+
func reduce(with helper: MinimizationHelper) {
1818
for instr in helper.code.reversed() {
1919
if !instr.isSimple || instr.isNop {
2020
continue
2121
}
2222

23-
await helper.tryNopping(instructionAt: instr.index)
23+
helper.tryNopping(instructionAt: instr.index)
2424
}
2525
}
2626
}

Sources/Fuzzilli/Minimization/LoopSimplifier.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct LoopSimplifier: Reducer {
2626
// (if e.g. the loop is necessary to trigger JIT compilation) and so we test each reduction multiple times.
2727
private let numTestExecutions = 3
2828

29-
func reduce(with helper: MinimizationHelper) async {
29+
func reduce(with helper: MinimizationHelper) {
3030
/// Here we keep blocks (i.e. something like an iterator) in use even while changing the underlying code.
3131
/// This works because the iteration order visits inner blocks before outer blocks, so we will never change
3232
/// block instructions that we will visit later on.
@@ -221,7 +221,7 @@ struct LoopSimplifier: Reducer {
221221
} else {
222222
replacement = Instruction(BeginRepeatLoop(iterations: numIterations, exposesLoopCounter: false))
223223
}
224-
if await helper.tryReplacing(instructionAt: group.head, with: replacement, numExecutions: numTestExecutions) {
224+
if helper.tryReplacing(instructionAt: group.head, with: replacement, numExecutions: numTestExecutions) {
225225
return
226226
}
227227
}
@@ -237,7 +237,7 @@ struct LoopSimplifier: Reducer {
237237
newCode[headerIndex] = Instruction(BeginRepeatLoop(iterations: numIterations, exposesLoopCounter: false))
238238
}
239239
// After this change, the variable numbers may no longer be sequential as we may have removed instructions with inner outputs. So we need to also renumber the variables.
240-
if await helper.tryReplacing(range: range, with: newCode, renumberVariables: true, numExecutions: numTestExecutions) {
240+
if helper.tryReplacing(range: range, with: newCode, renumberVariables: true, numExecutions: numTestExecutions) {
241241
return
242242
}
243243
}
@@ -326,6 +326,6 @@ struct LoopSimplifier: Reducer {
326326
}
327327

328328
// We may have changed the order of variable declarations, so we need to renumber the variables.
329-
await helper.tryReplacements(replacements, renumberVariables: true, numExecutions: numTestExecutions)
329+
helper.tryReplacements(replacements, renumberVariables: true, numExecutions: numTestExecutions)
330330
}
331331
}

Sources/Fuzzilli/Minimization/VariadicInputReducer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
/// Reducer to remove inputs from variadic operations.
1616
struct VariadicInputReducer: Reducer {
17-
func reduce(with helper: MinimizationHelper) async {
17+
func reduce(with helper: MinimizationHelper) {
1818
for instr in helper.code {
1919
guard instr.isVariadic else { continue }
2020
let index = instr.index
@@ -84,7 +84,7 @@ struct VariadicInputReducer: Reducer {
8484

8585
let inouts = instr.inputs.dropLast() + instr.outputs + instr.innerOutputs
8686
instr = Instruction(newOp, inouts: inouts, flags: instr.flags)
87-
} while await helper.tryReplacing(instructionAt: index, with: instr)
87+
} while helper.tryReplacing(instructionAt: index, with: instr)
8888
}
8989
}
9090
}

Sources/Fuzzilli/Minimization/WasmTypeGroupReducer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
struct WasmTypeGroupReducer: Reducer {
16-
func reduce(with helper: MinimizationHelper) async {
16+
func reduce(with helper: MinimizationHelper) {
1717
// Compute all candidates: intermediate operations in a data flow chain.
1818
var candidates = [Int]()
1919
var uses = VariableMap<Int>()
@@ -49,6 +49,6 @@ struct WasmTypeGroupReducer: Reducer {
4949
let newInstr = Instruction(WasmEndTypeGroup(typesCount: newInoutsMap.count), inouts: newInouts, flags: .empty)
5050
replacements.append((candidate, newInstr))
5151
}
52-
await helper.tryReplacements(replacements, renumberVariables: true)
52+
helper.tryReplacements(replacements, renumberVariables: true)
5353
}
5454
}

0 commit comments

Comments
 (0)