aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2010-12-25 20:51:46 -0800
committerAlon Zakai <azakai@mozilla.com>2010-12-25 20:51:46 -0800
commit025d25c187f2daf9bb507b72ab85db47904af977 (patch)
tree5cb052284513e54d767ebefbcd92090b73201df2 /src/compiler.js
parent2f8f8a72fffffdd2b9f4114c0d7e7d8bc941c1d2 (diff)
comments + clean up compiler.js
Diffstat (limited to 'src/compiler.js')
-rw-r--r--src/compiler.js31
1 files changed, 16 insertions, 15 deletions
diff --git a/src/compiler.js b/src/compiler.js
index 1cdc0002..92c9a4d9 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -8,20 +8,9 @@ if (!this['read']) {
read = function(f) { snarf(f) };
}
-load('settings.js');
+// Load settings, can be overridden by commandline
-load('utility.js');
-load('framework.js');
-load('parseTools.js');
-load('intertyper.js');
-load('analyzer.js');
-load('jsifier.js');
-
-//===============================
-// Main
-//===============================
-
-// Override settings.js
+load('settings.js');
var settings = JSON.parse(readline());
for (setting in settings) {
@@ -29,12 +18,25 @@ for (setting in settings) {
}
var CONSTANTS = { 'QUANTUM_SIZE': QUANTUM_SIZE };
+// Load compiler code
+
+load('utility.js');
+load('framework.js');
+load('parseTools.js');
+load('intertyper.js');
+load('analyzer.js');
+load('jsifier.js');
load('runtime.js');
+eval(preprocess(read('library.js'), CONSTANTS));
-// Sanity of settings
+// Sanity checks
assert(!(USE_TYPED_ARRAYS && SAFE_HEAP));
+//===============================
+// Main
+//===============================
+
// Read llvm
var lines = [];
@@ -47,6 +49,5 @@ do {
// Do it
-eval(preprocess(read('library.js'), CONSTANTS));
print(JSify(analyzer(intertyper(lines))));