Ian Price
89029a54f4
Explicitly test for undefined arguments to handle false values like 0
2015-06-24 19:57:28 +01:00
Ian Price
b631576f13
Fixup binop unparsing
2015-06-23 15:52:42 +01:00
Ian Price
88c052214f
Handle more identifier characters
2015-06-23 15:46:26 +01:00
Ian Price
a680a4cb9d
Change local type representation and remove var type
2015-06-22 16:18:18 +01:00
Ian Price
e9f37e6a31
Change function type representation
2015-06-22 16:18:12 +01:00
Ian Price
a7b2dfa581
Change program type representation
2015-06-22 16:08:20 +01:00
Ian Price
f0537e39ee
Rewrite js-il inliner
2015-06-22 16:08:20 +01:00
Ian Price
2e10f55426
Different types for Continuation and Variable identifiers
2015-06-22 16:08:02 +01:00
Ian Price
78cacbe450
Implement fluid primitives
2015-06-18 04:14:44 +01:00
Ian Price
46597b49dc
Use scheme.frame.Prompt objects for prompts on dynstack
2015-06-18 04:14:44 +01:00
Ian Price
6f77715457
Implement apply correctly
2015-06-18 04:14:43 +01:00
Ian Price
b939d51f8a
values takes multiple arguments
2015-06-18 04:14:43 +01:00
Ian Price
ee42731b57
abort-to-prompt takes multiple arguments
2015-06-18 04:14:43 +01:00
Ian Price
cf905a7004
Implement call-with-values
2015-06-18 04:14:43 +01:00
Ian Price
56e6c33264
Primitives create multiple argument continuations.
2015-06-18 04:14:43 +01:00
Ian Price
5827ad4f03
Compile cps $prompt form to javascript
2015-06-18 04:14:43 +01:00
Ian Price
48e84c5a2c
Add more Scheme Primitives to runtime.js
2015-06-18 04:14:43 +01:00
Ian Price
4622269e68
Primitives should return Scheme Booleans
2015-06-18 04:14:43 +01:00
Ian Price
e84f839463
Implement keyword argument parsing
2015-06-18 04:14:43 +01:00
Ian Price
46905ec322
Simplify output Javascript
2015-06-18 04:14:43 +01:00
Ian Price
e9d0f97410
Add more types of constants
2015-06-18 04:14:43 +01:00
Ian Price
941f8fac01
Implement Optional arguments
2015-06-18 04:14:43 +01:00
Ian Price
f83c651f46
Remove superfluous space
2015-06-18 04:14:42 +01:00
Ian Price
44e04eae0a
Handle case-lambda via a jump table
2015-06-18 04:14:42 +01:00
Ian Price
30afdcd976
Add binop type
2015-06-18 04:14:42 +01:00
Ian Price
41023d5b4c
Mangle js identifiers
2015-06-18 04:14:42 +01:00
Ian Price
a4003003e2
Compile string constants
2015-06-18 04:14:42 +01:00
Ian Price
86fabef4ca
Compile rest args
2015-06-18 04:14:42 +01:00
Ian Price
1bed3f047e
fix makefile
2015-06-18 04:14:42 +01:00
Ian Price
a3ddf537dc
get rid of unused match case
2015-06-18 04:14:42 +01:00
Ian Price
f8618a522f
conditional->branch
2015-06-18 04:14:42 +01:00
Ian Price
3b32d180b1
Simple inlining of immediate calls
2015-06-18 04:14:42 +01:00
Ian Price
d1a663baec
Get rid of comments and dead branches
2015-06-18 04:14:42 +01:00
Ian Price
54ce470cf8
separate js-il functions into actual functions and those for continuations
2015-06-18 04:14:42 +01:00
Ian Price
9e498f2430
fix makefile
2015-06-18 04:14:42 +01:00
Ian Price
b70b39e478
Remove jscall type
2015-06-18 04:14:41 +01:00
Ian Price
d57dc85fa8
Replace values object with values passed as continuation arguments
2015-06-18 04:14:41 +01:00
Ian Price
ce1cc2706c
Temp commit
2015-06-18 04:14:41 +01:00
Andy Wingo
dbe6247acf
Add split-rec pass
...
* module/language/cps2/split-rec.scm: New pass.
* module/language/cps2/optimize.scm: Run new pass.
* module/Makefile.am: Add new pass to build.
2015-06-07 11:16:09 +02:00
Andy Wingo
f41823538a
Renumber before contifying to eliminate stale conts
...
* module/language/cps2/contification.scm (contify): Renumber before contifying.
2015-06-05 17:10:29 +02:00
Andy Wingo
6f4487f268
Disable CPS optimization passes
...
* module/language/cps/compile-bytecode.scm (compile-bytecode): Don't
bother running the CPS optimization passes, as they are redundant
with CPS2.
2015-06-05 00:54:18 +02:00
Andy Wingo
b926d85a17
Enable all CPS2 optimization passes
...
* module/language/cps2/optimize.scm (optimize): Enable all CPS2
passes. Wheee!
2015-06-05 00:52:27 +02:00
Andy Wingo
c028a0a7c4
Tweaks to bootstrap build order
...
* module/Makefile.am (SOURCES): Since intmaps and intsets are used so
much in CPS2, bump them up. Demote (language cps types).
2015-06-05 00:52:27 +02:00
Andy Wingo
1071e77785
Add CPS2 verification pass
...
* module/language/cps2/verify.scm: New diagnostic pass.
* module/Makefile.am: Add verify.scm.
* module/language/cps2/optimize.scm: Wire up verification pass.
Always run the pass at the end, and if a variable is set run it
between passes too.
2015-06-05 00:52:27 +02:00
Andy Wingo
b012248f04
Refactor renumber.scm
...
* module/language/cps2/renumber.scm (sort-labels-locally): Rewrite to
be functional. Yay :)
2015-06-05 00:52:27 +02:00
Andy Wingo
ff1a02bd09
Port self-references pass to CPS2
...
* module/language/cps2/self-references.scm: New pass, ported from CPS.
* module/language/cps2/optimize.scm: Wire up the self references pass.
* module/Makefile.am: Add new file.
2015-06-05 00:52:27 +02:00
Andy Wingo
b0148e11db
Fix eta reduction on CPS2
...
* module/language/cps2/simplify.scm (compute-singly-referenced-vars):
New helper.
(compute-eta-reductions): Turns out, eta conversion on a graph
doesn't work the same way that it works on nested terms -- since
uses and defs are computed using the flow graph and not nested
terms, we need to check additionally that the vars are singly-used.
2015-06-05 00:34:06 +02:00
Andy Wingo
1850497a5c
Fix intmap-ref bug
...
* module/language/cps/intmap.scm (intmap-ref): Fix a case in which the
not-found procedure could be called with an incorrect value.
2015-06-05 00:34:05 +02:00
Andy Wingo
8eea1fb142
Fix slot allocation hinting for intervening terms that define dead values
...
* module/language/cps/slot-allocation.scm (allocate-slots): Even if an
expression does not define a live value, it might need a place to
put its value. In that case we should stop scanning for hints,
otherwise e.g. an (current-module) primcall whose value isn't used
could clobber a hinted variable.
2015-06-05 00:34:05 +02:00
Andy Wingo
f541ee1968
Port type-fold to CPS2
...
* module/language/cps2/type-fold.scm: New file, ported from CPS.
* module/language/cps2/optimize.scm: Wire up type-fold.
* module/Makefile.am (CPS2_LANG_SOURCES): Add language/cps2/type-fold.cps.
2015-06-03 16:40:16 +02:00