diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-12-25 20:51:46 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-12-25 20:51:46 -0800 |
commit | 025d25c187f2daf9bb507b72ab85db47904af977 (patch) | |
tree | 5cb052284513e54d767ebefbcd92090b73201df2 /src/runtime.js | |
parent | 2f8f8a72fffffdd2b9f4114c0d7e7d8bc941c1d2 (diff) |
comments + clean up compiler.js
Diffstat (limited to 'src/runtime.js')
-rw-r--r-- | src/runtime.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/runtime.js b/src/runtime.js index 3784c236..7131bf9c 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -1,7 +1,9 @@ -////////////QUANTUM_SIZE = GUARD_STACK = 1; -// Generates code that can be placed inline in generated code. -// This is not the cleanest way to write this kind of code - it is -// optimized for generating fast inline code. +// Implementation details for the 'runtime environment' we generate in +// JavaScript. The Runtime object itself is used both during compilation, +// and is available at runtime (dynamic compilation). The RuntimeGenerator +// helps to create the Runtime object (written so that the Runtime object +// itself is as optimized as possible - no unneeded runtime checks). + RuntimeGenerator = { alloc: function(size, type) { var ret = type + 'TOP'; @@ -76,10 +78,6 @@ function unInline(name_, params) { return eval(src); } -// Uses the RuntimeGenerator during compilation, in order to -// 1. Let the compiler access and run those functions during compilation -// 2. We expose the entire Runtime object to generated code, so it can -// use that functionality in a non-inline manner. Runtime = { stackAlloc: unInline('stackAlloc', ['size']), staticAlloc: unInline('staticAlloc', ['size']), |