1 / 13

Incremental Compilation

Incremental Compilation. Jonathan Bachrach MIT AI Lab. Problem. Do less work than full recompile Produce same result as full recompile. Solution. Change something in source Change all output that would be different Leave others alone Track dependencies between output and source.

jacob
Download Presentation

Incremental Compilation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Incremental Compilation Jonathan Bachrach MIT AI Lab

  2. Problem • Do less work than full recompile • Produce same result as full recompile

  3. Solution • Change something in source • Change all output that would be different • Leave others alone • Track dependencies between output and source

  4. Fun-O-Dylan Approach • Source broken up into source records • Compiler takes source records in and produces bits out

  5. Source Records • Source is broken up into sequence of source records • Each source record contains some contiguous source text • File • Top-level-form

  6. Compilation Phases • Parsing => forms + bindings • Modeling => compile-time models • Conversion => IR • Optimization => IR (method dispatch …) • Code Gen => bits • Linking => bits

  7. Compilation Records • Contain compilation products • One compilation record per source record

  8. Top Level Forms • Object-oriented and syntactic representation of programmatic forms occurring at top level • init-world(); -- top level call • define method … end; -- method definition • define class … end; -- class definition • Registered in compilation records in order • Contains all information for each form • Signatures • Superclasses • Defined bindings • Definitions are binding defining top-level-forms

  9. Bindings • Objects representing global variables • Contain • Name • Home module • Defining definitions • Dependencies

  10. Dependencies • Record bindings for given stage depended on

  11. Incremental Recompilation • Remembers last source records • Computes source record diff to say which source records have changed or been added • When source record diffs • Compile it and • Rerun any phases of records dependent on it • by examining deps on all bindings defined by it • Can increase precision by decreasing size of record • From say file to top-level-form size

  12. Other Systems • SmallEiffel • Eiffel to C compiler • Most time is spent in C compilation • Recompute all C each time • Only recompile C that diffs

  13. Interactive Compilation • Live incremental compilation • Must patch running system • Difficult in the face of optimization

More Related