Bug 67920 - JavaScriptCore does not have baseline->speculative OSR
Summary: JavaScriptCore does not have baseline->speculative OSR
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 64279
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-11 21:17 PDT by Filip Pizlo
Modified: 2011-09-13 00:20 PDT (History)
1 user (show)

See Also:


Attachments
work in progress (140.28 KB, patch)
2011-09-11 21:19 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch (80.19 KB, patch)
2011-09-12 19:01 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch - fix style (80.50 KB, patch)
2011-09-12 19:09 PDT, Filip Pizlo
no flags Details | Formatted Diff | Diff
the patch - fix style (80.50 KB, patch)
2011-09-12 19:12 PDT, Filip Pizlo
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
the patch - fix build (80.08 KB, patch)
2011-09-12 19:30 PDT, Filip Pizlo
oliver: review+
fpizlo: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Filip Pizlo 2011-09-11 21:17:38 PDT
Tiered compilation in JavaScriptCore only produces a benefit if the code being optimized does most of its work in functions that get called repeatedly.  Hot loops in functions that don't return for a long time continue to execute old JIT code.  Fixing that requires on-stack-replacement from baseline (old JIT) code to speculative (DFG JIT) code.
Comment 1 Filip Pizlo 2011-09-11 21:19:21 PDT
Created attachment 107019 [details]
work in progress

Still working on it, but it's starting to work.
Comment 2 Filip Pizlo 2011-09-12 01:03:37 PDT
It appears that with this patch, tiered compilation is a pure win, and is probably good enough to enable in ToT.



Benchmark report for SunSpider, V8, and Kraken.

VMs tested:
"TipOfTree" at /Volumes/Data/pizlo/quinary/OpenSource/WebKitBuild/Release/jsc
"OSRExit" at /Volumes/Data/pizlo/OpenSource/WebKitBuild/Release/jsc
"OSREnter" at /Volumes/Data/pizlo/octonary/OpenSource/WebKitBuild/Release/jsc

Collected 12 samples per benchmark/VM, with 4 VM invocations per benchmark. Used 1 benchmark iteration per VM invocation for warm-up.
Used the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark execution times with 95% confidence
intervals in milliseconds.

                                            TipOfTree                OSRExit                 OSREnter            OSREnter v. TipOfTree   
SunSpider:
   3d-cube                                8.6538+-0.2445    !     9.8197+-0.2429          9.7211+-0.2500       ! definitely 1.1233x slower
   3d-morph                               7.4333+-0.1905    ?     7.5068+-0.2221          7.4015+-0.1159       
   3d-raytrace                            8.0800+-0.2070    ?     8.1327+-0.1275          8.0972+-0.1711       ?
   access-binary-trees                    3.3529+-0.0715          3.3493+-0.0639    ?     3.4034+-0.1113       ? might be 1.0151x slower
   access-fannkuch                       11.7457+-0.1979    ?    11.8288+-0.2726         11.5642+-0.2437         might be 1.0157x faster
   access-nbody                           4.2957+-0.0658          4.2564+-0.1403          4.1282+-0.0654       ^ definitely 1.0406x faster
   access-nsieve                          2.5446+-0.0719    !     2.8076+-0.0829    ^     2.6584+-0.0650       ? might be 1.0447x slower
   bitops-3bit-bits-in-byte               1.7152+-0.0510    !     1.8190+-0.0393          1.7013+-0.0950       
   bitops-bits-in-byte                    3.3163+-0.0906    !     5.3742+-0.1637    ^     3.1249+-0.0470       ^ definitely 1.0613x faster
   bitops-bitwise-and                     3.6230+-0.1118          3.6229+-0.0979          3.5523+-0.1120         might be 1.0199x faster
   bitops-nsieve-bits                     5.4752+-0.1264          5.2639+-0.1630    ?     5.2954+-0.1245         might be 1.0340x faster
   controlflow-recursive                  1.9879+-0.0458    ?     2.0770+-0.0553          1.9895+-0.0495       ?
   crypto-aes                             7.6468+-0.2855    ?     8.0935+-0.3318          7.6487+-0.1677       ?
   crypto-md5                             2.8797+-0.1083          2.8015+-0.0864    ?     2.8928+-0.1564       ?
   crypto-sha1                            2.2917+-0.0576    ^     2.1669+-0.0464    ?     2.2158+-0.0414         might be 1.0343x faster
   date-format-tofte                     12.4361+-0.2173         12.3944+-0.3561    ?    12.4613+-0.3561       ?
   date-format-xparb                     10.7844+-0.2669    ?    10.8425+-0.3045         10.6484+-0.2471         might be 1.0128x faster
   math-cordic                            6.4941+-0.1730          6.2070+-0.1304    ?     6.2946+-0.1683         might be 1.0317x faster
   math-partial-sums                      7.5474+-0.1556          7.4442+-0.2342          7.4153+-0.1500         might be 1.0178x faster
   math-spectral-norm                     2.4813+-0.0507    !     2.6118+-0.0580          2.5514+-0.0353       ? might be 1.0283x slower
   regexp-dna                            10.7326+-0.1828    ?    10.7935+-0.2052    ?    10.9701+-0.3206       ? might be 1.0221x slower
   string-base64                          7.9637+-0.2596          7.8483+-0.2541    ?     7.9952+-0.2541       ?
   string-fasta                           8.5115+-0.3501    !     9.3982+-0.2687          9.2106+-0.2616       ! definitely 1.0821x slower
   string-tagcloud                       12.6699+-0.3420    ?    12.9489+-0.4807         12.6656+-0.3720       
   string-unpack-code                    20.9736+-0.5323    ?    21.0942+-0.6218         20.7491+-0.4228         might be 1.0108x faster
   string-validate-input                  9.4274+-0.3451    ^     8.6838+-0.3201    ?     8.8235+-0.3177         might be 1.0684x faster

   <arithmetic>                           7.1178+-0.0319    !     7.2764+-0.0511    ^     7.1223+-0.0569       ?
   <geometric>                            5.8095+-0.0246    !     5.9878+-0.0418    ^     5.8014+-0.0390       
   <harmonic>                             4.6563+-0.0306    !     4.8303+-0.0449    ^     4.6390+-0.0377       

                                            TipOfTree                OSRExit                 OSREnter            OSREnter v. TipOfTree   
