aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-08 11:47:14 -0400
committerAlon Zakai <alonzakai@gmail.com>2013-10-08 11:47:14 -0400
commit0a229cf5a240a1ebf4ff5d0ebb501a286bc96202 (patch)
tree2797d054788e88863d77f9826dde94fb4c276c69 /src/compiler.js
parent05b6aa32a5f1633797f7eae390b3a8048b29ca69 (diff)
parentae5ef852920ce67449af7693f05a767a87aed976 (diff)
Merge branch 'incoming'
Diffstat (limited to 'src/compiler.js')
-rw-r--r--src/compiler.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/compiler.js b/src/compiler.js
index 4f16986c..90060837 100644
--- a/src/compiler.js
+++ b/src/compiler.js
@@ -206,6 +206,11 @@ if (phase == 'pre') {
if (VERBOSE) printErr('VERBOSE is on, this generates a lot of output and can slow down compilation');
+// Load struct and define information.
+var temp = JSON.parse(read(STRUCT_INFO));
+C_STRUCTS = temp.structs;
+C_DEFINES = temp.defines;
+
// Load compiler code
load('modules.js');
@@ -215,7 +220,12 @@ load('analyzer.js');
load('jsifier.js');
if (phase == 'funcs' && RELOOP) { // XXX handle !singlePhase
RelooperModule = { TOTAL_MEMORY: ceilPowerOfTwo(2*RELOOPER_BUFFER_SIZE) };
- load(RELOOPER);
+ try {
+ load(RELOOPER);
+ } catch(e) {
+ printErr('cannot load relooper at ' + RELOOPER + ' : ' + e + ', trying in current dir');
+ load('relooper.js');
+ }
assert(typeof Relooper != 'undefined');
}
globalEval(processMacros(preprocess(read('runtime.js'))));
@@ -269,6 +279,9 @@ function compile(raw) {
intertyped = null;
JSify(analyzed);
+ //dumpInterProf();
+ //printErr(phase + ' paths (fast, slow): ' + [fastPaths, slowPaths]);
+
phase = null;
if (DEBUG_MEMORY) {