aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-12-10 17:26:15 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-12-10 17:26:15 -0800
commitf59ffc338e2c1df792709a823be1c1d2735e88bf (patch)
tree7268bc264e4364f9766f1b137882870bf7b90569 /src/runtime.js
parent0162cc4bdc1955b442bec1a185d024d3d30cec0e (diff)
parent3a35fd9389a18707abd51dc71e2096c64413d510 (diff)
Merge branch 'ta2bydefault'
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/runtime.js b/src/runtime.js
index a6261c74..0b36f967 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -56,7 +56,11 @@ var RuntimeGenerator = {
// An allocation that cannot be free'd
staticAlloc: function(size) {
- return RuntimeGenerator.alloc(size, 'STATIC', INIT_HEAP);
+ var ret = '';
+ if (USE_TYPED_ARRAYS) ret += 'LAST_STATICTOP = STATICTOP;'
+ ret += RuntimeGenerator.alloc(size, 'STATIC', INIT_HEAP);
+ if (USE_TYPED_ARRAYS) ret += '; if (STATICTOP >= TOTAL_MEMORY) enlargeMemory();'
+ return ret;
},
alignMemory: function(target, quantum) {
@@ -301,6 +305,8 @@ function reSign(value, bits, ignore, sig) {
var noted = false;
#endif
if (value >= half && (bits <= 32 || value > half)) { // for huge values, we can hit the precision limit and always get true here. so don't do that
+ // but, in general there is no perfect solution here. With 64-bit ints, we get rounding and errors
+ // TODO: In i64 mode 1, resign the two parts separately and safely
#if CHECK_SIGNS
if (!ignore) {
CorrectionsMonitor.note('ReSign', 0, sig);