19.04.2013 Views

Apostila antiga - The Cyan Programming Language

Apostila antiga - The Cyan Programming Language

Apostila antiga - The Cyan Programming Language

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 5. OTIMIZAÇÃO DE CÓDIGO 65<br />

Ou Q deve salvar estes registradores antes de usá-los.<br />

2. Reuso de Registradores e Variáveis Locais/Temporárias<br />

Um registrador/variável está vivo do ponto em que recebe um valor ao ponto onde é utilizado<br />

pela última vez. Se duas variáveis locais a uma subrotina nunca estão vivas ao mesmo tempo,<br />

elas podem ocupar a mesma posição de memória ou registrador. Assim, no código<br />

void f()<br />

{<br />

int i, j;<br />

for ( i = 0; i < 10; i++ )<br />

cout

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!