Skip to content

Commit 57da3ab

Browse files
mi-acV8-internal LUCI CQ
authored andcommitted
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>
1 parent b7df828 commit 57da3ab

5 files changed

Lines changed: 7 additions & 30 deletions

File tree

Sources/FuzzilliCli/Profiles/V8CommonProfile.swift

Lines changed: 3 additions & 20 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 ForceTurboFanCompilationGenerator = CodeGenerator("ForceTurboFanCompilationGenerator", inputs: .required(.function())) { b, f in
98+
public let ForceCompilationGenerator = CodeGenerator("ForceCompilationGenerator", 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,25 +108,8 @@ public let ForceTurboFanCompilationGenerator = CodeGenerator("ForceTurboFanCompi
108108
b.callFunction(f, withArgs: args2, guard: guardCalls)
109109
b.callFunction(f, withArgs: args3, guard: guardCalls)
110110

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]);
111+
let optimizer = chooseUniform(from: ["OptimizeFunctionOnNextCall", "OptimizeMaglevOnNextCall"])
112+
b.eval("%\(optimizer)(%@)", with: [f]);
130113

131114
b.callFunction(f, withArgs: args4, guard: guardCalls)
132115
}

Sources/FuzzilliCli/Profiles/V8DumplingProfile.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,7 @@ let v8DumplingProfile = Profile(
106106

107107
additionalCodeGenerators: [
108108
(ForceJITCompilationThroughLoopGenerator, 5),
109-
(ForceTurboFanCompilationGenerator, 5),
110-
(ForceMaglevCompilationGenerator, 5),
111-
(TurbofanVerifyTypeGenerator, 10),
112-
109+
(ForceCompilationGenerator, 20),
113110
(V8GcGenerator, 10),
114111
],
115112

Sources/FuzzilliCli/Profiles/V8HoleFuzzingProfile.swift

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

7171
additionalCodeGenerators: [
7272
(ForceJITCompilationThroughLoopGenerator, 5),
73-
(ForceTurboFanCompilationGenerator, 5),
74-
(ForceMaglevCompilationGenerator, 5),
73+
(ForceCompilationGenerator, 20),
7574
(V8GcGenerator, 10),
7675
(HoleLeakGenerator, 25),
7776
],

Sources/FuzzilliCli/Profiles/V8Profile.swift

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

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

6665
(WorkerGenerator, 10),

Sources/FuzzilliCli/Profiles/V8SandboxProfile.swift

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

523523
additionalCodeGenerators: [
524524
(ForceJITCompilationThroughLoopGenerator, 5),
525-
(ForceTurboFanCompilationGenerator, 5),
526-
(ForceMaglevCompilationGenerator, 5),
525+
(ForceCompilationGenerator, 20),
527526
(V8GcGenerator, 10),
528527
(WasmStructGenerator, 5),
529528
(WasmArrayGenerator, 5),

0 commit comments

Comments
 (0)