aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-07 16:48:12 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-07 16:48:12 -0700
commit272e961c063ad4fdb44e61babdfbb0bee200752b (patch)
treecb5f090f03833247edca5e6b26152c4f0fe1c97b
parent6dff9374e3cb873968f9a58f80b625e7f256d6d9 (diff)
rename __stackbase__ to sp
-rw-r--r--src/jsifier.js2
-rw-r--r--src/runtime.js8
-rw-r--r--tools/autodebugger_js.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 3f8c184c..86931f3e 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1335,7 +1335,7 @@ function JSify(data, functionsOnly, givenFunctions) {
makeFuncLineActor('alloca', function(item) {
if (typeof item.allocatedIndex === 'number') {
if (item.allocatedSize === 0) return ''; // This will not actually be shown - it's nativized
- return asmCoercion(getFastValue('__stackBase__', '+', item.allocatedIndex.toString()), 'i32');
+ return asmCoercion(getFastValue('sp', '+', item.allocatedIndex.toString()), 'i32');
} else {
return RuntimeGenerator.stackAlloc(getFastValue(calcAllocatedSize(item.allocatedType), '*', item.allocatedNum));
}
diff --git a/src/runtime.js b/src/runtime.js
index e6d5f962..684f11e7 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -32,7 +32,7 @@ var RuntimeGenerator = {
stackEnter: function(initial, force) {
if (initial === 0 && SKIP_STACK_IN_SMALL && !force) return '';
- var ret = 'var __stackBase__ = ' + (ASM_JS ? '0; __stackBase__ = ' : '') + 'STACKTOP';
+ var ret = 'var sp = ' + (ASM_JS ? '0; sp = ' : '') + 'STACKTOP';
if (initial > 0) ret += '; STACKTOP = (STACKTOP + ' + initial + ')|0';
if (USE_TYPED_ARRAYS == 2) {
assert(initial % Runtime.STACK_ALIGN == 0);
@@ -44,7 +44,7 @@ var RuntimeGenerator = {
ret += '; (assert(' + asmCoercion('(STACKTOP|0) < (STACK_MAX|0)', 'i32') + ')|0)';
}
if (false) {
- ret += '; _memset(' + asmCoercion('__stackBase__', 'i32') + ', 0, ' + initial + ')';
+ ret += '; _memset(' + asmCoercion('sp', 'i32') + ', 0, ' + initial + ')';
}
return ret;
},
@@ -53,9 +53,9 @@ var RuntimeGenerator = {
if (initial === 0 && SKIP_STACK_IN_SMALL && !force) return '';
var ret = '';
if (SAFE_HEAP) {
- ret += 'var i = __stackBase__; while ((i|0) < (STACKTOP|0)) { SAFE_HEAP_CLEAR(i|0); i = (i+1)|0 }';
+ ret += 'var i = sp; while ((i|0) < (STACKTOP|0)) { SAFE_HEAP_CLEAR(i|0); i = (i+1)|0 }';
}
- return ret += 'STACKTOP = __stackBase__';
+ return ret += 'STACKTOP = sp';
},
// An allocation that cannot normally be free'd (except through sbrk, which once
diff --git a/tools/autodebugger_js.py b/tools/autodebugger_js.py
index 3f8818c6..1de837f0 100644
--- a/tools/autodebugger_js.py
+++ b/tools/autodebugger_js.py
@@ -33,7 +33,7 @@ for i in range(len(lines)):
(' else' not in lines[i-1] or '{' in lines[i-1]) and \
(' else' not in lines[i+1] or '{' in lines[i+1]):
var = m.groups(1)[0].rstrip().split(' ')[-1]
- if 'STACKTOP' not in lines[i] and 'stackBase' not in lines[i]:
+ if 'STACKTOP' not in lines[i] and 'sp' not in lines[i]:
#lines[i] += ''' print("[%4d] %s = " + %s);''' % (i+1, var, var)
lines[i] += ''' print("%s = " + %s);''' % (var, var)
m = re.match('^ +HEAP.*$', lines[i])