V8:
   crypto                                91.3270+-0.5783    ^    84.8944+-0.7944    ?    85.1714+-0.5082       ^ definitely 1.0723x faster
   deltablue                            280.4096+-1.6747    ^   267.4857+-2.5117    ?   271.4189+-1.8715       ^ definitely 1.0331x faster
   earley-boyer                         107.2856+-1.4692        106.8650+-0.3474        106.8528+-0.7143       
   raytrace                              87.1412+-0.5858    !    88.5495+-0.4171    ^    87.3666+-0.6869       ?
   regexp                               116.8110+-0.5595    ?   117.8736+-0.9676        116.5011+-1.3460       
   richards                             228.9993+-0.9538    ^   215.3427+-0.2853    !   222.4097+-1.0724       ^ definitely 1.0296x faster
   splay                                179.7157+-1.0183    ?   181.3913+-0.7650        180.0017+-0.9076       ?

   <arithmetic>                         155.9556+-0.4211    ^   151.7718+-0.4730    !   152.8175+-0.2995       ^ definitely 1.0205x faster
   <geometric>                          141.7613+-0.4067    ^   138.7326+-0.4030    ?   139.0711+-0.2878       ^ definitely 1.0193x faster
   <harmonic>                           130.0867+-0.4418    ^   127.7069+-0.4133        127.5706+-0.3208       ^ definitely 1.0197x faster

                                            TipOfTree                OSRExit                 OSREnter            OSREnter v. TipOfTree   
Kraken:
   ai-astar                            1085.3365+-5.9033    !  1118.8661+-6.9293       1114.5020+-5.7857       ! definitely 1.0269x slower
   audio-beat-detection                 480.7979+-2.1540        474.5989+-6.6917        468.2753+-2.6514       ^ definitely 1.0267x faster
   audio-dft                            415.4874+-2.1583    !   422.8530+-3.5811        420.1431+-2.9278       ? might be 1.0112x slower
   audio-fft                            369.3367+-1.4110    ^   365.8327+-1.2752    ^   361.9488+-1.3125       ^ definitely 1.0204x faster
   audio-oscillator                     377.5589+-1.8711    ^   357.7255+-1.5519    ^   352.3107+-1.0252       ^ definitely 1.0717x faster
   imaging-darkroom                     529.9963+-3.4289    ^   508.8806+-1.1331    ?   512.4397+-7.4576       ^ definitely 1.0343x faster
   imaging-desaturate                   622.7195+-5.3329    ^   571.2379+-3.0810    ^   216.0253+-0.5649       ^ definitely 2.8826x faster
   imaging-gaussian-blur               1722.3304+-6.0498    !  2271.0239+-4.6600    ^  1722.6744+-7.9226       ?
   json-parse-financial                  55.3235+-0.9510         55.1895+-0.5653    ?    55.4367+-0.6541       ?
   json-stringify-tinderbox              69.0833+-0.3308         68.8264+-0.3208    ^    67.9154+-0.4609       ^ definitely 1.0172x faster
   stanford-crypto-aes                  150.6488+-0.9144    !   152.5331+-0.9238    ^   150.7415+-0.4415       ?
   stanford-crypto-ccm                  123.7896+-1.0019    ?   124.2190+-0.7717    ?   124.4001+-0.7065       ?
   stanford-crypto-pbkdf2               352.5917+-4.7548    !   407.2319+-2.8103    ?   410.2262+-3.7950       ! definitely 1.1635x slower
   stanford-crypto-sha256-iterative     133.9557+-0.6957    !   152.1153+-0.5327        151.8553+-0.4600       ! definitely 1.1336x slower

   <arithmetic>                         463.4969+-0.6681    !   503.6524+-1.1248    ^   437.7782+-1.2406       ^ definitely 1.0587x faster
   <geometric>                          304.0857+-0.6485    !   312.9511+-0.5859    ^   285.0960+-0.6719       ^ definitely 1.0666x faster
   <harmonic>                           193.3201+-0.9482    !   196.2345+-0.3049    ^   187.5629+-0.6077       ^ definitely 1.0307x faster

                                            TipOfTree                OSRExit                 OSREnter            OSREnter v. TipOfTree   
