This will be painful.
Created attachment 185646 [details] it begins
Created attachment 185856 [details] work in progress I believe that I've written a completely sensible and easy-to-understand Phi simplifier. Now I need to carefully glue it in and hopefully not get a massive performance regression in the process...
Created attachment 185888 [details] work in progress Slowly weaning other phases off of their Phi maintenance addiction. Also starting to work on the unification phase.
Created attachment 185975 [details] work in progress
Created attachment 186179 [details] it might be done Now I just have to compile it...
Created attachment 186192 [details] it builds!
Created attachment 186237 [details] it runs 3d-cube! It can run some things now, like the 3d-cube benchmark, which is the most important benchmark, ever. Soon, it will run other things, too.
Created attachment 186271 [details] passes all of the simple tests Still need more debugging.
Created attachment 186292 [details] It runs all of the things I'm still working on performance issues.
Created attachment 186313 [details] improved performance Reintroduced some of the optimizations that the bytecode parser's phi management had: in particular we template-specialize so that we don't have to branch on operand kind.
Created attachment 187166 [details] it might be done
Created attachment 187181 [details] almost there Still need to do build system hackage.
Created attachment 187387 [details] the patch
Attachment 187387 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/JavaScriptCore/CMakeLists.txt', u'Source/JavaScriptCore/ChangeLog', u'Source/JavaScriptCore/GNUmakefile.list.am', u'Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj', u'Source/JavaScriptCore/Target.pri', u'Source/JavaScriptCore/bytecode/Operands.h', u'Source/JavaScriptCore/dfg/DFGAbstractState.cpp', u'Source/JavaScriptCore/dfg/DFGAllocator.h', u'Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp', u'Source/JavaScriptCore/dfg/DFGBasicBlockInlines.h', u'Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp', u'Source/JavaScriptCore/dfg/DFGCFGSimplificationPhase.cpp', u'Source/JavaScriptCore/dfg/DFGCPSRethreadingPhase.cpp', u'Source/JavaScriptCore/dfg/DFGCPSRethreadingPhase.h', u'Source/JavaScriptCore/dfg/DFGCSEPhase.cpp', u'Source/JavaScriptCore/dfg/DFGCommon.cpp', u'Source/JavaScriptCore/dfg/DFGCommon.h', u'Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp', u'Source/JavaScriptCore/dfg/DFGDriver.cpp', u'Source/JavaScriptCore/dfg/DFGGraph.cpp', u'Source/JavaScriptCore/dfg/DFGGraph.h', u'Source/JavaScriptCore/dfg/DFGNode.h', u'Source/JavaScriptCore/dfg/DFGNodeType.h', u'Source/JavaScriptCore/dfg/DFGPhase.cpp', u'Source/JavaScriptCore/dfg/DFGPhase.h', u'Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp', u'Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.h', u'Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp', u'Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp', u'Source/JavaScriptCore/dfg/DFGStructureCheckHoistingPhase.cpp', u'Source/JavaScriptCore/dfg/DFGUnificationPhase.cpp', u'Source/JavaScriptCore/dfg/DFGUnificationPhase.h', u'Source/JavaScriptCore/dfg/DFGValidate.cpp', u'Source/JavaScriptCore/dfg/DFGVirtualRegisterAllocationPhase.cpp', u'Source/JavaScriptCore/llint/LLIntSlowPaths.cpp', u'Source/JavaScriptCore/runtime/JSCJSValue.cpp', u'Source/JavaScriptCore/runtime/JSString.h', u'Source/JavaScriptCore/runtime/Options.h']" exit_code: 1 Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp:242: One space before end of line comments [whitespace/comments] [5] Source/JavaScriptCore/dfg/DFGArgumentsSimplificationPhase.cpp:242: Should have a space between // and comment [whitespace/comments] [4] Source/JavaScriptCore/dfg/DFGCPSRethreadingPhase.cpp:158: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] Source/JavaScriptCore/dfg/DFGCPSRethreadingPhase.cpp:432: Weird number of spaces at line-start. Are you using a 4-space indent? [whitespace/indent] [3] Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp:333: An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] Total errors found: 5 in 39 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 187387 [details] the patch View in context: https://bugs.webkit.org/attachment.cgi?id=187387&action=review r=me. Just for due diligence, what's the performance numbers for this currently? > Source/JavaScriptCore/dfg/DFGCPSRethreadingPhase.cpp:342 > + // following from from predecessor blocks: SetLocal, Phi, or SetArgument. from from > Source/JavaScriptCore/dfg/DFGGraph.h:-83 > - Stray whitespace.
Performance: Benchmark report for SunSpider, V8Spider, Octane, Kraken, and JSRegress on wartooth (MacBookPro8,2). VMs tested: "TipOfTree" at /Volumes/Data/pizlo/quinary/OpenSource/WebKitBuild/Release/jsc (r142321) "CPSRethreading" at /Volumes/Data/pizlo/secondary/OpenSource/WebKitBuild/Release/jsc (r142321) Collected 12 samples per benchmark/VM, with 4 VM invocations per benchmark. Emitted a call to gc() between sample measurements. 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 CPSRethreading SunSpider: 3d-cube 7.3513+-0.0962 ! 7.5958+-0.0772 ! definitely 1.0333x slower 3d-morph 7.2424+-0.0946 7.2288+-0.0586 3d-raytrace 8.1068+-0.1291 ? 8.3262+-0.0990 ? might be 1.0271x slower access-binary-trees 1.4855+-0.0513 ? 1.5246+-0.0969 ? might be 1.0263x slower access-fannkuch 5.7826+-0.0783 ? 5.9039+-0.1111 ? might be 1.0210x slower access-nbody 3.2072+-0.0785 ? 3.2796+-0.0757 ? might be 1.0226x slower access-nsieve 3.5960+-0.0697 ? 3.6101+-0.0991 ? bitops-3bit-bits-in-byte 1.7174+-0.0334 ? 1.7606+-0.0776 ? might be 1.0251x slower bitops-bits-in-byte 2.2026+-0.0260 2.1293+-0.0556 might be 1.0344x faster bitops-bitwise-and 2.0469+-0.0497 ? 2.1184+-0.1290 ? might be 1.0349x slower bitops-nsieve-bits 3.3347+-0.0828 ? 3.3657+-0.0514 ? controlflow-recursive 2.0731+-0.0206 2.0585+-0.0218 crypto-aes 6.1142+-0.0730 ! 6.4354+-0.0943 ! definitely 1.0525x slower crypto-md5 2.9443+-0.0919 ? 3.0622+-0.1059 ? might be 1.0400x slower crypto-sha1 2.5351+-0.0664 ! 2.6746+-0.0719 ! definitely 1.0551x slower date-format-tofte 11.8771+-0.2156 ? 11.9804+-0.2246 ? date-format-xparb 12.1287+-0.2728 11.9756+-0.1811 might be 1.0128x faster math-cordic 3.2758+-0.0850 3.2494+-0.0845 math-partial-sums 7.6486+-0.1564 7.6229+-0.1564 math-spectral-norm 2.5782+-0.0682 2.4860+-0.0514 might be 1.0371x faster regexp-dna 7.3667+-0.0854 ? 7.4244+-0.0844 ? string-base64 4.1721+-0.0956 4.0864+-0.0669 might be 1.0210x faster string-fasta 7.5388+-0.1207 7.4819+-0.1130 string-tagcloud 10.9886+-0.2348 ? 11.0610+-0.1851 ? string-unpack-code 19.0560+-0.2886 19.0204+-0.2474 string-validate-input 5.9433+-0.1340 ? 6.0162+-0.1287 ? might be 1.0123x slower <arithmetic> * 5.8582+-0.0486 ? 5.9030+-0.0384 ? might be 1.0076x slower <geometric> 4.6869+-0.0408 ? 4.7303+-0.0409 ? might be 1.0093x slower <harmonic> 3.7928+-0.0357 ? 3.8295+-0.0462 ? might be 1.0097x slower TipOfTree CPSRethreading V8Spider: crypto 60.0306+-0.5406 ! 61.5250+-0.6450 ! definitely 1.0249x slower deltablue 93.6007+-1.3571 ! 95.7814+-0.4248 ! definitely 1.0233x slower earley-boyer 56.4647+-1.3491 ? 57.1343+-0.2794 ? might be 1.0119x slower raytrace 48.3663+-0.5129 ? 48.7322+-0.3738 ? regexp 70.1942+-0.4902 ? 70.5960+-0.9391 ? richards 82.9286+-0.3618 ? 83.2773+-0.6056 ? splay 40.8410+-0.2034 40.6449+-0.2960 <arithmetic> 64.6323+-0.2715 ! 65.3844+-0.2346 ! definitely 1.0116x slower <geometric> * 62.3043+-0.2590 ! 62.9541+-0.2444 ! definitely 1.0104x slower <harmonic> 60.0599+-0.2682 ! 60.6024+-0.2542 ! definitely 1.0090x slower TipOfTree CPSRethreading Octane and V8v7: encrypt 0.32440+-0.00131 ? 0.32445+-0.00324 ? decrypt 5.67955+-0.01808 5.67041+-0.04890 deltablue x2 0.41085+-0.00128 ? 0.41176+-0.00142 ? earley 0.61496+-0.00440 ^ 0.60046+-0.00208 ^ definitely 1.0242x faster boyer 7.99015+-0.01987 ^ 7.95597+-0.01227 ^ definitely 1.0043x faster raytrace x2 3.35482+-0.00664 3.34612+-0.01250 regexp x2 22.59610+-0.10528 22.37049+-0.17507 might be 1.0101x faster richards x2 0.20972+-0.00124 ^ 0.20724+-0.00054 ^ definitely 1.0120x faster splay x2 0.56772+-0.02342 ? 0.59818+-0.02702 ? might be 1.0536x slower navier-stokes x2 8.40020+-0.02680 ? 8.60942+-0.22640 ? might be 1.0249x slower closure 0.39911+-0.00308 ? 0.40018+-0.00352 ? jquery 5.59731+-0.07091 5.49686+-0.09469 might be 1.0183x faster gbemu x2 175.50045+-11.90205 ? 175.73621+-11.01902 ? box2d x2 25.70952+-0.44401 ? 26.08464+-0.27045 ? might be 1.0146x slower V8v7: <arithmetic> 5.35549+-0.01409 5.35236+-0.04041 might be 1.0006x faster <geometric> * 1.76354+-0.00948 ? 1.77209+-0.01286 ? might be 1.0049x slower <harmonic> 0.67025+-0.00475 ? 0.67129+-0.00453 ? might be 1.0016x slower Octane including V8v7: <arithmetic> 22.45928+-1.08070 ? 22.50802+-1.00030 ? might be 1.0022x slower <geometric> * 3.36544+-0.02018 ? 3.38004+-0.02112 ? might be 1.0043x slower <harmonic> 0.82564+-0.00537 ? 0.82693+-0.00514 ? might be 1.0016x slower TipOfTree CPSRethreading Kraken: ai-astar 279.159+-1.644 277.098+-1.723 audio-beat-detection 177.951+-1.766 ^ 174.559+-1.516 ^ definitely 1.0194x faster audio-dft 246.525+-2.334 ? 247.634+-3.464 ? audio-fft 101.516+-0.934 ? 101.654+-0.668 ? audio-oscillator 179.380+-2.052 ? 182.280+-2.190 ? might be 1.0162x slower imaging-darkroom 207.871+-0.942 ? 211.039+-2.750 ? might be 1.0152x slower imaging-desaturate 104.979+-0.669 ^ 103.324+-0.229 ^ definitely 1.0160x faster imaging-gaussian-blur 289.391+-2.327 288.607+-1.083 json-parse-financial 54.813+-0.395 54.742+-0.748 json-stringify-tinderbox 69.497+-1.918 ? 69.525+-0.395 ? stanford-crypto-aes 69.130+-0.620 ? 69.707+-0.813 ? stanford-crypto-ccm 75.030+-3.241 ? 75.516+-3.416 ? stanford-crypto-pbkdf2 191.796+-2.000 ^ 187.433+-0.847 ^ definitely 1.0233x faster stanford-crypto-sha256-iterative 82.991+-1.399 81.974+-0.482 might be 1.0124x faster <arithmetic> * 152.145+-0.465 151.792+-0.639 might be 1.0023x faster <geometric> 131.061+-0.584 130.790+-0.713 might be 1.0021x faster <harmonic> 112.669+-0.645 112.518+-0.809 might be 1.0013x faster TipOfTree CPSRethreading JSRegress: adapt-to-double-divide 75.3465+-0.4350 75.2567+-0.2146 aliased-arguments-getbyval 0.7673+-0.0058 ! 0.7949+-0.0084 ! definitely 1.0360x slower allocate-big-object 1.8407+-0.0228 ? 1.8958+-0.0434 ? might be 1.0300x slower arity-mismatch-inlining 0.6015+-0.0110 ? 0.6078+-0.0065 ? might be 1.0106x slower array-access-polymorphic-structure 43.8935+-0.3524 43.6009+-0.2770 array-with-double-add 4.1707+-0.0995 4.1263+-0.1007 might be 1.0108x faster array-with-double-increment 3.5498+-0.1178 ? 3.6295+-0.0799 ? might be 1.0225x slower array-with-double-mul-add 4.7339+-0.1115 ? 4.8435+-0.0807 ? might be 1.0231x slower array-with-double-sum 4.5948+-0.0981 ? 4.6396+-0.0927 ? array-with-int32-add-sub 7.4036+-0.1119 ? 7.4149+-0.1027 ? array-with-int32-or-double-sum 4.6357+-0.0733 ? 4.7393+-0.0743 ? might be 1.0224x slower big-int-mul 3.7645+-0.0943 ? 3.8126+-0.0784 ? might be 1.0128x slower boolean-test 3.2422+-0.0849 3.2396+-0.0997 cast-int-to-double 11.4394+-0.1556 ? 11.6818+-0.4150 ? might be 1.0212x slower cell-argument 12.8855+-0.1206 12.8213+-0.1928 cfg-simplify 3.0132+-0.0751 2.9762+-0.0638 might be 1.0124x faster cmpeq-obj-to-obj-other 9.0928+-0.1743 8.8768+-0.1384 might be 1.0243x faster constant-test 4.8821+-0.0918 ? 4.9113+-0.0754 ? direct-arguments-getbyval 0.6972+-0.0059 ! 0.7237+-0.0075 ! definitely 1.0380x slower double-pollution-getbyval 9.2472+-0.0666 ? 9.3956+-0.1112 ? might be 1.0160x slower double-pollution-putbyoffset 3.9324+-0.0683 ? 3.9327+-0.1081 ? external-arguments-getbyval 1.6322+-0.0266 1.6288+-0.0292 external-arguments-putbyval 2.4096+-0.0617 ? 2.4294+-0.0451 ? Float32Array-matrix-mult 9.4745+-0.0996 9.3447+-0.1307 might be 1.0139x faster fold-double-to-int 17.1006+-0.4984 16.6145+-0.1413 might be 1.0293x faster function-dot-apply 2.1912+-0.0274 2.1897+-0.0425 function-test 3.2597+-0.0610 3.2355+-0.0537 get-by-id-chain-from-try-block 5.2250+-0.1271 5.1440+-0.1210 might be 1.0158x faster indexed-properties-in-objects 3.2903+-0.0792 ? 3.3470+-0.0729 ? might be 1.0173x slower inline-arguments-access 1.0281+-0.0104 ! 1.0463+-0.0072 ! definitely 1.0176x slower inline-arguments-local-escape 15.6365+-0.2735 15.2822+-0.2337 might be 1.0232x faster inline-get-scoped-var 5.3761+-0.0750 5.3507+-0.0734 inlined-put-by-id-transition 9.9811+-0.1655 ? 10.0022+-0.0992 ? int-or-other-abs-then-get-by-val 6.8123+-0.1196 6.7650+-0.1050 int-or-other-abs-zero-then-get-by-val 26.6592+-0.2342 ! 27.5452+-0.2677 ! definitely 1.0332x slower int-or-other-add-then-get-by-val 8.2947+-0.1519 ? 8.2955+-0.1063 ? int-or-other-add 7.5124+-0.1262 ? 7.5786+-0.1138 ? int-or-other-div-then-get-by-val 6.3039+-0.4014 ? 6.4763+-0.4647 ? might be 1.0273x slower int-or-other-max-then-get-by-val 7.0281+-0.0847 6.9958+-0.1307 int-or-other-min-then-get-by-val 6.8951+-0.1001 ? 6.9659+-0.1008 ? might be 1.0103x slower int-or-other-mod-then-get-by-val 5.8966+-0.0766 ? 5.9336+-0.0612 ? int-or-other-mul-then-get-by-val 5.8023+-0.0775 ? 5.8165+-0.1070 ? int-or-other-neg-then-get-by-val 5.9645+-0.0816 ? 6.0107+-0.0797 ? int-or-other-neg-zero-then-get-by-val 25.9048+-0.3786 ? 26.4683+-0.5408 ? might be 1.0218x slower int-or-other-sub-then-get-by-val 7.9825+-0.1494 ? 7.9956+-0.1221 ? int-or-other-sub 7.1840+-0.1035 7.1656+-0.1249 int-overflow-local 197.5204+-0.8437 196.9987+-1.0043 Int16Array-bubble-sort 24.5623+-0.5116 ? 24.6167+-0.4209 ? Int16Array-load-int-mul 1.4892+-0.0161 ? 1.5082+-0.0093 ? might be 1.0128x slower Int8Array-load 3.6639+-0.0890 ? 3.7345+-0.0597 ? might be 1.0193x slower integer-divide 13.0407+-0.4650 12.9980+-0.4247 integer-modulo 1.5775+-0.0201 ? 1.5900+-0.0139 ? make-indexed-storage 2.8866+-0.0609 ? 2.9906+-0.0973 ? might be 1.0360x slower method-on-number 187.3597+-2.5455 185.6352+-1.9131 new-array-buffer-dead 2.8265+-0.0582 2.8215+-0.1022 new-array-buffer-push 7.2039+-0.0722 7.2025+-0.0520 new-array-dead 22.2644+-0.1936 ? 22.6008+-0.2406 ? might be 1.0151x slower new-array-push 4.9765+-0.0697 4.9400+-0.0368 number-test 3.1589+-0.0858 ? 3.2116+-0.0615 ? might be 1.0167x slower object-closure-call 6.7482+-0.0781 6.5998+-0.0932 might be 1.0225x faster object-test 3.4391+-0.0843 ? 3.5332+-0.0652 ? might be 1.0274x slower poly-stricteq 73.5902+-0.5459 73.2536+-0.3875 polymorphic-structure 14.8530+-0.1938 14.8409+-0.1913 polyvariant-monomorphic-get-by-id 10.4995+-0.5741 ? 10.6131+-0.5376 ? might be 1.0108x slower rare-osr-exit-on-local 152.3211+-0.7098 ? 153.1462+-0.7105 ? register-pressure-from-osr 24.6226+-0.2096 24.4576+-0.2020 simple-activation-demo 27.4539+-0.2322 27.2610+-0.2945 slow-array-profile-convergence 3.3130+-0.0759 ? 3.3945+-0.0818 ? might be 1.0246x slower slow-convergence 58.8908+-0.5100 58.3886+-0.3044 sparse-conditional 0.9993+-0.0045 ? 1.0072+-0.0135 ? splice-to-remove 39.1461+-0.2717 ? 39.2787+-0.3761 ? string-hash 2.1361+-0.0370 2.1073+-0.0492 might be 1.0137x faster string-repeat-arith 32.4702+-0.4610 ? 32.6677+-0.3229 ? string-sub 64.9460+-0.4867 ? 65.8427+-0.5323 ? might be 1.0138x slower string-test 3.0620+-0.0771 ? 3.0846+-0.0809 ? structure-hoist-over-transitions 2.5320+-0.0470 2.5118+-0.0489 tear-off-arguments-simple 1.4474+-0.0174 ? 1.4628+-0.0173 ? might be 1.0107x slower tear-off-arguments 2.6686+-0.0568 ? 2.7120+-0.0536 ? might be 1.0163x slower temporal-structure 15.3105+-0.1692 ! 15.6571+-0.0916 ! definitely 1.0226x slower to-int32-boolean 19.9505+-0.1784 ? 19.9568+-0.1780 ? undefined-test 3.2583+-0.0948 3.1846+-0.0662 might be 1.0231x faster <arithmetic> 17.9601+-0.0570 ? 17.9674+-0.0520 ? might be 1.0004x slower <geometric> * 7.0863+-0.0397 ? 7.1200+-0.0395 ? might be 1.0048x slower <harmonic> 3.7870+-0.0191 ! 3.8273+-0.0206 ! definitely 1.0106x slower TipOfTree CPSRethreading All benchmarks: <arithmetic> 31.2243+-0.2229 ? 31.2453+-0.2274 ? might be 1.0007x slower <geometric> 8.5938+-0.0467 ? 8.6376+-0.0458 ? might be 1.0051x slower <harmonic> 2.7206+-0.0097 ? 2.7372+-0.0107 ? might be 1.0061x slower TipOfTree CPSRethreading Geomean of preferred means: <scaled-result> 16.7647+-0.0757 ? 16.8478+-0.0688 ? might be 1.0050x slower
Landed in http://trac.webkit.org/changeset/142377