Commit graph

12 commits

Author SHA1 Message Date
Alex Shinn
57b2bc281d apply opcode is now tail-recursive - calling it in a non-tail position is an error 2012-07-18 21:34:53 +09:00
Alex Shinn
016560e5fe Additional OOM checks - harder but still not impossible to segfault on OOM. 2012-07-17 23:40:16 +09:00
Alex Shinn
6de7d5621d Keeping track of the maximum stack depth a procedure needs for accurate stack checks
(fixes bug #130).  Done in conjunction with code generation refactoring, so that context
objects temporarily use their specific slot instead of having space for useful fields
at runtime.
2012-07-16 16:23:54 +09:00
Alex Shinn
c063dadd2e build fixes for global symbols and vm profiling 2012-07-10 22:42:31 +09:00
Alex Shinn
150cfd0a8b too dangerous to leave bytecode source uninitialized 2012-07-09 20:20:07 +09:00
Alex Shinn
3e79138e21 Various fixes for better debug output.
* Associate file/line source info with corresponding bytecode offset.
  * Fixes for losing source info after macro expansion and simplification.
  * Fix for showing the source info of the calling procedure of an error.
2012-07-07 15:26:08 +09:00
Alex Shinn
d11ededc50 better initialization checks for out of memory 2012-06-24 10:44:34 -07:00
Alex Shinn
3b10f4f748 Don't reset dynamic stack on eval. 2012-06-23 23:37:36 -07:00
Alex Shinn
a18deb68cc Optional code refactoring.
Chibi uses a lot of #if conditioned code so that configuration
management can be done entirely with the C preprocessor.

Originally this also involved conditional includes of .c files
from other source files.  The alterative, which this change
switches to, is to compile and link all files, and for uneeded
files conditionally eliminate their entire bodies so they compile
to empty object files.

Pros for conditionally including all code into one large file:

  * Don't need to declare most functions (keeps .h files small).
  * Can keep most functions static/inlined (keeps objects small).
  * Don't need to even distribute uneeded files with the default
    Makefile (e.g. can prune opt/* from dist for minimal builds).

Pros for linking multiple possibly empty files:

  * Extensions and third-party libs probably want the exported
    declarations anyway.
  * Static analysis tools work better (e.g. flymake on what previously
    was an included file).
  * Can build each file in parallel (i.e. make -j for faster builds).
  * Can build and link in just the changed files, instead of
    having to recompile the whole thing.

For Chibi these are all minor points - it will be small
regardless, and will build fast regardless - but the arguments
for splitting seem stronger.  Note the new shared lib is about
1k larger, but that can be trimmed down later.
2012-06-21 23:04:07 -07:00
Alex Shinn
08e4fead8b small fixes and warning removals for build tests 2012-06-20 21:39:52 -07:00
Alex Shinn
8d5ea4cdf4 making literals embedded in the source immutable 2012-06-10 14:22:22 +09:00
Alex Shinn
85a7efc003 automatically making sockets non-blocking on accept 2012-05-14 08:37:45 -04:00