Skip to content

Commit be671ee

Browse files
mi-acV8-internal LUCI CQ
authored andcommitted
Revert "Simplify force-compilation generator"
This reverts commit 57da3ab. Reason for revert: The simplification doesn't take the swarm mode into account. Original change's description: > Simplify force-compilation generator > > This merges the code of the two generators forcing Maglev or > Turbofan compilation. The separation is probably not adding any > value. > > This also doubles the weight of the resulting generator as local > experiments show that it's called a bit too rarely. Probably > due to other generators being added over time. > > Fly-by: Remove a counter-productive generator for Dumpling. > > Bug: 465497343 > Change-Id: I208fc1ba47caa3b3d0f2d672b72b527e001a0f45 > Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9020158 > Reviewed-by: Dominik Klemba <tacet@google.com> > Commit-Queue: Michael Achenbach <machenbach@google.com> Bug: 465497343 Change-Id: I98fdb06431c296b7a516502899b6a94712cb3dcd Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9026358 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Michael Achenbach <machenbach@google.com>
1 parent 4e27e74 commit be671ee

5 files changed

Lines changed: 30 additions & 7 deletions

File tree

Sources/FuzzilliCli/Profiles/V8CommonProfile.swift

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func chooseArgumentLists(_ b: ProgramBuilder, forCalling f: Variable) -> ([Varia
9595
return (args[0], args[1], args[2], args[3])
9696
}
9797

98-
public let ForceCompilationGenerator = CodeGenerator("ForceCompilationGenerator", inputs: .required(.function())) { b, f in
98+
public let ForceTurboFanCompilationGenerator = CodeGenerator("ForceTurboFanCompilationGenerator", inputs: .required(.function())) { b, f in
9999
assert(b.type(of: f).Is(.function()))
100100
let (args1, args2, args3, args4) = chooseArgumentLists(b, forCalling: f)
101101

@@ -108,8 +108,25 @@ public let ForceCompilationGenerator = CodeGenerator("ForceCompilationGenerator"
108108
b.callFunction(f, withArgs: args2, guard: guardCalls)
109109
b.callFunction(f, withArgs: args3, guard: guardCalls)
110110

111-
let optimizer = chooseUniform(from: ["OptimizeFunctionOnNextCall", "OptimizeMaglevOnNextCall"])
112-
b.eval("%\(optimizer)(%@)", with: [f]);
111+
b.eval("%OptimizeFunctionOnNextCall(%@)", with: [f]);
112+
113+
b.callFunction(f, withArgs: args4, guard: guardCalls)
114+
}
115+
116+
public let ForceMaglevCompilationGenerator = CodeGenerator("ForceMaglevCompilationGenerator", inputs: .required(.function())) { b, f in
117+
assert(b.type(of: f).Is(.function()))
118+
let (args1, args2, args3, args4) = chooseArgumentLists(b, forCalling: f)
119+
120+
let guardCalls = probability(0.5)
121+
122+
b.callFunction(f, withArgs: args1, guard: guardCalls)
123+
124+
b.eval("%PrepareFunctionForOptimization(%@)", with: [f]);
125+
126+
b.callFunction(f, withArgs: args2, guard: guardCalls)
127+
b.callFunction(f, withArgs: args3, guard: guardCalls)
128+
129+
b.eval("%OptimizeMaglevOnNextCall(%@)", with: [f]);
113130

114131
b.callFunction(f, withArgs: args4, guard: guardCalls)
115132
}

Sources/FuzzilliCli/Profiles/V8DumplingProfile.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ let v8DumplingProfile = Profile(
125125

126126
additionalCodeGenerators: [
127127
(ForceJITCompilationThroughLoopGenerator, 5),
128-
(ForceCompilationGenerator, 20),
128+
(ForceTurboFanCompilationGenerator, 5),
129+
(ForceMaglevCompilationGenerator, 5),
130+
(TurbofanVerifyTypeGenerator, 10),
131+
129132
(V8GcGenerator, 10),
130133
],
131134

Sources/FuzzilliCli/Profiles/V8HoleFuzzingProfile.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ let v8HoleFuzzingProfile = Profile(
7070

7171
additionalCodeGenerators: [
7272
(ForceJITCompilationThroughLoopGenerator, 5),
73-
(ForceCompilationGenerator, 20),
73+
(ForceTurboFanCompilationGenerator, 5),
74+
(ForceMaglevCompilationGenerator, 5),
7475
(V8GcGenerator, 10),
7576
(HoleLeakGenerator, 25),
7677
],

Sources/FuzzilliCli/Profiles/V8Profile.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ let v8Profile = Profile(
5959

6060
additionalCodeGenerators: [
6161
(ForceJITCompilationThroughLoopGenerator, 5),
62-
(ForceCompilationGenerator, 20),
62+
(ForceTurboFanCompilationGenerator, 5),
63+
(ForceMaglevCompilationGenerator, 5),
6364
(TurbofanVerifyTypeGenerator, 10),
6465

6566
(WorkerGenerator, 10),

Sources/FuzzilliCli/Profiles/V8SandboxProfile.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,8 @@ let v8SandboxProfile = Profile(
522522

523523
additionalCodeGenerators: [
524524
(ForceJITCompilationThroughLoopGenerator, 5),
525-
(ForceCompilationGenerator, 20),
525+
(ForceTurboFanCompilationGenerator, 5),
526+
(ForceMaglevCompilationGenerator, 5),
526527
(V8GcGenerator, 10),
527528
(WasmStructGenerator, 5),
528529
(WasmArrayGenerator, 5),

0 commit comments

Comments
 (0)