aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-05-24 15:07:49 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-05-24 15:07:49 -0700
commitbcdfcfbfed3d6946a1811b17a1f77e0fb8d0fc25 (patch)
tree380a661fae739a3374d976da5d14c83fe3ed0624 /src/jsifier.js
parent77cacaa2fd27bcc1265f2f7255b18c3461e0ddff (diff)
remove obsolete fastops; generalize load with parseLLVM/finalizeLLVM; fix issue 14
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 6c27f653..d1e608a1 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -632,13 +632,13 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) {
return ret;
});
makeFuncLineActor('load', function(item) {
- var ident = toNiceIdent(item.ident);
- var impl = getVarImpl(item.funcData, item.ident);
+ var value = finalizeLLVMParameter(item.pointer);
+ var impl = item.ident ? getVarImpl(item.funcData, item.ident) : VAR_EMULATED;
switch (impl) {
case VAR_NATIVIZED: {
- return ident; // We have the actual value here
+ return value; // We have the actual value here
}
- case VAR_EMULATED: return makeGetValue(ident, null, item.type);
+ case VAR_EMULATED: return makeGetValue(value, null, item.type);
default: throw "unknown [load] impl: " + impl;
}
});
@@ -722,15 +722,6 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) {
return makeFunctionCall(item.ident, item.params, item.funcData) + (item.standalone ? ';' : '');
});
- // Optimized intertypes
-
- makeFuncLineActor('fastgetelementptrload', function(item) {
- return 'var ' + item.ident + '=' + makeGetValue(parseNumerical(item.value.ident), getGetElementPtrIndexes(item.value), item.value.valueType, true) + ';';
- });
- makeFuncLineActor('fastgetelementptrstore', function(item) {
- return makeSetValue(item.value.ident, getGetElementPtrIndexes(item.value), parseNumerical(item.ident), item.type, true) + ';';
- });
-
makeFuncLineActor('unreachable', function(item) { return 'throw "Reached an unreachable! Original .ll line: ' + item.lineNum + '";' });
// Final combiner