All benchmarks:
   <arithmetic>                         165.2279+-0.2263    !   176.6537+-0.2824    ^   157.1021+-0.3760       ^ definitely 1.0517x faster
   <geometric>                           30.3929+-0.0773    !    31.0708+-0.1171    ^    29.7067+-0.1209       ^ definitely 1.0231x faster
   <harmonic>                             8.2311+-0.0533    !     8.5317+-0.0776    ^     8.1964+-0.0654
Comment 3 Filip Pizlo 2011-09-12 19:01:11 PDT
Created attachment 107125 [details]
the patch
Comment 4 WebKit Review Bot 2011-09-12 19:03:52 PDT
Attachment 107125 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1

Source/JavaScriptCore/jit/CompactJITCodeMap.h:160:  The parameter name "jitCodeMap" adds no information, so it should be removed.  [readability/parameter_name] [5]
Source/JavaScriptCore/jit/JITStubs.cpp:40:  Alphabetical sorting problem.  [build/include_order] [4]
Source/JavaScriptCore/jit/JITStubs.cpp:1860:  Should have only a single space after a punctuation in a comment.  [whitespace/comments] [5]
Source/JavaScriptCore/bytecode/CodeBlock.h:596:  Should have only a single space after a punctuation in a comment.  [whitespace/comments] [5]
Total errors found: 4 in 27 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Filip Pizlo 2011-09-12 19:09:19 PDT
Created attachment 107126 [details]
the patch - fix style
Comment 6 WebKit Review Bot 2011-09-12 19:11:45 PDT
Attachment 107126 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/ChangeLog', u'Source..." exit_code: 1

Source/JavaScriptCore/jit/JITStubs.cpp:1860:  Should have only a single space after a punctuation in a comment.  [whitespace/comments] [5]
Total errors found: 1 in 27 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 Filip Pizlo 2011-09-12 19:12:51 PDT
Created attachment 107127 [details]
the patch - fix style
Comment 8 Filip Pizlo 2011-09-12 19:23:23 PDT
Latest numbers, after merging.

TipOfTree: r94996
TipOfTreeDyn: r94996 with tiered compilation enabled
OSREntry: r94996 with this patch and tiered compilation enabled


Benchmark report for SunSpider, V8, and Kraken.

VMs tested:
"TipOfTree" at /Volumes/Data/pizlo/OpenSource/WebKitBuild/Release/jsc
"TipOfTreeDyn" at /Volumes/Data/pizlo/quinary/OpenSource/WebKitBuild/Release/jsc
"OSREntry" at /Volumes/Data/pizlo/octonary/OpenSource/WebKitBuild/Release/jsc

Collected 12 samples per benchmark/VM, with 4 VM invocations per benchmark. Used 1 benchmark iteration per VM invocation for warm-up.
Used the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark execution times with 95% confidence
intervals in milliseconds.

                                            TipOfTree              TipOfTreeDyn              OSREntry            OSREntry v. TipOfTree   
