lp:~mgiuca/mars/closure-templates
A major change to the instruction set architecture: replacing parcall instructions with lower-level 'closure template' functions that can be instantiated with a new new_closure instruction. Addresses bug #744760.
- Get this branch:
- bzr branch lp:~mgiuca/mars/closure-templates
Branch merges
- Matt Giuca: Approve
-
Diff: 2405 lines (+795/-388)16 files modifieddoc/dev/isa.rst (+16/-42)
misc/mars-asm.vim (+1/-1)
src/ast_cfg.m (+436/-143)
src/builtins.m (+32/-24)
src/callgraph.m (+1/-1)
src/executor.m (+6/-0)
src/interactive.m (+16/-3)
src/interpret.m (+43/-46)
src/ir.m (+21/-10)
src/parsem.m (+2/-1)
src/pretty.m (+17/-22)
src/tables.m (+7/-0)
src/typecheck.m (+27/-1)
src/typedict.m (+155/-85)
src/usedef.m (+3/-9)
src/util.m (+12/-0)
Related bugs
Bug #744760: Mars assembly: Replace parcall with closure-variable functions | Medium | Fix Released |
Related blueprints
Branch information
Recent revisions
- 1263. By Matt Giuca
-
interpret: Changed show behaviour for functions; no longer prints the function name and displays 'closure' instead of 'curried'.
This reflects the new semantics of function objects. Any lifted function object will now have a meaningless name, so it doesn't make sense to show it.
Also, closures are no longer necessarily curried, since we could introduce lambda expressions.
Sadly, this means we can no longer see the name of a function object at runtime, or distinguish between built-ins, constructors, thunks etc (since they are all wrapped in closure templates). - 1260. By Matt Giuca
-
ir: Remove three instructions: parcall, parcall_ctor and parcall_global.
These have now been entirely replaced by closure templates and the new_closure instruction, and are no longer generated.
Remove all references to these instructions from the rest of the code, and the documentation. - 1259. By Matt Giuca
-
typedict: Remove special case for new_closure call to show or eq.
As show or eq are not closure templates, they can never be the target of new_closure, hence this case is never entered. - 1258. By Matt Giuca
-
ast_cfg: Partial application to a local function value is now compiled to a new closure template (specific to the type of the function being called), instead of a parcall instruction.
- 1257. By Matt Giuca
-
ast_cfg: Abstract common code for building a closure template (shared between parcall_global and parcall_ctor).
- 1256. By Matt Giuca
-
ast_cfg: Now generates closure templates for lifts and partial application of constructors, rather than generating parcall_ctor instructions.
- 1255. By Matt Giuca
-
Merge from trunk (parcall tests).
Removed typedict test suite (those cases are duplicated in the parcall tests from trunk). - 1254. By Matt Giuca
-
typedict: Fixed unbound variable errors.
Now unifies the actual CVars with the formals.
All test cases pass.
Branch metadata
- Branch format:
- Branch format 7
- Repository format:
- Bazaar repository format 2a (needs bzr 1.16 or later)
- Stacked on:
- lp:mars