aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-05-26 16:29:59 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-05-26 16:29:59 -0700
commit196cc4113a0ab6a0f04d482689428951a19e3725 (patch)
tree5b47f7650f3fc935327a132c498636acc45ccd7c /src/preamble.js
parent78ee9a8f64d734405e8e85e03c3d3768fce45e41 (diff)
improve AUTO_OPTIMIZE
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/preamble.js b/src/preamble.js
index cb4e8571..1a4fdff3 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -117,7 +117,6 @@ var CorrectionsMonitor = {
if (this.corrections >= this.MAX_ALLOWED) abort('\n\nToo many corrections!');
}
#if AUTO_OPTIMIZE
- if (succeed) return; // XXX - enable this later on, as a profiling tool
if (!sig)
sig = (new Error().stack).toString().split('\n')[2].split(':').slice(-1)[0]; // Spidermonkey-specific FIXME
sig = type + '|' + sig;
@@ -157,18 +156,18 @@ function cRound(x) {
//========================================
// Debugging tools - Mathop overflows
//========================================
-function CHECK_OVERFLOW(value, bits, ignore) {
+function CHECK_OVERFLOW(value, bits, ignore, sig) {
if (ignore) return value;
var twopbits = Math.pow(2, bits);
var twopbits1 = Math.pow(2, bits-1);
// For signedness issue here, see settings.js, CHECK_SIGNED_OVERFLOWS
#if CHECK_SIGNED_OVERFLOWS
if (value === Infinity || value === -Infinity || value >= twopbits1 || value < -twopbits1) {
- CorrectionsMonitor.note('SignedOverflow');
+ CorrectionsMonitor.note('SignedOverflow', 0, sig);
if (value === Infinity || value === -Infinity || Math.abs(value) >= twopbits) CorrectionsMonitor.note('Overflow');
#else
if (value === Infinity || value === -Infinity || Math.abs(value) >= twopbits) {
- CorrectionsMonitor.note('Overflow');
+ CorrectionsMonitor.note('Overflow', 0, sig);
#endif
#if CORRECT_OVERFLOWS
// Fail on >32 bits - we warned at compile time
@@ -178,9 +177,9 @@ function CHECK_OVERFLOW(value, bits, ignore) {
#endif
} else {
#if CHECK_SIGNED_OVERFLOWS
- CorrectionsMonitor.note('SignedOverflow', 1);
+ CorrectionsMonitor.note('SignedOverflow', 1, sig);
#endif
- CorrectionsMonitor.note('Overflow', 1);
+ CorrectionsMonitor.note('Overflow', 1, sig);
}
return value;
}