SunSpider:
   3d-cube                                7.7184+-0.1100    !     8.9085+-0.1620    ?     8.9214+-0.1325       ! definitely 1.1559x slower
   3d-morph                               7.4503+-0.1056    !     7.7622+-0.1635          7.6214+-0.1253       ? might be 1.0230x slower
   3d-raytrace                            7.4272+-0.1336    ?     7.5459+-0.1919    ?     7.6250+-0.2150       ? might be 1.0266x slower
   access-binary-trees                    2.2947+-0.0509    ?     2.3706+-0.1106    ?     2.4490+-0.0621       ! definitely 1.0672x slower
   access-fannkuch                       11.9483+-0.1975         11.6984+-0.2259    ?    11.9258+-1.0304       
   access-nbody                           4.3891+-0.0669          4.2874+-0.0599          4.2159+-0.0917       ^ definitely 1.0411x faster
   access-nsieve                          2.5623+-0.0878    !     2.8594+-0.0228    ^     2.5834+-0.0431       ?
   bitops-3bit-bits-in-byte               1.7385+-0.0336    !     1.8276+-0.0365    ^     1.6624+-0.0317       ^ definitely 1.0458x faster
   bitops-bits-in-byte                    3.2493+-0.0690    !     5.5825+-0.1160    ^     3.2049+-0.0624         might be 1.0139x faster
   bitops-bitwise-and                     3.5795+-0.0882    ?     3.6996+-0.0938          3.6282+-0.0949       ? might be 1.0136x slower
   bitops-nsieve-bits                     5.6046+-0.1285          5.3794+-0.1261    ?     5.4322+-0.0559         might be 1.0317x faster
   controlflow-recursive                  2.0711+-0.0439    ^     1.9854+-0.0307    ?     2.0288+-0.0526         might be 1.0208x faster
   crypto-aes                             6.6405+-0.1539    !     7.1225+-0.2580          7.0693+-0.2434       ! definitely 1.0646x slower
   crypto-md5                             2.8088+-0.0418          2.7695+-0.0662    ?     2.8314+-0.0446       ?
   crypto-sha1                            2.3172+-0.0678          2.2083+-0.0452          2.1598+-0.0469       ^ definitely 1.0729x faster
   date-format-tofte                     10.0744+-0.2586    ?    10.3379+-0.0644    ^    10.0557+-0.1534       
   date-format-xparb                      8.6629+-0.1886    ?     8.8287+-0.1612          8.5590+-0.1303         might be 1.0121x faster
   math-cordic                            6.4963+-0.1488    ^     6.2470+-0.0928    ?     6.3014+-0.0690         might be 1.0309x faster
   math-partial-sums                      7.7424+-0.1417    ^     7.4190+-0.1262    ?     7.4701+-0.1282       ^ definitely 1.0364x faster
   math-spectral-norm                     2.4844+-0.0485    !     2.5765+-0.0323          2.5679+-0.0335       ! definitely 1.0336x slower
   regexp-dna                            10.7656+-0.1135    ?    10.9759+-0.1922    ?    11.2254+-0.2329       ! definitely 1.0427x slower
   string-base64                          6.1072+-0.1020          5.8784+-0.1417          5.8057+-0.1375       ^ definitely 1.0519x faster
   string-fasta                           7.5601+-0.1272    !     8.3642+-0.1315          8.2778+-0.1067       ! definitely 1.0949x slower
   string-tagcloud                       11.9666+-0.2187    ?    12.1449+-0.1819         11.9751+-0.1859       ?
   string-unpack-code                    18.7544+-0.1948    ?    18.7719+-0.1832         18.5954+-0.2264       
   string-validate-input                  7.1293+-0.1916    ^     6.6377+-0.1308          6.4927+-0.0986       ^ definitely 1.0981x faster

   <arithmetic>                           6.5209+-0.0327    !     6.6996+-0.0190    ^     6.5648+-0.0423       ?
   <geometric>                            5.4079+-0.0257    !     5.5923+-0.0125    ^     5.4196+-0.0216       ?
   <harmonic>                             4.4293+-0.0268    !     4.5850+-0.0154    ^     4.4125+-0.0261       

                                            TipOfTree              TipOfTreeDyn              OSREntry            OSREntry v. TipOfTree   
V8:
   crypto                                93.9862+-1.1192    ^    85.1213+-0.7738    !    88.3021+-1.3944       ^ definitely 1.0644x faster
   deltablue                            275.9727+-2.3166    ^   260.9344+-2.1377    ?   263.8965+-1.5998       ^ definitely 1.0458x faster
   earley-boyer                          95.7358+-1.1461    ?    96.4736+-0.5928         95.6193+-0.8177       
   raytrace                              77.9518+-0.8902    ?    78.7043+-0.8503    ?    79.5421+-1.2368       ? might be 1.0204x slower
   regexp                               108.6761+-0.6543    ?   109.7936+-0.5208        109.4807+-0.9202       ?
   richards                             236.1509+-2.6112    ^   219.8697+-2.3076        218.7715+-1.1891       ^ definitely 1.0794x faster
   splay                                102.6694+-1.0482    ?   103.6818+-1.0776    ?   104.9136+-1.1978       ? might be 1.0219x slower

   <arithmetic>                         141.5919+-0.5536    ^   136.3684+-0.5139    ?   137.2180+-0.4638       ^ definitely 1.0319x faster
   <geometric>                          126.1949+-0.5441    ^   122.8319+-0.3350    !   123.7718+-0.4899       ^ definitely 1.0196x faster
   <harmonic>                           115.2729+-0.5685    ^   112.9720+-0.3575    !   114.0106+-0.5369       ^ definitely 1.0111x faster

                                            TipOfTree              TipOfTreeDyn              OSREntry            OSREntry v. TipOfTree   
