aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2011-01-07 20:44:14 -0800
committerAlon Zakai <azakai@mozilla.com>2011-01-07 20:44:14 -0800
commit1a2f55979d66202814c61a4c4ed934b770606947 (patch)
treedf641930d1c9db3a176872e4e00d9743f7abc053 /src
parent044ce8ea7c61616d1836633a40db06e128c051b9 (diff)
enable llvm opts on tests with precompiled .ll (python, bullet, lua); fix minor uncovered bugs; disable some dangerous llvm opts
Diffstat (limited to 'src')
-rw-r--r--src/jsifier.js8
-rw-r--r--src/library.js1
2 files changed, 6 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 0738363e..a88429a0 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -489,6 +489,7 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions, givenGlobalVaria
}
function getVarImpl(funcData, ident) {
+ if (ident === 'null') return VAR_NATIVIZED; // like nativized, in that we have the actual value right here
var data = getVarData(funcData, ident);
assert(data, 'What variable is this? |' + ident + '|');
return data.impl;
@@ -682,7 +683,7 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions, givenGlobalVaria
+ makeFunctionCall(item.ident, item.params, item.funcData) + ' '
+ '} catch(e) { '
+ 'if (ABORT) throw e; __THREW__ = true; '
- + (EXCEPTION_DEBUG ? 'print("Exception: " + e + " : " + (new Error().stack)); ' : '')
+ + (EXCEPTION_DEBUG ? 'print("Exception: " + e + " : " + e.stack + ", currently at: " + (new Error().stack)); ' : '')
+ '} })(); if (!__THREW__) { ' + makeBranch(item.toLabel, item.currLabelId)
+ ' } else { ' + makeBranch(item.unwindLabel, item.currLabelId) + ' }';
return ret;
@@ -715,9 +716,10 @@ function JSify(data, functionsOnly, givenTypes, givenFunctions, givenGlobalVaria
var params = item.params;
function makeOne(i) {
if (i === params.length-1) {
- return finalizeLLVMParameter(params[i].value);
+ return indexizeFunctions(finalizeLLVMParameter(params[i].value));
}
- return '__lastLabel__ == ' + getLabelId(params[i].label) + ' ? ' + finalizeLLVMParameter(params[i].value) + ' : (' + makeOne(i+1) + ')';
+ return '__lastLabel__ == ' + getLabelId(params[i].label) + ' ? ' +
+ indexizeFunctions(finalizeLLVMParameter(params[i].value)) + ' : (' + makeOne(i+1) + ')';
}
return makeOne(0);
});
diff --git a/src/library.js b/src/library.js
index bc722d98..a00bce91 100644
--- a/src/library.js
+++ b/src/library.js
@@ -25,6 +25,7 @@ var Library = {
__print__(Pointer_stringify(__formatString.apply(null, args)));
},
+ sprintf__deps: ['strcpy'],
sprintf: function() {
var str = arguments[0];
var args = Array.prototype.slice.call(arguments, 1);