Category Archives: cgo

Revision Notes

Identification Often (5 different papers) you will be asked to produce the symbol table, attribute records, and links between these, corresponding to a C program that has a lot of nested scope. Remember; this is not the program running, it … Continue reading

Posted in cgo, lecture | Leave a comment

Optimisation

Optimisation isn’t actually optimisation; it doesn’t result in optimal code. So what does it do? Preserve the meaning of the program On average improves the program (run time, space, program size) Is worth the cost of extended compile time + … Continue reading

Posted in cgo, lecture | Leave a comment

Tree-based languages (continued?)

Tiling algorithms Sorry, when did this become about tiles? In RISC you have small tiles, in CISC you have large tiles. Oh, this makes sense; tree tiles are bits of trees that can be matched up together to form complex … Continue reading

Posted in cgo, lecture | Leave a comment

Liveness Analysis

Liveness analysis is related to allocating registers. Two temporary values can fit in the same register if they’re never ‘live’ at the same time. A temporary is live if it holds a value that will be used in the future. … Continue reading

Posted in cgo, lecture | Leave a comment

Code Generation

Intermediate code generation is useful for: Storage allocation; fix address or offsets for each variable identifier. Translation to intermediate code. The slides are pretty confusing…

Posted in cgo, lecture | Leave a comment

Intermediate Languages

You’re going to have to write a lot of compilers if you go from language to assembly. So why not put an intermediate language in the middle. Then you can reuse optimisation phases and mainly it saves a huge amount … Continue reading

Posted in cgo, lecture | Leave a comment

Garbage Collection 2

Cost of Garbage Collection I think basically if you have a very small reachable heap copying is good (Cheney’s Algorithm). But otherwise Mark-and-Sweep is pretty good. Mark Phase with Pointer Reversal Note: You’d do this because doing a DFS down … Continue reading

Posted in cgo, lecture | Leave a comment

Memory Organisation and Procedure Call Protocol

Generally RAM is split up into (in order): Code Static Data Stack Free Space Heap And code memory is usually split up into code for procedures, with entry points at the bottom (lowest address) for each procedure. Storage can be … Continue reading

Posted in cgo, lecture | Leave a comment

Data Representation

First, a summary of Run Time Organisation Run time organisation deals with the general issues of mapping high-level programming language constructs onto low-level features of the target machine. We are going to look at: Data representation. Memory organisation. Procedure call … Continue reading

Posted in cgo, lecture | Leave a comment

Attribute Grammars

An attribute grammar, at its simplest, is a grammar with attributes attached to it. Previously we’ve discussed transforming the abstract syntax tree by explicitly traversing the tree. But instead we can do this shorter, implementation-independent specification. The ‘attributes’ in an … Continue reading

Posted in cgo, lecture | 1 Comment