Incremental Compilation - PowerPoint PPT Presentation

About This Presentation
Title:

Incremental Compilation

Description:

init-world(); -- top level call. define method ... end; -- method definition. define class ... Remembers last source records ... – PowerPoint PPT presentation

Number of Views:564
Avg rating:3.0/5.0
Slides: 14
Provided by: jonathan62
Learn more at: http://www.ai.mit.edu
Category:

less

Transcript and Presenter's Notes

Title: Incremental Compilation


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 gt forms bindings
  • Modeling gt compile-time models
  • Conversion gt IR
  • Optimization gt IR (method dispatch )
  • Code Gen gt bits
  • Linking gt 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
Write a Comment
User Comments (0)
About PowerShow.com