lp:~mgiuca/mars/atom
Adding atoms to the instruction set architecture so that most instructions can refer directly to integer literals and other "atomic" values without having to load them into a variable. (Bug #440429)
- Get this branch:
- bzr branch lp:~mgiuca/mars/atom
Branch merges
- Matt Giuca: Approve
-
Diff: 894 lines (+233/-144)10 files modifieddoc/dev/isa.rst (+16/-19)
src/ast_cfg.m (+70/-45)
src/cfg.m (+1/-1)
src/interactive.m (+6/-1)
src/interpret.m (+30/-19)
src/ir.m (+19/-15)
src/pretty.m (+14/-20)
src/typedict.m (+34/-11)
src/usedef.m (+14/-13)
test/cases/compiler/ctorsym-unify.mar (+29/-0)
Related bugs
Bug #440429: Mars assembly: Use atoms rather than variable names | Medium | Fix Released | |
Bug #877111: atom: Constructor symbol varset is not converted to local space | Critical | Fix Released |
Related blueprints
Branch information
Recent revisions
- 1273. By Matt Giuca
-
typedict: atom_type now merges the ctorsym's varset into the local one and updates the type.
Now it performs type unification on a consistent namespace.
Fixes LP: #877111. - 1272. By Matt Giuca
-
typedict: augment_
instr_globalref s now uses the augmented varset from calling atom_type on a new_closure instruction (previously only did it for a call_global).
This doesn't have any effect now, but fixing atom_type to augment the varset properly would break on new_closure (see the nil_id case in the test file ctorsym-unify). - 1271. By Matt Giuca
-
test case ctorsym: Added a new case, nil_id.
It currently passes, but when I tried to fix LP: #877111 it broke, so best to have it in here.
(reverse in the prelude broke; this is a simplified version of the same problem). - 1270. By Matt Giuca
-
test case ctorsym-unify: cons now calls show on the two arguments, so that it requires the 'a' type dict.
This doesn't really change the test case, but it makes the output more clearly correct (since foo will pass the correct type dictionary). - 1269. By Matt Giuca
-
typedict: Changed atom_type to thread a varset, so that it can augment the varset with ctorsym type variables.
Update code that uses it -- calls augment_globalref with the augmented varset.
Note: Currently atom_type doesn't actually update the varset. - 1267. By Matt Giuca
-
Test case ctorsym-unify: Added description, and a new test function that passes Nil as the only argument to a function.
- 1265. By Matt Giuca
-
ast_cfg: expr_to_instrs now special-cases intlit and ctorref expressions, to generate intlit and ctorsym atoms rather than mov instructions to load them into temporary variables.
This addresses LP: #440429. All of the 'atomic' expressions now remain as atoms in the instruction representation, so they do not require separate instructions.
This makes the source code much more condensed.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:mars