Kraken:
   ai-astar                            1132.2278+-9.3623    ?  1139.4513+-10.9565   !  1181.6296+-13.2666      ! definitely 1.0436x slower
   audio-beat-detection                 485.6322+-4.3795        482.8488+-4.4589        479.7418+-5.5265         might be 1.0123x faster
   audio-dft                            447.0208+-8.0453        439.9793+-11.6465   ?   444.7427+-11.4764      
   audio-fft                            375.8554+-3.4366    ?   377.7592+-2.5715    ^   371.3852+-3.1369         might be 1.0120x faster
   audio-oscillator                     386.6605+-3.4668    ^   364.1778+-4.7367        358.4429+-2.7246       ^ definitely 1.0787x faster
   imaging-darkroom                     540.9640+-4.1834    ^   523.6350+-4.1609        520.7076+-6.5455       ^ definitely 1.0389x faster
   imaging-desaturate                   638.5479+-6.2265    ^   586.9443+-6.0193    ^   223.2449+-2.3036       ^ definitely 2.8603x faster
   imaging-gaussian-blur               1781.5950+-9.5280    !  2322.6440+-11.0342   ^  1753.7993+-8.3234       ^ definitely 1.0158x faster
   json-parse-financial                  50.2136+-0.3357    ?    50.6477+-0.6864         49.6699+-0.3513         might be 1.0109x faster
   json-stringify-tinderbox              70.5986+-0.3327    ?    71.2043+-0.7247    ^    68.5845+-0.9333       ^ definitely 1.0294x faster
   stanford-crypto-aes                  146.3031+-0.8386    !   149.2882+-0.9315        147.8578+-0.5439       ! definitely 1.0106x slower
   stanford-crypto-ccm                  113.4581+-1.6943    ?   115.7532+-1.7936    ?   115.7774+-1.2888       ? might be 1.0204x slower
   stanford-crypto-pbkdf2               342.3863+-3.1070    !   403.7150+-4.6479    ?   408.9552+-3.7587       ! definitely 1.1944x slower
   stanford-crypto-sha256-iterative     135.4929+-1.4215    !   153.7509+-0.6486        152.6394+-1.2845       ! definitely 1.1265x slower

   <arithmetic>                         474.7826+-1.4206    !   512.9857+-1.9518    ^   448.3699+-1.8529       ^ definitely 1.0589x faster
   <geometric>                          304.8701+-0.7144    !   314.2936+-1.0548    ^   286.2978+-0.7210       ^ definitely 1.0649x faster
   <harmonic>                           188.0597+-0.5032    !   192.3389+-0.4486    ^   182.3855+-0.4791       ^ definitely 1.0311x faster

                                            TipOfTree              TipOfTreeDyn              OSREntry            OSREntry v. TipOfTree   
All benchmarks:
   <arithmetic>                         166.1201+-0.4098    !   176.8206+-0.5782    ^   157.6253+-0.5166       ^ definitely 1.0539x faster
   <geometric>                           28.7324+-0.0862    !    29.4183+-0.0425    ^    28.1519+-0.0594       ^ definitely 1.0206x faster
   <harmonic>                             7.8265+-0.0462    !     8.0960+-0.0269    ^     7.7936+-0.0451
Comment 9 Early Warning System Bot 2011-09-12 19:28:17 PDT
Comment on attachment 107127 [details]
the patch - fix style

Attachment 107127 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/9649293
Comment 10 Filip Pizlo 2011-09-12 19:30:24 PDT
Created attachment 107129 [details]
the patch - fix build

This now passes all tests with tiering enabled.  The web also works.  Hopefully I've got all the kinks out for when tiering is disabled, as well.
Comment 11 Filip Pizlo 2011-09-12 22:34:03 PDT
Comment on attachment 107129 [details]
the patch - fix build

Committing manually.
Comment 12 Filip Pizlo 2011-09-12 22:35:50 PDT
Landed in r95016.