home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / pcl / docs.lha / internals / back.tex < prev    next >
LaTeX Document  |  1992-05-30  |  34.2 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 20 2d 2a 2d 20 44 69 | 63 74 69 6f 6e 61 72 79 |% -*- Di|ctionary|
|00000010| 3a 20 64 65 73 69 67 6e | 20 2d 2a 2d 0a 0c 0a 5c |: design| -*-...\|
|00000020| 63 68 61 70 74 65 72 7b | 43 6f 70 79 20 70 72 6f |chapter{|Copy pro|
|00000030| 70 61 67 61 74 69 6f 6e | 7d 0a 0a 46 69 6c 65 3a |pagation|}..File:|
|00000040| 20 7b 5c 74 74 20 63 6f | 70 79 70 72 6f 70 7d 0a | {\tt co|pyprop}.|
|00000050| 0a 54 68 69 73 20 70 68 | 61 73 65 20 69 73 20 6f |.This ph|ase is o|
|00000060| 70 74 69 6f 6e 61 6c 2c | 20 62 75 74 20 73 68 6f |ptional,| but sho|
|00000070| 75 6c 64 20 62 65 20 64 | 6f 6e 65 20 77 68 65 6e |uld be d|one when|
|00000080| 65 76 65 72 20 73 70 65 | 65 64 20 6f 72 20 73 70 |ever spe|ed or sp|
|00000090| 61 63 65 20 69 73 20 6d | 6f 72 65 0a 69 6d 70 6f |ace is m|ore.impo|
|000000a0| 72 74 61 6e 74 20 74 68 | 61 6e 20 63 6f 6d 70 69 |rtant th|an compi|
|000000b0| 6c 65 20 73 70 65 65 64 | 2e 20 20 57 65 20 75 73 |le speed|. We us|
|000000c0| 65 20 67 6c 6f 62 61 6c | 20 66 6c 6f 77 20 61 6e |e global| flow an|
|000000d0| 61 6c 79 73 69 73 20 74 | 6f 20 66 69 6e 64 20 74 |alysis t|o find t|
|000000e0| 68 65 20 72 65 61 63 68 | 69 6e 67 0a 64 65 66 69 |he reach|ing.defi|
|000000f0| 6e 69 74 69 6f 6e 73 20 | 66 6f 72 20 65 61 63 68 |nitions |for each|
|00000100| 20 54 4e 2e 20 20 54 68 | 69 73 20 69 6e 66 6f 72 | TN. Th|is infor|
|00000110| 6d 61 74 69 6f 6e 20 69 | 73 20 75 73 65 64 20 68 |mation i|s used h|
|00000120| 65 72 65 20 74 6f 20 65 | 6c 69 6d 69 6e 61 74 65 |ere to e|liminate|
|00000130| 0a 75 6e 6e 65 63 65 73 | 73 61 72 79 20 54 4e 73 |.unneces|sary TNs|
|00000140| 2c 20 61 6e 64 20 69 73 | 20 61 6c 73 6f 20 75 73 |, and is| also us|
|00000150| 65 64 20 6c 61 74 65 72 | 20 6f 6e 20 62 79 20 6c |ed later| on by l|
|00000160| 6f 6f 70 20 69 6e 76 61 | 72 69 61 6e 74 20 6f 70 |oop inva|riant op|
|00000170| 74 69 6d 69 7a 61 74 69 | 6f 6e 2e 0a 0a 49 6e 20 |timizati|on...In |
|00000180| 73 6f 6d 65 20 63 61 73 | 65 73 2c 20 56 4d 52 20 |some cas|es, VMR |
|00000190| 63 6f 6e 76 65 72 73 69 | 6f 6e 20 77 69 6c 6c 20 |conversi|on will |
|000001a0| 75 6e 6e 65 63 65 73 73 | 61 72 69 6c 79 20 63 6f |unnecess|arily co|
|000001b0| 70 79 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |py the v|alue of |
|000001c0| 61 20 54 4e 20 69 6e 74 | 6f 0a 61 6e 6f 74 68 65 |a TN int|o.anothe|
|000001d0| 72 20 54 4e 2c 20 73 69 | 6e 63 65 20 69 74 20 6d |r TN, si|nce it m|
|000001e0| 61 79 20 6e 6f 74 20 62 | 65 20 61 62 6c 65 20 74 |ay not b|e able t|
|000001f0| 6f 20 74 65 6c 6c 20 74 | 68 61 74 20 74 68 65 20 |o tell t|hat the |
|00000200| 69 6e 69 74 69 61 6c 20 | 54 4e 20 68 61 73 20 74 |initial |TN has t|
|00000210| 68 65 20 73 61 6d 65 0a | 76 61 6c 75 65 20 61 74 |he same.|value at|
|00000220| 20 74 68 65 20 74 69 6d | 65 20 74 68 65 20 73 65 | the tim|e the se|
|00000230| 63 6f 6e 64 20 54 4e 20 | 69 73 20 72 65 66 65 72 |cond TN |is refer|
|00000240| 65 6e 63 65 64 2e 20 20 | 54 68 69 73 20 63 61 6e |enced. |This can|
|00000250| 20 68 61 70 70 65 6e 20 | 77 68 65 6e 20 49 43 52 | happen |when ICR|
|00000260| 0a 6f 70 74 69 6d 69 7a | 65 20 69 73 20 75 6e 61 |.optimiz|e is una|
|00000270| 62 6c 65 20 74 6f 20 65 | 6c 69 6d 69 6e 61 74 65 |ble to e|liminate|
|00000280| 20 61 20 74 72 69 76 69 | 61 6c 20 76 61 72 69 61 | a trivi|al varia|
|00000290| 62 6c 65 20 62 69 6e 64 | 69 6e 67 2c 20 6f 72 20 |ble bind|ing, or |
|000002a0| 77 68 65 6e 20 74 68 65 | 20 75 73 65 72 0a 64 6f |when the| user.do|
|000002b0| 65 73 20 61 20 73 65 74 | 71 2c 20 6f 72 20 6d 61 |es a set|q, or ma|
|000002c0| 79 20 61 6c 73 6f 20 72 | 65 73 75 6c 74 20 66 72 |y also r|esult fr|
|000002d0| 6f 6d 20 63 72 65 61 74 | 69 6f 6e 20 6f 66 20 65 |om creat|ion of e|
|000002e0| 78 70 72 65 73 73 69 6f | 6e 20 65 76 61 6c 75 61 |xpressio|n evalua|
|000002f0| 74 69 6f 6e 0a 74 65 6d | 70 6f 72 61 72 69 65 73 |tion.tem|poraries|
|00000300| 20 64 75 72 69 6e 67 20 | 56 4d 52 20 63 6f 6e 76 | during |VMR conv|
|00000310| 65 72 73 69 6f 6e 2e 20 | 20 57 68 61 74 65 76 65 |ersion. | Whateve|
|00000320| 72 20 74 68 65 20 63 61 | 75 73 65 2c 20 77 65 20 |r the ca|use, we |
|00000330| 77 6f 75 6c 64 20 6c 69 | 6b 65 20 74 6f 20 61 76 |would li|ke to av|
|00000340| 6f 69 64 0a 74 68 65 20 | 75 6e 6e 65 63 65 73 73 |oid.the |unnecess|
|00000350| 61 72 79 20 63 72 65 61 | 74 69 6f 6e 20 61 6e 64 |ary crea|tion and|
|00000360| 20 61 73 73 69 67 6e 6d | 65 6e 74 20 6f 66 20 74 | assignm|ent of t|
|00000370| 68 65 73 65 20 54 4e 73 | 2e 0a 0a 57 68 61 74 20 |hese TNs|...What |
|00000380| 77 65 20 64 6f 20 69 73 | 20 72 65 70 6c 61 63 65 |we do is| replace|
|00000390| 20 54 4e 20 72 65 66 65 | 72 65 6e 63 65 73 20 77 | TN refe|rences w|
|000003a0| 68 6f 73 65 20 6f 6e 6c | 79 20 72 65 61 63 68 69 |hose onl|y reachi|
|000003b0| 6e 67 20 64 65 66 69 6e | 69 74 69 6f 6e 20 69 73 |ng defin|ition is|
|000003c0| 20 61 20 4d 6f 76 65 0a | 56 4f 50 20 77 69 74 68 | a Move.|VOP with|
|000003d0| 20 61 20 72 65 66 65 72 | 65 6e 63 65 20 74 6f 20 | a refer|ence to |
|000003e0| 74 68 65 20 54 4e 20 6d | 6f 76 65 64 20 66 72 6f |the TN m|oved fro|
|000003f0| 6d 2c 20 61 6e 64 20 74 | 68 65 6e 20 64 65 6c 65 |m, and t|hen dele|
|00000400| 74 65 20 74 68 65 20 4d | 6f 76 65 20 56 4f 50 20 |te the M|ove VOP |
|00000410| 69 66 20 74 68 65 0a 63 | 6f 70 79 20 54 4e 20 68 |if the.c|opy TN h|
|00000420| 61 73 20 6e 6f 20 72 65 | 6d 61 69 6e 69 6e 67 20 |as no re|maining |
|00000430| 72 65 66 65 72 65 6e 63 | 65 73 2e 20 20 54 68 65 |referenc|es. The|
|00000440| 72 65 20 61 72 65 20 73 | 65 76 65 72 61 6c 20 72 |re are s|everal r|
|00000450| 65 73 74 72 69 63 74 69 | 6f 6e 73 20 6f 6e 20 63 |estricti|ons on c|
|00000460| 6f 70 79 0a 70 72 6f 70 | 61 67 61 74 69 6f 6e 3a |opy.prop|agation:|
|00000470| 0a 5c 62 65 67 69 6e 7b | 69 74 65 6d 69 7a 65 7d |.\begin{|itemize}|
|00000480| 0a 5c 69 74 65 6d 20 54 | 68 65 20 54 4e 73 20 6d |.\item T|he TNs m|
|00000490| 75 73 74 20 62 65 20 60 | 60 6f 72 64 69 6e 61 72 |ust be `|`ordinar|
|000004a0| 79 27 27 20 54 4e 73 2c | 20 6e 6f 74 20 72 65 73 |y'' TNs,| not res|
|000004b0| 74 72 69 63 74 65 64 20 | 6f 72 20 6f 74 68 65 72 |tricted |or other|
|000004c0| 77 69 73 65 0a 75 6e 75 | 73 75 61 6c 2e 20 20 45 |wise.unu|sual. E|
|000004d0| 78 74 65 6e 64 69 6e 67 | 20 74 68 65 20 6c 69 66 |xtending| the lif|
|000004e0| 65 20 6f 66 20 72 65 73 | 74 72 69 63 74 65 64 20 |e of res|tricted |
|000004f0| 28 6f 72 20 77 69 72 65 | 64 29 20 54 4e 73 20 63 |(or wire|d) TNs c|
|00000500| 61 6e 20 6d 61 6b 65 20 | 72 65 67 69 73 74 65 72 |an make |register|
|00000510| 0a 61 6c 6c 6f 63 61 74 | 69 6f 6e 20 69 6d 70 6f |.allocat|ion impo|
|00000520| 73 73 69 62 6c 65 2e 20 | 20 53 6f 6d 65 20 6f 74 |ssible. | Some ot|
|00000530| 68 65 72 20 54 4e 20 6b | 69 6e 64 73 20 68 61 76 |her TN k|inds hav|
|00000540| 65 20 68 69 64 64 65 6e | 20 72 65 66 65 72 65 6e |e hidden| referen|
|00000550| 63 65 73 2e 0a 0a 5c 69 | 74 65 6d 20 57 65 20 64 |ces...\i|tem We d|
|00000560| 6f 6e 27 74 20 77 61 6e | 74 20 74 6f 20 64 65 66 |on't wan|t to def|
|00000570| 65 61 74 20 73 6f 75 72 | 63 65 2d 6c 65 76 65 6c |eat sour|ce-level|
|00000580| 20 64 65 62 75 67 67 69 | 6e 67 20 62 79 20 72 65 | debuggi|ng by re|
|00000590| 70 6c 61 63 69 6e 67 20 | 6e 61 6d 65 64 0a 76 61 |placing |named.va|
|000005a0| 72 69 61 62 6c 65 73 20 | 77 69 74 68 20 61 6e 6f |riables |with ano|
|000005b0| 6e 79 6d 6f 75 73 20 74 | 65 6d 70 6f 72 61 72 69 |nymous t|emporari|
|000005c0| 65 73 2e 0a 0a 5c 69 74 | 65 6d 20 57 65 20 63 61 |es...\it|em We ca|
|000005d0| 6e 27 74 20 64 65 6c 65 | 74 65 20 6d 6f 76 65 73 |n't dele|te moves|
|000005e0| 20 74 68 61 74 20 72 65 | 70 72 65 73 65 6e 74 61 | that re|presenta|
|000005f0| 74 69 6f 6e 20 73 65 6c | 65 63 74 65 64 20 6d 69 |tion sel|ected mi|
|00000600| 67 68 74 20 77 61 6e 74 | 20 74 6f 20 63 68 61 6e |ght want| to chan|
|00000610| 67 65 0a 69 6e 74 6f 20 | 61 20 72 65 70 72 65 73 |ge.into |a repres|
|00000620| 65 6e 74 61 74 69 6f 6e | 20 63 6f 6e 76 65 72 73 |entation| convers|
|00000630| 69 6f 6e 2c 20 73 69 6e | 63 65 20 77 65 20 6e 65 |ion, sin|ce we ne|
|00000640| 65 64 20 74 68 65 20 70 | 72 69 6d 69 74 69 76 65 |ed the p|rimitive|
|00000650| 20 74 79 70 65 73 20 6f | 66 20 62 6f 74 68 20 54 | types o|f both T|
|00000660| 4e 73 0a 74 6f 20 73 65 | 6c 65 63 74 20 61 20 63 |Ns.to se|lect a c|
|00000670| 6f 6e 76 65 72 73 69 6f | 6e 2e 0a 5c 65 6e 64 7b |onversio|n..\end{|
|00000680| 69 74 65 6d 69 7a 65 7d | 0a 0a 53 6f 6d 65 20 63 |itemize}|..Some c|
|00000690| 6c 65 76 65 72 6e 65 73 | 73 20 72 65 64 75 63 65 |levernes|s reduce|
|000006a0| 73 20 74 68 65 20 63 6f | 73 74 20 6f 66 20 66 6c |s the co|st of fl|
|000006b0| 6f 77 20 61 6e 61 6c 79 | 73 69 73 2e 20 20 41 73 |ow analy|sis. As|
|000006c0| 20 66 6f 72 20 6c 69 66 | 65 74 69 6d 65 20 61 6e | for lif|etime an|
|000006d0| 61 6c 79 73 69 73 2c 0a | 77 65 20 6f 6e 6c 79 20 |alysis,.|we only |
|000006e0| 6e 65 65 64 20 74 6f 20 | 64 6f 20 66 6c 6f 77 20 |need to |do flow |
|000006f0| 61 6e 61 6c 79 73 69 73 | 20 6f 6e 20 67 6c 6f 62 |analysis| on glob|
|00000700| 61 6c 20 70 61 63 6b 65 | 64 20 54 4e 73 2e 20 20 |al packe|d TNs. |
|00000710| 57 65 20 63 61 6e 27 74 | 20 64 6f 20 74 68 65 20 |We can't| do the |
|00000720| 72 65 61 6c 0a 6c 6f 63 | 61 6c 20 54 4e 20 61 73 |real.loc|al TN as|
|00000730| 73 69 67 6e 6d 65 6e 74 | 20 70 61 73 73 20 62 65 |signment| pass be|
|00000740| 66 6f 72 65 20 74 68 69 | 73 2c 20 73 69 6e 63 65 |fore thi|s, since|
|00000750| 20 77 65 20 61 6c 6c 6f | 63 61 74 65 20 54 4e 73 | we allo|cate TNs|
|00000760| 20 61 66 74 65 72 77 61 | 72 64 2c 20 73 6f 20 77 | afterwa|rd, so w|
|00000770| 65 20 64 6f 0a 61 20 70 | 72 65 2d 70 61 73 73 20 |e do.a p|re-pass |
|00000780| 74 68 61 74 20 6d 61 72 | 6b 73 20 74 68 65 20 54 |that mar|ks the T|
|00000790| 4e 73 20 74 68 61 74 20 | 61 72 65 20 6c 6f 63 61 |Ns that |are loca|
|000007a0| 6c 20 66 6f 72 20 6f 75 | 72 20 70 75 72 70 6f 73 |l for ou|r purpos|
|000007b0| 65 73 2e 20 20 57 65 20 | 64 6f 6e 27 74 20 63 61 |es. We |don't ca|
|000007c0| 72 65 0a 69 66 20 62 6c | 6f 63 6b 20 73 70 6c 69 |re.if bl|ock spli|
|000007d0| 74 74 69 6e 67 20 65 76 | 65 6e 74 75 61 6c 6c 79 |tting ev|entually|
|000007e0| 20 63 61 75 73 65 73 20 | 73 6f 6d 65 20 6f 66 20 | causes |some of |
|000007f0| 74 68 65 6d 20 74 6f 20 | 62 65 20 63 6f 6e 73 69 |them to |be consi|
|00000800| 64 65 72 65 64 20 67 6c | 6f 62 61 6c 2e 0a 0a 4e |dered gl|obal...N|
|00000810| 6f 74 65 20 61 6c 73 6f | 20 74 68 61 74 20 77 65 |ote also| that we|
|00000820| 20 61 72 65 20 72 65 61 | 6c 6c 79 20 6f 6e 6c 79 | are rea|lly only|
|00000830| 20 61 72 65 20 69 6e 74 | 65 72 65 73 74 65 64 20 | are int|erested |
|00000840| 69 6e 20 6b 6e 6f 77 69 | 6e 67 20 69 66 20 74 68 |in knowi|ng if th|
|00000850| 65 72 65 20 69 73 20 61 | 0a 75 6e 69 71 75 65 20 |ere is a|.unique |
|00000860| 72 65 61 63 68 69 6e 67 | 20 64 65 66 69 6e 69 74 |reaching| definit|
|00000870| 69 6f 6e 2c 20 77 68 69 | 63 68 20 77 65 20 63 61 |ion, whi|ch we ca|
|00000880| 6e 20 6d 61 73 68 20 69 | 6e 74 6f 20 6f 75 72 20 |n mash i|nto our |
|00000890| 66 6c 6f 77 20 61 6e 61 | 6c 79 73 69 73 20 72 75 |flow ana|lysis ru|
|000008a0| 6c 65 73 20 62 79 0a 64 | 6f 69 6e 67 20 61 6e 20 |les by.d|oing an |
|000008b0| 69 6e 74 65 72 73 65 63 | 74 69 6f 6e 2e 20 20 54 |intersec|tion. T|
|000008c0| 68 65 6e 20 61 20 64 65 | 66 69 6e 69 74 69 6f 6e |hen a de|finition|
|000008d0| 20 6f 6e 6c 79 20 61 70 | 70 65 61 72 73 20 69 6e | only ap|pears in|
|000008e0| 20 74 68 65 20 73 65 74 | 20 77 68 65 6e 20 69 74 | the set| when it|
|000008f0| 20 69 73 0a 75 6e 69 71 | 75 65 2e 20 20 57 65 20 | is.uniq|ue. We |
|00000900| 74 68 65 6e 20 70 72 6f | 70 61 67 61 74 65 20 6f |then pro|pagate o|
|00000910| 6e 6c 79 20 64 65 66 69 | 6e 69 74 69 6f 6e 73 20 |nly defi|nitions |
|00000920| 6f 66 20 54 4e 73 20 77 | 69 74 68 20 6f 6e 6c 79 |of TNs w|ith only|
|00000930| 20 6f 6e 65 20 77 72 69 | 74 65 2c 20 77 68 69 63 | one wri|te, whic|
|00000940| 68 0a 61 6c 6c 6f 77 73 | 20 74 68 65 20 54 4e 20 |h.allows| the TN |
|00000950| 74 6f 20 73 74 61 6e 64 | 20 66 6f 72 20 74 68 65 |to stand| for the|
|00000960| 20 64 65 66 69 6e 69 74 | 69 6f 6e 2e 0a 0a 0c 0a | definit|ion.....|
|00000970| 5c 63 68 61 70 74 65 72 | 7b 52 65 70 72 65 73 65 |\chapter|{Represe|
|00000980| 6e 74 61 74 69 6f 6e 20 | 73 65 6c 65 63 74 69 6f |ntation |selectio|
|00000990| 6e 7d 0a 0a 46 69 6c 65 | 3a 20 7b 5c 74 74 20 72 |n}..File|: {\tt r|
|000009a0| 65 70 72 65 73 65 6e 74 | 7d 0a 0a 53 6f 6d 65 20 |epresent|}..Some |
|000009b0| 74 79 70 65 73 20 6f 66 | 20 6f 62 6a 65 63 74 20 |types of| object |
|000009c0| 28 73 75 63 68 20 61 73 | 20 7b 5c 74 74 20 73 69 |(such as| {\tt si|
|000009d0| 6e 67 6c 65 2d 66 6c 6f | 61 74 7d 29 20 68 61 76 |ngle-flo|at}) hav|
|000009e0| 65 20 6d 75 6c 74 69 70 | 6c 65 20 70 6f 73 73 69 |e multip|le possi|
|000009f0| 62 6c 65 0a 72 65 70 72 | 65 73 65 6e 74 61 74 69 |ble.repr|esentati|
|00000a00| 6f 6e 73 2e 20 20 4d 75 | 6c 74 69 70 6c 65 20 72 |ons. Mu|ltiple r|
|00000a10| 65 70 72 65 73 65 6e 74 | 61 74 69 6f 6e 73 20 61 |epresent|ations a|
|00000a20| 72 65 20 75 73 65 66 75 | 6c 20 6d 61 69 6e 6c 79 |re usefu|l mainly|
|00000a30| 20 77 68 65 6e 20 74 68 | 65 72 65 20 69 73 20 61 | when th|ere is a|
|00000a40| 0a 70 61 72 74 69 63 75 | 6c 61 72 6c 79 20 65 66 |.particu|larly ef|
|00000a50| 66 69 63 69 65 6e 74 20 | 6e 6f 6e 2d 64 65 73 63 |ficient |non-desc|
|00000a60| 72 69 70 74 6f 72 20 72 | 65 70 72 65 73 65 6e 74 |riptor r|epresent|
|00000a70| 61 74 69 6f 6e 2e 20 20 | 49 6e 20 74 68 69 73 20 |ation. |In this |
|00000a80| 63 61 73 65 2c 20 74 68 | 65 72 65 20 69 73 0a 74 |case, th|ere is.t|
|00000a90| 68 65 20 6e 6f 72 6d 61 | 6c 20 64 65 73 63 72 69 |he norma|l descri|
|00000aa0| 70 74 6f 72 20 72 65 70 | 72 65 73 65 6e 74 61 74 |ptor rep|resentat|
|00000ab0| 69 6f 6e 2c 20 61 6e 64 | 20 61 6e 20 61 6c 74 65 |ion, and| an alte|
|00000ac0| 72 6e 61 74 65 20 6e 6f | 6e 2d 64 65 73 63 72 69 |rnate no|n-descri|
|00000ad0| 70 74 6f 72 0a 72 65 70 | 72 65 73 65 6e 74 61 74 |ptor.rep|resentat|
|00000ae0| 69 6f 6e 2e 0a 0a 54 68 | 69 73 20 70 6f 73 73 69 |ion...Th|is possi|
|00000af0| 62 69 6c 69 74 79 20 62 | 72 69 6e 67 73 20 75 70 |bility b|rings up|
|00000b00| 20 74 77 6f 20 6d 61 6a | 6f 72 20 69 73 73 75 65 | two maj|or issue|
|00000b10| 73 3a 0a 5c 62 65 67 69 | 6e 7b 69 74 65 6d 69 7a |s:.\begi|n{itemiz|
|00000b20| 65 7d 0a 5c 69 74 65 6d | 20 54 68 65 20 63 6f 6d |e}.\item| The com|
|00000b30| 70 69 6c 65 72 20 6d 75 | 73 74 20 64 65 63 69 64 |piler mu|st decid|
|00000b40| 65 20 77 68 69 63 68 20 | 72 65 70 72 65 73 65 6e |e which |represen|
|00000b50| 74 61 74 69 6f 6e 20 77 | 69 6c 6c 20 62 65 20 6d |tation w|ill be m|
|00000b60| 6f 73 74 20 65 66 66 69 | 63 69 65 6e 74 20 66 6f |ost effi|cient fo|
|00000b70| 72 0a 61 6e 79 20 67 69 | 76 65 6e 20 76 61 6c 75 |r.any gi|ven valu|
|00000b80| 65 2c 20 61 6e 64 0a 0a | 5c 69 74 65 6d 20 52 65 |e, and..|\item Re|
|00000b90| 70 72 65 73 65 6e 74 61 | 74 69 6f 6e 20 63 6f 6e |presenta|tion con|
|00000ba0| 76 65 72 73 69 6f 6e 20 | 63 6f 64 65 20 6d 75 73 |version |code mus|
|00000bb0| 74 20 62 65 20 69 6e 73 | 65 72 74 65 64 20 77 68 |t be ins|erted wh|
|00000bc0| 65 72 65 20 74 68 65 20 | 72 65 70 72 65 73 65 6e |ere the |represen|
|00000bd0| 74 61 74 69 6f 6e 0a 6f | 66 20 61 20 76 61 6c 75 |tation.o|f a valu|
|00000be0| 65 20 69 73 20 63 68 61 | 6e 67 65 64 2e 0a 5c 65 |e is cha|nged..\e|
|00000bf0| 6e 64 7b 69 74 65 6d 69 | 7a 65 7d 0a 46 69 72 73 |nd{itemi|ze}.Firs|
|00000c00| 74 2c 20 74 68 65 20 72 | 65 70 72 65 73 65 6e 74 |t, the r|epresent|
|00000c10| 61 74 69 6f 6e 73 20 66 | 6f 72 20 54 4e 73 20 61 |ations f|or TNs a|
|00000c20| 72 65 20 73 65 6c 65 63 | 74 65 64 20 62 79 20 65 |re selec|ted by e|
|00000c30| 78 61 6d 69 6e 69 6e 67 | 20 61 6c 6c 20 74 68 65 |xamining| all the|
|00000c40| 20 54 4e 0a 72 65 66 65 | 72 65 6e 63 65 73 20 61 | TN.refe|rences a|
|00000c50| 6e 64 20 61 74 74 65 6d | 70 74 69 6e 67 20 74 6f |nd attem|pting to|
|00000c60| 20 6d 69 6e 69 6d 69 7a | 65 20 72 65 66 65 72 65 | minimiz|e refere|
|00000c70| 6e 63 65 20 63 6f 73 74 | 73 2e 20 20 54 68 65 6e |nce cost|s. Then|
|00000c80| 20 72 65 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 0a | represe|ntation.|
|00000c90| 63 6f 6e 76 65 72 73 69 | 6f 6e 20 63 6f 64 65 20 |conversi|on code |
|00000ca0| 69 73 20 69 6e 74 72 6f | 64 75 63 65 64 2e 0a 0a |is intro|duced...|
|00000cb0| 54 68 69 73 20 70 68 61 | 73 65 20 69 73 20 69 6e |This pha|se is in|
|00000cc0| 20 65 66 66 65 63 74 20 | 61 20 70 72 65 2d 70 61 | effect |a pre-pa|
|00000cd0| 73 73 20 74 6f 20 72 65 | 67 69 73 74 65 72 20 61 |ss to re|gister a|
|00000ce0| 6c 6c 6f 63 61 74 69 6f | 6e 2e 20 20 54 68 65 20 |llocatio|n. The |
|00000cf0| 6d 61 69 6e 20 72 65 61 | 73 6f 6e 20 66 6f 72 0a |main rea|son for.|
|00000d00| 69 74 73 20 65 78 69 73 | 74 65 6e 63 65 20 69 73 |its exis|tence is|
|00000d10| 20 74 68 61 74 20 72 65 | 70 72 65 73 65 6e 74 61 | that re|presenta|
|00000d20| 74 69 6f 6e 20 63 6f 6e | 76 65 72 73 69 6f 6e 73 |tion con|versions|
|00000d30| 20 6d 61 79 20 62 65 20 | 66 61 72 69 6c 79 20 63 | may be |farily c|
|00000d40| 6f 6d 70 6c 65 78 20 28 | 65 2e 67 2e 0a 69 6e 76 |omplex (|e.g..inv|
|00000d50| 6f 6c 76 69 6e 67 20 6d | 65 6d 6f 72 79 20 61 6c |olving m|emory al|
|00000d60| 6c 6f 63 61 74 69 6f 6e | 29 2c 20 61 6e 64 20 74 |location|), and t|
|00000d70| 68 75 73 20 6d 75 73 74 | 20 62 65 20 64 69 73 63 |hus must| be disc|
|00000d80| 6f 76 65 72 65 64 20 62 | 65 66 6f 72 65 20 72 65 |overed b|efore re|
|00000d90| 67 69 73 74 65 72 0a 61 | 6c 6c 6f 63 61 74 69 6f |gister.a|llocatio|
|00000da0| 6e 2e 0a 0a 0a 56 4d 52 | 20 63 6f 6e 76 65 72 73 |n....VMR| convers|
|00000db0| 69 6f 6e 20 6c 65 61 76 | 65 73 20 73 74 75 62 73 |ion leav|es stubs|
|00000dc0| 20 66 6f 72 20 72 65 70 | 72 65 73 65 6e 74 61 74 | for rep|resentat|
|00000dd0| 69 6f 6e 20 73 70 65 63 | 69 66 69 63 20 6d 6f 76 |ion spec|ific mov|
|00000de0| 65 20 6f 70 65 72 61 74 | 69 6f 6e 73 2e 0a 52 65 |e operat|ions..Re|
|00000df0| 70 72 65 73 65 6e 74 61 | 74 69 6f 6e 20 73 65 6c |presenta|tion sel|
|00000e00| 65 63 74 69 6f 6e 20 72 | 65 63 6f 67 6e 69 7a 65 |ection r|ecognize|
|00000e10| 73 20 7b 5c 74 74 20 6d | 6f 76 65 7d 20 62 79 20 |s {\tt m|ove} by |
|00000e20| 6e 61 6d 65 2e 20 20 41 | 72 67 75 6d 65 6e 74 20 |name. A|rgument |
|00000e30| 61 6e 64 20 72 65 74 75 | 72 6e 0a 76 61 6c 75 65 |and retu|rn.value|
|00000e40| 20 70 61 73 73 69 6e 67 | 20 66 6f 72 20 63 61 6c | passing| for cal|
|00000e50| 6c 20 56 4f 50 73 20 69 | 73 20 63 6f 6e 74 72 6f |l VOPs i|s contro|
|00000e60| 6c 6c 65 64 20 62 79 20 | 74 68 65 20 7b 5c 74 74 |lled by |the {\tt|
|00000e70| 20 3a 6d 6f 76 65 2d 61 | 72 67 75 6d 65 6e 74 73 | :move-a|rguments|
|00000e80| 7d 20 6f 70 74 69 6f 6e | 0a 74 6f 20 7b 5c 74 74 |} option|.to {\tt|
|00000e90| 20 64 65 66 69 6e 65 2d | 76 6f 70 7d 2e 0a 0a 52 | define-|vop}...R|
|00000ea0| 65 70 72 65 73 65 6e 74 | 61 74 69 6f 6e 20 73 65 |epresent|ation se|
|00000eb0| 6c 65 63 74 69 6f 6e 20 | 69 73 20 61 6c 73 6f 20 |lection |is also |
|00000ec0| 72 65 73 70 6f 6e 73 69 | 62 6c 65 20 66 6f 72 20 |responsi|ble for |
|00000ed0| 64 65 74 65 72 6d 69 6e | 69 6e 67 20 77 68 61 74 |determin|ing what|
|00000ee0| 20 66 75 6e 63 74 69 6f | 6e 73 20 75 73 65 0a 74 | functio|ns use.t|
|00000ef0| 68 65 20 6e 75 6d 62 65 | 72 20 73 74 61 63 6b 2e |he numbe|r stack.|
|00000f00| 20 20 49 66 20 61 6e 79 | 20 72 65 70 72 65 73 65 | If any| represe|
|00000f10| 6e 74 61 74 69 6f 6e 20 | 69 73 20 63 68 6f 73 65 |ntation |is chose|
|00000f20| 6e 20 77 68 69 63 68 20 | 63 6f 75 6c 64 20 69 6e |n which |could in|
|00000f30| 76 6f 6c 76 65 20 70 61 | 63 6b 69 6e 67 0a 69 6e |volve pa|cking.in|
|00000f40| 74 6f 20 74 68 65 20 7b | 5c 74 74 20 6e 6f 6e 2d |to the {|\tt non-|
|00000f50| 64 65 73 63 72 69 70 74 | 6f 72 2d 73 74 61 63 6b |descript|or-stack|
|00000f60| 7d 20 53 42 2c 20 74 68 | 65 6e 20 77 65 20 61 6c |} SB, th|en we al|
|00000f70| 6c 6f 63 61 74 65 20 74 | 68 65 20 4e 46 50 20 72 |locate t|he NFP r|
|00000f80| 65 67 69 73 74 65 72 0a | 74 68 72 6f 75 67 68 6f |egister.|througho|
|00000f90| 75 74 20 74 68 65 20 63 | 6f 6d 70 6f 6e 65 6e 74 |ut the c|omponent|
|00000fa0| 2e 20 20 41 73 20 61 6e | 20 6f 70 74 69 6d 69 7a |. As an| optimiz|
|00000fb0| 61 74 69 6f 6e 2c 20 70 | 65 72 6d 69 74 20 74 68 |ation, p|ermit th|
|00000fc0| 65 20 64 65 63 69 73 69 | 6f 6e 20 6f 66 20 77 68 |e decisi|on of wh|
|00000fd0| 65 74 68 65 72 20 61 0a | 6e 75 6d 62 65 72 20 73 |ether a.|number s|
|00000fe0| 74 61 63 6b 20 66 72 61 | 6d 65 20 6e 65 65 64 73 |tack fra|me needs|
|00000ff0| 20 74 6f 20 62 65 20 61 | 6c 6c 6f 63 61 74 65 64 | to be a|llocated|
|00001000| 20 74 6f 20 62 65 20 6d | 61 64 65 20 6f 6e 20 61 | to be m|ade on a|
|00001010| 20 70 65 72 2d 66 75 6e | 63 74 69 6f 6e 20 62 61 | per-fun|ction ba|
|00001020| 73 69 73 2e 0a 49 66 20 | 61 20 66 75 6e 63 74 69 |sis..If |a functi|
|00001030| 6f 6e 20 64 6f 65 73 6e | 27 74 20 75 73 65 20 74 |on doesn|'t use t|
|00001040| 68 65 20 6e 75 6d 62 65 | 72 20 73 74 61 63 6b 2c |he numbe|r stack,|
|00001050| 20 61 6e 64 20 69 73 6e | 27 74 20 69 6e 20 74 68 | and isn|'t in th|
|00001060| 65 20 73 61 6d 65 20 74 | 61 69 6c 2d 73 65 74 20 |e same t|ail-set |
|00001070| 61 73 0a 61 6e 79 20 66 | 75 6e 63 74 69 6f 6e 20 |as.any f|unction |
|00001080| 74 68 61 74 20 75 73 65 | 73 20 74 68 65 20 6e 75 |that use|s the nu|
|00001090| 6d 62 65 72 20 73 74 61 | 63 6b 2c 20 74 68 65 6e |mber sta|ck, then|
|000010a0| 20 69 74 20 64 6f 65 73 | 6e 27 74 20 6e 65 65 64 | it does|n't need|
|000010b0| 20 61 20 6e 75 6d 62 65 | 72 20 73 74 61 63 6b 0a | a numbe|r stack.|
|000010c0| 66 72 61 6d 65 2c 20 65 | 76 65 6e 20 69 66 20 6f |frame, e|ven if o|
|000010d0| 74 68 65 72 20 66 75 6e | 63 74 69 6f 6e 73 20 69 |ther fun|ctions i|
|000010e0| 6e 20 74 68 65 20 63 6f | 6d 70 6f 6e 65 6e 74 20 |n the co|mponent |
|000010f0| 64 6f 2e 0a 0a 0c 0a 5c | 63 68 61 70 74 65 72 7b |do.....\|chapter{|
|00001100| 4c 69 66 65 74 69 6d 65 | 20 61 6e 61 6c 79 73 69 |Lifetime| analysi|
|00001110| 73 7d 0a 0a 46 69 6c 65 | 3a 20 7b 5c 74 74 20 6c |s}..File|: {\tt l|
|00001120| 69 66 65 7d 0a 0a 54 68 | 69 73 20 70 68 61 73 65 |ife}..Th|is phase|
|00001130| 20 69 73 20 61 20 70 72 | 65 6c 69 6d 69 6e 61 72 | is a pr|eliminar|
|00001140| 79 20 74 6f 20 50 61 63 | 6b 2e 20 20 49 74 20 69 |y to Pac|k. It i|
|00001150| 6e 76 6f 6c 76 65 73 20 | 74 68 72 65 65 20 70 61 |nvolves |three pa|
|00001160| 73 73 65 73 3a 0a 20 2d | 2d 20 41 20 70 72 65 2d |sses:. -|- A pre-|
|00001170| 70 61 73 73 20 74 68 61 | 74 20 63 6f 6d 70 75 74 |pass tha|t comput|
|00001180| 65 73 20 74 68 65 20 44 | 45 46 20 61 6e 64 20 55 |es the D|EF and U|
|00001190| 53 45 20 73 65 74 73 20 | 66 6f 72 20 6c 69 76 65 |SE sets |for live|
|000011a0| 20 54 4e 20 61 6e 61 6c | 79 73 69 73 2c 20 77 68 | TN anal|ysis, wh|
|000011b0| 69 6c 65 0a 20 20 20 20 | 61 6c 73 6f 20 61 73 73 |ile. |also ass|
|000011c0| 69 67 6e 69 6e 67 20 6c | 6f 63 61 6c 20 54 4e 20 |igning l|ocal TN |
|000011d0| 6e 75 6d 62 65 72 73 2c | 20 73 70 6c 69 74 74 69 |numbers,| splitti|
|000011e0| 6e 67 20 62 6c 6f 63 6b | 73 20 69 66 20 6e 65 63 |ng block|s if nec|
|000011f0| 65 73 73 61 72 79 2e 20 | 20 5c 23 5c 23 5c 23 20 |essary. | \#\#\# |
|00001200| 42 75 74 0a 6e 6f 74 20 | 72 65 61 6c 6c 79 2e 2e |But.not |really..|
|00001210| 2e 0a 20 2d 2d 20 41 20 | 66 6c 6f 77 20 61 6e 61 |.. -- A |flow ana|
|00001220| 6c 79 73 69 73 20 70 61 | 73 73 20 74 68 61 74 20 |lysis pa|ss that |
|00001230| 64 6f 65 73 20 62 61 63 | 6b 77 61 72 64 20 66 6c |does bac|kward fl|
|00001240| 6f 77 20 61 6e 61 6c 79 | 73 69 73 20 6f 6e 20 74 |ow analy|sis on t|
|00001250| 68 65 0a 20 20 20 20 63 | 6f 6d 70 6f 6e 65 6e 74 |he. c|omponent|
|00001260| 20 74 6f 20 66 69 6e 64 | 20 74 68 65 20 6c 69 76 | to find| the liv|
|00001270| 65 20 54 4e 73 20 61 74 | 20 65 61 63 68 20 62 6c |e TNs at| each bl|
|00001280| 6f 63 6b 20 62 6f 75 6e | 64 61 72 79 2e 0a 20 2d |ock boun|dary.. -|
|00001290| 2d 20 41 20 70 6f 73 74 | 2d 70 61 73 73 20 74 68 |- A post|-pass th|
|000012a0| 61 74 20 66 69 6e 64 73 | 20 74 68 65 20 63 6f 6e |at finds| the con|
|000012b0| 66 6c 69 63 74 20 73 65 | 74 20 66 6f 72 20 65 61 |flict se|t for ea|
|000012c0| 63 68 20 54 4e 2e 0a 0a | 5c 23 7c 0a 45 78 70 6c |ch TN...|\#|.Expl|
|000012d0| 6f 69 74 20 74 68 65 20 | 66 61 63 74 20 74 68 61 |oit the |fact tha|
|000012e0| 74 20 61 20 73 69 6e 67 | 6c 65 20 56 4f 50 20 63 |t a sing|le VOP c|
|000012f0| 61 6e 20 6f 6e 6c 79 20 | 65 78 68 61 75 73 74 20 |an only |exhaust |
|00001300| 4c 54 4e 20 6e 75 6d 62 | 65 72 73 20 77 68 65 6e |LTN numb|ers when|
|00001310| 20 74 68 65 72 65 20 61 | 72 65 0a 6c 61 72 67 65 | there a|re.large|
|00001320| 20 6d 6f 72 65 20 6f 70 | 65 72 61 6e 64 73 2e 20 | more op|erands. |
|00001330| 20 53 69 6e 63 65 20 6d | 6f 72 65 20 6f 70 65 72 | Since m|ore oper|
|00001340| 61 6e 64 20 72 65 66 65 | 72 65 6e 63 65 20 63 61 |and refe|rence ca|
|00001350| 6e 6e 6f 74 20 62 65 20 | 69 6e 74 65 72 6c 65 61 |nnot be |interlea|
|00001360| 76 65 64 20 77 69 74 68 | 0a 74 65 6d 70 6f 72 61 |ved with|.tempora|
|00001370| 72 79 20 72 65 66 65 72 | 65 6e 63 65 2c 20 74 68 |ry refer|ence, th|
|00001380| 65 20 72 65 66 65 72 65 | 6e 63 65 73 20 61 6c 6c |e refere|nces all|
|00001390| 20 65 66 66 65 63 74 69 | 76 65 6c 79 20 6f 63 63 | effecti|vely occ|
|000013a0| 75 72 20 61 74 20 74 68 | 65 20 73 61 6d 65 20 74 |ur at th|e same t|
|000013b0| 69 6d 65 2e 0a 54 68 69 | 73 20 6d 65 61 6e 73 20 |ime..Thi|s means |
|000013c0| 74 68 61 74 20 77 65 20 | 63 61 6e 20 61 73 73 69 |that we |can assi|
|000013d0| 67 6e 20 61 6c 6c 20 74 | 68 65 20 6d 6f 72 65 20 |gn all t|he more |
|000013e0| 61 72 67 73 20 61 6e 64 | 20 61 6c 6c 20 74 68 65 |args and| all the|
|000013f0| 20 6d 6f 72 65 20 72 65 | 73 75 6c 74 73 20 74 68 | more re|sults th|
|00001400| 65 0a 73 61 6d 65 20 4c | 54 4e 20 6e 75 6d 62 65 |e.same L|TN numbe|
|00001410| 72 20 61 6e 64 20 74 68 | 65 20 73 61 6d 65 20 6c |r and th|e same l|
|00001420| 69 66 65 74 69 6d 65 20 | 69 6e 66 6f 2e 0a 7c 5c |ifetime |info..|\|
|00001430| 23 0a 0a 0c 0a 5c 73 65 | 63 74 69 6f 6e 7b 46 6c |#....\se|ction{Fl|
|00001440| 6f 77 20 61 6e 61 6c 79 | 73 69 73 7d 0a 0a 49 74 |ow analy|sis}..It|
|00001450| 20 73 65 65 6d 73 20 77 | 65 20 63 6f 75 6c 64 20 | seems w|e could |
|00001460| 75 73 65 20 74 68 65 20 | 67 6c 6f 62 61 6c 2d 63 |use the |global-c|
|00001470| 6f 6e 66 6c 69 63 74 73 | 20 73 74 72 75 63 74 75 |onflicts| structu|
|00001480| 72 65 73 20 64 75 72 69 | 6e 67 20 63 6f 6d 70 75 |res duri|ng compu|
|00001490| 74 65 20 74 68 65 0a 69 | 6e 74 65 72 2d 62 6c 6f |te the.i|nter-blo|
|000014a0| 63 6b 20 6c 69 66 65 74 | 69 6d 65 20 69 6e 66 6f |ck lifet|ime info|
|000014b0| 72 6d 61 74 69 6f 6e 2e | 20 20 54 68 65 20 70 72 |rmation.| The pr|
|000014c0| 65 2d 70 61 73 73 20 63 | 72 65 61 74 65 73 20 61 |e-pass c|reates a|
|000014d0| 6c 6c 20 74 68 65 0a 67 | 6c 6f 62 61 6c 2d 63 6f |ll the.g|lobal-co|
|000014e0| 6e 66 6c 69 63 74 73 20 | 66 6f 72 20 62 6c 6f 63 |nflicts |for bloc|
|000014f0| 6b 73 20 74 68 61 74 20 | 67 6c 6f 62 61 6c 20 54 |ks that |global T|
|00001500| 4e 73 20 61 72 65 20 72 | 65 66 65 72 65 6e 63 65 |Ns are r|eference|
|00001510| 64 20 69 6e 2e 20 20 54 | 68 65 20 66 6c 6f 77 0a |d in. T|he flow.|
|00001520| 61 6e 61 6c 79 73 69 73 | 20 70 61 73 73 20 6a 75 |analysis| pass ju|
|00001530| 73 74 20 61 64 64 73 20 | 61 6c 77 61 79 73 2d 6c |st adds |always-l|
|00001540| 69 76 65 20 67 6c 6f 62 | 61 6c 2d 63 6f 6e 66 6c |ive glob|al-confl|
|00001550| 69 63 74 73 20 66 6f 72 | 20 74 68 65 20 6f 74 68 |icts for| the oth|
|00001560| 65 72 20 62 6c 6f 63 6b | 73 20 74 68 65 0a 54 4e |er block|s the.TN|
|00001570| 73 20 61 72 65 20 6c 69 | 76 65 20 69 6e 2e 20 20 |s are li|ve in. |
|00001580| 49 6e 20 61 64 64 69 74 | 69 6f 6e 20 74 6f 20 70 |In addit|ion to p|
|00001590| 6f 73 73 69 62 6c 79 20 | 62 65 69 6e 67 20 6d 6f |ossibly |being mo|
|000015a0| 72 65 20 65 66 66 69 63 | 69 65 6e 74 20 74 68 61 |re effic|ient tha|
|000015b0| 6e 20 53 53 65 74 73 2c | 20 74 68 69 73 0a 77 6f |n SSets,| this.wo|
|000015c0| 75 6c 64 20 64 69 72 65 | 63 74 6c 79 20 72 65 73 |uld dire|ctly res|
|000015d0| 75 6c 74 20 69 6e 20 74 | 68 65 20 64 65 73 69 72 |ult in t|he desir|
|000015e0| 65 64 20 67 6c 6f 62 61 | 6c 2d 63 6f 6e 66 6c 69 |ed globa|l-confli|
|000015f0| 63 74 73 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 2c |cts info|rmation,|
|00001600| 20 72 61 74 68 65 72 20 | 74 68 61 74 0a 68 61 76 | rather |that.hav|
|00001610| 69 6e 67 20 74 6f 20 63 | 72 65 61 74 65 20 69 74 |ing to c|reate it|
|00001620| 20 66 72 6f 6d 20 61 6e | 6f 74 68 65 72 20 72 65 | from an|other re|
|00001630| 70 72 65 73 65 6e 74 61 | 74 69 6f 6e 2e 0a 0a 54 |presenta|tion...T|
|00001640| 68 65 20 44 46 4f 20 73 | 6f 72 74 65 64 20 70 65 |he DFO s|orted pe|
|00001650| 72 2d 54 4e 20 67 6c 6f | 62 61 6c 2d 63 6f 6e 66 |r-TN glo|bal-conf|
|00001660| 6c 69 63 74 73 20 74 68 | 72 65 61 64 20 73 75 67 |licts th|read sug|
|00001670| 67 65 73 74 73 20 73 6f | 6d 65 20 6b 69 6e 64 20 |gests so|me kind |
|00001680| 6f 66 20 61 6c 67 6f 72 | 69 74 68 6d 0a 62 61 73 |of algor|ithm.bas|
|00001690| 65 64 20 6f 6e 20 74 68 | 65 20 6d 61 6e 69 70 75 |ed on th|e manipu|
|000016a0| 6c 61 74 69 6f 6e 20 6f | 66 20 74 68 65 20 73 65 |lation o|f the se|
|000016b0| 74 73 20 6f 66 20 62 6c | 6f 63 6b 73 20 65 61 63 |ts of bl|ocks eac|
|000016c0| 68 20 54 4e 20 69 73 20 | 6c 69 76 65 20 69 6e 20 |h TN is |live in |
|000016d0| 28 77 68 69 63 68 20 69 | 73 0a 77 68 61 74 20 77 |(which i|s.what w|
|000016e0| 65 20 72 65 61 6c 6c 79 | 20 77 61 6e 74 29 2c 20 |e really| want), |
|000016f0| 72 61 74 68 65 72 20 74 | 68 61 6e 20 74 68 65 20 |rather t|han the |
|00001700| 73 65 74 20 6f 66 20 54 | 4e 73 20 6c 69 76 65 20 |set of T|Ns live |
|00001710| 69 6e 20 65 61 63 68 20 | 62 6c 6f 63 6b 2e 0a 0a |in each |block...|
|00001720| 49 66 20 77 65 20 73 6f | 72 74 65 64 20 74 68 65 |If we so|rted the|
|00001730| 20 70 65 72 2d 54 4e 20 | 67 6c 6f 62 61 6c 2d 63 | per-TN |global-c|
|00001740| 6f 6e 66 6c 69 63 74 73 | 20 69 6e 20 72 65 76 65 |onflicts| in reve|
|00001750| 72 73 65 20 44 46 4f 20 | 28 77 68 69 63 68 20 69 |rse DFO |(which i|
|00001760| 73 20 6a 75 73 74 20 61 | 73 20 67 6f 6f 64 0a 66 |s just a|s good.f|
|00001770| 6f 72 20 64 65 74 65 72 | 6d 69 6e 69 6e 67 20 63 |or deter|mining c|
|00001780| 6f 6e 66 6c 69 63 74 73 | 20 62 65 74 77 65 65 6e |onflicts| between|
|00001790| 20 54 4e 73 29 2c 20 74 | 68 65 6e 20 69 74 20 73 | TNs), t|hen it s|
|000017a0| 65 65 6d 73 20 77 65 20 | 63 6f 75 6c 64 20 73 63 |eems we |could sc|
|000017b0| 61 6e 20 74 68 6f 75 67 | 68 20 74 68 65 0a 63 6f |an thoug|h the.co|
|000017c0| 6e 66 6c 69 63 74 73 20 | 73 69 6d 75 6c 74 61 6e |nflicts |simultan|
|000017d0| 65 6f 75 73 6c 79 20 77 | 69 74 68 20 6f 75 72 20 |eously w|ith our |
|000017e0| 66 6c 6f 77 2d 61 6e 61 | 6c 79 73 69 73 20 73 63 |flow-ana|lysis sc|
|000017f0| 61 6e 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 62 |an throu|gh the b|
|00001800| 6c 6f 63 6b 73 2e 0a 0a | 54 68 65 20 66 6c 6f 77 |locks...|The flow|
|00001810| 20 61 6e 61 6c 79 73 69 | 73 20 73 74 65 70 20 69 | analysi|s step i|
|00001820| 73 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 3a |s the fo|llowing:|
|00001830| 0a 20 20 20 20 49 66 20 | 61 20 54 4e 20 69 73 20 |. If |a TN is |
|00001840| 61 6c 77 61 79 73 2d 6c | 69 76 65 20 6f 72 20 72 |always-l|ive or r|
|00001850| 65 61 64 2d 62 65 66 6f | 72 65 2d 77 72 69 74 74 |ead-befo|re-writt|
|00001860| 65 6e 20 69 6e 20 61 20 | 73 75 63 63 65 73 73 6f |en in a |successo|
|00001870| 72 20 62 6c 6f 63 6b 2c | 20 74 68 65 6e 20 77 65 |r block,| then we|
|00001880| 0a 20 20 20 20 6d 61 6b | 65 20 69 74 20 61 6c 77 |. mak|e it alw|
|00001890| 61 79 73 2d 6c 69 76 65 | 20 69 6e 20 74 68 65 20 |ays-live| in the |
|000018a0| 63 75 72 72 65 6e 74 20 | 62 6c 6f 63 6b 20 75 6e |current |block un|
|000018b0| 6c 65 73 73 20 74 68 65 | 72 65 20 61 72 65 20 61 |less the|re are a|
|000018c0| 6c 72 65 61 64 79 0a 20 | 20 20 20 67 6c 6f 62 61 |lready. | globa|
|000018d0| 6c 2d 63 6f 6e 66 6c 69 | 63 74 73 20 72 65 63 6f |l-confli|cts reco|
|000018e0| 72 64 65 64 20 66 6f 72 | 20 74 68 61 74 20 54 4e |rded for| that TN|
|000018f0| 20 69 6e 20 74 68 69 73 | 20 62 6c 6f 63 6b 2e 0a | in this| block..|
|00001900| 0a 54 68 65 20 69 74 65 | 72 61 74 69 6f 6e 20 74 |.The ite|ration t|
|00001910| 65 72 6d 69 6e 61 74 65 | 73 20 77 68 65 6e 20 77 |erminate|s when w|
|00001920| 65 20 64 6f 6e 27 74 20 | 61 64 64 20 61 6e 79 20 |e don't |add any |
|00001930| 6e 65 77 20 67 6c 6f 62 | 61 6c 2d 63 6f 6e 66 6c |new glob|al-confl|
|00001940| 69 63 74 73 20 64 75 72 | 69 6e 67 20 61 0a 70 61 |icts dur|ing a.pa|
|00001950| 73 73 2e 0a 0a 57 65 20 | 6d 61 79 20 61 6c 73 6f |ss...We |may also|
|00001960| 20 77 61 6e 74 20 74 6f | 20 70 72 6f 6d 6f 74 65 | want to| promote|
|00001970| 20 54 4e 73 20 6f 6e 6c | 79 20 72 65 61 64 20 77 | TNs onl|y read w|
|00001980| 69 74 68 69 6e 20 61 20 | 62 6c 6f 63 6b 20 74 6f |ithin a |block to|
|00001990| 20 61 6c 77 61 79 73 2d | 6c 69 76 65 20 77 68 65 | always-|live whe|
|000019a0| 6e 0a 74 68 65 20 54 4e | 20 69 73 20 6c 69 76 65 |n.the TN| is live|
|000019b0| 20 69 6e 20 61 20 73 75 | 63 63 65 73 73 6f 72 2e | in a su|ccessor.|
|000019c0| 20 20 54 68 69 73 20 73 | 68 6f 75 6c 64 20 62 65 | This s|hould be|
|000019d0| 20 65 61 73 79 20 65 6e | 6f 75 67 68 20 61 73 20 | easy en|ough as |
|000019e0| 6c 6f 6e 67 20 61 73 20 | 74 68 65 0a 67 6c 6f 62 |long as |the.glob|
|000019f0| 61 6c 2d 63 6f 6e 66 6c | 69 63 74 73 20 73 74 72 |al-confl|icts str|
|00001a00| 75 63 74 75 72 65 20 63 | 6f 6e 74 61 69 6e 73 20 |ucture c|ontains |
|00001a10| 74 68 69 73 20 6b 69 6e | 64 20 6f 66 20 69 6e 66 |this kin|d of inf|
|00001a20| 6f 2e 0a 0a 54 68 65 20 | 63 72 69 74 69 63 61 6c |o...The |critical|
|00001a30| 20 6f 70 65 72 61 74 69 | 6f 6e 20 68 65 72 65 20 | operati|on here |
|00001a40| 69 73 20 64 65 74 65 72 | 6d 69 6e 69 6e 67 20 77 |is deter|mining w|
|00001a50| 68 65 74 68 65 72 20 61 | 20 67 69 76 65 6e 20 67 |hether a| given g|
|00001a60| 6c 6f 62 61 6c 20 54 4e | 20 68 61 73 20 67 6c 6f |lobal TN| has glo|
|00001a70| 62 61 6c 0a 63 6f 6e 66 | 6c 69 63 74 73 20 69 6e |bal.conf|licts in|
|00001a80| 20 61 20 67 69 76 65 6e | 20 62 6c 6f 63 6b 2e 20 | a given| block. |
|00001a90| 20 4e 6f 74 65 20 74 68 | 61 74 20 73 69 6e 63 65 | Note th|at since|
|00001aa0| 20 77 65 20 73 63 61 6e | 20 74 68 65 20 62 6c 6f | we scan| the blo|
|00001ab0| 63 6b 73 20 69 6e 20 44 | 46 4f 2c 20 61 6e 64 20 |cks in D|FO, and |
|00001ac0| 74 68 65 0a 67 6c 6f 62 | 61 6c 2d 63 6f 6e 66 6c |the.glob|al-confl|
|00001ad0| 69 63 74 73 20 61 72 65 | 20 73 6f 72 74 65 64 20 |icts are| sorted |
|00001ae0| 69 6e 20 44 46 4f 2c 20 | 69 66 20 77 65 20 67 69 |in DFO, |if we gi|
|00001af0| 76 65 20 65 61 63 68 20 | 67 6c 6f 62 61 6c 20 54 |ve each |global T|
|00001b00| 4e 20 61 20 70 6f 69 6e | 74 65 72 20 74 6f 20 74 |N a poin|ter to t|
|00001b10| 68 65 0a 67 6c 6f 62 61 | 6c 2d 63 6f 6e 66 6c 69 |he.globa|l-confli|
|00001b20| 63 74 73 20 66 6f 72 20 | 74 68 65 20 6c 61 73 74 |cts for |the last|
|00001b30| 20 62 6c 6f 63 6b 20 77 | 65 20 63 68 65 63 6b 65 | block w|e checke|
|00001b40| 64 20 74 68 65 20 54 4e | 20 77 61 73 20 69 6e 2c |d the TN| was in,|
|00001b50| 20 74 68 65 6e 20 77 65 | 20 63 61 6e 0a 67 75 61 | then we| can.gua|
|00001b60| 72 61 6e 74 65 65 20 74 | 68 61 74 20 74 68 65 20 |rantee t|hat the |
|00001b70| 67 6c 6f 62 61 6c 2d 63 | 6f 6e 66 6c 69 63 74 73 |global-c|onflicts|
|00001b80| 20 77 65 20 61 72 65 20 | 6c 6f 6f 6b 69 6e 67 20 | we are |looking |
|00001b90| 66 6f 72 20 61 72 65 20 | 61 6c 77 61 79 73 20 61 |for are |always a|
|00001ba0| 74 20 6f 72 20 61 66 74 | 65 72 0a 74 68 61 74 20 |t or aft|er.that |
|00001bb0| 70 6f 69 6e 74 65 72 2e | 20 20 49 66 20 77 65 20 |pointer.| If we |
|00001bc0| 6e 65 65 64 20 74 6f 20 | 69 6e 73 65 72 74 20 61 |need to |insert a|
|00001bd0| 20 6e 65 77 20 73 74 72 | 75 63 74 75 72 65 2c 20 | new str|ucture, |
|00001be0| 74 68 65 6e 20 74 68 65 | 20 70 6f 69 6e 74 65 72 |then the| pointer|
|00001bf0| 20 77 69 6c 6c 20 68 65 | 6c 70 0a 75 73 20 72 61 | will he|lp.us ra|
|00001c00| 70 69 64 6c 79 20 66 69 | 6e 64 20 74 68 65 20 70 |pidly fi|nd the p|
|00001c10| 6c 61 63 65 20 74 6f 20 | 64 6f 20 74 68 65 20 69 |lace to |do the i|
|00001c20| 6e 73 65 72 74 69 6f 6e | 2e 5d 0a 0a 0c 0a 5c 73 |nsertion|.]....\s|
|00001c30| 65 63 74 69 6f 6e 7b 43 | 6f 6e 66 6c 69 63 74 20 |ection{C|onflict |
|00001c40| 64 65 74 65 63 74 69 6f | 6e 7d 0a 0a 5b 5c 23 5c |detectio|n}..[\#\|
|00001c50| 23 5c 23 20 45 6e 76 69 | 72 6f 6e 6d 65 6e 74 2c |#\# Envi|ronment,|
|00001c60| 20 3a 6d 6f 72 65 20 54 | 4e 73 2e 5d 0a 0a 54 68 | :more T|Ns.]..Th|
|00001c70| 69 73 20 70 68 61 73 65 | 20 6d 61 6b 65 73 20 75 |is phase| makes u|
|00001c80| 73 65 20 6f 66 20 74 68 | 65 20 72 65 73 75 6c 74 |se of th|e result|
|00001c90| 73 20 6f 66 20 6c 69 66 | 65 74 69 6d 65 20 61 6e |s of lif|etime an|
|00001ca0| 61 6c 79 73 69 73 20 74 | 6f 20 66 69 6e 64 20 74 |alysis t|o find t|
|00001cb0| 68 65 20 73 65 74 20 6f | 66 20 54 4e 73 0a 74 68 |he set o|f TNs.th|
|00001cc0| 61 74 20 68 61 76 65 20 | 6c 69 66 65 74 69 6d 65 |at have |lifetime|
|00001cd0| 73 20 6f 76 65 72 6c 61 | 70 70 69 6e 67 20 77 69 |s overla|pping wi|
|00001ce0| 74 68 20 74 68 6f 73 65 | 20 6f 66 20 65 61 63 68 |th those| of each|
|00001cf0| 20 54 4e 2e 20 20 57 65 | 20 61 6c 73 6f 20 61 6e | TN. We| also an|
|00001d00| 6e 6f 74 61 74 65 20 63 | 61 6c 6c 0a 56 4f 50 73 |notate c|all.VOPs|
|00001d10| 20 77 69 74 68 20 69 6e | 66 6f 72 6d 61 74 69 6f | with in|formatio|
|00001d20| 6e 20 61 62 6f 75 74 20 | 74 68 65 20 6c 69 76 65 |n about |the live|
|00001d30| 20 54 4e 73 20 73 6f 20 | 74 68 61 74 20 63 6f 64 | TNs so |that cod|
|00001d40| 65 20 67 65 6e 65 72 61 | 74 69 6f 6e 20 6b 6e 6f |e genera|tion kno|
|00001d50| 77 73 20 77 68 69 63 68 | 0a 72 65 67 69 73 74 65 |ws which|.registe|
|00001d60| 72 73 20 6e 65 65 64 20 | 74 6f 20 62 65 20 73 61 |rs need |to be sa|
|00001d70| 76 65 64 2e 0a 0a 54 68 | 65 20 62 61 73 69 63 20 |ved...Th|e basic |
|00001d80| 61 63 74 69 6f 6e 20 69 | 73 20 61 20 62 61 63 6b |action i|s a back|
|00001d90| 77 61 72 64 20 73 63 61 | 6e 20 6f 66 20 65 61 63 |ward sca|n of eac|
|00001da0| 68 20 62 6c 6f 63 6b 2c | 20 6c 6f 6f 6b 69 6e 67 |h block,| looking|
|00001db0| 20 61 74 20 65 61 63 68 | 20 54 4e 2d 52 65 66 20 | at each| TN-Ref |
|00001dc0| 61 6e 64 0a 6d 61 69 6e | 74 61 69 6e 69 6e 67 20 |and.main|taining |
|00001dd0| 61 20 73 65 74 20 6f 66 | 20 74 68 65 20 63 75 72 |a set of| the cur|
|00001de0| 72 65 6e 74 6c 79 20 6c | 69 76 65 20 54 4e 73 2e |rently l|ive TNs.|
|00001df0| 20 20 57 68 65 6e 20 77 | 65 20 73 65 65 20 61 20 | When w|e see a |
|00001e00| 72 65 61 64 2c 20 77 65 | 20 63 68 65 63 6b 20 69 |read, we| check i|
|00001e10| 66 0a 74 68 65 20 54 4e | 20 69 73 20 69 6e 20 74 |f.the TN| is in t|
|00001e20| 68 65 20 6c 69 76 65 20 | 73 65 74 2e 20 20 49 66 |he live |set. If|
|00001e30| 20 6e 6f 74 2c 20 77 65 | 3a 0a 20 2d 2d 20 41 64 | not, we|:. -- Ad|
|00001e40| 64 20 74 68 65 20 54 4e | 20 74 6f 20 74 68 65 20 |d the TN| to the |
|00001e50| 63 6f 6e 66 6c 69 63 74 | 20 73 65 74 20 66 6f 72 |conflict| set for|
|00001e60| 20 65 76 65 72 79 20 63 | 75 72 72 65 6e 74 6c 79 | every c|urrently|
|00001e70| 20 6c 69 76 65 20 54 4e | 2c 0a 20 2d 2d 20 55 6e | live TN|,. -- Un|
|00001e80| 69 6f 6e 20 74 68 65 20 | 73 65 74 20 6f 66 20 63 |ion the |set of c|
|00001e90| 75 72 72 65 6e 74 6c 79 | 20 6c 69 76 65 20 54 4e |urrently| live TN|
|00001ea0| 73 20 77 69 74 68 20 74 | 68 65 20 63 6f 6e 66 6c |s with t|he confl|
|00001eb0| 69 63 74 20 73 65 74 20 | 66 6f 72 20 74 68 65 20 |ict set |for the |
|00001ec0| 54 4e 2c 20 61 6e 64 0a | 20 2d 2d 20 41 64 64 20 |TN, and.| -- Add |
|00001ed0| 74 68 65 20 54 4e 20 74 | 6f 20 74 68 65 20 73 65 |the TN t|o the se|
|00001ee0| 74 20 6f 66 20 6c 69 76 | 65 20 54 4e 73 2e 0a 0a |t of liv|e TNs...|
|00001ef0| 57 68 65 6e 20 77 65 20 | 73 65 65 20 61 20 77 72 |When we |see a wr|
|00001f00| 69 74 65 20 66 6f 72 20 | 61 20 6c 69 76 65 20 54 |ite for |a live T|
|00001f10| 4e 2c 20 77 65 20 6a 75 | 73 74 20 72 65 6d 6f 76 |N, we ju|st remov|
|00001f20| 65 20 69 74 20 66 72 6f | 6d 20 74 68 65 20 6c 69 |e it fro|m the li|
|00001f30| 76 65 20 73 65 74 2e 20 | 20 49 66 20 77 65 0a 73 |ve set. | If we.s|
|00001f40| 65 65 20 61 20 77 72 69 | 74 65 20 74 6f 20 61 20 |ee a wri|te to a |
|00001f50| 64 65 61 64 20 54 4e 2c | 20 74 68 65 6e 20 77 65 |dead TN,| then we|
|00001f60| 20 75 70 64 61 74 65 20 | 74 68 65 20 63 6f 6e 66 | update |the conf|
|00001f70| 6c 69 63 74 73 20 73 65 | 74 73 20 61 73 20 66 6f |licts se|ts as fo|
|00001f80| 72 20 61 20 72 65 61 64 | 2c 20 62 75 74 0a 64 6f |r a read|, but.do|
|00001f90| 6e 27 74 20 61 64 64 20 | 74 68 65 20 54 4e 20 74 |n't add |the TN t|
|00001fa0| 6f 20 74 68 65 20 6c 69 | 76 65 20 73 65 74 2e 20 |o the li|ve set. |
|00001fb0| 20 57 65 20 68 61 76 65 | 20 74 6f 20 64 6f 20 74 | We have| to do t|
|00001fc0| 68 69 73 20 73 6f 20 74 | 68 61 74 20 74 68 65 20 |his so t|hat the |
|00001fd0| 62 6f 67 75 73 20 77 72 | 69 74 65 0a 64 6f 65 73 |bogus wr|ite.does|
|00001fe0| 6e 27 74 20 63 6c 6f 62 | 62 65 72 20 61 6e 79 74 |n't clob|ber anyt|
|00001ff0| 68 69 6e 67 2e 0a 0a 5b | 57 65 20 64 6f 6e 27 74 |hing...[|We don't|
|00002000| 20 63 6f 6e 73 69 64 65 | 72 20 61 6c 77 61 79 73 | conside|r always|
|00002010| 2d 6c 69 76 65 20 54 4e | 73 20 61 74 20 61 6c 6c |-live TN|s at all|
|00002020| 20 69 6e 20 74 68 69 73 | 20 70 72 6f 63 65 73 73 | in this| process|
|00002030| 2c 20 73 69 6e 63 65 20 | 74 68 65 20 63 6f 6e 66 |, since |the conf|
|00002040| 6c 69 63 74 0a 6f 66 20 | 61 6c 77 61 79 73 2d 6c |lict.of |always-l|
|00002050| 69 76 65 20 54 4e 73 20 | 77 69 74 68 20 6f 74 68 |ive TNs |with oth|
|00002060| 65 72 20 54 4e 73 20 69 | 6e 20 74 68 65 20 62 6c |er TNs i|n the bl|
|00002070| 6f 63 6b 20 69 73 20 69 | 6d 70 6c 69 63 69 74 20 |ock is i|mplicit |
|00002080| 69 6e 20 74 68 65 0a 67 | 6c 6f 62 61 6c 2d 63 6f |in the.g|lobal-co|
|00002090| 6e 66 6c 69 63 74 73 20 | 73 74 72 75 63 74 75 72 |nflicts |structur|
|000020a0| 65 73 2e 0a 0a 42 65 66 | 6f 72 65 20 77 65 20 64 |es...Bef|ore we d|
|000020b0| 6f 20 74 68 65 20 73 63 | 61 6e 20 6f 6e 20 61 20 |o the sc|an on a |
|000020c0| 62 6c 6f 63 6b 2c 20 77 | 65 20 67 6f 20 74 68 72 |block, w|e go thr|
|000020d0| 6f 75 67 68 20 74 68 65 | 20 67 6c 6f 62 61 6c 2d |ough the| global-|
|000020e0| 63 6f 6e 66 6c 69 63 74 | 73 20 73 74 72 75 63 74 |conflict|s struct|
|000020f0| 75 72 65 73 0a 6f 66 20 | 54 4e 73 20 74 68 61 74 |ures.of |TNs that|
|00002100| 20 63 68 61 6e 67 65 20 | 6c 69 76 65 6e 65 73 73 | change |liveness|
|00002110| 20 69 6e 20 74 68 65 20 | 62 6c 6f 63 6b 2c 20 61 | in the |block, a|
|00002120| 73 73 69 67 6e 69 6e 67 | 20 74 68 65 20 72 65 63 |ssigning| the rec|
|00002130| 6f 72 64 65 64 20 4c 54 | 4e 20 6e 75 6d 62 65 72 |orded LT|N number|
|00002140| 20 74 6f 0a 74 68 65 20 | 54 4e 27 73 20 4c 54 4e | to.the |TN's LTN|
|00002150| 20 6e 75 6d 62 65 72 20 | 66 6f 72 20 74 68 65 20 | number |for the |
|00002160| 64 75 72 61 74 69 6f 6e | 20 6f 66 20 70 72 6f 63 |duration| of proc|
|00002170| 65 73 73 69 6e 67 20 6f | 66 20 74 68 61 74 20 62 |essing o|f that b|
|00002180| 6c 6f 63 6b 2e 5d 0a 20 | 0a 0a 45 66 66 69 63 69 |lock.]. |..Effici|
|00002190| 65 6e 74 6c 79 20 63 6f | 6d 70 75 74 69 6e 67 20 |ently co|mputing |
|000021a0| 61 6e 64 20 72 65 70 72 | 65 73 65 6e 74 69 6e 67 |and repr|esenting|
|000021b0| 20 74 68 69 73 20 69 6e | 66 6f 72 6d 61 74 69 6f | this in|formatio|
|000021c0| 6e 20 63 61 6c 6c 73 20 | 66 6f 72 20 73 6f 6d 65 |n calls |for some|
|000021d0| 0a 63 6c 65 76 65 72 6e | 65 73 73 2e 20 20 49 74 |.clevern|ess. It|
|000021e0| 20 77 6f 75 6c 64 20 62 | 65 20 70 72 6f 68 69 62 | would b|e prohib|
|000021f0| 69 74 69 76 65 6c 79 20 | 65 78 70 65 6e 73 69 76 |itively |expensiv|
|00002200| 65 20 74 6f 20 72 65 70 | 72 65 73 65 6e 74 20 74 |e to rep|resent t|
|00002210| 68 65 20 66 75 6c 6c 20 | 63 6f 6e 66 6c 69 63 74 |he full |conflict|
|00002220| 0a 73 65 74 20 66 6f 72 | 20 65 76 65 72 79 20 54 |.set for| every T|
|00002230| 4e 20 77 69 74 68 20 73 | 70 61 72 73 65 20 73 65 |N with s|parse se|
|00002240| 74 73 2c 20 61 73 20 69 | 73 20 64 6f 6e 65 20 61 |ts, as i|s done a|
|00002250| 74 20 74 68 65 20 62 6c | 6f 63 6b 2d 6c 65 76 65 |t the bl|ock-leve|
|00002260| 6c 2e 20 20 41 6c 74 68 | 6f 75 67 68 20 69 74 0a |l. Alth|ough it.|
|00002270| 77 6f 75 6c 64 6e 27 74 | 20 63 61 75 73 65 20 6e |wouldn't| cause n|
|00002280| 6f 6e 2d 6c 69 6e 65 61 | 72 20 62 65 68 61 76 69 |on-linea|r behavi|
|00002290| 6f 72 2c 20 69 74 20 77 | 6f 75 6c 64 20 72 65 71 |or, it w|ould req|
|000022a0| 75 69 72 65 20 61 20 63 | 6f 6d 70 6c 65 78 20 6c |uire a c|omplex l|
|000022b0| 69 6e 6b 65 64 20 73 74 | 72 75 63 74 75 72 65 0a |inked st|ructure.|
|000022c0| 63 6f 6e 74 61 69 6e 69 | 6e 67 20 74 65 6e 73 20 |containi|ng tens |
|000022d0| 6f 66 20 65 6c 65 6d 65 | 6e 74 73 20 74 6f 20 62 |of eleme|nts to b|
|000022e0| 65 20 63 72 65 61 74 65 | 64 20 66 6f 72 20 65 76 |e create|d for ev|
|000022f0| 65 72 79 20 54 4e 2e 20 | 20 46 6f 72 74 75 6e 61 |ery TN. | Fortuna|
|00002300| 74 65 6c 79 20 77 65 20 | 63 61 6e 0a 69 6d 70 72 |tely we |can.impr|
|00002310| 6f 76 65 20 6f 6e 20 74 | 68 69 73 20 69 66 20 77 |ove on t|his if w|
|00002320| 65 20 74 61 6b 65 20 69 | 6e 74 6f 20 61 63 63 6f |e take i|nto acco|
|00002330| 75 6e 74 20 74 68 65 20 | 66 61 63 74 20 74 68 61 |unt the |fact tha|
|00002340| 74 20 6d 6f 73 74 20 54 | 4e 73 20 61 72 65 20 22 |t most T|Ns are "|
|00002350| 6c 6f 63 61 6c 22 20 54 | 4e 73 3a 0a 54 4e 73 20 |local" T|Ns:.TNs |
|00002360| 77 68 69 63 68 20 68 61 | 76 65 20 61 6c 6c 20 74 |which ha|ve all t|
|00002370| 68 65 69 72 20 75 73 65 | 73 20 69 6e 20 6f 6e 65 |heir use|s in one|
|00002380| 20 62 6c 6f 63 6b 2e 0a | 0a 46 69 72 73 74 2c 20 | block..|.First, |
|00002390| 6d 61 6e 79 20 67 6c 6f | 62 61 6c 20 54 4e 73 20 |many glo|bal TNs |
|000023a0| 77 69 6c 6c 20 62 65 20 | 65 69 74 68 65 72 20 6c |will be |either l|
|000023b0| 69 76 65 20 6f 72 20 64 | 65 61 64 20 66 6f 72 20 |ive or d|ead for |
|000023c0| 74 68 65 20 65 6e 74 69 | 72 65 20 64 75 72 61 74 |the enti|re durat|
|000023d0| 69 6f 6e 20 6f 66 20 61 | 0a 67 69 76 65 6e 20 62 |ion of a|.given b|
|000023e0| 6c 6f 63 6b 2e 20 20 57 | 65 20 63 61 6e 20 72 65 |lock. W|e can re|
|000023f0| 70 72 65 73 65 6e 74 20 | 74 68 65 20 63 6f 6e 66 |present |the conf|
|00002400| 6c 69 63 74 20 62 65 74 | 77 65 65 6e 20 67 6c 6f |lict bet|ween glo|
|00002410| 62 61 6c 20 54 4e 73 20 | 6c 69 76 65 20 74 68 72 |bal TNs |live thr|
|00002420| 6f 75 67 68 6f 75 74 0a | 74 68 65 20 62 6c 6f 63 |oughout.|the bloc|
|00002430| 6b 20 61 6e 64 20 54 4e | 73 20 6c 6f 63 61 6c 20 |k and TN|s local |
|00002440| 74 6f 20 74 68 65 20 62 | 6c 6f 63 6b 20 62 79 20 |to the b|lock by |
|00002450| 73 74 6f 72 69 6e 67 20 | 74 68 65 20 73 65 74 20 |storing |the set |
|00002460| 6f 66 20 61 6c 77 61 79 | 73 2d 6c 69 76 65 20 67 |of alway|s-live g|
|00002470| 6c 6f 62 61 6c 0a 54 4e | 73 20 69 6e 20 74 68 65 |lobal.TN|s in the|
|00002480| 20 62 6c 6f 63 6b 2e 20 | 20 54 68 69 73 20 72 65 | block. | This re|
|00002490| 64 75 63 65 73 20 74 68 | 65 20 6e 75 6d 62 65 72 |duces th|e number|
|000024a0| 20 6f 66 20 67 6c 6f 62 | 61 6c 20 54 4e 73 20 74 | of glob|al TNs t|
|000024b0| 68 61 74 20 6d 75 73 74 | 20 62 65 0a 72 65 70 72 |hat must| be.repr|
|000024c0| 65 73 65 6e 74 65 64 20 | 69 6e 20 74 68 65 20 63 |esented |in the c|
|000024d0| 6f 6e 66 6c 69 63 74 73 | 20 66 6f 72 20 6c 6f 63 |onflicts| for loc|
|000024e0| 61 6c 20 54 4e 73 2e 0a | 0a 53 65 63 6f 6e 64 2c |al TNs..|.Second,|
|000024f0| 20 77 65 20 63 61 6e 20 | 72 65 70 72 65 73 65 6e | we can |represen|
|00002500| 74 20 63 6f 6e 66 6c 69 | 63 74 73 20 77 69 74 68 |t confli|cts with|
|00002510| 69 6e 20 61 20 62 6c 6f | 63 6b 20 75 73 69 6e 67 |in a blo|ck using|
|00002520| 20 62 69 74 2d 76 65 63 | 74 6f 72 73 2e 20 20 45 | bit-vec|tors. E|
|00002530| 61 63 68 20 54 4e 0a 74 | 68 61 74 20 63 68 61 6e |ach TN.t|hat chan|
|00002540| 67 65 73 20 6c 69 76 65 | 6e 65 73 73 20 77 69 74 |ges live|ness wit|
|00002550| 68 69 6e 20 61 20 62 6c | 6f 63 6b 20 69 73 20 61 |hin a bl|ock is a|
|00002560| 73 73 69 67 6e 65 64 20 | 61 20 6c 6f 63 61 6c 20 |ssigned |a local |
|00002570| 54 4e 20 6e 75 6d 62 65 | 72 2e 20 20 4c 6f 63 61 |TN numbe|r. Loca|
|00002580| 6c 0a 63 6f 6e 66 6c 69 | 63 74 73 20 61 72 65 20 |l.confli|cts are |
|00002590| 72 65 70 72 65 73 65 6e | 74 65 64 20 75 73 69 6e |represen|ted usin|
|000025a0| 67 20 61 20 66 69 78 65 | 64 2d 73 69 7a 65 20 62 |g a fixe|d-size b|
|000025b0| 69 74 2d 76 65 63 74 6f | 72 20 6f 66 20 36 34 20 |it-vecto|r of 64 |
|000025c0| 65 6c 65 6d 65 6e 74 73 | 20 6f 72 20 73 6f 0a 77 |elements| or so.w|
|000025d0| 68 69 63 68 20 68 61 73 | 20 61 20 31 20 66 6f 72 |hich has| a 1 for|
|000025e0| 20 74 68 65 20 6c 6f 63 | 61 6c 20 54 4e 20 6e 75 | the loc|al TN nu|
|000025f0| 6d 62 65 72 20 6f 66 20 | 65 76 65 72 79 20 54 4e |mber of |every TN|
|00002600| 20 6c 69 76 65 20 61 74 | 20 74 68 61 74 20 74 69 | live at| that ti|
|00002610| 6d 65 2e 20 20 54 68 65 | 20 62 6c 6f 63 6b 0a 68 |me. The| block.h|
|00002620| 61 73 20 61 20 73 69 6d | 70 6c 65 2d 76 65 63 74 |as a sim|ple-vect|
|00002630| 6f 72 20 77 68 69 63 68 | 20 6d 61 70 73 20 66 72 |or which| maps fr|
|00002640| 6f 6d 20 6c 6f 63 61 6c | 20 54 4e 20 6e 75 6d 62 |om local| TN numb|
|00002650| 65 72 73 20 74 6f 20 54 | 4e 73 2e 20 20 46 69 78 |ers to T|Ns. Fix|
|00002660| 65 64 2d 73 69 7a 65 0a | 76 65 63 74 6f 72 73 20 |ed-size.|vectors |
|00002670| 72 65 64 75 63 65 20 74 | 68 65 20 68 61 73 73 6c |reduce t|he hassl|
|00002680| 65 20 6f 66 20 64 6f 69 | 6e 67 20 61 6c 6c 6f 63 |e of doi|ng alloc|
|00002690| 61 74 69 6f 6e 73 20 61 | 6e 64 20 61 6c 6c 6f 77 |ations a|nd allow|
|000026a0| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 74 6f 20 62 | operati|ons to b|
|000026b0| 65 0a 6f 70 65 6e 2d 63 | 6f 64 65 64 20 69 6e 20 |e.open-c|oded in |
|000026c0| 61 20 6d 61 78 69 6d 61 | 6c 6c 79 20 74 65 6e 73 |a maxima|lly tens|
|000026d0| 65 20 66 61 73 68 69 6f | 6e 2e 0a 0a 57 65 20 63 |e fashio|n...We c|
|000026e0| 61 6e 20 72 65 70 72 65 | 73 65 6e 74 20 74 68 65 |an repre|sent the|
|000026f0| 20 63 6f 6e 66 6c 69 63 | 74 73 20 66 6f 72 20 61 | conflic|ts for a|
|00002700| 20 6c 6f 63 61 6c 20 54 | 4e 20 62 79 20 61 20 73 | local T|N by a s|
|00002710| 69 6e 67 6c 65 20 62 69 | 74 2d 76 65 63 74 6f 72 |ingle bi|t-vector|
|00002720| 20 69 6e 64 65 78 65 64 | 20 62 79 0a 74 68 65 20 | indexed| by.the |
|00002730| 6c 6f 63 61 6c 20 54 4e | 20 6e 75 6d 62 65 72 73 |local TN| numbers|
|00002740| 20 66 6f 72 20 74 68 61 | 74 20 62 6c 6f 63 6b 2c | for tha|t block,|
|00002750| 20 62 75 74 20 69 6e 20 | 74 68 65 20 67 6c 6f 62 | but in |the glob|
|00002760| 61 6c 20 54 4e 20 63 61 | 73 65 2c 20 77 65 20 6e |al TN ca|se, we n|
|00002770| 65 65 64 20 74 6f 20 62 | 65 0a 61 62 6c 65 20 74 |eed to b|e.able t|
|00002780| 6f 20 72 65 70 72 65 73 | 65 6e 74 20 63 6f 6e 66 |o repres|ent conf|
|00002790| 6c 69 63 74 73 20 77 69 | 74 68 20 61 72 62 69 74 |licts wi|th arbit|
|000027a0| 72 61 72 79 20 54 4e 73 | 2e 20 20 57 65 20 63 6f |rary TNs|. We co|
|000027b0| 75 6c 64 20 75 73 65 20 | 61 20 6c 69 73 74 2d 6c |uld use |a list-l|
|000027c0| 69 6b 65 0a 73 70 61 72 | 73 65 20 73 65 74 20 72 |ike.spar|se set r|
|000027d0| 65 70 72 65 73 65 6e 74 | 61 74 69 6f 6e 2c 20 62 |epresent|ation, b|
|000027e0| 75 74 20 74 68 65 6e 20 | 77 65 20 77 6f 75 6c 64 |ut then |we would|
|000027f0| 20 68 61 76 65 20 74 6f | 20 65 69 74 68 65 72 20 | have to| either |
|00002800| 73 70 65 63 69 61 6c 2d | 63 61 73 65 20 67 6c 6f |special-|case glo|
|00002810| 62 61 6c 0a 54 4e 73 20 | 62 79 20 75 73 69 6e 67 |bal.TNs |by using|
|00002820| 20 74 68 65 20 73 70 61 | 72 73 65 20 72 65 70 72 | the spa|rse repr|
|00002830| 65 73 65 6e 74 61 74 69 | 6f 6e 20 77 69 74 68 69 |esentati|on withi|
|00002840| 6e 20 74 68 65 20 62 6c | 6f 63 6b 2c 20 6f 72 20 |n the bl|ock, or |
|00002850| 63 6f 6e 76 65 72 74 20 | 74 68 65 20 6c 6f 63 61 |convert |the loca|
|00002860| 6c 0a 63 6f 6e 66 6c 69 | 63 74 73 20 62 69 74 2d |l.confli|cts bit-|
|00002870| 76 65 63 74 6f 72 20 74 | 6f 20 74 68 65 20 73 70 |vector t|o the sp|
|00002880| 61 72 73 65 20 72 65 70 | 72 65 73 65 6e 74 61 74 |arse rep|resentat|
|00002890| 69 6f 6e 20 61 74 20 74 | 68 65 20 62 6c 6f 63 6b |ion at t|he block|
|000028a0| 20 65 6e 64 2e 20 20 49 | 6e 73 74 65 61 64 2c 0a | end. I|nstead,.|
|000028b0| 77 65 20 67 69 76 65 20 | 65 61 63 68 20 67 6c 6f |we give |each glo|
|000028c0| 62 61 6c 20 54 4e 20 61 | 20 6c 69 73 74 20 6f 66 |bal TN a| list of|
|000028d0| 20 74 68 65 20 6c 6f 63 | 61 6c 20 63 6f 6e 66 6c | the loc|al confl|
|000028e0| 69 63 74 73 20 62 69 74 | 2d 76 65 63 74 6f 72 73 |icts bit|-vectors|
|000028f0| 20 66 6f 72 20 65 61 63 | 68 20 62 6c 6f 63 6b 0a | for eac|h block.|
|00002900| 74 68 61 74 20 74 68 65 | 20 54 4e 20 69 73 20 6c |that the| TN is l|
|00002910| 69 76 65 20 69 6e 2e 20 | 20 49 66 20 74 68 65 20 |ive in. | If the |
|00002920| 54 4e 20 69 73 20 61 6c | 77 61 79 73 2d 6c 69 76 |TN is al|ways-liv|
|00002930| 65 20 69 6e 20 61 20 62 | 6c 6f 63 6b 2c 20 74 68 |e in a b|lock, th|
|00002940| 65 6e 20 77 65 20 72 65 | 63 6f 72 64 0a 74 68 61 |en we re|cord.tha|
|00002950| 74 20 66 61 63 74 20 69 | 6e 73 74 65 61 64 2e 20 |t fact i|nstead. |
|00002960| 20 54 68 69 73 20 67 69 | 76 65 73 20 75 73 20 61 | This gi|ves us a|
|00002970| 20 6d 61 6a 6f 72 20 72 | 65 64 75 63 74 69 6f 6e | major r|eduction|
|00002980| 20 69 6e 20 74 68 65 20 | 61 6d 6f 75 6e 74 20 6f | in the |amount o|
|00002990| 66 20 77 6f 72 6b 20 77 | 65 0a 68 61 76 65 20 74 |f work w|e.have t|
|000029a0| 6f 20 64 6f 20 69 6e 20 | 6c 69 66 65 74 69 6d 65 |o do in |lifetime|
|000029b0| 20 61 6e 61 6c 79 73 69 | 73 20 61 74 20 74 68 65 | analysi|s at the|
|000029c0| 20 63 6f 73 74 20 6f 66 | 20 73 6f 6d 65 20 69 6e | cost of| some in|
|000029d0| 63 72 65 61 73 65 20 69 | 6e 20 74 68 65 20 74 69 |crease i|n the ti|
|000029e0| 6d 65 20 74 6f 0a 69 74 | 65 72 61 74 65 20 6f 76 |me to.it|erate ov|
|000029f0| 65 72 20 74 68 65 20 73 | 65 74 20 64 75 72 69 6e |er the s|et durin|
|00002a00| 67 20 50 61 63 6b 2e 0a | 0a 53 69 6e 63 65 20 77 |g Pack..|.Since w|
|00002a10| 65 20 62 75 69 6c 64 20 | 74 68 65 20 6c 69 73 74 |e build |the list|
|00002a20| 73 20 6f 66 20 6c 6f 63 | 61 6c 20 63 6f 6e 66 6c |s of loc|al confl|
|00002a30| 69 63 74 20 76 65 63 74 | 6f 72 73 20 61 20 62 6c |ict vect|ors a bl|
|00002a40| 6f 63 6b 20 61 74 20 61 | 20 74 69 6d 65 2c 20 74 |ock at a| time, t|
|00002a50| 68 65 0a 62 6c 6f 63 6b | 73 20 69 6e 20 74 68 65 |he.block|s in the|
|00002a60| 20 6c 69 73 74 73 20 66 | 6f 72 20 65 61 63 68 20 | lists f|or each |
|00002a70| 54 4e 20 77 69 6c 6c 20 | 62 65 20 73 6f 72 74 65 |TN will |be sorte|
|00002a80| 64 20 62 79 20 74 68 65 | 20 62 6c 6f 63 6b 20 6e |d by the| block n|
|00002a90| 75 6d 62 65 72 2e 20 20 | 54 68 65 0a 73 74 72 75 |umber. |The.stru|
|00002aa0| 63 74 75 72 65 20 61 6c | 73 6f 20 63 6f 6e 74 61 |cture al|so conta|
|00002ab0| 69 6e 73 20 74 68 65 20 | 6c 6f 63 61 6c 20 54 4e |ins the |local TN|
|00002ac0| 20 6e 75 6d 62 65 72 20 | 66 6f 72 20 74 68 65 20 | number |for the |
|00002ad0| 54 4e 20 69 6e 20 74 68 | 61 74 20 62 6c 6f 63 6b |TN in th|at block|
|00002ae0| 2e 20 20 54 68 65 73 65 | 0a 66 65 61 74 75 72 65 |. These|.feature|
|00002af0| 73 20 61 6c 6c 6f 77 20 | 70 61 63 6b 20 74 6f 20 |s allow |pack to |
|00002b00| 65 66 66 69 63 69 65 6e | 74 6c 79 20 64 65 74 65 |efficien|tly dete|
|00002b10| 72 6d 69 6e 65 20 77 68 | 65 74 68 65 72 20 74 77 |rmine wh|ether tw|
|00002b20| 6f 20 61 72 62 69 74 72 | 61 72 79 20 54 4e 73 0a |o arbitr|ary TNs.|
|00002b30| 63 6f 6e 66 6c 69 63 74 | 2e 20 20 59 6f 75 20 6a |conflict|. You j|
|00002b40| 75 73 74 20 73 63 61 6e | 20 74 68 65 20 6c 69 73 |ust scan| the lis|
|00002b50| 74 73 20 69 6e 20 6f 72 | 64 65 72 2c 20 73 6b 69 |ts in or|der, ski|
|00002b60| 70 70 69 6e 67 20 62 6c | 6f 63 6b 73 20 74 68 61 |pping bl|ocks tha|
|00002b70| 74 20 61 72 65 20 69 6e | 20 6f 6e 6c 79 0a 6f 6e |t are in| only.on|
|00002b80| 65 20 6c 69 73 74 20 62 | 79 20 75 73 69 6e 67 20 |e list b|y using |
|00002b90| 74 68 65 20 62 6c 6f 63 | 6b 20 6e 75 6d 62 65 72 |the bloc|k number|
|00002ba0| 73 2e 20 20 57 68 65 6e | 20 77 65 20 66 69 6e 64 |s. When| we find|
|00002bb0| 20 61 20 62 6c 6f 63 6b | 20 74 68 61 74 20 62 6f | a block| that bo|
|00002bc0| 74 68 20 54 4e 73 20 61 | 72 65 0a 6c 69 76 65 20 |th TNs a|re.live |
|00002bd0| 69 6e 2c 20 77 65 20 6a | 75 73 74 20 63 68 65 63 |in, we j|ust chec|
|00002be0| 6b 20 74 68 65 20 6c 6f | 63 61 6c 20 54 4e 20 6e |k the lo|cal TN n|
|00002bf0| 75 6d 62 65 72 20 6f 66 | 20 6f 6e 65 20 54 4e 20 |umber of| one TN |
|00002c00| 69 6e 20 74 68 65 20 6c | 6f 63 61 6c 20 63 6f 6e |in the l|ocal con|
|00002c10| 66 6c 69 63 74 73 0a 76 | 65 63 74 6f 72 20 6f 66 |flicts.v|ector of|
|00002c20| 20 74 68 65 20 6f 74 68 | 65 72 2e 0a 0a 49 6e 20 | the oth|er...In |
|00002c30| 6f 72 64 65 72 20 74 6f | 20 64 6f 20 74 68 65 73 |order to| do thes|
|00002c40| 65 20 6f 70 74 69 6d 69 | 7a 61 74 69 6f 6e 73 2c |e optimi|zations,|
|00002c50| 20 77 65 20 6d 75 73 74 | 20 64 6f 20 61 20 70 72 | we must| do a pr|
|00002c60| 65 2d 70 61 73 73 20 74 | 68 61 74 20 66 69 6e 64 |e-pass t|hat find|
|00002c70| 73 20 74 68 65 0a 61 6c | 77 61 79 73 2d 6c 69 76 |s the.al|ways-liv|
|00002c80| 65 20 54 4e 73 20 61 6e | 64 20 62 72 65 61 6b 73 |e TNs an|d breaks|
|00002c90| 20 62 6c 6f 63 6b 73 20 | 75 70 20 69 6e 74 6f 20 | blocks |up into |
|00002ca0| 73 6d 61 6c 6c 20 65 6e | 6f 75 67 68 20 70 69 65 |small en|ough pie|
|00002cb0| 63 65 73 20 73 6f 20 74 | 68 61 74 20 77 65 20 64 |ces so t|hat we d|
|00002cc0| 6f 6e 27 74 0a 72 75 6e | 20 6f 75 74 20 6f 66 20 |on't.run| out of |
|00002cd0| 6c 6f 63 61 6c 20 54 4e | 20 6e 75 6d 62 65 72 73 |local TN| numbers|
|00002ce0| 2e 20 20 49 66 20 77 65 | 20 63 61 6e 20 6d 61 6b |. If we| can mak|
|00002cf0| 65 20 61 20 62 6c 6f 63 | 6b 20 61 72 62 69 74 72 |e a bloc|k arbitr|
|00002d00| 61 72 69 6c 79 20 73 6d | 61 6c 6c 2c 20 74 68 65 |arily sm|all, the|
|00002d10| 6e 20 77 65 0a 63 61 6e | 20 67 75 61 72 61 6e 74 |n we.can| guarant|
|00002d20| 65 65 20 74 68 61 74 20 | 61 6e 20 61 72 62 69 74 |ee that |an arbit|
|00002d30| 72 61 72 69 6c 79 20 73 | 6d 61 6c 6c 20 6e 75 6d |rarily s|mall num|
|00002d40| 62 65 72 20 6f 66 20 54 | 4e 73 20 63 68 61 6e 67 |ber of T|Ns chang|
|00002d50| 65 20 6c 69 76 65 6e 65 | 73 73 20 77 69 74 68 69 |e livene|ss withi|
|00002d60| 6e 0a 74 68 65 20 62 6c | 6f 63 6b 2e 20 20 57 65 |n.the bl|ock. We|
|00002d70| 20 6d 75 73 74 20 62 65 | 20 70 72 65 70 61 72 65 | must be| prepare|
|00002d80| 64 20 74 6f 20 6d 61 6b | 65 20 74 68 65 20 61 72 |d to mak|e the ar|
|00002d90| 67 75 6d 65 6e 74 73 20 | 74 6f 20 75 6e 62 6f 75 |guments |to unbou|
|00002da0| 6e 64 65 64 20 61 72 67 | 20 63 6f 75 6e 74 0a 56 |nded arg| count.V|
|00002db0| 4f 50 73 20 28 73 75 63 | 68 20 61 73 20 66 75 6e |OPs (suc|h as fun|
|00002dc0| 63 74 69 6f 6e 20 63 61 | 6c 6c 29 20 61 6c 77 61 |ction ca|ll) alwa|
|00002dd0| 79 73 2d 6c 69 76 65 20 | 65 76 65 6e 20 77 68 65 |ys-live |even whe|
|00002de0| 6e 20 74 68 65 79 20 72 | 65 61 6c 6c 79 20 61 72 |n they r|eally ar|
|00002df0| 65 6e 27 74 2e 20 20 54 | 68 69 73 20 69 73 0a 65 |en't. T|his is.e|
|00002e00| 6e 61 62 6c 65 64 20 62 | 79 20 61 20 70 61 6e 69 |nabled b|y a pani|
|00002e10| 63 20 6d 6f 64 65 20 69 | 6e 20 74 68 65 20 62 6c |c mode i|n the bl|
|00002e20| 6f 63 6b 20 73 70 6c 69 | 74 74 65 72 3a 20 69 66 |ock spli|tter: if|
|00002e30| 20 77 65 20 64 69 73 63 | 6f 76 65 72 20 74 68 61 | we disc|over tha|
|00002e40| 74 20 74 68 65 20 62 6c | 6f 63 6b 0a 6f 6e 6c 79 |t the bl|ock.only|
|00002e50| 20 63 6f 6e 74 61 69 6e | 73 20 6f 6e 65 20 56 4f | contain|s one VO|
|00002e60| 50 20 61 6e 64 20 74 68 | 65 72 65 20 61 72 65 20 |P and th|ere are |
|00002e70| 73 74 69 6c 6c 20 74 6f | 6f 20 6d 61 6e 79 20 54 |still to|o many T|
|00002e80| 4e 73 20 74 68 61 74 20 | 61 72 65 6e 27 74 20 61 |Ns that |aren't a|
|00002e90| 6c 77 61 79 73 2d 6c 69 | 76 65 2c 0a 74 68 65 6e |lways-li|ve,.then|
|00002ea0| 20 77 65 20 70 72 6f 6d | 6f 74 65 20 74 68 65 20 | we prom|ote the |
|00002eb0| 61 72 67 75 6d 65 6e 74 | 73 20 28 77 68 69 63 68 |argument|s (which|
|00002ec0| 20 77 65 27 64 20 62 65 | 74 74 65 72 20 62 65 20 | we'd be|tter be |
|00002ed0| 61 62 6c 65 20 74 6f 20 | 64 6f 2e 2e 2e 29 2e 0a |able to |do...)..|
|00002ee0| 0a 54 68 69 73 20 69 73 | 20 64 6f 6e 65 20 64 75 |.This is| done du|
|00002ef0| 72 69 6e 67 20 74 68 65 | 20 70 72 65 2d 73 63 61 |ring the| pre-sca|
|00002f00| 6e 20 69 6e 20 6c 69 66 | 65 74 69 6d 65 20 61 6e |n in lif|etime an|
|00002f10| 61 6c 79 73 69 73 2e 20 | 20 57 65 20 63 61 6e 20 |alysis. | We can |
|00002f20| 64 6f 20 74 68 69 73 20 | 62 65 63 61 75 73 65 0a |do this |because.|
|00002f30| 61 6c 6c 20 54 4e 73 20 | 74 68 61 74 20 63 68 61 |all TNs |that cha|
|00002f40| 6e 67 65 20 6c 69 76 65 | 6e 65 73 73 20 77 69 74 |nge live|ness wit|
|00002f50| 68 69 6e 20 61 20 62 6c | 6f 63 6b 20 63 61 6e 20 |hin a bl|ock can |
|00002f60| 62 65 20 66 6f 75 6e 64 | 20 62 79 20 65 78 61 6d |be found| by exam|
|00002f70| 69 6e 69 6e 67 20 74 68 | 61 74 0a 62 6c 6f 63 6b |ining th|at.block|
|00002f80| 3a 20 74 68 65 20 66 6c | 6f 77 20 61 6e 61 6c 79 |: the fl|ow analy|
|00002f90| 73 69 73 20 6f 6e 6c 79 | 20 61 64 64 73 20 61 6c |sis only| adds al|
|00002fa0| 77 61 79 73 2d 6c 69 76 | 65 20 54 4e 73 2e 0a 0a |ways-liv|e TNs...|
|00002fb0| 0a 57 68 65 6e 20 77 65 | 20 61 72 65 20 64 6f 69 |.When we| are doi|
|00002fc0| 6e 67 20 74 68 65 20 63 | 6f 6e 66 6c 69 63 74 20 |ng the c|onflict |
|00002fd0| 64 65 74 65 63 74 69 6f | 6e 20 70 61 73 73 2c 20 |detectio|n pass, |
|00002fe0| 77 65 20 73 65 74 20 74 | 68 65 20 4c 54 4e 20 6e |we set t|he LTN n|
|00002ff0| 75 6d 62 65 72 20 6f 66 | 20 67 6c 6f 62 61 6c 0a |umber of| global.|
|00003000| 54 4e 73 2e 20 20 57 65 | 20 63 61 6e 20 65 61 73 |TNs. We| can eas|
|00003010| 69 6c 79 20 64 65 74 65 | 63 74 20 67 6c 6f 62 61 |ily dete|ct globa|
|00003020| 6c 20 54 4e 73 20 74 68 | 61 74 20 68 61 76 65 20 |l TNs th|at have |
|00003030| 6e 6f 74 20 62 65 65 6e | 20 6c 6f 63 61 6c 6c 79 |not been| locally|
|00003040| 20 6d 61 70 70 65 64 20 | 62 65 63 61 75 73 65 0a | mapped |because.|
|00003050| 74 68 69 73 20 73 6c 6f | 74 20 69 73 20 69 6e 69 |this slo|t is ini|
|00003060| 74 69 61 6c 6c 79 20 6e | 75 6c 6c 20 66 6f 72 20 |tially n|ull for |
|00003070| 67 6c 6f 62 61 6c 20 54 | 4e 73 20 61 6e 64 20 77 |global T|Ns and w|
|00003080| 65 20 6e 75 6c 6c 20 69 | 74 20 6f 75 74 20 61 66 |e null i|t out af|
|00003090| 74 65 72 20 70 72 6f 63 | 65 73 73 69 6e 67 0a 65 |ter proc|essing.e|
|000030a0| 61 63 68 20 62 6c 6f 63 | 6b 2e 20 20 57 65 20 61 |ach bloc|k. We a|
|000030b0| 73 73 69 67 6e 20 61 6c | 6c 20 41 6c 77 61 79 73 |ssign al|l Always|
|000030c0| 2d 4c 69 76 65 20 54 4e | 73 20 74 6f 20 74 68 65 |-Live TN|s to the|
|000030d0| 20 73 61 6d 65 20 6c 6f | 63 61 6c 20 6e 75 6d 62 | same lo|cal numb|
|000030e0| 65 72 20 73 6f 20 74 68 | 61 74 20 77 65 0a 64 6f |er so th|at we.do|
|000030f0| 6e 27 74 20 6e 65 65 64 | 20 74 6f 20 74 72 65 61 |n't need| to trea|
|00003100| 74 20 72 65 66 65 72 65 | 6e 63 65 73 20 74 6f 20 |t refere|nces to |
|00003110| 74 68 65 6d 20 73 70 65 | 63 69 61 6c 6c 79 20 77 |them spe|cially w|
|00003120| 68 65 6e 20 6d 61 6b 69 | 6e 67 20 74 68 65 20 73 |hen maki|ng the s|
|00003130| 63 61 6e 2e 0a 0a 57 65 | 20 61 6c 73 6f 20 61 6e |can...We| also an|
|00003140| 6e 6f 74 61 74 65 20 63 | 61 6c 6c 20 56 4f 50 73 |notate c|all VOPs|
|00003150| 20 74 68 61 74 20 64 6f | 20 72 65 67 69 73 74 65 | that do| registe|
|00003160| 72 20 73 61 76 69 6e 67 | 20 77 69 74 68 20 74 68 |r saving| with th|
|00003170| 65 20 54 4e 73 20 74 68 | 61 74 20 61 72 65 20 6c |e TNs th|at are l|
|00003180| 69 76 65 0a 64 75 72 69 | 6e 67 20 74 68 65 20 63 |ive.duri|ng the c|
|00003190| 61 6c 6c 2c 20 61 6e 64 | 20 74 68 75 73 20 77 6f |all, and| thus wo|
|000031a0| 75 6c 64 20 6e 65 65 64 | 20 74 6f 20 62 65 20 73 |uld need| to be s|
|000031b0| 61 76 65 64 20 69 66 20 | 74 68 65 79 20 61 72 65 |aved if |they are|
|000031c0| 20 70 61 63 6b 65 64 20 | 69 6e 0a 72 65 67 69 73 | packed |in.regis|
|000031d0| 74 65 72 73 2e 0a 0a 57 | 65 20 61 64 6a 75 73 74 |ters...W|e adjust|
|000031e0| 20 74 68 65 20 63 6f 73 | 74 73 20 66 6f 72 20 54 | the cos|ts for T|
|000031f0| 4e 73 20 74 68 61 74 20 | 6e 65 65 64 20 74 6f 20 |Ns that |need to |
|00003200| 62 65 20 73 61 76 65 64 | 20 73 6f 20 74 68 61 74 |be saved| so that|
|00003210| 20 54 4e 73 20 63 6f 73 | 74 69 6e 67 20 6d 6f 72 | TNs cos|ting mor|
|00003220| 65 20 74 6f 0a 73 61 76 | 65 20 61 6e 64 20 72 65 |e to.sav|e and re|
|00003230| 73 74 6f 72 65 20 74 68 | 61 6e 20 74 6f 20 72 65 |store th|an to re|
|00003240| 66 65 72 65 6e 63 65 20 | 67 65 74 20 70 61 63 6b |ference |get pack|
|00003250| 65 64 20 6f 6e 20 74 68 | 65 20 73 74 61 63 6b 2e |ed on th|e stack.|
|00003260| 20 20 57 65 20 77 6f 75 | 6c 64 20 61 6c 73 6f 20 | We wou|ld also |
|00003270| 6c 69 6b 65 0a 6d 6f 72 | 65 20 6f 66 74 65 6e 20 |like.mor|e often |
|00003280| 73 61 76 65 64 20 54 4e | 73 20 74 6f 20 67 65 74 |saved TN|s to get|
|00003290| 20 68 69 67 68 65 72 20 | 63 6f 73 74 73 20 73 6f | higher |costs so|
|000032a0| 20 74 68 61 74 20 74 68 | 65 79 20 61 72 65 20 70 | that th|ey are p|
|000032b0| 61 63 6b 65 64 20 69 6e | 20 6d 6f 72 65 0a 73 61 |acked in| more.sa|
|000032c0| 76 61 62 6c 65 20 6c 6f | 63 61 74 69 6f 6e 73 2e |vable lo|cations.|
|000032d0| 0a 0a 0c 0a 5c 63 68 61 | 70 74 65 72 7b 50 61 63 |....\cha|pter{Pac|
|000032e0| 6b 69 6e 67 7d 0a 0a 46 | 69 6c 65 3a 20 7b 5c 74 |king}..F|ile: {\t|
|000032f0| 74 20 70 61 63 6b 7d 0a | 0a 5c 23 7c 0a 0a 41 64 |t pack}.|.\#|..Ad|
|00003300| 64 20 6c 69 66 65 74 69 | 6d 65 2f 70 61 63 6b 20 |d lifeti|me/pack |
|00003310| 73 75 70 70 6f 72 74 20 | 66 6f 72 20 70 72 65 2d |support |for pre-|
|00003320| 70 61 63 6b 65 64 20 73 | 61 76 65 20 54 4e 73 2e |packed s|ave TNs.|
|00003330| 0a 0a 46 69 78 20 47 54 | 4e 2f 56 4d 52 20 63 6f |..Fix GT|N/VMR co|
|00003340| 6e 76 65 72 73 69 6f 6e | 20 74 6f 20 75 73 65 20 |nversion| to use |
|00003350| 70 72 65 2d 70 61 63 6b | 65 64 20 73 61 76 65 20 |pre-pack|ed save |
|00003360| 54 4e 73 20 66 6f 72 20 | 6f 6c 64 2d 63 6f 6e 74 |TNs for |old-cont|
|00003370| 20 61 6e 64 20 72 65 74 | 75 72 6e 2d 50 43 2e 0a | and ret|urn-PC..|
|00003380| 28 57 69 6c 6c 20 70 72 | 65 76 65 6e 74 20 70 72 |(Will pr|event pr|
|00003390| 65 66 65 72 65 6e 63 65 | 20 66 72 6f 6d 20 70 61 |eference| from pa|
|000033a0| 73 73 69 6e 67 20 6c 6f | 63 61 74 69 6f 6e 20 74 |ssing lo|cation t|
|000033b0| 6f 20 73 61 76 65 20 6c | 6f 63 61 74 69 6f 6e 20 |o save l|ocation |
|000033c0| 66 72 6f 6d 20 65 76 65 | 72 20 62 65 69 6e 67 0a |from eve|r being.|
|000033d0| 68 6f 6e 6f 72 65 64 3f | 29 0a 0a 57 65 20 77 69 |honored?|)..We wi|
|000033e0| 6c 6c 20 6e 65 65 64 20 | 74 6f 20 6d 61 6b 65 20 |ll need |to make |
|000033f0| 70 61 63 6b 69 6e 67 20 | 6f 66 20 70 61 73 73 69 |packing |of passi|
|00003400| 6e 67 20 6c 6f 63 61 74 | 69 6f 6e 73 20 73 6d 61 |ng locat|ions sma|
|00003410| 72 74 65 72 20 62 65 66 | 6f 72 65 20 77 65 20 77 |rter bef|ore we w|
|00003420| 69 6c 6c 20 62 65 0a 61 | 62 6c 65 20 74 6f 20 74 |ill be.a|ble to t|
|00003430| 61 72 67 65 74 20 74 68 | 65 20 70 61 73 73 69 6e |arget th|e passin|
|00003440| 67 20 6c 6f 63 61 74 69 | 6f 6e 20 6f 6e 20 74 68 |g locati|on on th|
|00003450| 65 20 73 74 61 63 6b 20 | 69 6e 20 61 20 74 61 69 |e stack |in a tai|
|00003460| 6c 20 63 61 6c 6c 20 28 | 77 68 65 6e 20 74 68 61 |l call (|when tha|
|00003470| 74 20 69 73 0a 77 68 65 | 72 65 20 74 68 65 20 63 |t is.whe|re the c|
|00003480| 61 6c 6c 65 65 20 77 61 | 6e 74 73 20 69 74 2e 29 |allee wa|nts it.)|
|00003490| 20 20 43 75 72 72 65 6e | 74 6c 79 2c 20 77 65 20 | Curren|tly, we |
|000034a0| 77 69 6c 6c 20 61 6c 6d | 6f 73 74 20 61 6c 77 61 |will alm|ost alwa|
|000034b0| 79 73 20 70 61 63 6b 20 | 74 68 65 20 70 61 73 73 |ys pack |the pass|
|000034c0| 69 6e 67 0a 6c 6f 63 61 | 74 69 6f 6e 20 69 6e 20 |ing.loca|tion in |
|000034d0| 61 20 72 65 67 69 73 74 | 65 72 20 77 69 74 68 6f |a regist|er witho|
|000034e0| 75 74 20 63 6f 6e 73 69 | 64 65 72 69 6e 67 20 77 |ut consi|dering w|
|000034f0| 68 65 74 68 65 72 20 74 | 68 61 74 20 69 73 20 72 |hether t|hat is r|
|00003500| 65 61 6c 6c 79 20 61 20 | 67 6f 6f 64 20 69 64 65 |eally a |good ide|
|00003510| 61 2e 0a 4d 61 79 62 65 | 20 77 65 20 73 68 6f 75 |a..Maybe| we shou|
|00003520| 6c 64 20 63 6f 6e 73 69 | 64 65 72 20 73 63 68 65 |ld consi|der sche|
|00003530| 6d 65 73 20 74 68 61 74 | 20 65 78 70 6c 69 63 69 |mes that| explici|
|00003540| 74 6c 79 20 75 6e 64 65 | 72 73 74 61 6e 64 20 74 |tly unde|rstand t|
|00003550| 68 65 20 70 61 72 61 6c | 6c 65 6c 0a 61 73 73 69 |he paral|lel.assi|
|00003560| 67 6e 6d 65 6e 74 20 73 | 65 6d 61 6e 74 69 63 73 |gnment s|emantics|
|00003570| 2c 20 61 6e 64 20 74 72 | 79 20 74 6f 20 64 6f 20 |, and tr|y to do |
|00003580| 74 68 65 20 61 73 73 69 | 67 6e 6d 65 6e 74 20 77 |the assi|gnment w|
|00003590| 69 74 68 20 61 20 6d 69 | 6e 69 6d 75 6d 20 6e 75 |ith a mi|nimum nu|
|000035a0| 6d 62 65 72 20 6f 66 0a | 74 65 6d 70 6f 72 61 72 |mber of.|temporar|
|000035b0| 69 65 73 2e 20 20 57 65 | 20 6f 6e 6c 79 20 6e 65 |ies. We| only ne|
|000035c0| 65 64 20 61 73 73 69 67 | 6e 6d 65 6e 74 20 74 65 |ed assig|nment te|
|000035d0| 6d 70 73 20 66 6f 72 20 | 54 4e 73 20 74 68 61 74 |mps for |TNs that|
|000035e0| 20 61 70 70 65 61 72 20 | 62 6f 74 68 20 61 73 20 | appear |both as |
|000035f0| 61 6e 0a 61 63 74 75 61 | 6c 20 61 72 67 75 6d 65 |an.actua|l argume|
|00003600| 6e 74 20 76 61 6c 75 65 | 20 61 6e 64 20 61 73 20 |nt value| and as |
|00003610| 61 20 66 6f 72 6d 61 6c | 20 70 61 72 61 6d 65 74 |a formal| paramet|
|00003620| 65 72 20 6f 66 20 74 68 | 65 20 63 61 6c 6c 65 64 |er of th|e called|
|00003630| 20 66 75 6e 63 74 69 6f | 6e 2e 20 20 54 68 69 73 | functio|n. This|
|00003640| 0a 6f 6e 6c 79 20 68 61 | 70 70 65 6e 73 20 69 6e |.only ha|ppens in|
|00003650| 20 73 65 6c 66 2d 72 65 | 63 75 72 73 69 76 65 20 | self-re|cursive |
|00003660| 66 75 6e 63 74 69 6f 6e | 73 2e 0a 0a 43 6f 75 6c |function|s...Coul|
|00003670| 64 20 62 65 20 61 20 70 | 72 6f 62 6c 65 6d 20 77 |d be a p|roblem w|
|00003680| 69 74 68 20 6c 69 66 65 | 74 69 6d 65 20 61 6e 61 |ith life|time ana|
|00003690| 6c 79 73 69 73 2c 20 74 | 68 6f 75 67 68 2e 20 20 |lysis, t|hough. |
|000036a0| 54 68 65 20 77 72 69 74 | 65 20 62 79 20 61 20 6d |The writ|e by a m|
|000036b0| 6f 76 65 2d 61 72 67 20 | 56 4f 50 0a 77 6f 75 6c |ove-arg |VOP.woul|
|000036c0| 64 20 6c 6f 6f 6b 20 6c | 69 6b 65 20 61 20 77 72 |d look l|ike a wr|
|000036d0| 69 74 65 20 69 6e 20 74 | 68 65 20 63 75 72 72 65 |ite in t|he curre|
|000036e0| 6e 74 20 65 6e 76 2c 20 | 77 68 65 6e 20 69 74 20 |nt env, |when it |
|000036f0| 72 65 61 6c 6c 79 20 69 | 73 6e 27 74 2e 20 20 49 |really i|sn't. I|
|00003700| 66 20 74 68 69 73 20 69 | 73 20 61 0a 70 72 6f 62 |f this i|s a.prob|
|00003710| 6c 65 6d 2c 20 74 68 65 | 6e 20 77 65 20 6d 69 67 |lem, the|n we mig|
|00003720| 68 74 20 77 61 6e 74 20 | 74 6f 20 6d 61 6b 65 20 |ht want |to make |
|00003730| 74 68 65 20 72 65 73 75 | 6c 74 20 54 4e 20 62 65 |the resu|lt TN be|
|00003740| 20 61 6e 20 69 6e 66 6f | 20 61 72 67 20 72 61 74 | an info| arg rat|
|00003750| 68 65 72 20 74 68 61 6e | 20 61 0a 72 65 61 6c 20 |her than| a.real |
|00003760| 6f 70 65 72 61 6e 64 2e | 20 20 42 75 74 20 74 68 |operand.| But th|
|00003770| 69 73 20 77 6f 75 6c 64 | 20 6f 6e 6c 79 20 62 65 |is would| only be|
|00003780| 20 61 20 70 72 6f 62 6c | 65 6d 20 69 6e 20 72 65 | a probl|em in re|
|00003790| 63 75 72 73 69 76 65 20 | 63 61 6c 6c 73 2c 20 61 |cursive |calls, a|
|000037a0| 6e 79 77 61 79 2e 0a 5b | 54 68 69 73 20 77 6f 75 |nyway..[|This wou|
|000037b0| 6c 64 20 70 72 65 76 65 | 6e 74 20 74 61 72 67 65 |ld preve|nt targe|
|000037c0| 74 69 6e 67 2c 20 62 75 | 74 20 74 61 72 67 65 74 |ting, bu|t target|
|000037d0| 69 6e 67 20 61 63 72 6f | 73 73 20 70 61 73 73 69 |ing acro|ss passi|
|000037e0| 6e 67 20 6c 6f 63 61 74 | 69 6f 6e 73 20 72 61 72 |ng locat|ions rar|
|000037f0| 65 6c 79 0a 73 65 65 6d | 73 20 74 6f 20 77 6f 72 |ely.seem|s to wor|
|00003800| 6b 20 61 6e 79 77 61 79 | 2e 5d 20 20 5b 5c 23 5c |k anyway|.] [\#\|
|00003810| 23 5c 23 20 42 75 74 20 | 74 68 65 20 3a 45 4e 56 |#\# But |the :ENV|
|00003820| 49 52 4f 4e 4d 45 4e 54 | 20 54 4e 20 6d 65 63 68 |IRONMENT| TN mech|
|00003830| 61 6e 69 73 6d 20 77 6f | 75 6c 64 20 67 65 74 0a |anism wo|uld get.|
|00003840| 63 6f 6e 66 75 73 65 64 | 2e 20 20 4d 61 79 62 65 |confused|. Maybe|
|00003850| 20 70 75 74 20 65 6e 76 | 20 65 78 70 6c 69 63 69 | put env| explici|
|00003860| 74 6c 79 20 69 6e 20 54 | 4e 2c 20 61 6e 64 20 68 |tly in T|N, and h|
|00003870| 61 76 65 20 69 74 20 6f | 6e 6c 79 20 61 6c 77 61 |ave it o|nly alwa|
|00003880| 79 73 2d 6c 69 76 65 20 | 69 6e 20 74 68 61 74 0a |ys-live |in that.|
|00003890| 65 6e 76 2c 20 61 6e 64 | 20 6e 6f 72 6d 61 6c 20 |env, and| normal |
|000038a0| 69 6e 20 6f 74 68 65 72 | 20 65 6e 76 73 20 28 6f |in other| envs (o|
|000038b0| 72 20 62 6c 6f 63 6b 73 | 20 69 74 20 69 73 20 77 |r blocks| it is w|
|000038c0| 72 69 74 74 65 6e 20 69 | 6e 2e 29 20 20 54 68 69 |ritten i|n.) Thi|
|000038d0| 73 20 77 6f 75 6c 64 20 | 61 6c 6c 6f 77 0a 74 61 |s would |allow.ta|
|000038e0| 72 67 65 74 69 6e 67 20 | 69 6e 74 6f 20 65 6e 76 |rgeting |into env|
|000038f0| 69 72 6f 6e 6d 65 6e 74 | 20 54 4e 73 2e 20 20 0a |ironment| TNs. .|
|00003900| 0a 49 20 67 75 65 73 73 | 20 77 65 20 77 6f 75 6c |.I guess| we woul|
|00003910| 64 20 61 6c 73 6f 20 77 | 61 6e 74 20 74 68 65 20 |d also w|ant the |
|00003920| 65 6e 76 2f 50 43 20 73 | 61 76 65 20 54 4e 73 20 |env/PC s|ave TNs |
|00003930| 6e 6f 72 6d 61 6c 20 69 | 6e 20 74 68 65 20 72 65 |normal i|n the re|
|00003940| 74 75 72 6e 20 62 6c 6f | 63 6b 20 73 6f 0a 74 68 |turn blo|ck so.th|
|00003950| 61 74 20 77 65 20 63 61 | 6e 20 74 61 72 67 65 74 |at we ca|n target|
|00003960| 20 74 68 65 6d 2e 20 20 | 57 65 20 63 6f 75 6c 64 | them. |We could|
|00003970| 20 64 6f 20 74 68 69 73 | 20 62 79 20 63 6f 6e 73 | do this| by cons|
|00003980| 69 64 65 72 69 6e 67 20 | 65 6e 76 20 54 4e 73 20 |idering |env TNs |
|00003990| 6e 6f 72 6d 61 6c 20 69 | 6e 0a 72 65 61 64 20 62 |normal i|n.read b|
|000039a0| 6c 6f 63 6b 73 20 77 69 | 74 68 20 6e 6f 20 73 75 |locks wi|th no su|
|000039b0| 63 63 65 73 73 6f 72 73 | 2e 20 20 0a 0a 45 4e 56 |ccessors|. ..ENV|
|000039c0| 20 54 4e 73 20 77 6f 75 | 6c 64 20 62 65 20 74 72 | TNs wou|ld be tr|
|000039d0| 65 61 74 65 64 20 74 6f | 74 61 6c 6c 79 20 6e 6f |eated to|tally no|
|000039e0| 72 6d 61 6c 6c 79 20 69 | 6e 20 6e 6f 6e 2d 65 6e |rmally i|n non-en|
|000039f0| 76 20 62 6c 6f 63 6b 73 | 2c 20 73 6f 20 77 65 20 |v blocks|, so we |
|00003a00| 64 6f 6e 27 74 20 68 61 | 76 65 0a 74 6f 20 77 6f |don't ha|ve.to wo|
|00003a10| 72 72 79 20 61 62 6f 75 | 74 20 6c 69 66 65 74 69 |rry abou|t lifeti|
|00003a20| 6d 65 20 61 6e 61 6c 79 | 73 69 73 20 67 65 74 74 |me analy|sis gett|
|00003a30| 69 6e 67 20 63 6f 6e 66 | 75 73 65 64 20 62 79 20 |ing conf|used by |
|00003a40| 76 61 72 69 61 62 6c 65 | 20 69 6e 69 74 69 61 6c |variable| initial|
|00003a50| 69 7a 61 74 69 6f 6e 73 | 2e 0a 44 6f 20 73 6f 6d |izations|..Do som|
|00003a60| 65 20 6b 69 6e 64 20 6f | 66 20 54 4e 20 63 6f 73 |e kind o|f TN cos|
|00003a70| 74 69 6e 67 20 74 6f 20 | 64 65 74 65 72 6d 69 6e |ting to |determin|
|00003a80| 65 20 77 68 65 6e 20 69 | 74 20 69 73 20 6d 6f 72 |e when i|t is mor|
|00003a90| 65 20 74 72 6f 75 62 6c | 65 20 74 68 61 6e 20 69 |e troubl|e than i|
|00003aa0| 74 20 69 73 0a 77 6f 72 | 74 68 20 74 6f 20 61 6c |t is.wor|th to al|
|00003ab0| 6c 6f 63 61 74 65 20 54 | 4e 73 20 69 6e 20 72 65 |locate T|Ns in re|
|00003ac0| 67 69 73 74 65 72 73 2e | 0a 0a 43 68 61 6e 67 65 |gisters.|..Change|
|00003ad0| 20 70 61 63 6b 20 6f 72 | 64 65 72 69 6e 67 20 74 | pack or|dering t|
|00003ae0| 6f 20 62 65 20 6c 65 73 | 73 20 70 65 73 73 69 6d |o be les|s pessim|
|00003af0| 61 6c 2e 20 20 50 61 63 | 6b 20 54 4e 73 20 61 73 |al. Pac|k TNs as|
|00003b00| 20 74 68 65 79 20 61 72 | 65 20 73 65 65 6e 20 69 | they ar|e seen i|
|00003b10| 6e 20 74 68 65 20 4c 54 | 4e 0a 6d 61 70 20 69 6e |n the LT|N.map in|
|00003b20| 20 44 46 4f 2c 20 77 68 | 69 63 68 20 61 74 20 6c | DFO, wh|ich at l|
|00003b30| 65 61 73 74 20 69 6e 20 | 6e 6f 6e 2d 62 6c 6f 63 |east in |non-bloc|
|00003b40| 6b 20 63 6f 6d 70 69 6c | 61 74 69 6f 6e 73 20 68 |k compil|ations h|
|00003b50| 61 73 20 61 6e 20 65 66 | 66 65 63 74 20 73 6f 6d |as an ef|fect som|
|00003b60| 65 74 68 69 6e 67 0a 6c | 69 6b 65 20 70 61 63 6b |ething.l|ike pack|
|00003b70| 69 6e 67 20 6d 61 69 6e | 20 74 72 61 63 65 20 54 |ing main| trace T|
|00003b80| 4e 73 20 66 69 72 73 74 | 2c 20 73 69 6e 63 65 20 |Ns first|, since |
|00003b90| 63 6f 6e 74 72 6f 6c 20 | 61 6e 61 6c 79 73 69 73 |control |analysis|
|00003ba0| 20 74 72 69 65 73 20 74 | 6f 20 70 75 74 20 74 68 | tries t|o put th|
|00003bb0| 65 20 67 6f 6f 64 0a 63 | 6f 64 65 20 66 69 72 73 |e good.c|ode firs|
|00003bc0| 74 2e 20 20 54 68 69 73 | 20 63 6f 75 6c 64 20 61 |t. This| could a|
|00003bd0| 6c 73 6f 20 72 65 64 75 | 63 65 20 73 70 69 6c 6c |lso redu|ce spill|
|00003be0| 69 6e 67 2c 20 73 69 6e | 63 65 20 69 74 20 6d 61 |ing, sin|ce it ma|
|00003bf0| 6b 65 73 20 69 74 20 6c | 65 73 73 20 6c 69 6b 65 |kes it l|ess like|
|00003c00| 6c 79 20 77 65 0a 77 69 | 6c 6c 20 63 6c 6f 67 20 |ly we.wi|ll clog |
|00003c10| 61 6c 6c 20 72 65 67 69 | 73 74 65 72 73 20 77 69 |all regi|sters wi|
|00003c20| 74 68 20 67 6c 6f 62 61 | 6c 20 54 4e 73 2e 0a 0a |th globa|l TNs...|
|00003c30| 49 66 20 77 65 20 70 61 | 63 6b 20 61 20 54 4e 20 |If we pa|ck a TN |
|00003c40| 77 69 74 68 20 61 20 73 | 70 65 63 69 66 69 65 64 |with a s|pecified|
|00003c50| 20 73 61 76 65 20 6c 6f | 63 61 74 69 6f 6e 20 6f | save lo|cation o|
|00003c60| 6e 20 74 68 65 20 73 74 | 61 63 6b 2c 20 70 61 63 |n the st|ack, pac|
|00003c70| 6b 20 69 6e 20 74 68 65 | 0a 73 70 65 63 69 66 69 |k in the|.specifi|
|00003c80| 65 64 20 6c 6f 63 61 74 | 69 6f 6e 2e 0a 0a 41 6c |ed locat|ion...Al|
|00003c90| 6c 6f 77 20 6f 6c 64 2d | 63 6f 6e 74 20 61 6e 64 |low old-|cont and|
|00003ca0| 20 72 65 74 75 72 6e 2d | 70 63 20 74 6f 20 62 65 | return-|pc to be|
|00003cb0| 20 6b 65 70 74 20 69 6e | 20 72 65 67 69 73 74 65 | kept in| registe|
|00003cc0| 72 73 20 62 79 20 61 64 | 64 69 6e 67 20 61 20 6e |rs by ad|ding a n|
|00003cd0| 65 77 20 22 6b 65 65 70 | 0a 61 72 6f 75 6e 64 22 |ew "keep|.around"|
|00003ce0| 20 6b 69 6e 64 20 6f 66 | 20 54 4e 2e 20 20 54 68 | kind of| TN. Th|
|00003cf0| 65 73 65 20 61 72 65 20 | 6b 69 6e 64 20 6f 66 20 |ese are |kind of |
|00003d00| 6c 69 6b 65 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |like env|ironment|
|00003d10| 20 6c 69 76 65 2c 20 62 | 75 74 20 61 72 65 20 6f | live, b|ut are o|
|00003d20| 6e 6c 79 0a 61 6c 77 61 | 79 73 2d 6c 69 76 65 20 |nly.alwa|ys-live |
|00003d30| 69 6e 20 62 6c 6f 63 6b | 73 20 74 68 61 74 20 74 |in block|s that t|
|00003d40| 68 65 79 20 77 65 72 65 | 6e 27 74 20 72 65 66 65 |hey were|n't refe|
|00003d50| 72 65 6e 63 65 64 20 69 | 6e 2e 20 20 4c 69 66 65 |renced i|n. Life|
|00003d60| 74 69 6d 65 20 61 6e 61 | 6c 79 73 69 73 20 64 6f |time ana|lysis do|
|00003d70| 65 73 0a 61 20 70 6f 73 | 74 2d 70 61 73 73 20 61 |es.a pos|t-pass a|
|00003d80| 64 64 69 6e 67 20 61 6c | 77 61 79 73 2d 6c 69 76 |dding al|ways-liv|
|00003d90| 65 20 63 6f 6e 66 6c 69 | 63 74 73 20 66 6f 72 20 |e confli|cts for |
|00003da0| 65 61 63 68 20 22 6b 65 | 65 70 20 61 72 6f 75 6e |each "ke|ep aroun|
|00003db0| 64 22 20 54 4e 20 74 6f | 20 74 68 6f 73 65 0a 62 |d" TN to| those.b|
|00003dc0| 6c 6f 63 6b 73 20 77 69 | 74 68 20 6e 6f 20 63 6f |locks wi|th no co|
|00003dd0| 6e 66 6c 69 63 74 20 66 | 6f 72 20 74 68 61 74 20 |nflict f|or that |
|00003de0| 54 4e 2e 20 20 54 68 65 | 20 64 69 73 74 69 6e 63 |TN. The| distinc|
|00003df0| 74 69 6f 6e 20 62 65 74 | 77 65 65 6e 20 61 6c 77 |tion bet|ween alw|
|00003e00| 61 79 73 2d 6c 69 76 65 | 20 61 6e 64 0a 6b 65 65 |ays-live| and.kee|
|00003e10| 70 2d 61 72 6f 75 6e 64 | 20 61 6c 6c 6f 77 73 20 |p-around| allows |
|00003e20| 75 73 20 74 6f 20 73 75 | 63 63 65 73 73 66 75 6c |us to su|ccessful|
|00003e30| 6c 79 20 74 61 72 67 65 | 74 20 6f 6c 64 2d 63 6f |ly targe|t old-co|
|00003e40| 6e 74 20 61 6e 64 20 72 | 65 74 75 72 6e 2d 70 63 |nt and r|eturn-pc|
|00003e50| 20 74 6f 20 70 61 73 73 | 69 6e 67 0a 6c 6f 63 61 | to pass|ing.loca|
|00003e60| 74 69 6f 6e 73 2e 20 20 | 4d 41 4b 45 2d 4b 45 45 |tions. |MAKE-KEE|
|00003e70| 50 2d 41 52 4f 55 4e 44 | 2d 54 4e 20 28 70 74 79 |P-AROUND|-TN (pty|
|00003e80| 70 65 29 2c 20 50 52 45 | 2d 50 41 43 4b 2d 53 41 |pe), PRE|-PACK-SA|
|00003e90| 56 45 2d 54 4e 20 28 74 | 6e 20 73 63 6e 20 6f 66 |VE-TN (t|n scn of|
|00003ea0| 66 73 65 74 29 2e 0a 45 | 6e 76 69 72 6f 6e 6d 65 |fset)..E|nvironme|
|00003eb0| 6e 74 20 6e 65 65 64 73 | 20 61 20 4b 45 45 50 2d |nt needs| a KEEP-|
|00003ec0| 41 52 4f 55 4e 44 2d 54 | 4e 53 20 73 6c 6f 74 20 |AROUND-T|NS slot |
|00003ed0| 73 6f 20 74 68 61 74 20 | 63 6f 6e 66 6c 69 63 74 |so that |conflict|
|00003ee0| 20 61 6e 61 6c 79 73 69 | 73 20 63 61 6e 20 66 69 | analysi|s can fi|
|00003ef0| 6e 64 0a 74 68 65 6d 20 | 28 6e 6f 20 73 70 65 63 |nd.them |(no spec|
|00003f00| 69 61 6c 20 63 61 73 69 | 6e 67 20 69 73 20 6e 65 |ial casi|ng is ne|
|00003f10| 65 64 65 64 20 61 66 74 | 65 72 20 74 68 65 6e 2c |eded aft|er then,|
|00003f20| 20 74 68 65 79 20 63 61 | 6e 20 62 65 20 6d 61 64 | they ca|n be mad|
|00003f30| 65 20 77 69 74 68 20 3a | 4e 4f 52 4d 41 4c 0a 6b |e with :|NORMAL.k|
|00003f40| 69 6e 64 29 2e 20 20 56 | 4d 52 2d 63 6f 6d 70 6f |ind). V|MR-compo|
|00003f50| 6e 65 6e 74 20 6e 65 65 | 64 73 20 50 52 45 2d 50 |nent nee|ds PRE-P|
|00003f60| 41 43 4b 45 44 2d 53 41 | 56 45 2d 54 4e 53 20 73 |ACKED-SA|VE-TNS s|
|00003f70| 6f 20 74 68 61 74 20 63 | 6f 6e 66 6c 69 63 74 20 |o that c|onflict |
|00003f80| 61 6e 61 6c 79 73 69 73 | 20 6f 72 0a 73 6f 6d 65 |analysis| or.some|
|00003f90| 62 6f 64 79 20 63 61 6e | 20 63 6f 70 79 20 63 6f |body can| copy co|
|00003fa0| 6e 66 6c 69 63 74 20 69 | 6e 66 6f 20 66 72 6f 6d |nflict i|nfo from|
|00003fb0| 20 74 68 65 20 73 61 76 | 65 64 20 54 4e 2e 0a 0a | the sav|ed TN...|
|00003fc0| 0a 0a 4e 6f 74 65 20 74 | 68 61 74 20 68 61 76 69 |..Note t|hat havi|
|00003fd0| 6e 67 20 62 6c 6f 63 6b | 20 67 72 61 6e 75 6c 61 |ng block| granula|
|00003fe0| 72 69 74 79 20 69 6e 20 | 74 68 65 20 63 6f 6e 66 |rity in |the conf|
|00003ff0| 6c 69 63 74 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |lict inf|ormation|
|00004000| 20 64 6f 65 73 6e 27 74 | 20 6d 65 61 6e 0a 74 68 | doesn't| mean.th|
|00004010| 61 74 20 61 20 6c 6f 63 | 61 6c 69 7a 65 64 20 70 |at a loc|alized p|
|00004020| 61 63 6b 69 6e 67 20 73 | 63 68 65 6d 65 20 77 6f |acking s|cheme wo|
|00004030| 75 6c 64 20 68 61 76 65 | 20 74 6f 20 64 6f 20 61 |uld have| to do a|
|00004040| 6c 6c 20 6d 6f 76 65 73 | 20 61 74 20 62 6c 6f 63 |ll moves| at bloc|
|00004050| 6b 20 62 6f 75 6e 64 61 | 72 69 65 73 0a 28 77 68 |k bounda|ries.(wh|
|00004060| 69 63 68 20 77 6f 75 6c | 64 20 63 6c 61 73 68 20 |ich woul|d clash |
|00004070| 77 69 74 68 20 74 68 65 | 20 64 65 73 69 72 65 20 |with the| desire |
|00004080| 74 68 65 20 68 61 76 65 | 20 73 61 76 69 6e 67 20 |the have| saving |
|00004090| 64 6f 6e 65 20 61 73 20 | 70 61 72 74 20 6f 66 20 |done as |part of |
|000040a0| 74 68 69 73 0a 6d 65 63 | 68 61 6e 69 73 6d 2e 29 |this.mec|hanism.)|
|000040b0| 20 20 41 6c 6c 20 74 68 | 61 74 20 69 74 20 6d 65 | All th|at it me|
|000040c0| 61 6e 73 20 69 73 20 74 | 68 61 74 20 69 66 20 77 |ans is t|hat if w|
|000040d0| 65 20 77 61 6e 74 20 74 | 6f 20 64 6f 20 61 20 6d |e want t|o do a m|
|000040e0| 6f 76 65 20 77 69 74 68 | 69 6e 20 74 68 65 0a 62 |ove with|in the.b|
|000040f0| 6c 6f 63 6b 2c 20 77 65 | 20 77 6f 75 6c 64 20 6e |lock, we| would n|
|00004100| 65 65 64 20 74 6f 20 61 | 6c 6c 6f 63 61 74 65 20 |eed to a|llocate |
|00004110| 62 6f 74 68 20 6c 6f 63 | 61 74 69 6f 6e 73 20 74 |both loc|ations t|
|00004120| 68 72 6f 75 67 68 6f 75 | 74 20 74 68 61 74 20 62 |hroughou|t that b|
|00004130| 6c 6f 63 6b 20 28 6f 72 | 0a 73 6f 6d 65 74 68 69 |lock (or|.somethi|
|00004140| 6e 67 29 2e 0a 0a 0a 0a | 0a 0a 4c 6f 61 64 20 54 |ng).....|..Load T|
|00004150| 4e 20 70 61 63 6b 3a 0a | 0a 41 20 6c 6f 63 61 74 |N pack:.|.A locat|
|00004160| 69 6f 6e 20 69 73 20 6f | 75 74 20 66 6f 72 20 6c |ion is o|ut for l|
|00004170| 6f 61 64 20 54 4e 20 70 | 61 63 6b 69 6e 67 20 69 |oad TN p|acking i|
|00004180| 66 3a 20 0a 0a 54 68 65 | 20 6c 6f 63 61 74 69 6f |f: ..The| locatio|
|00004190| 6e 20 68 61 73 20 54 4e | 20 6c 69 76 65 20 69 6e |n has TN| live in|
|000041a0| 20 69 74 20 61 66 74 65 | 72 20 74 68 65 20 56 4f | it afte|r the VO|
|000041b0| 50 20 66 6f 72 20 61 20 | 72 65 73 75 6c 74 2c 20 |P for a |result, |
|000041c0| 6f 72 20 62 65 66 6f 72 | 65 20 74 68 65 20 56 4f |or befor|e the VO|
|000041d0| 50 0a 66 6f 72 20 61 6e | 20 61 72 67 75 6d 65 6e |P.for an| argumen|
|000041e0| 74 2c 20 6f 72 0a 0a 54 | 68 65 20 6c 6f 63 61 74 |t, or..T|he locat|
|000041f0| 69 6f 6e 20 69 73 20 75 | 73 65 64 20 65 61 72 6c |ion is u|sed earl|
|00004200| 69 65 72 20 69 6e 20 74 | 68 65 20 54 4e 2d 72 65 |ier in t|he TN-re|
|00004210| 66 20 6c 69 73 74 20 28 | 61 66 74 65 72 29 20 74 |f list (|after) t|
|00004220| 68 65 20 73 61 76 65 64 | 20 72 65 73 75 6c 74 73 |he saved| results|
|00004230| 20 72 65 66 0a 6f 72 20 | 6c 61 74 65 72 20 69 6e | ref.or |later in|
|00004240| 20 74 68 65 20 54 4e 2d | 52 65 66 20 6c 69 73 74 | the TN-|Ref list|
|00004250| 20 28 62 65 66 6f 72 65 | 29 20 74 68 65 20 6c 6f | (before|) the lo|
|00004260| 61 64 65 64 20 61 72 67 | 75 6d 65 6e 74 27 73 20 |aded arg|ument's |
|00004270| 72 65 66 2e 0a 0a 54 6f | 20 70 61 63 6b 20 6c 6f |ref...To| pack lo|
|00004280| 61 64 20 54 4e 73 2c 20 | 77 65 20 61 64 76 61 6e |ad TNs, |we advan|
|00004290| 63 65 20 74 68 65 20 6c | 69 76 65 2d 74 6e 73 20 |ce the l|ive-tns |
|000042a0| 74 6f 20 74 68 65 20 69 | 6e 74 65 72 65 73 74 69 |to the i|nteresti|
|000042b0| 6e 67 20 56 4f 50 2c 20 | 74 68 65 6e 0a 72 65 70 |ng VOP, |then.rep|
|000042c0| 65 61 74 65 64 6c 79 20 | 73 63 61 6e 20 74 68 65 |eatedly |scan the|
|000042d0| 20 76 6f 70 2d 72 65 66 | 73 20 74 6f 20 66 69 6e | vop-ref|s to fin|
|000042e0| 64 20 76 6f 70 2d 6c 6f | 63 61 6c 20 63 6f 6e 66 |d vop-lo|cal conf|
|000042f0| 6c 69 63 74 73 20 66 6f | 72 20 65 61 63 68 20 6e |licts fo|r each n|
|00004300| 65 65 64 65 64 20 6c 6f | 61 64 0a 54 4e 2e 20 20 |eeded lo|ad.TN. |
|00004310| 57 65 20 69 6e 73 65 72 | 74 20 6d 6f 76 65 20 56 |We inser|t move V|
|00004320| 4f 50 73 20 61 6e 64 20 | 63 68 61 6e 67 65 20 6f |OPs and |change o|
|00004330| 76 65 72 20 74 68 65 20 | 54 4e 2d 52 65 66 2d 54 |ver the |TN-Ref-T|
|00004340| 4e 73 20 61 73 20 77 65 | 20 67 6f 20 73 6f 20 74 |Ns as we| go so t|
|00004350| 68 65 20 54 4e 2d 52 65 | 66 73 0a 77 69 6c 6c 20 |he TN-Re|fs.will |
|00004360| 72 65 66 6c 65 63 74 20 | 63 6f 6e 66 6c 69 63 74 |reflect |conflict|
|00004370| 73 20 77 69 74 68 20 61 | 6c 72 65 61 64 79 20 70 |s with a|lready p|
|00004380| 61 63 6b 65 64 20 6c 6f | 61 64 2d 54 4e 73 2e 0a |acked lo|ad-TNs..|
|00004390| 0a 49 66 20 77 65 20 66 | 61 69 6c 20 74 6f 20 70 |.If we f|ail to p|
|000043a0| 61 63 6b 20 61 20 6c 6f | 61 64 2d 54 4e 20 69 6e |ack a lo|ad-TN in|
|000043b0| 20 74 68 65 20 64 65 73 | 69 72 65 64 20 53 43 2c | the des|ired SC,|
|000043c0| 20 74 68 65 6e 20 77 65 | 20 73 63 61 6e 20 74 68 | then we| scan th|
|000043d0| 65 20 4c 69 76 65 2d 54 | 4e 73 20 66 6f 72 0a 74 |e Live-T|Ns for.t|
|000043e0| 68 65 20 53 42 2c 20 6c | 6f 6f 6b 69 6e 67 20 66 |he SB, l|ooking f|
|000043f0| 6f 72 20 61 20 54 4e 20 | 74 68 61 74 20 63 61 6e |or a TN |that can|
|00004400| 20 62 65 20 70 61 63 6b | 65 64 20 69 6e 20 61 6e | be pack|ed in an|
|00004410| 20 75 6e 62 6f 75 6e 64 | 65 64 20 53 42 2e 20 20 | unbound|ed SB. |
|00004420| 54 68 69 73 20 54 4e 20 | 6d 75 73 74 0a 74 68 65 |This TN |must.the|
|00004430| 6e 20 62 65 20 72 65 70 | 61 63 6b 65 64 20 69 6e |n be rep|acked in|
|00004440| 20 74 68 65 20 75 6e 62 | 6f 75 6e 64 65 64 20 53 | the unb|ounded S|
|00004450| 42 2e 20 20 49 74 20 69 | 73 20 69 6d 70 6f 72 74 |B. It i|s import|
|00004460| 61 6e 74 20 74 68 65 20 | 6c 6f 61 64 2d 54 4e 73 |ant the |load-TNs|
|00004470| 20 61 72 65 20 6e 65 76 | 65 72 0a 70 61 63 6b 65 | are nev|er.packe|
|00004480| 64 20 69 6e 20 75 6e 62 | 6f 75 6e 64 65 64 20 53 |d in unb|ounded S|
|00004490| 42 73 2c 20 73 69 6e 63 | 65 20 74 68 61 74 20 77 |Bs, sinc|e that w|
|000044a0| 6f 75 6c 64 20 69 6e 76 | 61 6c 69 64 61 74 65 20 |ould inv|alidate |
|000044b0| 74 68 65 20 63 6f 6e 66 | 6c 69 63 74 73 20 69 6e |the conf|licts in|
|000044c0| 66 6f 2c 0a 70 72 65 76 | 65 6e 74 69 6e 67 20 75 |fo,.prev|enting u|
|000044d0| 73 20 66 72 6f 6d 20 72 | 65 70 61 63 6b 69 6e 67 |s from r|epacking|
|000044e0| 20 54 4e 73 20 69 6e 20 | 75 6e 62 6f 75 6e 64 65 | TNs in |unbounde|
|000044f0| 64 20 53 42 73 2e 20 20 | 57 65 20 63 61 6e 27 74 |d SBs. |We can't|
|00004500| 20 72 65 70 61 63 6b 20 | 69 6e 20 61 20 66 69 6e | repack |in a fin|
|00004510| 69 74 65 0a 53 42 2c 20 | 73 69 6e 63 65 20 74 68 |ite.SB, |since th|
|00004520| 65 72 65 20 6d 69 67 68 | 74 20 68 61 76 65 20 62 |ere migh|t have b|
|00004530| 65 65 6e 20 6c 6f 61 64 | 20 54 4e 73 20 70 61 63 |een load| TNs pac|
|00004540| 6b 65 64 20 69 6e 20 74 | 68 61 74 20 53 42 20 77 |ked in t|hat SB w|
|00004550| 68 69 63 68 20 61 72 65 | 6e 27 74 0a 72 65 70 72 |hich are|n't.repr|
|00004560| 65 73 65 6e 74 65 64 20 | 69 6e 20 74 68 65 20 6f |esented |in the o|
|00004570| 72 69 67 69 6e 61 6c 20 | 63 6f 6e 66 6c 69 63 74 |riginal |conflict|
|00004580| 20 73 74 72 75 63 74 75 | 72 65 73 2e 0a 0a 49 73 | structu|res...Is|
|00004590| 20 69 74 20 70 65 72 6d | 69 73 73 69 62 6c 65 20 | it perm|issible |
|000045a0| 74 6f 20 22 72 65 73 74 | 72 69 63 74 22 20 61 6e |to "rest|rict" an|
|000045b0| 20 6f 70 65 72 61 6e 64 | 20 74 6f 20 61 6e 20 75 | operand| to an u|
|000045c0| 6e 62 6f 75 6e 64 65 64 | 20 53 43 3f 20 20 4e 6f |nbounded| SC? No|
|000045d0| 74 20 69 6d 70 6f 73 73 | 69 62 6c 65 0a 74 6f 20 |t imposs|ible.to |
|000045e0| 73 61 74 69 73 66 79 20 | 61 73 20 6c 6f 6e 67 20 |satisfy |as long |
|000045f0| 61 73 20 61 20 66 69 6e | 69 74 65 20 53 43 20 69 |as a fin|ite SC i|
|00004600| 73 20 61 6c 73 6f 20 61 | 6c 6c 6f 77 65 64 2e 20 |s also a|llowed. |
|00004610| 20 42 75 74 20 69 6e 20 | 70 72 61 63 74 69 63 65 | But in |practice|
|00004620| 2c 20 6e 6f 0a 72 65 73 | 74 72 69 63 74 69 6f 6e |, no.res|triction|
|00004630| 20 77 6f 75 6c 64 20 70 | 72 6f 62 61 62 6c 79 20 | would p|robably |
|00004640| 62 65 20 61 73 20 67 6f | 6f 64 2e 0a 0a 57 65 20 |be as go|od...We |
|00004650| 61 73 73 75 6d 65 20 61 | 6c 6c 20 6c 6f 63 61 74 |assume a|ll locat|
|00004660| 69 6f 6e 73 20 63 61 6e | 20 62 65 20 75 73 65 64 |ions can| be used|
|00004670| 20 77 68 65 6e 20 61 6e | 20 73 63 20 69 73 20 62 | when an| sc is b|
|00004680| 61 73 65 64 20 6f 6e 20 | 61 6e 20 75 6e 62 6f 75 |ased on |an unbou|
|00004690| 6e 64 65 64 20 73 62 2e | 0a 0a 5d 0a 0a 0a 54 4e |nded sb.|..]...TN|
|000046a0| 2d 52 65 66 73 20 61 72 | 65 20 62 65 20 63 6f 6e |-Refs ar|e be con|
|000046b0| 76 65 6e 69 65 6e 74 20 | 73 74 72 75 63 74 75 72 |venient |structur|
|000046c0| 65 73 20 74 6f 20 62 75 | 69 6c 64 20 74 68 65 20 |es to bu|ild the |
|000046d0| 74 61 72 67 65 74 20 67 | 72 61 70 68 20 6f 75 74 |target g|raph out|
|000046e0| 20 6f 66 2e 20 20 49 66 | 20 77 65 0a 61 6c 6c 6f | of. If| we.allo|
|000046f0| 63 61 74 65 64 20 73 70 | 61 63 65 20 69 6e 20 65 |cated sp|ace in e|
|00004700| 76 65 72 79 20 54 4e 2d | 52 65 66 2c 20 74 68 65 |very TN-|Ref, the|
|00004710| 6e 20 74 68 65 72 65 20 | 77 6f 75 6c 64 20 63 65 |n there |would ce|
|00004720| 72 74 61 69 6e 6c 79 20 | 62 65 20 65 6e 6f 75 67 |rtainly |be enoug|
|00004730| 68 20 74 6f 0a 72 65 70 | 72 65 73 65 6e 74 20 61 |h to.rep|resent a|
|00004740| 72 62 69 74 72 61 72 79 | 20 74 61 72 67 65 74 20 |rbitrary| target |
|00004750| 67 72 61 70 68 73 2e 20 | 20 57 6f 75 6c 64 20 69 |graphs. | Would i|
|00004760| 74 20 62 65 20 65 6e 6f | 75 67 68 20 74 6f 20 61 |t be eno|ugh to a|
|00004770| 6c 6c 6f 63 61 74 65 20 | 61 20 73 69 6e 67 6c 65 |llocate |a single|
|00004780| 0a 54 61 72 67 65 74 20 | 73 6c 6f 74 3f 20 20 49 |.Target |slot? I|
|00004790| 66 20 74 68 65 72 65 20 | 69 73 20 61 20 74 61 72 |f there |is a tar|
|000047a0| 67 65 74 20 70 61 74 68 | 20 74 68 6f 75 67 68 20 |get path| though |
|000047b0| 61 20 67 69 76 65 6e 20 | 56 4f 50 2c 20 74 68 65 |a given |VOP, the|
|000047c0| 6e 20 74 68 65 20 54 61 | 72 67 65 74 20 6f 66 0a |n the Ta|rget of.|
|000047d0| 74 68 65 20 77 72 69 74 | 65 20 72 65 66 20 77 6f |the writ|e ref wo|
|000047e0| 75 6c 64 20 62 65 20 74 | 68 65 20 72 65 61 64 2c |uld be t|he read,|
|000047f0| 20 61 6e 64 20 76 69 63 | 65 2d 76 65 72 73 61 2e | and vic|e-versa.|
|00004800| 20 20 54 6f 20 66 69 6e | 64 20 61 6c 6c 20 74 68 | To fin|d all th|
|00004810| 65 20 54 4e 73 20 74 68 | 61 74 0a 74 61 72 67 65 |e TNs th|at.targe|
|00004820| 74 20 75 73 2c 20 77 65 | 20 6c 6f 6f 6b 20 61 74 |t us, we| look at|
|00004830| 20 74 68 65 20 54 4e 20 | 66 6f 72 20 74 68 65 20 | the TN |for the |
|00004840| 74 61 72 67 65 74 20 6f | 66 20 61 6c 6c 20 6f 75 |target o|f all ou|
|00004850| 72 20 77 72 69 74 65 20 | 72 65 66 73 2e 0a 0a 57 |r write |refs...W|
|00004860| 65 20 73 65 70 61 72 61 | 74 65 6c 79 20 63 68 61 |e separa|tely cha|
|00004870| 69 6e 20 74 6f 67 65 74 | 68 65 72 20 74 68 65 20 |in toget|her the |
|00004880| 72 65 61 64 20 72 65 66 | 73 20 61 6e 64 20 74 68 |read ref|s and th|
|00004890| 65 20 77 72 69 74 65 20 | 72 65 66 73 20 66 6f 72 |e write |refs for|
|000048a0| 20 61 20 54 4e 2c 0a 61 | 6c 6c 6f 77 69 6e 67 20 | a TN,.a|llowing |
|000048b0| 65 61 73 79 20 64 65 74 | 65 72 6d 69 6e 61 74 69 |easy det|erminati|
|000048c0| 6f 6e 20 6f 66 20 74 68 | 69 6e 67 73 20 73 75 63 |on of th|ings suc|
|000048d0| 68 20 61 73 20 77 68 65 | 74 68 65 72 20 61 20 54 |h as whe|ther a T|
|000048e0| 4e 20 68 61 73 20 6f 6e | 6c 79 20 61 20 73 69 6e |N has on|ly a sin|
|000048f0| 67 6c 65 0a 64 65 66 69 | 6e 69 74 69 6f 6e 20 6f |gle.defi|nition o|
|00004900| 72 20 68 61 73 20 6e 6f | 20 72 65 61 64 73 2e 20 |r has no| reads. |
|00004910| 20 49 74 20 77 6f 75 6c | 64 20 61 6c 73 6f 20 61 | It woul|d also a|
|00004920| 6c 6c 6f 77 20 65 61 73 | 69 65 72 20 74 72 61 76 |llow eas|ier trav|
|00004930| 65 72 73 61 6c 20 6f 66 | 20 74 68 65 20 74 61 72 |ersal of| the tar|
|00004940| 67 65 74 0a 67 72 61 70 | 68 2e 0a 20 0a 52 65 70 |get.grap|h.. .Rep|
|00004950| 72 65 73 65 6e 74 20 70 | 65 72 2d 6c 6f 63 61 74 |resent p|er-locat|
|00004960| 69 6f 6e 20 63 6f 6e 66 | 6c 69 63 74 73 20 61 73 |ion conf|licts as|
|00004970| 20 76 65 63 74 6f 72 73 | 20 69 6e 64 65 78 65 64 | vectors| indexed|
|00004980| 20 62 79 20 62 6c 6f 63 | 6b 20 6e 75 6d 62 65 72 | by bloc|k number|
|00004990| 20 6f 66 0a 70 65 72 2d | 62 6c 6f 63 6b 20 63 6f | of.per-|block co|
|000049a0| 6e 66 6c 69 63 74 20 69 | 6e 66 6f 2e 20 20 54 6f |nflict i|nfo. To|
|000049b0| 20 74 65 73 74 20 77 68 | 65 74 68 65 72 20 61 20 | test wh|ether a |
|000049c0| 54 4e 20 63 6f 6e 66 6c | 69 63 74 73 20 6f 6e 20 |TN confl|icts on |
|000049d0| 61 20 6c 6f 63 61 74 69 | 6f 6e 2c 20 77 65 0a 77 |a locati|on, we.w|
|000049e0| 6f 75 6c 64 20 74 68 65 | 6e 20 68 61 76 65 20 74 |ould the|n have t|
|000049f0| 6f 20 69 74 65 72 61 74 | 65 20 6f 76 65 72 20 74 |o iterat|e over t|
|00004a00| 68 65 20 54 4e 73 20 67 | 6c 6f 62 61 6c 2d 63 6f |he TNs g|lobal-co|
|00004a10| 6e 66 6c 69 63 74 73 2c | 20 75 73 69 6e 67 20 74 |nflicts,| using t|
|00004a20| 68 65 20 62 6c 6f 63 6b | 0a 6e 75 6d 62 65 72 20 |he block|.number |
|00004a30| 61 6e 64 20 4c 54 4e 20 | 6e 75 6d 62 65 72 20 74 |and LTN |number t|
|00004a40| 6f 20 63 68 65 63 6b 20 | 66 6f 72 20 61 20 63 6f |o check |for a co|
|00004a50| 6e 66 6c 69 63 74 20 69 | 6e 20 74 68 61 74 20 62 |nflict i|n that b|
|00004a60| 6c 6f 63 6b 2e 20 20 42 | 75 74 20 73 69 6e 63 65 |lock. B|ut since|
|00004a70| 20 6d 6f 73 74 0a 54 4e | 73 20 61 72 65 20 6c 6f | most.TN|s are lo|
|00004a80| 63 61 6c 2c 20 74 68 69 | 73 20 74 65 73 74 20 61 |cal, thi|s test a|
|00004a90| 63 74 75 61 6c 6c 79 20 | 69 73 6e 27 74 20 6d 75 |ctually |isn't mu|
|00004aa0| 63 68 20 6d 6f 72 65 20 | 65 78 70 65 6e 73 69 76 |ch more |expensiv|
|00004ab0| 65 20 74 68 61 6e 20 69 | 6e 64 65 78 69 6e 67 20 |e than i|ndexing |
|00004ac0| 69 6e 74 6f 0a 61 20 62 | 69 74 2d 76 65 63 74 6f |into.a b|it-vecto|
|00004ad0| 72 20 62 79 20 47 54 4e | 20 6e 75 6d 62 65 72 73 |r by GTN| numbers|
|00004ae0| 2e 0a 0a 54 68 65 20 62 | 69 67 20 77 69 6e 20 6f |...The b|ig win o|
|00004af0| 66 20 74 68 69 73 20 73 | 63 68 65 6d 65 20 69 73 |f this s|cheme is|
|00004b00| 20 74 68 61 74 20 69 74 | 20 69 73 20 6d 75 63 68 | that it| is much|
|00004b10| 20 63 68 65 61 70 65 72 | 20 74 6f 20 61 64 64 20 | cheaper| to add |
|00004b20| 63 6f 6e 66 6c 69 63 74 | 73 20 69 6e 74 6f 20 74 |conflict|s into t|
|00004b30| 68 65 0a 63 6f 6e 66 6c | 69 63 74 20 73 65 74 20 |he.confl|ict set |
|00004b40| 66 6f 72 20 61 20 6c 6f | 63 61 74 69 6f 6e 2c 20 |for a lo|cation, |
|00004b50| 73 69 6e 63 65 20 77 65 | 20 6e 65 76 65 72 20 6e |since we| never n|
|00004b60| 65 65 64 20 74 6f 20 61 | 63 74 75 61 6c 6c 79 20 |eed to a|ctually |
|00004b70| 63 6f 6d 70 75 74 65 20 | 74 68 65 0a 63 6f 6e 66 |compute |the.conf|
|00004b80| 6c 69 63 74 20 73 65 74 | 20 69 6e 20 61 20 6c 69 |lict set| in a li|
|00004b90| 73 74 2d 6c 69 6b 65 20 | 72 65 70 72 65 73 65 6e |st-like |represen|
|00004ba0| 74 61 74 69 6f 6e 20 28 | 77 68 69 63 68 20 72 65 |tation (|which re|
|00004bb0| 71 75 69 72 65 73 20 69 | 74 65 72 61 74 69 6e 67 |quires i|terating|
|00004bc0| 20 6f 76 65 72 20 74 68 | 65 0a 4c 54 4e 20 63 6f | over th|e.LTN co|
|00004bd0| 6e 66 6c 69 63 74 73 20 | 76 65 63 74 6f 72 73 20 |nflicts |vectors |
|00004be0| 61 6e 64 20 75 6e 69 6f | 6e 69 6e 67 20 69 6e 20 |and unio|ning in |
|00004bf0| 74 68 65 20 61 6c 77 61 | 79 73 2d 6c 69 76 65 20 |the alwa|ys-live |
|00004c00| 54 4e 73 29 2e 20 20 49 | 6e 73 74 65 61 64 2c 20 |TNs). I|nstead, |
|00004c10| 77 65 20 6a 75 73 74 0a | 69 74 65 72 61 74 65 20 |we just.|iterate |
|00004c20| 6f 76 65 72 20 74 68 65 | 20 67 6c 6f 62 61 6c 2d |over the| global-|
|00004c30| 63 6f 6e 66 6c 69 63 74 | 73 20 66 6f 72 20 74 68 |conflict|s for th|
|00004c40| 65 20 54 4e 2c 20 75 73 | 69 6e 67 20 42 49 54 2d |e TN, us|ing BIT-|
|00004c50| 49 4f 52 20 74 6f 20 63 | 6f 6d 62 69 6e 65 20 74 |IOR to c|ombine t|
|00004c60| 68 65 0a 63 6f 6e 66 6c | 69 63 74 20 73 65 74 20 |he.confl|ict set |
|00004c70| 77 69 74 68 20 74 68 65 | 20 62 69 74 2d 76 65 63 |with the| bit-vec|
|00004c80| 74 6f 72 20 66 6f 72 20 | 74 68 61 74 20 62 6c 6f |tor for |that blo|
|00004c90| 63 6b 20 69 6e 20 74 68 | 61 74 20 6c 6f 63 61 74 |ck in th|at locat|
|00004ca0| 69 6f 6e 2c 20 6f 72 20 | 6d 61 72 6b 69 6e 67 0a |ion, or |marking.|
|00004cb0| 74 68 61 74 20 62 6c 6f | 63 6b 2f 6c 6f 63 61 74 |that blo|ck/locat|
|00004cc0| 69 6f 6e 20 63 6f 6d 62 | 69 6e 61 74 69 6f 6e 20 |ion comb|ination |
|00004cd0| 61 73 20 62 65 69 6e 67 | 20 61 6c 77 61 79 73 2d |as being| always-|
|00004ce0| 6c 69 76 65 20 69 66 20 | 74 68 65 20 63 6f 6e 66 |live if |the conf|
|00004cf0| 6c 69 63 74 20 69 73 0a | 61 6c 77 61 79 73 2d 6c |lict is.|always-l|
|00004d00| 69 76 65 2e 0a 0a 47 65 | 6e 65 72 61 74 69 6e 67 |ive...Ge|nerating|
|00004d10| 20 74 68 65 20 63 6f 6e | 66 6c 69 63 74 20 73 65 | the con|flict se|
|00004d20| 74 20 69 73 20 69 6e 68 | 65 72 65 6e 74 6c 79 20 |t is inh|erently |
|00004d30| 6d 6f 72 65 20 63 6f 73 | 74 6c 79 2c 20 73 69 6e |more cos|tly, sin|
|00004d40| 63 65 20 61 6c 74 68 6f | 75 67 68 20 77 65 0a 62 |ce altho|ugh we.b|
|00004d50| 65 6c 69 65 76 65 20 74 | 68 65 20 63 6f 6e 66 6c |elieve t|he confl|
|00004d60| 69 63 74 20 73 65 74 20 | 73 69 7a 65 20 74 6f 20 |ict set |size to |
|00004d70| 62 65 20 72 6f 75 67 68 | 6c 79 20 63 6f 6e 73 74 |be rough|ly const|
|00004d80| 61 6e 74 2c 20 69 74 20 | 63 61 6e 20 65 61 73 69 |ant, it |can easi|
|00004d90| 6c 79 20 63 6f 6e 74 61 | 69 6e 0a 74 65 6e 73 20 |ly conta|in.tens |
|00004da0| 6f 66 20 65 6c 65 6d 65 | 6e 74 73 2e 20 20 57 65 |of eleme|nts. We|
|00004db0| 20 77 6f 75 6c 64 20 68 | 61 76 65 20 74 6f 20 67 | would h|ave to g|
|00004dc0| 65 6e 65 72 61 74 65 20 | 74 68 65 73 65 20 6d 6f |enerate |these mo|
|00004dd0| 64 65 72 61 74 65 6c 79 | 20 6c 61 72 67 65 20 6c |derately| large l|
|00004de0| 69 73 74 73 20 66 6f 72 | 0a 61 6c 6c 20 54 4e 73 |ists for|.all TNs|
|00004df0| 2c 20 69 6e 63 6c 75 64 | 69 6e 67 20 6c 6f 63 61 |, includ|ing loca|
|00004e00| 6c 20 54 4e 73 2e 20 20 | 49 6e 20 63 6f 6e 74 72 |l TNs. |In contr|
|00004e10| 61 73 74 2c 20 74 68 65 | 20 70 72 6f 70 6f 73 65 |ast, the| propose|
|00004e20| 64 20 73 63 68 65 6d 65 | 20 64 6f 65 73 20 77 6f |d scheme| does wo|
|00004e30| 72 6b 0a 70 72 6f 70 6f | 72 74 69 6f 6e 61 6c 20 |rk.propo|rtional |
|00004e40| 74 6f 20 74 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |to the n|umber of|
|00004e50| 20 62 6c 6f 63 6b 73 20 | 74 68 65 20 54 4e 20 69 | blocks |the TN i|
|00004e60| 73 20 6c 69 76 65 20 69 | 6e 2c 20 77 68 69 63 68 |s live i|n, which|
|00004e70| 20 69 73 20 73 6d 61 6c | 6c 20 6f 6e 0a 61 76 65 | is smal|l on.ave|
|00004e80| 72 61 67 65 20 28 31 20 | 66 6f 72 20 6c 6f 63 61 |rage (1 |for loca|
|00004e90| 6c 20 54 4e 73 29 2e 20 | 20 54 68 69 73 20 77 69 |l TNs). | This wi|
|00004ea0| 6e 20 65 78 69 73 74 73 | 20 69 6e 64 65 70 65 6e |n exists| indepen|
|00004eb0| 64 65 6e 74 6c 79 20 66 | 72 6f 6d 20 74 68 65 20 |dently f|rom the |
|00004ec0| 77 69 6e 20 6f 66 20 6e | 6f 74 0a 68 61 76 69 6e |win of n|ot.havin|
|00004ed0| 67 20 74 6f 20 69 74 65 | 72 61 74 65 20 6f 76 65 |g to ite|rate ove|
|00004ee0| 72 20 4c 54 4e 20 63 6f | 6e 66 6c 69 63 74 20 76 |r LTN co|nflict v|
|00004ef0| 65 63 74 6f 72 73 2e 0a | 0a 0a 5b 5c 23 5c 23 5c |ectors..|..[\#\#\|
|00004f00| 23 20 4e 6f 74 65 20 74 | 68 61 74 20 73 69 6e 63 |# Note t|hat sinc|
|00004f10| 65 20 77 65 20 6e 65 76 | 65 72 20 64 6f 20 62 69 |e we nev|er do bi|
|00004f20| 74 77 69 73 65 20 69 74 | 65 72 61 74 69 6f 6e 20 |twise it|eration |
|00004f30| 6f 76 65 72 20 74 68 65 | 20 4c 54 4e 20 63 6f 6e |over the| LTN con|
|00004f40| 66 6c 69 63 74 0a 76 65 | 63 74 6f 72 73 2c 20 70 |flict.ve|ctors, p|
|00004f50| 61 72 74 20 6f 66 20 74 | 68 65 20 6d 6f 74 69 76 |art of t|he motiv|
|00004f60| 61 74 69 6f 6e 20 66 6f | 72 20 6b 65 65 70 69 6e |ation fo|r keepin|
|00004f70| 67 20 74 68 65 73 65 20 | 61 20 73 6d 61 6c 6c 20 |g these |a small |
|00004f80| 66 69 78 65 64 20 73 69 | 7a 65 20 68 61 73 20 62 |fixed si|ze has b|
|00004f90| 65 65 6e 0a 72 65 6d 6f | 76 65 64 2e 20 20 42 75 |een.remo|ved. Bu|
|00004fa0| 74 20 69 74 20 77 6f 75 | 6c 64 20 73 74 69 6c 6c |t it wou|ld still|
|00004fb0| 20 62 65 20 75 73 65 66 | 75 6c 20 74 6f 20 6b 65 | be usef|ul to ke|
|00004fc0| 65 70 20 74 68 65 20 73 | 69 7a 65 20 66 69 78 65 |ep the s|ize fixe|
|00004fd0| 64 20 73 6f 20 74 68 61 | 74 20 77 65 20 63 61 6e |d so tha|t we can|
|00004fe0| 0a 65 61 73 69 6c 79 20 | 72 65 63 79 63 6c 65 20 |.easily |recycle |
|00004ff0| 74 68 65 20 62 69 74 2d | 76 65 63 74 6f 72 73 2c |the bit-|vectors,|
|00005000| 20 61 6e 64 20 73 6f 20 | 74 68 61 74 20 77 65 20 | and so |that we |
|00005010| 63 6f 75 6c 64 20 70 6f | 74 65 6e 74 69 61 6c 6c |could po|tentiall|
|00005020| 79 20 68 61 76 65 20 6d | 61 78 69 6d 61 6c 6c 79 |y have m|aximally|
|00005030| 0a 74 65 6e 73 65 20 73 | 70 65 63 69 61 6c 20 70 |.tense s|pecial p|
|00005040| 72 69 6d 69 74 69 76 65 | 73 20 66 6f 72 20 64 6f |rimitive|s for do|
|00005050| 69 6e 67 20 63 6c 65 61 | 72 20 61 6e 64 20 62 69 |ing clea|r and bi|
|00005060| 74 2d 69 6f 72 20 6f 6e | 20 74 68 65 73 65 20 76 |t-ior on| these v|
|00005070| 65 63 74 6f 72 73 2e 5d | 0a 0a 54 68 69 73 20 73 |ectors.]|..This s|
|00005080| 63 68 65 6d 65 20 69 73 | 20 73 6f 6d 65 77 68 61 |cheme is| somewha|
|00005090| 74 20 6d 6f 72 65 20 73 | 70 61 63 65 2d 69 6e 74 |t more s|pace-int|
|000050a0| 65 6e 73 69 76 65 20 74 | 68 61 6e 20 68 61 76 69 |ensive t|han havi|
|000050b0| 6e 67 20 61 20 70 65 72 | 2d 6c 6f 63 61 74 69 6f |ng a per|-locatio|
|000050c0| 6e 0a 62 69 74 2d 76 65 | 63 74 6f 72 2e 20 20 45 |n.bit-ve|ctor. E|
|000050d0| 61 63 68 20 76 65 63 74 | 6f 72 20 65 6e 74 72 79 |ach vect|or entry|
|000050e0| 20 77 6f 75 6c 64 20 62 | 65 20 73 6f 6d 65 74 68 | would b|e someth|
|000050f0| 69 6e 67 20 6c 69 6b 65 | 20 31 35 30 20 62 69 74 |ing like| 150 bit|
|00005100| 73 20 72 61 74 68 65 72 | 20 74 68 61 6e 20 6f 6e |s rather| than on|
|00005110| 65 0a 62 69 74 2c 20 62 | 75 74 20 74 68 69 73 20 |e.bit, b|ut this |
|00005120| 69 73 20 6d 69 74 69 67 | 61 74 65 64 20 62 79 20 |is mitig|ated by |
|00005130| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 62 6c |the numb|er of bl|
|00005140| 6f 63 6b 73 20 62 65 69 | 6e 67 20 35 2d 31 30 78 |ocks bei|ng 5-10x|
|00005150| 20 73 6d 61 6c 6c 65 72 | 20 74 68 61 6e 20 74 68 | smaller| than th|
|00005160| 65 0a 6e 75 6d 62 65 72 | 20 6f 66 20 54 4e 73 2e |e.number| of TNs.|
|00005170| 20 20 54 68 69 73 20 73 | 65 65 6d 73 20 6c 69 6b | This s|eems lik|
|00005180| 65 20 61 6e 20 61 63 63 | 65 70 74 61 62 6c 65 20 |e an acc|eptable |
|00005190| 6f 76 65 72 68 65 61 64 | 2c 20 61 20 73 6d 61 6c |overhead|, a smal|
|000051a0| 6c 20 66 72 61 63 74 69 | 6f 6e 20 6f 66 20 74 68 |l fracti|on of th|
|000051b0| 65 0a 74 6f 74 61 6c 20 | 56 4d 52 20 72 65 70 72 |e.total |VMR repr|
|000051c0| 65 73 65 6e 74 61 74 69 | 6f 6e 2e 0a 0a 54 68 65 |esentati|on...The|
|000051d0| 20 73 70 61 63 65 20 6f | 76 65 72 68 65 61 64 20 | space o|verhead |
|000051e0| 63 6f 75 6c 64 20 61 6c | 73 6f 20 62 65 20 72 65 |could al|so be re|
|000051f0| 64 75 63 65 64 20 62 79 | 20 75 73 69 6e 67 20 73 |duced by| using s|
|00005200| 6f 6d 65 74 68 69 6e 67 | 20 65 71 75 69 76 61 6c |omething| equival|
|00005210| 65 6e 74 20 74 6f 20 61 | 0a 74 77 6f 2d 64 69 6d |ent to a|.two-dim|
|00005220| 65 6e 73 69 6f 6e 61 6c | 20 62 69 74 20 61 72 72 |ensional| bit arr|
|00005230| 61 79 2c 20 69 6e 64 65 | 78 65 64 20 66 69 72 73 |ay, inde|xed firs|
|00005240| 74 20 62 79 20 4c 54 4e | 20 6e 75 6d 62 65 72 73 |t by LTN| numbers|
|00005250| 2c 20 61 6e 64 20 74 68 | 65 6e 20 62 6c 6f 63 6b |, and th|en block|
|00005260| 20 6e 75 6d 62 65 72 73 | 0a 28 69 6e 73 74 65 61 | numbers|.(instea|
|00005270| 64 20 6f 66 20 75 73 69 | 6e 67 20 61 20 73 69 6d |d of usi|ng a sim|
|00005280| 70 6c 65 2d 76 65 63 74 | 6f 72 20 6f 66 20 73 65 |ple-vect|or of se|
|00005290| 70 61 72 61 74 65 20 62 | 69 74 2d 76 65 63 74 6f |parate b|it-vecto|
|000052a0| 72 73 2e 29 20 20 54 68 | 69 73 20 77 6f 75 6c 64 |rs.) Th|is would|
|000052b0| 0a 65 6c 69 6d 69 6e 61 | 74 65 20 73 70 61 63 65 |.elimina|te space|
|000052c0| 20 77 61 73 74 61 67 65 | 20 64 75 65 20 74 6f 20 | wastage| due to |
|000052d0| 62 69 74 2d 76 65 63 74 | 6f 72 20 6f 76 65 72 68 |bit-vect|or overh|
|000052e0| 65 61 64 73 2c 20 77 68 | 69 63 68 20 6d 69 67 68 |eads, wh|ich migh|
|000052f0| 74 20 62 65 20 35 30 25 | 20 6f 72 0a 6d 6f 72 65 |t be 50%| or.more|
|00005300| 2c 20 61 6e 64 20 77 6f | 75 6c 64 20 61 6c 73 6f |, and wo|uld also|
|00005310| 20 6d 61 6b 65 20 65 66 | 66 69 63 69 65 6e 74 20 | make ef|ficient |
|00005320| 7a 65 72 6f 69 6e 67 20 | 6f 66 20 74 68 65 20 76 |zeroing |of the v|
|00005330| 65 63 74 6f 72 73 20 6d | 6f 72 65 0a 73 74 72 61 |ectors m|ore.stra|
|00005340| 69 67 68 74 66 6f 72 77 | 61 72 64 2e 20 20 57 65 |ightforw|ard. We|
|00005350| 20 77 6f 75 6c 64 20 74 | 68 65 6e 20 77 61 6e 74 | would t|hen want|
|00005360| 20 65 66 66 69 63 69 65 | 6e 74 20 6f 70 65 72 61 | efficie|nt opera|
|00005370| 74 69 6f 6e 73 20 66 6f | 72 20 4f 52 27 69 6e 67 |tions fo|r OR'ing|
|00005380| 20 4c 54 4e 0a 63 6f 6e | 66 6c 69 63 74 20 76 65 | LTN.con|flict ve|
|00005390| 63 74 6f 72 73 20 77 69 | 74 68 20 72 6f 77 73 20 |ctors wi|th rows |
|000053a0| 69 6e 20 74 68 65 20 61 | 72 72 61 79 2e 0a 0a 54 |in the a|rray...T|
|000053b0| 68 69 73 20 72 65 70 72 | 65 73 65 6e 74 61 74 69 |his repr|esentati|
|000053c0| 6f 6e 20 61 6c 73 6f 20 | 6f 70 65 6e 73 20 61 20 |on also |opens a |
|000053d0| 77 68 6f 6c 65 20 6e 65 | 77 20 72 61 6e 67 65 20 |whole ne|w range |
|000053e0| 6f 66 20 61 6c 6c 6f 63 | 61 74 69 6f 6e 20 61 6c |of alloc|ation al|
|000053f0| 67 6f 72 69 74 68 6d 73 | 3a 20 6f 6e 65 73 0a 74 |gorithms|: ones.t|
|00005400| 68 61 74 20 73 74 6f 72 | 65 20 61 6c 6c 6f 63 61 |hat stor|e alloca|
|00005410| 74 65 20 54 4e 73 20 69 | 6e 20 64 69 66 66 65 72 |te TNs i|n differ|
|00005420| 65 6e 74 20 6c 6f 63 61 | 74 69 6f 6e 73 20 77 69 |ent loca|tions wi|
|00005430| 74 68 69 6e 20 64 69 66 | 66 65 72 65 6e 74 20 70 |thin dif|ferent p|
|00005440| 6f 72 74 69 6f 6e 73 20 | 6f 66 20 74 68 65 0a 70 |ortions |of the.p|
|00005450| 72 6f 67 72 61 6d 2e 20 | 20 54 68 69 73 20 69 73 |rogram. | This is|
|00005460| 20 62 65 63 61 75 73 65 | 20 77 65 20 63 61 6e 20 | because| we can |
|00005470| 6e 6f 77 20 72 65 70 72 | 65 73 65 6e 74 20 61 20 |now repr|esent a |
|00005480| 6c 6f 63 61 74 69 6f 6e | 20 62 65 69 6e 67 20 75 |location| being u|
|00005490| 73 65 64 20 74 6f 20 68 | 6f 6c 64 20 61 0a 63 65 |sed to h|old a.ce|
|000054a0| 72 74 61 69 6e 20 54 4e | 20 77 69 74 68 69 6e 20 |rtain TN| within |
|000054b0| 61 6e 20 61 72 62 69 74 | 72 61 72 79 20 73 75 62 |an arbit|rary sub|
|000054c0| 73 65 74 20 6f 66 20 74 | 68 65 20 62 6c 6f 63 6b |set of t|he block|
|000054d0| 73 20 74 68 65 20 54 4e | 20 69 73 20 72 65 66 65 |s the TN| is refe|
|000054e0| 72 65 6e 63 65 64 20 69 | 6e 2e 0a 0a 0a 0a 0a 0a |renced i|n.......|
|000054f0| 0a 0a 0a 0a 50 61 63 6b | 20 67 6f 61 6c 73 3a 0a |....Pack| goals:.|
|00005500| 0a 50 61 63 6b 20 73 68 | 6f 75 6c 64 3a 0a 0a 53 |.Pack sh|ould:..S|
|00005510| 75 62 6a 65 63 74 20 74 | 6f 20 72 65 73 6f 75 72 |ubject t|o resour|
|00005520| 63 65 20 63 6f 6e 73 74 | 72 61 69 6e 74 73 3a 0a |ce const|raints:.|
|00005530| 20 2d 2d 20 4d 69 6e 69 | 6d 69 7a 65 20 75 73 65 | -- Mini|mize use|
|00005540| 20 63 6f 73 74 73 0a 20 | 20 20 20 20 2d 2d 20 22 | costs. | -- "|
|00005550| 52 65 67 69 73 74 65 72 | 20 61 6c 6c 6f 63 61 74 |Register| allocat|
|00005560| 69 6f 6e 22 0a 20 20 20 | 20 20 20 20 20 20 41 6c |ion". | Al|
|00005570| 6c 6f 63 61 74 65 20 61 | 73 20 6d 61 6e 79 20 76 |locate a|s many v|
|00005580| 61 6c 75 65 73 20 61 73 | 20 70 6f 73 73 69 62 6c |alues as| possibl|
|00005590| 65 20 69 6e 20 73 63 61 | 72 63 65 20 22 67 6f 6f |e in sca|rce "goo|
|000055a0| 64 22 20 6c 6f 63 61 74 | 69 6f 6e 73 2c 0a 20 20 |d" locat|ions,. |
|000055b0| 20 20 20 20 20 20 20 61 | 74 74 65 6d 70 74 69 6e | a|ttemptin|
|000055c0| 67 20 74 6f 20 6d 69 6e | 69 6d 69 7a 65 20 74 68 |g to min|imize th|
|000055d0| 65 20 61 67 67 72 65 67 | 61 74 65 20 75 73 65 20 |e aggreg|ate use |
|000055e0| 63 6f 73 74 20 66 6f 72 | 20 74 68 65 20 65 6e 74 |cost for| the ent|
|000055f0| 69 72 65 20 70 72 6f 67 | 72 61 6d 2e 0a 20 20 20 |ire prog|ram.. |
|00005600| 20 20 2d 2d 20 22 53 61 | 76 65 20 6f 70 74 69 6d | -- "Sa|ve optim|
|00005610| 69 7a 61 74 69 6f 6e 22 | 0a 20 20 20 20 20 20 20 |ization"|. |
|00005620| 20 20 44 6f 6e 27 74 20 | 61 6c 6c 6f 63 61 74 65 | Don't |allocate|
|00005630| 20 76 61 6c 75 65 73 20 | 69 6e 20 72 65 67 69 73 | values |in regis|
|00005640| 74 65 72 73 20 77 68 65 | 6e 20 74 68 65 20 73 61 |ters whe|n the sa|
|00005650| 76 65 2f 72 65 73 74 6f | 72 65 20 63 6f 73 74 73 |ve/resto|re costs|
|00005660| 20 65 78 63 65 65 64 0a | 20 20 20 20 20 20 20 20 | exceed.| |
|00005670| 20 74 68 65 20 65 78 70 | 65 63 74 65 64 20 67 61 | the exp|ected ga|
|00005680| 69 6e 20 66 6f 72 20 6b | 65 65 70 69 6e 67 20 74 |in for k|eeping t|
|00005690| 68 65 20 76 61 6c 75 65 | 20 69 6e 20 61 20 72 65 |he value| in a re|
|000056a0| 67 69 73 74 65 72 2e 20 | 20 28 53 69 6d 69 6c 61 |gister. | (Simila|
|000056b0| 72 20 74 6f 0a 20 20 20 | 20 20 20 20 20 20 22 6f |r to. | "o|
|000056c0| 70 65 6e 69 6e 67 20 63 | 6f 73 74 73 22 20 69 6e |pening c|osts" in|
|000056d0| 20 52 41 4f 43 2e 29 20 | 20 5b 52 65 61 6c 6c 79 | RAOC.) | [Really|
|000056e0| 20 6a 75 73 74 20 61 20 | 63 61 73 65 20 6f 66 20 | just a |case of |
|000056f0| 72 65 70 72 65 73 65 6e | 74 61 74 69 6f 6e 0a 20 |represen|tation. |
|00005700| 20 20 20 20 20 20 20 20 | 73 65 6c 65 63 74 69 6f | |selectio|
|00005710| 6e 2e 5d 0a 0a 20 2d 2d | 20 4d 69 6e 69 6d 69 7a |n.].. --| Minimiz|
|00005720| 65 20 70 72 65 66 65 72 | 65 6e 63 65 20 63 6f 73 |e prefer|ence cos|
|00005730| 74 73 0a 20 20 20 20 45 | 6c 69 6d 69 6e 61 74 65 |ts. E|liminate|
|00005740| 20 61 73 20 6d 61 6e 79 | 20 6d 6f 76 65 73 20 61 | as many| moves a|
|00005750| 73 20 70 6f 73 73 69 62 | 6c 65 2e 0a 0a 0a 22 52 |s possib|le...."R|
|00005760| 65 67 69 73 74 65 72 20 | 61 6c 6c 6f 63 61 74 69 |egister |allocati|
|00005770| 6f 6e 22 20 69 73 20 62 | 61 73 69 63 61 6c 6c 79 |on" is b|asically|
|00005780| 20 61 6e 20 61 74 74 65 | 6d 70 74 20 74 6f 20 65 | an atte|mpt to e|
|00005790| 6c 69 6d 69 6e 61 74 65 | 20 6d 6f 76 65 73 20 62 |liminate| moves b|
|000057a0| 65 74 77 65 65 6e 0a 72 | 65 67 69 73 74 65 72 73 |etween.r|egisters|
|000057b0| 20 61 6e 64 20 6d 65 6d | 6f 72 79 2e 20 20 22 53 | and mem|ory. "S|
|000057c0| 61 76 65 20 6f 70 74 69 | 6d 69 7a 61 74 69 6f 6e |ave opti|mization|
|000057d0| 22 20 63 6f 75 6e 74 65 | 72 62 61 6c 61 6e 63 65 |" counte|rbalance|
|000057e0| 73 20 22 72 65 67 69 73 | 74 65 72 0a 61 6c 6c 6f |s "regis|ter.allo|
|000057f0| 63 61 74 69 6f 6e 22 20 | 74 6f 20 70 72 65 76 65 |cation" |to preve|
|00005800| 6e 74 20 69 74 20 66 72 | 6f 6d 20 62 65 63 6f 6d |nt it fr|om becom|
|00005810| 69 6e 67 20 61 20 70 65 | 73 73 69 6d 69 7a 61 74 |ing a pe|ssimizat|
|00005820| 69 6f 6e 2c 20 73 69 6e | 63 65 20 73 61 76 65 73 |ion, sin|ce saves|
|00005830| 20 63 61 6e 0a 69 6e 74 | 72 6f 64 75 63 65 20 72 | can.int|roduce r|
|00005840| 65 67 69 73 74 65 72 2f | 6d 65 6d 6f 72 79 20 6d |egister/|memory m|
|00005850| 6f 76 65 73 2e 0a 0a 50 | 72 65 66 65 72 65 6e 63 |oves...P|referenc|
|00005860| 65 20 6f 70 74 69 6d 69 | 7a 61 74 69 6f 6e 20 72 |e optimi|zation r|
|00005870| 65 64 75 63 65 73 20 74 | 68 65 20 6e 75 6d 62 65 |educes t|he numbe|
|00005880| 72 20 6f 66 20 6d 6f 76 | 65 73 20 77 69 74 68 69 |r of mov|es withi|
|00005890| 6e 20 61 6e 20 53 43 2e | 20 20 44 6f 69 6e 67 20 |n an SC.| Doing |
|000058a0| 61 20 67 6f 6f 64 0a 6a | 6f 62 20 6f 66 20 68 6f |a good.j|ob of ho|
|000058b0| 6e 6f 72 69 6e 67 20 70 | 72 65 66 65 72 65 6e 63 |noring p|referenc|
|000058c0| 65 73 20 69 73 20 69 6d | 70 6f 72 74 61 6e 74 20 |es is im|portant |
|000058d0| 74 6f 20 74 68 65 20 73 | 75 63 63 65 73 73 20 6f |to the s|uccess o|
|000058e0| 66 20 74 68 65 20 63 6f | 6d 70 69 6c 65 72 2c 20 |f the co|mpiler, |
|000058f0| 73 69 6e 63 65 0a 77 65 | 20 68 61 76 65 20 61 73 |since.we| have as|
|00005900| 73 75 6d 65 64 20 69 6e | 20 6d 61 6e 79 20 70 6c |sumed in| many pl|
|00005910| 61 63 65 73 20 74 68 61 | 74 20 6d 6f 76 65 73 20 |aces tha|t moves |
|00005920| 77 69 6c 6c 20 75 73 75 | 61 6c 6c 79 20 62 65 20 |will usu|ally be |
|00005930| 6f 70 74 69 6d 69 7a 65 | 64 20 61 77 61 79 2e 0a |optimize|d away..|
|00005940| 0a 54 68 65 20 73 63 61 | 72 63 69 74 79 2d 6f 72 |.The sca|rcity-or|
|00005950| 69 65 6e 74 65 64 20 61 | 73 70 65 63 74 20 6f 66 |iented a|spect of|
|00005960| 20 22 72 65 67 69 73 74 | 65 72 20 61 6c 6c 6f 63 | "regist|er alloc|
|00005970| 61 74 69 6f 6e 22 20 69 | 73 20 68 61 6e 64 6c 65 |ation" i|s handle|
|00005980| 64 20 62 79 20 61 20 67 | 72 65 65 64 79 0a 61 6c |d by a g|reedy.al|
|00005990| 67 6f 72 69 74 68 6d 20 | 69 6e 20 70 61 63 6b 2e |gorithm |in pack.|
|000059a0| 20 20 57 65 20 74 72 79 | 20 74 6f 20 70 61 63 6b | We try| to pack|
|000059b0| 20 74 68 65 20 22 6d 6f | 73 74 20 69 6d 70 6f 72 | the "mo|st impor|
|000059c0| 74 61 6e 74 22 20 54 4e | 73 20 66 69 72 73 74 2c |tant" TN|s first,|
|000059d0| 20 75 6e 64 65 72 20 74 | 68 65 0a 74 68 65 6f 72 | under t|he.theor|
|000059e0| 79 20 74 68 61 74 20 65 | 61 72 6c 69 65 72 20 70 |y that e|arlier p|
|000059f0| 61 63 6b 69 6e 67 20 69 | 73 20 6d 6f 72 65 20 6c |acking i|s more l|
|00005a00| 69 6b 65 6c 79 20 74 6f | 20 73 75 63 63 65 65 64 |ikely to| succeed|
|00005a10| 20 64 75 65 20 74 6f 20 | 66 65 77 65 72 20 63 6f | due to |fewer co|
|00005a20| 6e 73 74 72 61 69 6e 74 | 73 2e 0a 0a 54 68 65 20 |nstraint|s...The |
|00005a30| 64 72 61 77 62 61 63 6b | 20 6f 66 20 67 72 65 65 |drawback| of gree|
|00005a40| 64 79 20 61 6c 67 6f 72 | 69 74 68 6d 73 20 69 73 |dy algor|ithms is|
|00005a50| 20 74 68 65 69 72 20 69 | 6e 61 62 69 6c 69 74 79 | their i|nability|
|00005a60| 20 74 6f 20 6c 6f 6f 6b | 20 61 68 65 61 64 2e 20 | to look| ahead. |
|00005a70| 20 50 61 63 6b 69 6e 67 | 20 61 0a 54 4e 20 6d 61 | Packing| a.TN ma|
|00005a80| 79 20 6d 65 73 73 20 75 | 70 20 6c 61 74 65 72 20 |y mess u|p later |
|00005a90| 22 72 65 67 69 73 74 65 | 72 20 61 6c 6c 6f 63 61 |"registe|r alloca|
|00005aa0| 74 69 6f 6e 22 20 62 79 | 20 70 72 65 63 6c 75 64 |tion" by| preclud|
|00005ab0| 69 6e 67 20 70 61 63 6b | 69 6e 67 20 6f 66 20 54 |ing pack|ing of T|
|00005ac0| 4e 73 20 74 68 61 74 0a | 61 72 65 20 69 6e 64 69 |Ns that.|are indi|
|00005ad0| 76 69 64 75 61 6c 6c 79 | 20 22 6c 65 73 73 20 69 |vidually| "less i|
|00005ae0| 6d 70 6f 72 74 61 6e 74 | 22 2c 20 62 75 74 20 6d |mportant|", but m|
|00005af0| 6f 72 65 20 69 6d 70 6f | 72 74 61 6e 74 20 69 6e |ore impo|rtant in|
|00005b00| 20 61 67 67 72 65 67 61 | 74 65 2e 20 20 50 61 63 | aggrega|te. Pac|
|00005b10| 6b 69 6e 67 20 61 0a 54 | 4e 20 6d 61 79 20 61 6c |king a.T|N may al|
|00005b20| 73 6f 20 70 72 65 76 65 | 6e 74 20 70 72 65 66 65 |so preve|nt prefe|
|00005b30| 72 65 6e 63 65 73 20 66 | 72 6f 6d 20 62 65 69 6e |rences f|rom bein|
|00005b40| 67 20 68 6f 6e 6f 72 65 | 64 2e 0a 0a 0a 0c 0a 49 |g honore|d......I|
|00005b50| 6e 69 74 69 61 6c 20 70 | 61 63 6b 69 6e 67 3a 0a |nitial p|acking:.|
|00005b60| 0a 0a 50 61 63 6b 20 61 | 6c 6c 20 54 4e 73 20 72 |..Pack a|ll TNs r|
|00005b70| 65 73 74 72 69 63 74 65 | 64 20 74 6f 20 61 20 66 |estricte|d to a f|
|00005b80| 69 6e 69 74 65 20 53 43 | 20 66 69 72 73 74 2c 20 |inite SC| first, |
|00005b90| 62 65 66 6f 72 65 20 70 | 61 63 6b 69 6e 67 20 61 |before p|acking a|
|00005ba0| 6e 79 20 6f 74 68 65 72 | 20 54 4e 73 2e 0a 0a 4f |ny other| TNs...O|
|00005bb0| 6e 65 20 6d 69 67 68 74 | 20 73 75 70 70 6f 73 65 |ne might| suppose|
|00005bc0| 20 74 68 61 74 20 50 61 | 63 6b 20 77 6f 75 6c 64 | that Pa|ck would|
|00005bd0| 20 68 61 76 65 20 74 6f | 20 74 72 65 61 74 20 54 | have to| treat T|
|00005be0| 4e 73 20 69 6e 20 64 69 | 66 66 65 72 65 6e 74 20 |Ns in di|fferent |
|00005bf0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 73 0a 64 69 66 |environm|ents.dif|
|00005c00| 66 65 72 65 6e 74 6c 79 | 2c 20 62 75 74 20 74 68 |ferently|, but th|
|00005c10| 69 73 20 69 73 20 6e 6f | 74 20 74 68 65 20 63 61 |is is no|t the ca|
|00005c20| 73 65 2e 20 20 50 61 63 | 6b 20 73 69 6d 70 6c 79 |se. Pac|k simply|
|00005c30| 20 61 73 73 69 67 6e 73 | 20 54 4e 73 20 74 6f 20 | assigns| TNs to |
|00005c40| 6c 6f 63 61 74 69 6f 6e | 73 20 73 6f 0a 74 68 61 |location|s so.tha|
|00005c50| 74 20 6e 6f 20 74 77 6f | 20 63 6f 6e 66 6c 69 63 |t no two| conflic|
|00005c60| 74 69 6e 67 20 54 4e 73 | 20 61 72 65 20 69 6e 20 |ting TNs| are in |
|00005c70| 74 68 65 20 73 61 6d 65 | 20 6c 6f 63 61 74 69 6f |the same| locatio|
|00005c80| 6e 2e 20 20 49 6e 20 74 | 68 65 20 70 72 6f 63 65 |n. In t|he proce|
|00005c90| 73 73 20 6f 66 0a 69 6d | 70 6c 65 6d 65 6e 74 69 |ss of.im|plementi|
|00005ca0| 6e 67 20 63 61 6c 6c 20 | 73 65 6d 61 6e 74 69 63 |ng call |semantic|
|00005cb0| 73 20 69 6e 20 63 6f 6e | 66 6c 69 63 74 20 61 6e |s in con|flict an|
|00005cc0| 61 6c 79 73 69 73 2c 20 | 77 65 20 63 61 75 73 65 |alysis, |we cause|
|00005cd0| 20 54 4e 73 20 69 6e 20 | 64 69 66 66 65 72 65 6e | TNs in |differen|
|00005ce0| 74 0a 65 6e 76 69 72 6f | 6e 6d 65 6e 74 73 20 6e |t.enviro|nments n|
|00005cf0| 6f 74 20 74 6f 20 63 6f | 6e 66 6c 69 63 74 2e 20 |ot to co|nflict. |
|00005d00| 20 49 6e 20 74 68 65 20 | 63 61 73 65 20 6f 66 20 | In the |case of |
|00005d10| 70 61 73 73 69 6e 67 20 | 54 4e 73 2c 20 63 72 6f |passing |TNs, cro|
|00005d20| 73 73 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 0a 63 |ss envir|onment.c|
|00005d30| 6f 6e 66 6c 69 63 74 73 | 20 64 6f 20 65 78 69 73 |onflicts| do exis|
|00005d40| 74 2c 20 62 75 74 20 74 | 68 69 73 20 72 65 66 6c |t, but t|his refl|
|00005d50| 65 63 74 73 20 72 65 61 | 6c 69 74 79 2c 20 73 69 |ects rea|lity, si|
|00005d60| 6e 63 65 20 74 68 65 20 | 70 61 73 73 69 6e 67 20 |nce the |passing |
|00005d70| 54 4e 73 20 61 72 65 0a | 6c 69 76 65 20 69 6e 20 |TNs are.|live in |
|00005d80| 62 6f 74 68 20 74 68 65 | 20 63 61 6c 6c 65 72 20 |both the| caller |
|00005d90| 61 6e 64 20 74 68 65 20 | 63 61 6c 6c 65 65 2e 20 |and the |callee. |
|00005da0| 20 45 6e 76 69 72 6f 6e | 6d 65 6e 74 20 73 65 6d | Environ|ment sem|
|00005db0| 61 6e 74 69 63 73 20 68 | 61 73 20 61 6c 72 65 61 |antics h|as alrea|
|00005dc0| 64 79 20 62 65 65 6e 0a | 69 6d 70 6c 65 6d 65 6e |dy been.|implemen|
|00005dd0| 74 65 64 20 61 74 20 74 | 68 69 73 20 70 6f 69 6e |ted at t|his poin|
|00005de0| 74 2e 0a 0a 54 68 69 73 | 20 6d 65 61 6e 73 20 74 |t...This| means t|
|00005df0| 68 61 74 20 50 61 63 6b | 20 63 61 6e 20 70 61 63 |hat Pack| can pac|
|00005e00| 6b 20 61 6c 6c 20 54 4e | 73 20 73 69 6d 75 6c 74 |k all TN|s simult|
|00005e10| 61 6e 65 6f 75 73 6c 79 | 2c 20 75 73 69 6e 67 20 |aneously|, using |
|00005e20| 6f 6e 65 20 64 61 74 61 | 20 73 74 72 75 63 74 75 |one data| structu|
|00005e30| 72 65 0a 74 6f 20 72 65 | 70 72 65 73 65 6e 74 20 |re.to re|present |
|00005e40| 74 68 65 20 63 6f 6e 66 | 6c 69 63 74 73 20 66 6f |the conf|licts fo|
|00005e50| 72 20 65 61 63 68 20 6c | 6f 63 61 74 69 6f 6e 2e |r each l|ocation.|
|00005e60| 20 20 53 6f 20 77 65 20 | 68 61 76 65 20 6f 6e 6c | So we |have onl|
|00005e70| 79 20 6f 6e 65 20 63 6f | 6e 66 6c 69 63 74 20 73 |y one co|nflict s|
|00005e80| 65 74 0a 70 65 72 20 53 | 42 20 6c 6f 63 61 74 69 |et.per S|B locati|
|00005e90| 6f 6e 2c 20 72 61 74 68 | 65 72 20 74 68 61 6e 20 |on, rath|er than |
|00005ea0| 73 65 70 61 72 61 74 69 | 6e 67 20 74 68 69 73 20 |separati|ng this |
|00005eb0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 62 79 20 65 |informat|ion by e|
|00005ec0| 6e 76 69 72 6f 6e 6d 65 | 6e 74 0a 65 6e 76 69 72 |nvironme|nt.envir|
|00005ed0| 6f 6e 6d 65 6e 74 2e 0a | 0a 0c 0a 4c 6f 61 64 20 |onment..|...Load |
|00005ee0| 54 4e 20 70 61 63 6b 69 | 6e 67 3a 0a 0a 57 65 20 |TN packi|ng:..We |
|00005ef0| 63 72 65 61 74 65 20 6c | 6f 61 64 20 54 4e 73 20 |create l|oad TNs |
|00005f00| 61 73 20 6e 65 65 64 65 | 64 20 69 6e 20 61 20 70 |as neede|d in a p|
|00005f10| 6f 73 74 2d 70 61 73 73 | 20 74 6f 20 74 68 65 20 |ost-pass| to the |
|00005f20| 69 6e 69 74 69 61 6c 20 | 70 61 63 6b 69 6e 67 2e |initial |packing.|
|00005f30| 20 20 41 66 74 65 72 20 | 54 4e 73 0a 61 72 65 20 | After |TNs.are |
|00005f40| 70 61 63 6b 65 64 2c 20 | 69 74 20 6d 61 79 20 62 |packed, |it may b|
|00005f50| 65 20 74 68 61 74 20 73 | 6f 6d 65 20 72 65 66 65 |e that s|ome refe|
|00005f60| 72 65 6e 63 65 73 20 74 | 6f 20 61 20 54 4e 20 77 |rences t|o a TN w|
|00005f70| 69 6c 6c 20 72 65 71 75 | 69 72 65 20 69 74 20 74 |ill requ|ire it t|
|00005f80| 6f 20 62 65 20 69 6e 20 | 61 0a 53 43 20 6f 74 68 |o be in |a.SC oth|
|00005f90| 65 72 20 74 68 61 6e 20 | 74 68 65 20 6f 6e 65 20 |er than |the one |
|00005fa0| 69 74 20 77 61 73 20 70 | 61 63 6b 65 64 20 69 6e |it was p|acked in|
|00005fb0| 2e 20 20 57 65 20 63 72 | 65 61 74 65 20 6c 6f 61 |. We cr|eate loa|
|00005fc0| 64 2d 54 4e 73 20 61 6e | 64 20 70 61 63 6b 20 74 |d-TNs an|d pack t|
|00005fd0| 68 65 6d 20 6f 6e 0a 74 | 68 65 20 66 6c 79 20 64 |hem on.t|he fly d|
|00005fe0| 75 72 69 6e 67 20 74 68 | 69 73 20 70 6f 73 74 2d |uring th|is post-|
|00005ff0| 70 61 73 73 2e 20 20 0a | 0a 57 68 61 74 20 77 65 |pass. .|.What we|
|00006000| 20 64 6f 20 69 73 20 68 | 61 76 65 20 61 6e 20 6f | do is h|ave an o|
|00006010| 70 74 69 6f 6e 61 6c 20 | 53 43 20 72 65 73 74 72 |ptional |SC restr|
|00006020| 69 63 74 69 6f 6e 20 61 | 73 73 6f 63 69 61 74 65 |iction a|ssociate|
|00006030| 64 20 77 69 74 68 20 54 | 4e 2d 72 65 66 73 2e 20 |d with T|N-refs. |
|00006040| 20 49 66 20 77 65 0a 70 | 61 63 6b 20 74 68 65 20 | If we.p|ack the |
|00006050| 54 4e 20 69 6e 20 61 6e | 20 53 43 20 77 68 69 63 |TN in an| SC whic|
|00006060| 68 20 69 73 20 64 69 66 | 66 65 72 65 6e 74 20 66 |h is dif|ferent f|
|00006070| 72 6f 6d 20 74 68 65 20 | 72 65 71 75 69 72 65 64 |rom the |required|
|00006080| 20 53 43 20 66 6f 72 20 | 74 68 65 20 72 65 66 65 | SC for |the refe|
|00006090| 72 65 6e 63 65 2c 0a 74 | 68 65 6e 20 77 65 20 63 |rence,.t|hen we c|
|000060a0| 72 65 61 74 65 20 61 20 | 54 4e 20 66 6f 72 20 65 |reate a |TN for e|
|000060b0| 61 63 68 20 73 75 63 68 | 20 72 65 66 65 72 65 6e |ach such| referen|
|000060c0| 63 65 2c 20 61 6e 64 20 | 70 61 63 6b 20 69 74 20 |ce, and |pack it |
|000060d0| 69 6e 74 6f 20 74 68 65 | 20 72 65 71 75 69 72 65 |into the| require|
|000060e0| 64 20 53 43 2e 0a 0a 49 | 6e 20 6d 61 6e 79 20 63 |d SC...I|n many c|
|000060f0| 61 73 65 73 20 77 65 20 | 77 69 6c 6c 20 62 65 20 |ases we |will be |
|00006100| 61 62 6c 65 20 74 6f 20 | 70 61 63 6b 20 74 68 65 |able to |pack the|
|00006110| 20 6c 6f 61 64 20 54 4e | 20 77 69 74 68 20 6e 6f | load TN| with no|
|00006120| 20 68 61 73 73 6c 65 2c | 20 62 75 74 20 69 6e 0a | hassle,| but in.|
|00006130| 67 65 6e 65 72 61 6c 20 | 77 65 20 6d 61 79 20 6e |general |we may n|
|00006140| 65 65 64 20 74 6f 20 73 | 70 69 6c 6c 20 61 20 54 |eed to s|pill a T|
|00006150| 4e 20 74 68 61 74 20 68 | 61 73 20 61 6c 72 65 61 |N that h|as alrea|
|00006160| 64 79 20 62 65 65 6e 20 | 70 61 63 6b 65 64 2e 20 |dy been |packed. |
|00006170| 20 57 65 20 63 68 6f 6f | 73 65 20 61 0a 54 4e 20 | We choo|se a.TN |
|00006180| 74 68 61 74 20 69 73 6e | 27 74 20 69 6e 20 75 73 |that isn|'t in us|
|00006190| 65 20 62 79 20 74 68 65 | 20 6f 66 66 65 6e 64 69 |e by the| offendi|
|000061a0| 6e 67 20 56 4f 50 2c 20 | 61 6e 64 20 74 68 65 6e |ng VOP, |and then|
|000061b0| 20 73 70 69 6c 6c 20 74 | 68 61 74 20 54 4e 20 6f | spill t|hat TN o|
|000061c0| 6e 74 6f 20 74 68 65 0a | 73 74 61 63 6b 20 66 6f |nto the.|stack fo|
|000061d0| 72 20 74 68 65 20 64 75 | 72 61 74 69 6f 6e 20 6f |r the du|ration o|
|000061e0| 66 20 74 68 61 74 20 56 | 4f 50 2e 20 20 49 66 20 |f that V|OP. If |
|000061f0| 74 68 65 20 56 4f 50 20 | 69 73 20 61 20 63 6f 6e |the VOP |is a con|
|00006200| 64 69 74 69 6f 6e 61 6c | 2c 20 74 68 65 6e 20 77 |ditional|, then w|
|00006210| 65 20 6d 75 73 74 0a 69 | 6e 73 65 72 74 20 61 20 |e must.i|nsert a |
|00006220| 6e 65 77 20 62 6c 6f 63 | 6b 20 69 6e 74 65 72 70 |new bloc|k interp|
|00006230| 6f 73 65 64 20 62 65 66 | 6f 72 65 20 74 68 65 20 |osed bef|ore the |
|00006240| 62 72 61 6e 63 68 20 74 | 61 72 67 65 74 20 73 6f |branch t|arget so|
|00006250| 20 74 68 61 74 20 74 68 | 65 20 76 61 6c 75 65 20 | that th|e value |
|00006260| 54 4e 0a 76 61 6c 75 65 | 20 69 73 20 72 65 73 74 |TN.value| is rest|
|00006270| 6f 72 65 64 20 72 65 67 | 61 72 64 6c 65 73 73 20 |ored reg|ardless |
|00006280| 6f 66 20 77 68 69 63 68 | 20 62 72 61 6e 63 68 20 |of which| branch |
|00006290| 69 73 20 74 61 6b 65 6e | 2e 0a 0a 49 6e 73 74 65 |is taken|...Inste|
|000062a0| 61 64 20 6f 66 20 72 65 | 6d 65 6d 62 65 72 69 6e |ad of re|memberin|
|000062b0| 67 20 6c 69 66 65 74 69 | 6d 65 20 69 6e 66 6f 72 |g lifeti|me infor|
|000062c0| 6d 61 74 69 6f 6e 20 66 | 72 6f 6d 20 63 6f 6e 66 |mation f|rom conf|
|000062d0| 6c 69 63 74 20 61 6e 61 | 6c 79 73 69 73 2c 20 77 |lict ana|lysis, w|
|000062e0| 65 20 72 65 64 65 72 69 | 76 65 0a 69 74 2e 20 20 |e rederi|ve.it. |
|000062f0| 57 65 20 73 63 61 6e 20 | 65 61 63 68 20 62 6c 6f |We scan |each blo|
|00006300| 63 6b 20 62 61 63 6b 77 | 61 72 64 20 77 68 69 6c |ck backw|ard whil|
|00006310| 65 20 6b 65 65 70 69 6e | 67 20 74 72 61 63 6b 20 |e keepin|g track |
|00006320| 6f 66 20 77 68 69 63 68 | 20 6c 6f 63 61 74 69 6f |of which| locatio|
|00006330| 6e 73 20 68 61 76 65 0a | 6c 69 76 65 20 54 4e 73 |ns have.|live TNs|
|00006340| 20 69 6e 20 74 68 65 6d | 2e 20 20 57 68 65 6e 20 | in them|. When |
|00006350| 77 65 20 66 69 6e 64 20 | 61 20 72 65 66 65 72 65 |we find |a refere|
|00006360| 6e 63 65 20 74 68 61 74 | 20 6e 65 65 64 73 20 61 |nce that| needs a|
|00006370| 20 6c 6f 61 64 20 54 4e | 20 70 61 63 6b 65 64 2c | load TN| packed,|
|00006380| 20 77 65 20 74 72 79 0a | 74 6f 20 70 61 63 6b 20 | we try.|to pack |
|00006390| 69 74 20 69 6e 20 61 6e | 20 75 6e 75 73 65 64 20 |it in an| unused |
|000063a0| 6c 6f 63 61 74 69 6f 6e | 2e 20 20 49 66 20 77 65 |location|. If we|
|000063b0| 20 63 61 6e 27 74 2c 20 | 77 65 20 75 6e 70 61 63 | can't, |we unpac|
|000063c0| 6b 20 74 68 65 20 63 75 | 72 72 65 6e 74 6c 79 20 |k the cu|rrently |
|000063d0| 6c 69 76 65 20 54 4e 0a | 77 69 74 68 20 74 68 65 |live TN.|with the|
|000063e0| 20 6c 6f 77 65 73 74 20 | 63 6f 73 74 20 61 6e 64 | lowest |cost and|
|000063f0| 20 66 6f 72 63 65 20 69 | 74 20 69 6e 74 6f 20 61 | force i|t into a|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.