diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-12-07 10:37:25 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-12-07 10:37:25 -0500 |
commit | 1a007b1631509b9d72499a8f4402294017ee04dc (patch) | |
tree | 92f8b0341497c7bd4e53aa82c690346536a244c3 /src/compiler.js | |
parent | df11c6f1fd1636a355b83a1c48b3a890596e6a32 (diff) | |
parent | eb083723747a90cb6ab9853fec8d6e8ef54748bc (diff) |
Merge branch 'incoming'
Diffstat (limited to 'src/compiler.js')
-rw-r--r-- | src/compiler.js | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/compiler.js b/src/compiler.js index aa3c7b92..7d768c3d 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -206,12 +206,12 @@ 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. -try { +//try { var temp = JSON.parse(read(STRUCT_INFO)); -} catch(e) { - printErr('cannot load struct info at ' + STRUCT_INFO + ' : ' + e + ', trying in current dir'); - temp = JSON.parse(read('struct_info.compiled.json')); -} +//} catch(e) { +// printErr('cannot load struct info at ' + STRUCT_INFO + ' : ' + e + ', trying in current dir'); +// temp = JSON.parse(read('struct_info.compiled.json')); +//} C_STRUCTS = temp.structs; C_DEFINES = temp.defines; @@ -224,12 +224,12 @@ load('analyzer.js'); load('jsifier.js'); if (phase == 'funcs' && RELOOP) { // XXX handle !singlePhase RelooperModule = { TOTAL_MEMORY: ceilPowerOfTwo(2*RELOOPER_BUFFER_SIZE) }; - try { + //try { load(RELOOPER); - } catch(e) { - printErr('cannot load relooper at ' + RELOOPER + ' : ' + e + ', trying in current dir'); - load('relooper.js'); - } + //} 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')))); @@ -267,7 +267,7 @@ function compile(raw) { function runPhase(currPhase) { //printErr('// JS compiler in action, phase ' + currPhase + typeof lines + (lines === null)); phase = currPhase; - if (phase != 'pre') { + if (phase != 'pre' && phase != 'glue') { if (singlePhase) PassManager.load(read(forwardedDataFile)); if (phase == 'funcs') { @@ -313,14 +313,16 @@ B = new Benchmarker(); try { if (ll_file) { - if (ll_file.indexOf(String.fromCharCode(10)) == -1) { + if (phase === 'glue') { + compile(';'); + } else if (ll_file.indexOf(String.fromCharCode(10)) == -1) { compile(read(ll_file)); } else { compile(ll_file); // we are given raw .ll } } } catch(err) { - printErr('aborting from js compiler due to exception: ' + err); + printErr('aborting from js compiler due to exception: ' + err + ' | ' + err.stack); } //var M = keys(tokenCacheMisses).map(function(m) { return [m, misses[m]] }).sort(function(a, b) { return a[1] - b[1] }); |