Skip to content

Commit 283cd7f

Browse files
LiedtkeV8-internal LUCI CQ
authored andcommitted
[v8] Add generator for %AllocateHeapNumberWithValue()
V8-side change: https://crrev.com/c/7623762 Bug: 487620644 Change-Id: Iee848582cf8ed19085daea8c7715bf8c3f54f3d9 Reviewed-on: https://chrome-internal-review.googlesource.com/c/v8/fuzzilli/+/9064480 Reviewed-by: Michael Achenbach <machenbach@google.com> Commit-Queue: Matthias Liedtke <mliedtke@google.com>
1 parent a247940 commit 283cd7f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Sources/FuzzilliCli/Profiles/V8CommonProfile.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ public let UndefinedNanGenerator = CodeGenerator("UndefinedNanGenerator") { b in
177177
b.eval("%GetUndefinedNaN()", hasOutput: true);
178178
}
179179

180+
public let HeapNumberGenerator = CodeGenerator("HeapNumberGenerator", inputs: .preferred(.integer))
181+
{ b, value in
182+
// This generator prefers an integer input as these have a high chance of being representable as
183+
// a Smi, meaning that we often end up with a HeapNumber that didn't have to be materialized.
184+
b.eval("%AllocateHeapNumberWithValue(%@)", with: [value], hasOutput: true);
185+
}
186+
180187
public let StringShapeGenerator = CodeGenerator("StringShapeGenerator") { b in
181188
withEqualProbability(
182189
{

Sources/FuzzilliCli/Profiles/V8Profile.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ let v8Profile = Profile(
7575
(HoleNanGenerator, 5),
7676
(UndefinedNanGenerator, 5),
7777
(StringShapeGenerator, 5),
78+
(HeapNumberGenerator, 5),
7879
],
7980

8081
additionalProgramTemplates: WeightedList<ProgramTemplate>([

0 commit comments

Comments
 (0)