aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-01-08 17:55:18 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-01-08 17:55:18 -0800
commitb8e1ed6edc6cb26ed46ecc57a7801a1000a8ec7e (patch)
treeb3b56b1e2a5c511f00c665d8111a1231b9aeac2f /src
parentb00fb4e8d96e01fe1a21b2a70eb64e62ca6a996f (diff)
fix ta1 breakage
Diffstat (limited to 'src')
-rw-r--r--src/parseTools.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index d14802a1..ae0c59ef 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1086,15 +1086,23 @@ function makeCopyValues(dest, src, num, type, modifier, align) {
function unroll(type, num, jump) {
jump = jump || 1;
return range(num).map(function(i) {
- return makeSetValue(dest, i*jump, makeGetValue(src, i*jump, type), type);
+ if (USE_TYPED_ARRAYS == 1 && type === 'null') {
+ // Null is special-cased: We copy over all heaps
+ return makeGetSlabs(dest, 'null', true).map(function(slab) {
+ return slab + '[' + getFastValue(dest, '+', i) + ']=' + slab + '[' + getFastValue(src, '+', i) + ']'; // TODO: Add SAFE_HEAP stuff
+ }).join('; ');
+ } else {
+ return makeSetValue(dest, i*jump, makeGetValue(src, i*jump, type), type);
+ }
}).join('; ');
}
if (USE_TYPED_ARRAYS <= 1) {
if (isNumber(num) && parseInt(num) <= UNROLL_LOOP_MAX) {
return unroll(type, num);
}
- return 'for (var $$i = 0; $$i < ' + num + '; $$i++) {\n' +
- makeSetValue(dest, '$$i', makeGetValue(src, i, type), type) + '\n}';
+ dest = dest + '+$$i';
+ src = src + '+$$i';
+ return 'for (var $$i = 0; $$i < ' + num + '; $$i++) {\n' + unroll(type, 1) + ' }';
} else { // USE_TYPED_ARRAYS == 2
// If we don't know how to handle this at compile-time, or handling it is best done in a large amount of code, call memset
if (!isNumber(num) || (align < 4 && parseInt(num) >= SEEK_OPTIMAL_ALIGN_MIN)) {