Bug 167460
| Summary: | Why doesn't mandelbrot.js FTL? | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | JF Bastien <jfbastien> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | fpizlo, ggaren, jfbastien, keith_miller, mark.lam, msaboff, saam, ysuzuki |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 167149, 172216 | ||
| Bug Blocks: | |||
JF Bastien
I added a mandelbrot test in #167149 because I wanted something with nested loops and not just int32.
This happens:
$ ./current-release/bin/jsc ./JSTests/microbenchmarks/mandelbrot.js --useConcurrentJIT=0 -p a && ./Tools/Scripts/display-profiler-output a
CodeBlock #Instr Source Counts Machine Counts #Compil Inlines #Exits Last Opts Source
Base/DFG/FTL/FTLOSR Base/DFG/FTL/FTLOSR Src/Total Get/Put/Call
mandelbrot#DoqaAb 579 50989/4078434/0/0 50989/4078434/0/0 4 0/0 15 4/0/4 function mandelbrot(x, y, w, h, scene_i, scene_z, X, Y, iterations) { const max_z = 2.0; for (let i =
shade#Eqog0q 118 67/6301/0/0 67/1911/0/0 2 2/2 0 1/0/1 function i => shades[Math.round((i * (shades.length - 1)) / max_s)]
<global>#DMGh43 779 2543/3507/0/0 2543/3507/0/0 2 0/0 1 3/0/3 const max_s = 255; const hysterisis = 3; function mandelbrot(x, y, w, h, scene_i, scene_z, X, Y, itera
printable#EmK4D0 135 1524/4390/0/0 1524/4390/0/0 2 1/1 0 1/0/2 function printable(scene_i, scene_z, X, Y) { let s = ""; for (let i = 0; i < X; ++i) { for (let j = 0;
of#A2awz5 114 0/0/0/0 0/0/0/0 0 0/0 0 N/A function () { "use strict"; var length = arguments.length; var array = @isConstructor(this) ? new this
fill#AXPfsF 231 0/0/0/0 0/0/0/0 0 0/0 0 N/A function (value ) { "use strict"; if (this == null) @throwTypeError("Array.prototype.fill requires tha
toLength#ESso8n 59 0/0/0/0 0/0/0/0 0 0/0 0 N/A function (target) { "use strict"; var length = @toInteger(target); return length > 0 ? (length < @MAX_
toInteger#BxMpe8 74 0/0/0/0 0/0/0/0 0 0/0 0 N/A function (target) { "use strict"; var numberValue = @Number(target); if (numberValue !== numberValue)
> l mandelbrot
Compilation mandelbrot#DoqaAb-1-Baseline:
Total count: 3155511 Max count: 50989
Compilation mandelbrot#DoqaAb-2-DFG:
Total count: 530545 Max count: 5413
EXIT: at bc#228 due to InadequateCoverage, 5 times
Jettisoned due to BaselineLoopReoptimizationTrigger
Compilation mandelbrot#DoqaAb-3-DFG:
Total count: 1146246 Max count: 22805
EXIT: at bc#311 due to Overflow, 10 times
Jettisoned due to BaselineLoopReoptimizationTrigger
Compilation mandelbrot#DoqaAb-4-DFG:
Total count: 118896069 Max count: 4050216
That's not cool. Mandelbrot only has Number and some int32 coercion. Exit due to overflow isn't a good reason to not FTL here.
I'll investigate this at some point in time. It's not a rush, but good to fix.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Filip Pizlo
--verboseFTLFailure=true
JF Bastien
(In reply to comment #1)
> --verboseFTLFailure=true
Ah nice.
FTL rejecting node in mandelbrot#DoqaAb:[0x111984dc0->0x111984b90->0x111994c80, NoneFunctionCall, 579]:
349:<!0:-> GetByVal(KnownCell:@342, Int32:@317, Untyped:@698, JS|MustGen|UseAsInt, Boolint32Other, ArrayStorage+OriginalArray+OutOfBounds+AsIs, R:World, W:Heap, Exits, ClobbersExit, bc#322) predicting Boolint32Other
FTL rejecting node in printable#EmK4D0:[0x111985ae0->0x111985450->0x111994d20, NoneFunctionCall, 135]:
94:<!0:-> GetByVal(KnownCell:@93, Int32:@74, Untyped:@313, JS|MustGen, Boolint32, ArrayStorage+OriginalArray+InBounds+AsIs, R:Butterfly_vectorLength,IndexedArrayStorageProperties, Exits, bc#65) predicting Boolint32
FTL rejecting <global>#DMGh43:[0x111985d10->0x1119840a0->0x111994be0, NoneGlobal, 779] because it doesn't belong to a function.
Yusuke Suzuki
(In reply to JF Bastien from comment #2)
> (In reply to comment #1)
> > --verboseFTLFailure=true
>
> Ah nice.
>
> FTL rejecting node in
> mandelbrot#DoqaAb:[0x111984dc0->0x111984b90->0x111994c80, NoneFunctionCall,
> 579]:
> 349:<!0:-> GetByVal(KnownCell:@342, Int32:@317, Untyped:@698,
> JS|MustGen|UseAsInt, Boolint32Other,
> ArrayStorage+OriginalArray+OutOfBounds+AsIs, R:World, W:Heap, Exits,
> ClobbersExit, bc#322) predicting Boolint32Other
> FTL rejecting node in
> printable#EmK4D0:[0x111985ae0->0x111985450->0x111994d20, NoneFunctionCall,
> 135]:
> 94:<!0:-> GetByVal(KnownCell:@93, Int32:@74, Untyped:@313, JS|MustGen,
> Boolint32, ArrayStorage+OriginalArray+InBounds+AsIs,
> R:Butterfly_vectorLength,IndexedArrayStorageProperties, Exits, bc#65)
> predicting Boolint32
> FTL rejecting <global>#DMGh43:[0x111985d10->0x1119840a0->0x111994be0,
> NoneGlobal, 779] because it doesn't belong to a function.
https://bugs.webkit.org/show_bug.cgi?id=172216
Yusuke Suzuki
PutByVal support is also necessary.
Yusuke Suzuki
We support it now :)