http:^^www.cs.washington.edu^homes^pardo^rtcg.d^index.html
来自「This data set contains WWW-pages collect」· HTML 代码 · 共 537 行 · 第 1/2 页
HTML
537 行
Date: Tue, 10 Dec 1996 22:41:58 GMTServer: NCSA/1.4.2Content-type: text/htmlLast-modified: Sat, 02 Nov 1996 19:51:27 GMTContent-length: 24614<html><head> <title> Runtime Code Generation (RTCG) </title> </head><body><h1>Runtime Code Generation (RTCG)</h1><h2>Terms</h2><em>Runtime Code Generation</em> (RTCG) is a general namefor structured techniques that change a program's instruction spacewhile the program is running.There are a variety of other common, overlapping names,such as ``dynamic compilation'' and ``self-modifying code'';there are also a variety of other less-polite names.<p><blockquote> <em>``Friends don't let friends use SMC''</em> -- email .signature</blockquote>The term "demand-driven compilation" is narrower than RTCG.It typically means that some or all parts of the language translationprocess are performed on a unit of code when that unit is invoked.Demand-driven compilation may be contrasted with runtime codegeneration that is performed speculatively; with demand-driven dynamiclinking in which the address space is modified without "compilation";and self-modifying code in which a code unit is updated by itselfwhich, necessarily, is after the unit has been invoked.The term <em>dynamic compilation</em> is also narrower,typically encompassing code that is generated dynamicallybut which does not self-modify.Dynamic compilation is most often applied to systems usinggeneral-purpose in-core code generatorsand performing code generation over sophisticated inputs(e.g., expressions, rather than simple values)or over dynamically-loaded source code or pseudocode.(Beware that the term ``dynamic compilation'' is nowadays often(?)used also to mean ``a compilation of literary works which is done onan ongoing and/or incremental basis'',e.g. <!WA0><!WA0><!WA0><!WA0><a href="http://www.thomson.com/tcom/resource.html">here</a>.)<p><em>Dynamic linking</em> adds code to the instruction space of theprogram.The code is typically generated using a code generator that is outsideof the program.The ``new code'' may have been generated on demand for theapplication;dynamically-linked code is also used to implementlanguage-independent enhancement and extension, to elilminatemachine-dependencies from binaries, and to reduce the size ofbinaries.(Unfortunately, the term is also sometimes used to describe``building hypermedia connections on an ongoing or incrementalbasis''.)<p>The term <em>runtime compilation</em> is often used to describeloop parallelization that is done at runtimeand which performs no code generation.The idea of runtime compilationis that loop-carried data dependencies for,e.g., ``<tt>x[i] = y[i+2] + z[i-5]</tt>''can be discovered by a static compiler,but that,e.g., ``<tt>x[a[i]] = y[a[i+2]] + z[a[i-5]]</tt>''cannot.The system thus examines the values of <tt>a</tt> at runtime,and performs parallelization at runtime, based on the values.The system thus ``compiles'' information at runtime butperforms no code generation.<!WA1><!WA1><!WA1><!WA1><a href="mailto:shuntak@cs.washington.edu">Write</a>to Shun-Tak Leung (<tt>shuntak@cs.washington.edu</tt>)for more information.<p><em>Instruction-Space Modification</em> is a general term,including any topic that changes bits in an instruction space,whether the change comes from inside the application or fromoutside.<p><em>Just-In-Time Comiplation</em> (JIT) is the general idea that somesteps of compilation may be deferred until the code is invoked.At the moment (1996)most systems that use "JIT" by name are systemsthat use dynamic compilation to get good performance from a portable(machine and/or OS-independent) program representation.Typically, the unit of translation is a loadable unit, or smaller;for example, modules, procedures, statements, etc.,and the input is some virtual machine byte coderather than source text, trees, etc.JIT is used to refer to code generation at dynamic link time as wellas invocation time.In contrast, many other systems perform compilation "just in time"but with the goal of fine-tuning machine-dependent code, etc.A more preceise (but longer) name for "classical" JIT is probablysomething like:"demand-driven specialization to processor architectureat the [module|procedure|...] level".<p>The term <em>self-modifying code</em> or <em>SMC</em> also refers to RTCGbut it is harder to pin down becausethere are many interpretations of ``modify''and so many ways to pronounce ``self''.``Modification'' may mean that an instruction is executed,manipulated in place, and then executed again;it may mean that a region of memory is reused,and holds several instructions over its lifetime;or, it may mean that the instruction space changes,even if no part of it is reused.As for the problem with ``self'', Adam Kao phrased it nicely:<blockquote>What I'm trying to say is, what constitutes ``self'' and ``other''depends on your point of view....Try this simple exercise.Point a finger at your belly-button.Poke.You poked yourself.Your finger didn't poke <em>itself</em>.</blockquote>Some various sensible interpretations include:(a) instructions that manipulate themselves;(b) instructions that manipulate other instructions in the same basicblock;(c) instructions from one source code module manipuate otherinstructions in the same module(d) instructions in one module manipulte instructionsthat are created on behalf of that module;(e) instructions in one address space manipulate other instructions inthe same address space;(f) instructions in one protection somain mainpulate otherinstructions in the same protection domain(g) instructions being used to solve onen problem manipulateinstructions that are also used to solve the same problem.<p>The terms <em>code</em> and <em>data</em> are used here in a limitedsense.``Code'' is used to refer to native machine code that is executableexcept that it may live in a data space instead of a code space.``Data'' is used to refer to all other state, including bits in aninstruction space that are not executable (e.g. are not well-formedinstructions) and things that will be manipulted to become code butwhich are not yet executable native machine code.These definitions are limited because a more general definition of``code'' defines it relative to some engine of execution.In particular, ``code'' in a more general sense might include virtualmachine code instructions, source text, etc.and might also include data values that are used to affect processorexecution in specific ways.<p><hr><h2>Pardo's RTCG stuff</h2><ul><li><!WA2><!WA2><!WA2><!WA2><a href="http://www.cs.washington.edu/homes/pardo/papers.d/rtcg-case.html">A Case for Runtime Code Generation</a>. Self-Modifying Code considered harmless.<li><!WA3><!WA3><!WA3><!WA3><a href="http://www.cs.washington.edu/homes/pardo/papers.d/rtcg-icache.html">A Portable Interface for On-The-Fly Instruction Space Modification</a>. A uniform interface to update the instruction cache ASAP when changing the instruction space of a running program.<li><!WA4><!WA4><!WA4><!WA4><a href="http://www.cs.washington.edu/homes/pardo/papers.d/eval-vso.html">Evaluating Runtime-Compiled Value-Specific Optimizations</a>. Dynamically optimizing around the values of variables can make even highly-tuned programs run faster.<li><!WA5><!WA5><!WA5><!WA5><a href="http://www.cs.washington.edu/homes/pardo/papers.d/dylink.html">Faster Dynamic Linking for SPARC V8 and System V.4</a>. How to make dynamic linking faster and how to do dynamic relinking.<li><!WA6><!WA6><!WA6><!WA6><a href="http://www.cs.washington.edu/homes/pardo/papers.d/data-break.html">Fast Data Breakpoints</a>. Yet <em>another</em> way to implement data breakpoints in a debugger. Uses RTCG.<li><!WA7><!WA7><!WA7><!WA7><a href="http://www.cs.washington.edu/research/compiler/papers.d/shade.html">Shade: A Fast Instruction-Set Simulator for Execution Profiling</a>. A fast extensible cross-machine simulator that collects all sorts of tracing information. It's implemented using RTCG. See also the <!WA8><!WA8><!WA8><!WA8><a href="http://www.cs.washington.edu/homes/pardo/sim.d/index.html">Simulators home page</a>.</ul><hr><!WA9><!WA9><!WA9><!WA9><a href="http://www.cs.washington.edu/homes/pardo/rtcg.d/mail.d/index.html">Mail archive</a>of postings to the <tt>rtcg</tt> mailing list.<hr><h2>Other RTCG stuff</h2><ul><li><!WA10><!WA10><!WA10><!WA10><a href="http://www.csl.sony.co.jp/project/Apertos/techpaper.html">Apertos</a> reflective operating system using "dynamic compilation" for ???<li><!WA11><!WA11><!WA11><!WA11><a href="http://ody.zcu.cz/~novy1/">BatOS</a>: Everything is viewed as source code that's being edited. On invocation, there's a ``freeze'' and compilation.<li><!WA12><!WA12><!WA12><!WA12><a href="http://www.cs.washington.edu/research/projects/cecil/cecil/www/cecil-home.html">Cecil</a>. Cecil code is statically compiled, but uses dynamically-compiled <!WA13><!WA13><!WA13><!WA13><a href="http://www.cs.ucsb.edu/oocsb/papers/pics.html">PICs</a>.<li><!WA14><!WA14><!WA14><!WA14><a href="http://www.swiss.ai.mit.edu/~ziggy/ziggy.html">Michael Blair</a>'s paper on <!WA15><!WA15><!WA15><!WA15><a href="ftp://ftp-swiss.ai.mit.edu/pub/users/ziggy/pac.ps.gz">Improving SCHEME Program Performance through Heuristic Redundant Predicate Evaluation using PAC Learning Techniques</a> (gzip'ped PostScript(tm))<li><!WA16><!WA16><!WA16><!WA16><a href="http://www.colusa.com">Colusa</a> doesn't say it very loudly, but they use a dynamic compiler. See <!WA17><!WA17><!WA17><!WA17><a href="http://www.colusa.com/html/omni_www.html">Omniware</a>. (Has the link expired? Here's a <!WA18><!WA18><!WA18><!WA18><a href="http://www.cs.washington.edu/homes/pardo/rtcg.d/papers.d/colusa-omniware.ps.gz">local copy</a> of the paper.)<li><!WA19><!WA19><!WA19><!WA19><a href="http://www-csag.cs.uiuc.edu/projects/concert.html">Concert</a> used to use (and may again someday use) dynamic compilation in order to transform general-purpose ``remote method invocation'' into a local procedure call. See, in particular, <!WA20><!WA20><!WA20><!WA20><a href="http://www-csag.cs.uiuc.edu/papers/concert-overview.ps">UIUC DCS TR R-93-1815</a><li><!WA21><!WA21><!WA21><!WA21><a href="http://www.stormking.com/~koth/corewar-faq.html">Core Wars</a><li><!WA22><!WA22><!WA22><!WA22><a href="http://amsterdam.lcs.mit.edu/~engler/">Dawson Engler</a> is working on general-purpose code generators for runtime code generation, including DCG (<!WA23><!WA23><!WA23><!WA23><a href="http://amsterdam.lcs.mit.edu/PDOS-papers.html/papers/dcg.ps">PostScript(tm) paper</a>) and `C (<!WA24><!WA24><!WA24><!WA24><a href="http://amsterdam.lcs.mit.edu/PDOS-papers.html/papers/tickc.ps">PostScript(tm) paper</a>)<li>For supporting <!WA25><!WA25><!WA25><!WA25><a href="http://math-www.uio.no/faq/object-faq/part2.html">generics</a><li><!WA26><!WA26><!WA26><!WA26><a href="ftp://ftp.netcom.com/pub/hb/hbaker/hakmem/hakmem.html">HAKMEM</a>: see <ul> <li><!WA27><!WA27><!WA27><!WA27><a href="ftp://ftp.netcom.com/pub/hb/hbaker/hakmem/hacks.html#item172">item #172</a>: a self-modifying sequence that, in just three instructions (including the procedure return) removes a CONS cell from a free list, fills it with the CAR and CDR values and, if needed, calls the garbage collector. (Duplicated <!WA28><!WA28><!WA28><!WA28><a href="http://www.cs.washington.edu/homes/pardo/rtcg.d/papers.d/hacks.html#item172">here</a>) <li><!WA29><!WA29><!WA29><!WA29><a href="ftp://ftp.netcom.com/pub/hb/hbaker/hakmem/hacks.html#item179">item #179</a>: a dynamically-compiled string matcher that implements the KMP searching algorithm, is clearly linear, and which appeared at least five years before KMP! (Duplicated <!WA30><!WA30><!WA30><!WA30><a href="http://www.cs.washington.edu/homes/pardo/rtcg.d/papers.d/algorithms.html#item179">here</a>) </ul><li><!WA31><!WA31><!WA31><!WA31><a href="ftp://ftp.cs.washington.edu/homes/pardo/gill.d/gill-00.html">Gill's 1951 EDSAC Debugger</a>: used a variety of patching techniques to instrument and debug programs.<li><!WA32><!WA32><!WA32><!WA32><a href="http://java.sun.com/">Java</a> uses secure bytecodes to move code from machine to machine. Someday, those bytecodes may be dynamically compiled. For example, <!WA33><!WA33><!WA33><!WA33><a href="http://www.softway.com.au/">Softway</a>'s <!WA34><!WA34><!WA34><!WA34><a href="http://www.softway.com.au/softway/products/guava/">Guava</a> VM. For more on moving code across protection boundaries, see <!WA35><!WA35><!WA35><!WA35><a href="http://www.w3.org/hypertext/WWW/MobileCode/">Mobile Code</a>.<li><!WA36><!WA36><!WA36><!WA36><a href="http://www.cs.arizona.edu/sumatra/juice/>Juice</a> is a Java-to-C translator. It's part of "Sumatra", below.<li><!WA37><!WA37><!WA37><!WA37><a href="http://www.cs.cmu.edu/~koopman">Phil Koopman</a> likes RTHWG (Runtime Hardware Generation). <! old: http://danville.res.utc.com/Mechatronics/ads/koopman/><li><!WA38><!WA38><!WA38><!WA38><a href="http://hopeless.mess.cs.cmu.edu:8001/nitrous/top.html">Lightweight
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?