diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-05-26 16:29:59 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-05-26 16:29:59 -0700 |
commit | 196cc4113a0ab6a0f04d482689428951a19e3725 (patch) | |
tree | 5b47f7650f3fc935327a132c498636acc45ccd7c /src/parseTools.js | |
parent | 78ee9a8f64d734405e8e85e03c3d3768fce45e41 (diff) |
improve AUTO_OPTIMIZE
Diffstat (limited to 'src/parseTools.js')
-rw-r--r-- | src/parseTools.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 5dec458e..bd68888b 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -850,7 +850,9 @@ function handleOverflow(text, bits) { if (!bits) return text; var correct = correctOverflows(); warn(!correct || bits <= 32, 'Cannot correct overflows of this many bits: ' + bits); - if (CHECK_OVERFLOWS) return 'CHECK_OVERFLOW(' + text + ', ' + bits + ')'; + if (CHECK_OVERFLOWS) return 'CHECK_OVERFLOW(' + text + ', ' + bits + ', ' + Math.floor(correctSpecificOverflow() && !AUTO_OPTIMIZE) + ( + AUTO_OPTIMIZE ? ', "' + Debugging.getIdentifier(Framework.currItem.lineNum) + '"' : '' + ) + ')'; if (!correct) return text; if (bits <= 32) { return '(' + text + ')&' + (Math.pow(2, bits) - 1); @@ -897,7 +899,9 @@ function makeSignOp(value, type, op) { } } } - return op + 'Sign(' + value + ', ' + bits + ', ' + Math.floor(correctSpecificSign()) + ')'; // If we are correcting a specific sign here, do not check for it + return op + 'Sign(' + value + ', ' + bits + ', ' + Math.floor(correctSpecificSign() && !AUTO_OPTIMIZE) + ( + AUTO_OPTIMIZE ? ', "' + Debugging.getIdentifier(Framework.currItem.lineNum) + '"' : '' + ) + ')'; // If we are correcting a specific sign here, do not check for it } else { return value; } |