Mercurial > lcfOS
comparison python/canon.py @ 279:2ccd57b1d78c
Fix register allocator to do burn2 OK
author | Windel Bouwman |
---|---|
date | Sat, 12 Oct 2013 09:56:23 +0200 |
parents | 6f2423df0675 |
children | 02385f62f250 |
comparison
equal
deleted
inserted
replaced
278:9fca39eebe50 | 279:2ccd57b1d78c |
---|---|
56 return exp | 56 return exp |
57 elif isinstance(exp, ir.Parameter): | 57 elif isinstance(exp, ir.Parameter): |
58 return frame.parMap[exp] | 58 return frame.parMap[exp] |
59 elif isinstance(exp, ir.LocalVariable): | 59 elif isinstance(exp, ir.LocalVariable): |
60 offset = frame.allocVar(exp) | 60 offset = frame.allocVar(exp) |
61 return ir.Mem(ir.Binop(frame.fp, '+', ir.Const(offset))) | 61 return ir.Add(frame.fp, ir.Const(offset)) |
62 elif isinstance(exp, ir.Mem): | 62 elif isinstance(exp, ir.Mem): |
63 exp.e = rewriteExp(exp.e, frame) | 63 exp.e = rewriteExp(exp.e, frame) |
64 return exp | 64 return exp |
65 elif isinstance(exp, ir.Call): | 65 elif isinstance(exp, ir.Call): |
66 exp.arguments = [rewriteExp(p, frame) for p in exp.arguments] | 66 exp.arguments = [rewriteExp(p, frame) for p in exp.arguments] |