aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-17 15:40:39 +0100
committerAlon Zakai <alonzakai@gmail.com>2013-02-17 15:40:39 +0100
commit3e0fa38db893f089de92ebe255301ff391f25793 (patch)
treeb43de5215cc02915aaea097230ed665d6401a52e /src/preamble.js
parenta124fadbf7fd210a7a6f6649dc7147438215d6ce (diff)
remove PGO option. It is only relevant for non-ta2 builds, which are on the way to deprecation, and it in the best case is not a precise optimization but an optimistic one
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js61
1 files changed, 3 insertions, 58 deletions
diff --git a/src/preamble.js b/src/preamble.js
index f168f5d5..3c206def 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -150,52 +150,6 @@ function SAFE_HEAP_COPY_HISTORY(dest, src) {
//==========================================
#endif
-var CorrectionsMonitor = {
-#if PGO
- MAX_ALLOWED: Infinity,
-#else
- MAX_ALLOWED: 0, // XXX
-#endif
- corrections: 0,
- sigs: {},
-
- note: function(type, succeed, sig) {
- if (!succeed) {
- this.corrections++;
- if (this.corrections >= this.MAX_ALLOWED) abort('\n\nToo many corrections!');
- }
-#if PGO
- if (!sig)
- sig = (new Error().stack).toString().split('\n')[2].split(':').slice(-1)[0]; // Spidermonkey-specific FIXME
- sig = type + '|' + sig;
- if (!this.sigs[sig]) {
- //Module.print('Correction: ' + sig);
- this.sigs[sig] = [0, 0]; // fail, succeed
- }
- this.sigs[sig][succeed ? 1 : 0]++;
-#endif
- },
-
- print: function() {
-#if PGO
- var items = [];
- for (var sig in this.sigs) {
- items.push({
- sig: sig,
- fails: this.sigs[sig][0],
- succeeds: this.sigs[sig][1],
- total: this.sigs[sig][0] + this.sigs[sig][1]
- });
- }
- items.sort(function(x, y) { return y.total - x.total; });
- for (var i = 0; i < items.length; i++) {
- var item = items[i];
- Module.print(item.sig + ' : ' + item.total + ' hits, %' + (Math.ceil(100*item.fails/item.total)) + ' failures');
- }
-#endif
- }
-};
-
#if CHECK_OVERFLOWS
//========================================
// Debugging tools - Mathop overflows
@@ -207,11 +161,11 @@ function CHECK_OVERFLOW(value, bits, ignore, sig) {
// 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', 0, sig);
- if (value === Infinity || value === -Infinity || Math.abs(value) >= twopbits) CorrectionsMonitor.note('Overflow');
+ throw 'SignedOverflow';
+ if (value === Infinity || value === -Infinity || Math.abs(value) >= twopbits) throw 'Overflow';
#else
if (value === Infinity || value === -Infinity || Math.abs(value) >= twopbits) {
- CorrectionsMonitor.note('Overflow', 0, sig);
+ throw 'Overflow';
#endif
#if CORRECT_OVERFLOWS
// Fail on >32 bits - we warned at compile time
@@ -219,12 +173,6 @@ function CHECK_OVERFLOW(value, bits, ignore, sig) {
value = value & (twopbits - 1);
}
#endif
- } else {
-#if CHECK_SIGNED_OVERFLOWS
- CorrectionsMonitor.note('SignedOverflow', 1, sig);
-#endif
- CorrectionsMonitor.note('Overflow', 1, sig);
- }
return value;
}
#endif
@@ -769,9 +717,6 @@ function preMain() {
}
function exitRuntime() {
callRuntimeCallbacks(__ATEXIT__);
-
- // Print summary of correction activity
- CorrectionsMonitor.print();
}
// Tools