From 59a3dbdf44ee7d4476fe460116179200004d4f1e Mon Sep 17 00:00:00 2001 From: dcode Date: Mon, 2 Nov 2015 04:02:34 +0200 Subject: [PATCH] Played through a couple of transparent or manual dispose ideas, ended up leaving a longish recommendation on not to implement any --- dist/long.js | 71 +++++++++++++---------- dist/long.min.js | 29 +++++----- dist/long.min.js.gz | Bin 2607 -> 2642 bytes dist/long.min.map | 6 +- scripts/build.js | 4 +- src/long.js | 135 ++++++++++++++++++++++++++++++++++---------- tests/suite.js | 20 +++++++ 7 files changed, 189 insertions(+), 76 deletions(-) diff --git a/dist/long.js b/dist/long.js index 09afa0d..a986f59 100644 --- a/dist/long.js +++ b/dist/long.js @@ -131,6 +131,17 @@ */ var UINT_CACHE = {}; + /** + * Determines if an integer value is cacheable. + * @param {number} value Integer value + * @param {boolean=} unsigned Whether unsigned or not + * @returns {boolean} + * @inner + */ + function cacheable(value, unsigned) { + return unsigned ? 0 <= (value >>>= 0) && value < 256 : -128 <= (value |= 0) && value < 128; + } + /** * @param {number} value * @param {boolean=} unsigned @@ -139,27 +150,25 @@ */ function fromInt(value, unsigned) { var obj, cachedObj, cache; - if (!unsigned) { - value = value | 0; - if (cache = (-128 <= value && value < 128)) { - cachedObj = INT_CACHE[value]; + if (unsigned) { + if (cache = cacheable(value >>>= 0, true)) { + cachedObj = UINT_CACHE[value]; if (cachedObj) return cachedObj; } - obj = fromBits(value, value < 0 ? -1 : 0, false); + obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); if (cache) - INT_CACHE[value] = obj; + UINT_CACHE[value] = obj; return obj; } else { - value = value >>> 0; - if (cache = (0 <= value && value < 256)) { - cachedObj = UINT_CACHE[value]; + if (cache = cacheable(value |= 0, false)) { + cachedObj = INT_CACHE[value]; if (cachedObj) return cachedObj; } - obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); + obj = fromBits(value, value < 0 ? -1 : 0, false); if (cache) - UINT_CACHE[value] = obj; + INT_CACHE[value] = obj; return obj; } } @@ -181,15 +190,19 @@ * @inner */ function fromNumber(value, unsigned) { - unsigned = !!unsigned; if (isNaN(value) || !isFinite(value)) - return ZERO; - if (!unsigned && value <= -TWO_PWR_63_DBL) - return MIN_VALUE; - if (!unsigned && value + 1 >= TWO_PWR_63_DBL) - return MAX_VALUE; - if (unsigned && value >= TWO_PWR_64_DBL) - return MAX_UNSIGNED_VALUE; + return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) + return UZERO; + if (value >= TWO_PWR_64_DBL) + return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) + return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return MAX_VALUE; + } if (value < 0) return fromNumber(-value, unsigned).neg(); return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); @@ -259,8 +272,9 @@ var p; if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen'); - else if (p === 0) + else if (p === 0) { return fromString(str.substring(1), unsigned, radix).neg(); + } // Do several (8) digits each time through the loop, so as to // minimize the calls to the very expensive emulated div. @@ -268,8 +282,8 @@ var result = ZERO; for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i); - var value = parseInt(str.substring(i, i + size), radix); + var size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); if (size < 8) { var power = fromNumber(pow_dbl(radix, size)); result = result.mul(power).add(fromNumber(value)); @@ -508,23 +522,22 @@ throw RangeError('radix'); if (this.isZero()) return '0'; - var rem; if (this.isNegative()) { // Unsigned Longs are never negative if (this.eq(MIN_VALUE)) { // We need to change the Long value before it can be negated, so we remove // the bottom-most digit in this base and then recurse to do the rest. - var radixLong = fromNumber(radix); - var div = this.div(radixLong); - rem = div.mul(radixLong).sub(this); - return div.toString(radix) + rem.toInt().toString(radix); + var radixLong = fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); } else return '-' + this.neg().toString(radix); } // Do several (6) digits each time through the loop, so as to // minimize the calls to the very expensive emulated div. - var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned); - rem = this; + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), + rem = this; var result = ''; while (true) { var remDiv = rem.div(radixToPower), diff --git a/dist/long.min.js b/dist/long.min.js index 5b387c7..72aa367 100644 --- a/dist/long.min.js +++ b/dist/long.min.js @@ -3,17 +3,18 @@ Released under the Apache License, Version 2.0 see: https://github.com/dcodeIO/long.js for details */ -(function(d,g){"function"===typeof define&&define.amd?define([],g):"function"===typeof require&&"object"===typeof module&&module&&module.exports?module.exports=g():(d.dcodeIO=d.dcodeIO||{}).Long=g()})(this,function(){function d(a,b,c){this.low=a|0;this.high=b|0;this.unsigned=!!c}function g(a){return!0===(a&&a.__isLong__)}function m(a,b){var c,s;if(b){a>>>=0;if(s=0<=a&&256>a)if(c=z[a])return c;c=e(a,0>(a|0)?-1:0,!0);s&&(z[a]=c)}else{a|=0;if(s=-128<=a&&128>a)if(c=A[a])return c;c=e(a,0>a?-1:0,!1);s&& -(A[a]=c)}return c}function n(a,b){b=!!b;return isNaN(a)||!isFinite(a)?k:!b&&a<=-B?l:!b&&a+1>=B?C:b&&a>=D?E:0>a?n(-a,b).neg():e(a%4294967296|0,a/4294967296|0,b)}function e(a,b,c){return new d(a,b,c)}function w(a,b,c){if(0===a.length)throw Error("empty string");if("NaN"===a||"Infinity"===a||"+Infinity"===a||"-Infinity"===a)return k;"number"===typeof b&&(c=b,b=!1);c=c||10;if(2>c||36d?(d=n(t(c,d)),e=e.mul(d).add(n(g))):(e=e.mul(s),e=e.add(n(g)))}e.unsigned=b;return e}function p(a){return a instanceof d?a:"number"===typeof a?n(a):"string"===typeof a?w(a):e(a.low,a.high,a.unsigned)}Object.defineProperty(d.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});d.isLong=g;var A={},z={};d.fromInt=m;d.fromNumber=n;d.fromBits=e;var t=Math.pow;d.fromString= -w;d.fromValue=p;var D=4294967296*4294967296,B=D/2,F=m(16777216),k=m(0);d.ZERO=k;var x=m(0,!0);d.UZERO=x;var q=m(1);d.ONE=q;var b=m(1,!0);d.UONE=b;var y=m(-1);d.NEG_ONE=y;var C=e(-1,2147483647,!1);d.MAX_VALUE=C;var E=e(-1,-1,!0);d.MAX_UNSIGNED_VALUE=E;var l=e(0,-2147483648,!1);d.MIN_VALUE=l;b=d.prototype;b.toInt=function(){return this.unsigned?this.low>>>0:this.low};b.toNumber=function(){return this.unsigned?4294967296*(this.high>>>0)+(this.low>>>0):4294967296*this.high+(this.low>>>0)};b.toString= -function(a){a=a||10;if(2>a||36>>0).toString(a);b=d;if(b.isZero())return f+e;for(;6>f.length;)f="0"+f;e=""+f+e}};b.getHighBits=function(){return this.high};b.getHighBitsUnsigned=function(){return this.high>>> -0};b.getLowBits=function(){return this.low};b.getLowBitsUnsigned=function(){return this.low>>>0};b.getNumBitsAbs=function(){if(this.isNegative())return this.eq(l)?64:this.neg().getNumBitsAbs();for(var a=0!=this.high?this.high:this.low,b=31;0this.high};b.isPositive=function(){return this.unsigned||0<=this.high};b.isOdd=function(){return 1===(this.low& -1)};b.isEven=function(){return 0===(this.low&1)};b.equals=function(a){g(a)||(a=p(a));return this.unsigned!==a.unsigned&&1===this.high>>>31&&1===a.high>>>31?!1:this.high===a.high&&this.low===a.low};b.eq=b.equals;b.notEquals=function(a){return!this.eq(a)};b.neq=b.notEquals;b.lessThan=function(a){return 0>this.comp(a)};b.lt=b.lessThan;b.lessThanOrEqual=function(a){return 0>=this.comp(a)};b.lte=b.lessThanOrEqual;b.greaterThan=function(a){return 0>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.sub(a).isNegative()?-1:1};b.comp=b.compare;b.negate=function(){return!this.unsigned&&this.eq(l)?l:this.not().add(q)};b.neg=b.negate;b.add=function(a){g(a)||(a=p(a));var b=this.high>>>16,c=this.high&65535,d=this.low>>>16, -l=a.high>>>16,f=a.high&65535,n=a.low>>>16,k;k=0+((this.low&65535)+(a.low&65535));a=0+(k>>>16);a+=d+n;d=0+(a>>>16);d+=c+f;c=0+(d>>>16);c=c+(b+l)&65535;return e((a&65535)<<16|k&65535,c<<16|d&65535,this.unsigned)};b.subtract=function(a){g(a)||(a=p(a));return this.add(a.neg())};b.sub=b.subtract;b.multiply=function(a){if(this.isZero())return k;g(a)||(a=p(a));if(a.isZero())return k;if(this.eq(l))return a.isOdd()?l:k;if(a.eq(l))return this.isOdd()?l:k;if(this.isNegative())return a.isNegative()?this.neg().mul(a.neg()): -this.neg().mul(a).neg();if(a.isNegative())return this.mul(a.neg()).neg();if(this.lt(F)&&a.lt(F))return n(this.toNumber()*a.toNumber(),this.unsigned);var b=this.high>>>16,c=this.high&65535,d=this.low>>>16,v=this.low&65535,f=a.high>>>16,m=a.high&65535,q=a.low>>>16;a=a.low&65535;var u,h,r,t;t=0+v*a;r=0+(t>>>16);r+=d*a;h=0+(r>>>16);r=(r&65535)+v*q;h+=r>>>16;r&=65535;h+=c*a;u=0+(h>>>16);h=(h&65535)+d*q;u+=h>>>16;h&=65535;h+=v*m;u+=h>>>16;h&=65535;u=u+(b*a+c*q+d*m+v*f)&65535;return e(r<<16|t&65535,u<<16| -h,this.unsigned)};b.mul=b.multiply;b.divide=function(a){g(a)||(a=p(a));if(a.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?x:k;var b,c,d;if(this.eq(l)){if(a.eq(q)||a.eq(y))return l;if(a.eq(l))return q;b=this.shr(1).div(a).shl(1);if(b.eq(k))return a.isNegative()?q:y;c=this.sub(a.mul(b));return d=b.add(c.div(a))}if(a.eq(l))return this.unsigned?x:k;if(this.isNegative())return a.isNegative()?this.neg().div(a.neg()):this.neg().div(a).neg();if(a.isNegative())return this.div(a.neg()).neg(); -d=k;for(c=this;c.gte(a);){b=Math.max(1,Math.floor(c.toNumber()/a.toNumber()));for(var e=Math.ceil(Math.log(b)/Math.LN2),e=48>=e?1:t(2,e-48),f=n(b),m=f.mul(a);m.isNegative()||m.gt(c);)b-=e,f=n(b,this.unsigned),m=f.mul(a);f.isZero()&&(f=q);d=d.add(f);c=c.sub(m)}return d};b.div=b.divide;b.modulo=function(a){g(a)||(a=p(a));return this.sub(this.div(a).mul(a))};b.mod=b.modulo;b.not=function(){return e(~this.low,~this.high,this.unsigned)};b.and=function(a){g(a)||(a=p(a));return e(this.low&a.low,this.high& -a.high,this.unsigned)};b.or=function(a){g(a)||(a=p(a));return e(this.low|a.low,this.high|a.high,this.unsigned)};b.xor=function(a){g(a)||(a=p(a));return e(this.low^a.low,this.high^a.high,this.unsigned)};b.shiftLeft=function(a){g(a)&&(a=a.toInt());return 0===(a&=63)?this:32>a?e(this.low<>>32-a,this.unsigned):e(0,this.low<a?e(this.low>>>a|this.high<<32-a,this.high>> -a,this.unsigned):e(this.high>>a-32,0<=this.high?0:-1,this.unsigned)};b.shr=b.shiftRight;b.shiftRightUnsigned=function(a){g(a)&&(a=a.toInt());a&=63;if(0===a)return this;var b=this.high;return 32>a?e(this.low>>>a|b<<32-a,b>>>a,this.unsigned):32===a?e(b,0,this.unsigned):e(b>>>a-32,0,this.unsigned)};b.shru=b.shiftRightUnsigned;b.toSigned=function(){return this.unsigned?e(this.low,this.high,!1):this};b.toUnsigned=function(){return this.unsigned?this:e(this.low,this.high,!0)};return d}); +(function(d,g){"function"===typeof define&&define.amd?define([],g):"function"===typeof require&&"object"===typeof module&&module&&module.exports?module.exports=g():(d.dcodeIO=d.dcodeIO||{}).Long=g()})(this,function(){function d(a,b,c){this.low=a|0;this.high=b|0;this.unsigned=!!c}function g(a){return!0===(a&&a.__isLong__)}function z(a,b){return b?0<=(a>>>=0)&&256>a:-128<=(a|=0)&&128>a}function m(a,b){var c,s;if(b){if(s=z(a>>>=0,!0))if(c=A[a])return c;c=e(a,0>(a|0)?-1:0,!0);s&&(A[a]=c)}else{if(s=z(a|= +0,!1))if(c=B[a])return c;c=e(a,0>a?-1:0,!1);s&&(B[a]=c)}return c}function n(a,b){if(isNaN(a)||!isFinite(a))return b?t:k;if(b){if(0>a)return t;if(a>=C)return D}else{if(a<=-E)return l;if(a+1>=E)return F}return 0>a?n(-a,b).neg():e(a%4294967296|0,a/4294967296|0,b)}function e(a,b,c){return new d(a,b,c)}function x(a,b,c){if(0===a.length)throw Error("empty string");if("NaN"===a||"Infinity"===a||"+Infinity"===a||"-Infinity"===a)return k;"number"===typeof b&&(c=b,b=!1);c=c||10;if(2>c||36d?(d=n(v(c,d)),e=e.mul(d).add(n(g))):(e=e.mul(s),e=e.add(n(g)))}e.unsigned=b;return e}function p(a){return a instanceof d?a:"number"===typeof a?n(a):"string"===typeof a?x(a):e(a.low,a.high,a.unsigned)}Object.defineProperty(d.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}); +d.isLong=g;var B={},A={};d.fromInt=m;d.fromNumber=n;d.fromBits=e;var v=Math.pow;d.fromString=x;d.fromValue=p;var C=4294967296*4294967296,E=C/2,G=m(16777216),k=m(0);d.ZERO=k;var t=m(0,!0);d.UZERO=t;var q=m(1);d.ONE=q;var b=m(1,!0);d.UONE=b;var y=m(-1);d.NEG_ONE=y;var F=e(-1,2147483647,!1);d.MAX_VALUE=F;var D=e(-1,-1,!0);d.MAX_UNSIGNED_VALUE=D;var l=e(0,-2147483648,!1);d.MIN_VALUE=l;b=d.prototype;b.toInt=function(){return this.unsigned?this.low>>>0:this.low};b.toNumber=function(){return this.unsigned? +4294967296*(this.high>>>0)+(this.low>>>0):4294967296*this.high+(this.low>>>0)};b.toString=function(a){a=a||10;if(2>a||36>>0).toString(a),b=d;if(b.isZero())return f+e;for(;6>f.length;)f="0"+f;e=""+ +f+e}};b.getHighBits=function(){return this.high};b.getHighBitsUnsigned=function(){return this.high>>>0};b.getLowBits=function(){return this.low};b.getLowBitsUnsigned=function(){return this.low>>>0};b.getNumBitsAbs=function(){if(this.isNegative())return this.eq(l)?64:this.neg().getNumBitsAbs();for(var a=0!=this.high?this.high:this.low,b=31;0this.high}; +b.isPositive=function(){return this.unsigned||0<=this.high};b.isOdd=function(){return 1===(this.low&1)};b.isEven=function(){return 0===(this.low&1)};b.equals=function(a){g(a)||(a=p(a));return this.unsigned!==a.unsigned&&1===this.high>>>31&&1===a.high>>>31?!1:this.high===a.high&&this.low===a.low};b.eq=b.equals;b.notEquals=function(a){return!this.eq(a)};b.neq=b.notEquals;b.lessThan=function(a){return 0>this.comp(a)};b.lt=b.lessThan;b.lessThanOrEqual=function(a){return 0>=this.comp(a)};b.lte=b.lessThanOrEqual; +b.greaterThan=function(a){return 0>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.sub(a).isNegative()?-1:1};b.comp=b.compare;b.negate=function(){return!this.unsigned&&this.eq(l)?l:this.not().add(q)};b.neg=b.negate; +b.add=function(a){g(a)||(a=p(a));var b=this.high>>>16,c=this.high&65535,d=this.low>>>16,l=a.high>>>16,f=a.high&65535,n=a.low>>>16,k;k=0+((this.low&65535)+(a.low&65535));a=0+(k>>>16);a+=d+n;d=0+(a>>>16);d+=c+f;c=0+(d>>>16);c=c+(b+l)&65535;return e((a&65535)<<16|k&65535,c<<16|d&65535,this.unsigned)};b.subtract=function(a){g(a)||(a=p(a));return this.add(a.neg())};b.sub=b.subtract;b.multiply=function(a){if(this.isZero())return k;g(a)||(a=p(a));if(a.isZero())return k;if(this.eq(l))return a.isOdd()?l:k; +if(a.eq(l))return this.isOdd()?l:k;if(this.isNegative())return a.isNegative()?this.neg().mul(a.neg()):this.neg().mul(a).neg();if(a.isNegative())return this.mul(a.neg()).neg();if(this.lt(G)&&a.lt(G))return n(this.toNumber()*a.toNumber(),this.unsigned);var b=this.high>>>16,c=this.high&65535,d=this.low>>>16,w=this.low&65535,f=a.high>>>16,m=a.high&65535,q=a.low>>>16;a=a.low&65535;var u,h,r,t;t=0+w*a;r=0+(t>>>16);r+=d*a;h=0+(r>>>16);r=(r&65535)+w*q;h+=r>>>16;r&=65535;h+=c*a;u=0+(h>>>16);h=(h&65535)+d* +q;u+=h>>>16;h&=65535;h+=w*m;u+=h>>>16;h&=65535;u=u+(b*a+c*q+d*m+w*f)&65535;return e(r<<16|t&65535,u<<16|h,this.unsigned)};b.mul=b.multiply;b.divide=function(a){g(a)||(a=p(a));if(a.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?t:k;var b,c,d;if(this.eq(l)){if(a.eq(q)||a.eq(y))return l;if(a.eq(l))return q;b=this.shr(1).div(a).shl(1);if(b.eq(k))return a.isNegative()?q:y;c=this.sub(a.mul(b));return d=b.add(c.div(a))}if(a.eq(l))return this.unsigned?t:k;if(this.isNegative())return a.isNegative()? +this.neg().div(a.neg()):this.neg().div(a).neg();if(a.isNegative())return this.div(a.neg()).neg();d=k;for(c=this;c.gte(a);){b=Math.max(1,Math.floor(c.toNumber()/a.toNumber()));for(var e=Math.ceil(Math.log(b)/Math.LN2),e=48>=e?1:v(2,e-48),f=n(b),m=f.mul(a);m.isNegative()||m.gt(c);)b-=e,f=n(b,this.unsigned),m=f.mul(a);f.isZero()&&(f=q);d=d.add(f);c=c.sub(m)}return d};b.div=b.divide;b.modulo=function(a){g(a)||(a=p(a));return this.sub(this.div(a).mul(a))};b.mod=b.modulo;b.not=function(){return e(~this.low, +~this.high,this.unsigned)};b.and=function(a){g(a)||(a=p(a));return e(this.low&a.low,this.high&a.high,this.unsigned)};b.or=function(a){g(a)||(a=p(a));return e(this.low|a.low,this.high|a.high,this.unsigned)};b.xor=function(a){g(a)||(a=p(a));return e(this.low^a.low,this.high^a.high,this.unsigned)};b.shiftLeft=function(a){g(a)&&(a=a.toInt());return 0===(a&=63)?this:32>a?e(this.low<>>32-a,this.unsigned):e(0,this.low<a?e(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):e(this.high>>a-32,0<=this.high?0:-1,this.unsigned)};b.shr=b.shiftRight;b.shiftRightUnsigned=function(a){g(a)&&(a=a.toInt());a&=63;if(0===a)return this;var b=this.high;return 32>a?e(this.low>>>a|b<<32-a,b>>>a,this.unsigned):32===a?e(b,0,this.unsigned):e(b>>>a-32,0,this.unsigned)};b.shru=b.shiftRightUnsigned;b.toSigned=function(){return this.unsigned?e(this.low,this.high,!1):this};b.toUnsigned=function(){return this.unsigned? +this:e(this.low,this.high,!0)};return d}); diff --git a/dist/long.min.js.gz b/dist/long.min.js.gz index 1413bc570cb2644720c3b802220e6096caeb4799..b1fbee855ddae7dbfa0eb2be4b5eba9084509a63 100644 GIT binary patch literal 2642 zcmV-Y3a#}YiwFqV!!}j|3v6$0XD)4NZZ2wb0G(L>bK1BP|DC_WVdgPbFpdo=Nil+# zwrQ_3x#Xtz+V|#e?lQ71gD=Jg+vH0F_qV^5EZH)cw7p-zTJ5fOwY#5{baLF%q9mS~ ze`T8PA+2xO1MMA&LmFxS4b%LqHuk;5r~l@^W|&M`+9w)Ol2Kn<$39K9d``8CCGp_z zD)eZaQA7Je(=1G4t#4W_Eu(a#&GUSjjZRKxVLo5Grk5;ExXO<=CvyEDNj0D5B#g4w z@kvV$*0Gm^7Tq^y=(#P2ZH#gLw4_M@+(8)APN(=c$-mUg)IL zA?EFEn6brgZ&Ahim8~S1HFs)_fqOEUU<-9R{a3>Y8TIV`Iiqek4F(fZ$uA1|dy;CN zkvUMtcvqTB#<+JW$r0!4+7n!o-b;g+!Li$Ly+^!4zp|9ZHw z402K%x=QG%OcJ3jrVnM}R9ugei+mD2#KOh5#J%r{$c+ zg;Q(;GHD*{jG3+7!fD+`e4C0mI2n%hd)+h65pn>1bha?XcSe9MCm72;bb>BEFOuKK zKa+fJF2YzpH{^UTK*kI&Nt)4*ab8<4FoLd+U_s}6;!ky7tmh+SP)yCmI?{b)65rQj zeFnabbV<$%j%sR4D;RJc;T)|pU|FGoMzk=_auRzSB&TGwA0d{K1Q1drgF5lZCLrw? zB7u_(ir`N!jeHxee?MdJGfET(wJUct<+e2jB!3dDcH-EeQbc64> ze9mYb(0ubVr{|o$Vv>w_bA5?doa8c+WMyQRlb?Xx zo)3nnXB_T)^XH5I-F~^a`h1DsbG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apy923868}47qE*Kh zPgGR}ZIENE)9f#C-t2JR9A*6U7dijF!}<54obxaWifbC|cYW|XEA8?!Uft@%<2)V> zMT(7wgDII+M^7fCIu{ljtkwH+pH9n-5cs2X#TSr;%D_JWyu;)Zx!NvRAx86-^uZQEq4B1;= RS;e5L{|_+;Wz$9+005by5m^8L diff --git a/dist/long.min.map b/dist/long.min.map index 6a66710..baff3b6 100644 --- a/dist/long.min.map +++ b/dist/long.min.map @@ -1,8 +1,8 @@ { "version":3, "file":"", -"lineCount":19, -"mappings":"A;;;;;AAsBC,SAAQ,CAACA,CAAD,CAASC,CAAT,CAAkB,CAES,UAAtB,GAAI,MAAOC,OAAX,EAAoCA,MAAA,IAApC,CACNA,MAAA,CAAO,EAAP,CAAWD,CAAX,CADM,CAEiC,UAAvB,GAAI,MAAOE,QAAX,EAAuD,QAAvD,GAAqC,MAAOC,OAA5C,EAAmEA,MAAnE,EAA6EA,MAAA,QAA7E,CAChBA,MAAA,QADgB,CACIH,CAAA,EADJ,CAGhB,CAACD,CAAA,QAAD,CAAqBA,CAAA,QAArB,EAA0C,EAA1C,MAHgB,CAGwCC,CAAA,EAPrC,CAA1B,CAAD,CASG,IATH,CASS,QAAQ,EAAG,CAahBI,QAASA,EAAI,CAACC,CAAD,CAAMC,CAAN,CAAYC,CAAZ,CAAsB,CAO/B,IAAAF,IAAA,CAAWA,CAAX,CAAiB,CAOjB,KAAAC,KAAA,CAAYA,CAAZ,CAAmB,CAOnB,KAAAC,SAAA,CAAgB,CAAEA,CAAAA,CArBa,CA8DnCC,QAASA,EAAM,CAACC,CAAD,CAAM,CACjB,MAAsC,CAAA,CAAtC,IAAQA,CAAR,EAAeA,CAAA,WAAf,CADiB,CAiCrBC,QAASA,EAAO,CAACC,CAAD,CAAQJ,CAAR,CAAkB,CAAA,IAC1BE,CAD0B,CACVG,CACpB,IAAKL,CAAL,CAWO,CACHI,CAAA,IAAkB,CAClB,IAAIC,CAAJ,CAAa,CAAb,EAAkBD,CAAlB,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,MAAA,EADd,CAEA8G,EAAA,EAAW,EACX,IAAgB,CAAhB,GAAIA,CAAJ,CACI,MAAO,KAEP,KAAI1K,EAAO,IAAAA,KACX,OAAc,GAAd,CAAI0K,CAAJ,CAEWhK,CAAA,CADG,IAAAX,IACH,GAAkB2K,CAAlB,CAA8B1K,CAA9B,EAAuC,EAAvC,CAA4C0K,CAA5C,CAAuD1K,CAAvD,GAAgE0K,CAAhE,CAAyE,IAAAzK,SAAzE,CAFX,CAGuB,EAAhB,GAAIyK,CAAJ,CACIhK,CAAA,CAASV,CAAT,CAAe,CAAf,CAAkB,IAAAC,SAAlB,CADJ,CAGIS,CAAA,CAASV,CAAT,GAAmB0K,CAAnB,CAA6B,EAA7B,CAAkC,CAAlC,CAAqC,IAAAzK,SAArC,CAdqD,CAyBxE0D,EAAAoH,KAAA,CAAqBpH,CAAAkH,mBAOrBlH,EAAAqH,SAAA,CAAyBC,QAAiB,EAAG,CACzC,MAAK,KAAAhL,SAAL,CAEOS,CAAA,CAAS,IAAAX,IAAT,CAAmB,IAAAC,KAAnB,CAA8B,CAAA,CAA9B,CAFP,CACW,IAF8B,CAW7C2D,EAAAuH,WAAA,CAA2BC,QAAmB,EAAG,CAC7C,MAAI,KAAAlL,SAAJ;AACW,IADX,CAEOS,CAAA,CAAS,IAAAX,IAAT,CAAmB,IAAAC,KAAnB,CAA8B,CAAA,CAA9B,CAHsC,CAMjD,OAAOF,EAnqCS,CATpB;", "sources":["dist/long.js"], -"names":["global","factory","define","require","module","Long","low","high","unsigned","isLong","obj","fromInt","value","cache","cachedObj","UINT_CACHE","fromBits","INT_CACHE","fromNumber","isNaN","isFinite","ZERO","TWO_PWR_63_DBL","MIN_VALUE","MAX_VALUE","TWO_PWR_64_DBL","MAX_UNSIGNED_VALUE","neg","TWO_PWR_32_DBL","lowBits","highBits","fromString","str","radix","length","Error","RangeError","p","indexOf","substring","radixToPower","pow_dbl","result","i","size","Math","min","parseInt","power","mul","add","fromValue","val","Object","defineProperty","prototype","enumerable","configurable","pow","TWO_PWR_24","TWO_PWR_24_DBL","UZERO","ONE","UONE","NEG_ONE","LongPrototype","toInt","LongPrototype.toInt","toNumber","LongPrototype.toNumber","toString","LongPrototype.toString","isZero","rem","isNegative","eq","radixLong","div","sub","remDiv","digits","getHighBits","LongPrototype.getHighBits","getHighBitsUnsigned","LongPrototype.getHighBitsUnsigned","getLowBits","LongPrototype.getLowBits","getLowBitsUnsigned","LongPrototype.getLowBitsUnsigned","getNumBitsAbs","LongPrototype.getNumBitsAbs","bit","LongPrototype.isZero","LongPrototype.isNegative","isPositive","LongPrototype.isPositive","isOdd","LongPrototype.isOdd","isEven","LongPrototype.isEven","equals","LongPrototype.equals","other","notEquals","LongPrototype.notEquals","neq","lessThan","LongPrototype.lessThan","comp","lt","lessThanOrEqual","LongPrototype.lessThanOrEqual","lte","greaterThan","LongPrototype.greaterThan","gt","greaterThanOrEqual","LongPrototype.greaterThanOrEqual","gte","compare","LongPrototype.compare","thisNeg","otherNeg","negate","LongPrototype.negate","not","LongPrototype.add","addend","a48","a32","a16","b48","b32","b16","c00","c16","c32","c48","subtract","LongPrototype.subtract","subtrahend","multiply","LongPrototype.multiply","multiplier","a00","b00","divide","LongPrototype.divide","divisor","approx","res","shr","halfThis","shl","max","floor","log2","ceil","log","LN2","delta","approxRes","approxRem","modulo","LongPrototype.modulo","mod","LongPrototype.not","and","LongPrototype.and","or","LongPrototype.or","xor","LongPrototype.xor","shiftLeft","LongPrototype.shiftLeft","numBits","shiftRight","LongPrototype.shiftRight","shiftRightUnsigned","LongPrototype.shiftRightUnsigned","shru","toSigned","LongPrototype.toSigned","toUnsigned","LongPrototype.toUnsigned"] +"names":["global","factory","define","require","module","Long","low","high","unsigned","isLong","obj","cacheable","value","fromInt","cache","cachedObj","UINT_CACHE","fromBits","INT_CACHE","fromNumber","isNaN","isFinite","UZERO","ZERO","TWO_PWR_64_DBL","MAX_UNSIGNED_VALUE","TWO_PWR_63_DBL","MIN_VALUE","MAX_VALUE","neg","TWO_PWR_32_DBL","lowBits","highBits","fromString","str","radix","length","Error","RangeError","p","indexOf","substring","radixToPower","pow_dbl","result","i","size","Math","min","parseInt","power","mul","add","fromValue","val","Object","defineProperty","prototype","enumerable","configurable","pow","TWO_PWR_24","TWO_PWR_24_DBL","ONE","UONE","NEG_ONE","LongPrototype","toInt","LongPrototype.toInt","toNumber","LongPrototype.toNumber","toString","LongPrototype.toString","isZero","isNegative","eq","radixLong","div","rem1","sub","rem","remDiv","digits","getHighBits","LongPrototype.getHighBits","getHighBitsUnsigned","LongPrototype.getHighBitsUnsigned","getLowBits","LongPrototype.getLowBits","getLowBitsUnsigned","LongPrototype.getLowBitsUnsigned","getNumBitsAbs","LongPrototype.getNumBitsAbs","bit","LongPrototype.isZero","LongPrototype.isNegative","isPositive","LongPrototype.isPositive","isOdd","LongPrototype.isOdd","isEven","LongPrototype.isEven","equals","LongPrototype.equals","other","notEquals","LongPrototype.notEquals","neq","lessThan","LongPrototype.lessThan","comp","lt","lessThanOrEqual","LongPrototype.lessThanOrEqual","lte","greaterThan","LongPrototype.greaterThan","gt","greaterThanOrEqual","LongPrototype.greaterThanOrEqual","gte","compare","LongPrototype.compare","thisNeg","otherNeg","negate","LongPrototype.negate","not","LongPrototype.add","addend","a48","a32","a16","b48","b32","b16","c00","c16","c32","c48","subtract","LongPrototype.subtract","subtrahend","multiply","LongPrototype.multiply","multiplier","a00","b00","divide","LongPrototype.divide","divisor","approx","res","shr","halfThis","shl","max","floor","log2","ceil","log","LN2","delta","approxRes","approxRem","modulo","LongPrototype.modulo","mod","LongPrototype.not","and","LongPrototype.and","or","LongPrototype.or","xor","LongPrototype.xor","shiftLeft","LongPrototype.shiftLeft","numBits","shiftRight","LongPrototype.shiftRight","shiftRightUnsigned","LongPrototype.shiftRightUnsigned","shru","toSigned","LongPrototype.toSigned","toUnsigned","LongPrototype.toUnsigned"] } diff --git a/scripts/build.js b/scripts/build.js index de97858..c50a85d 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -8,7 +8,9 @@ var rootDir = path.join(__dirname, ".."), pkg = require(path.join(rootDir, "package.json")), filename; -var scope = {}; +var scope = { + DISPOSE: false +}; // Build console.log("Building long.js with scope", JSON.stringify(scope, null, 2)); diff --git a/src/long.js b/src/long.js index ae96a85..8212d27 100644 --- a/src/long.js +++ b/src/long.js @@ -97,6 +97,17 @@ var INT_CACHE = {}; */ var UINT_CACHE = {}; +/** + * Determines if an integer value is cacheable. + * @param {number} value Integer value + * @param {boolean=} unsigned Whether unsigned or not + * @returns {boolean} + * @inner + */ +function cacheable(value, unsigned) { + return unsigned ? 0 <= (value >>>= 0) && value < 256 : -128 <= (value |= 0) && value < 128; +} + /** * @param {number} value * @param {boolean=} unsigned @@ -105,27 +116,25 @@ var UINT_CACHE = {}; */ function fromInt(value, unsigned) { var obj, cachedObj, cache; - if (!unsigned) { - value = value | 0; - if (cache = (-128 <= value && value < 128)) { - cachedObj = INT_CACHE[value]; + if (unsigned) { + if (cache = cacheable(value >>>= 0, true)) { + cachedObj = UINT_CACHE[value]; if (cachedObj) return cachedObj; } - obj = fromBits(value, value < 0 ? -1 : 0, false); + obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); if (cache) - INT_CACHE[value] = obj; + UINT_CACHE[value] = obj; return obj; } else { - value = value >>> 0; - if (cache = (0 <= value && value < 256)) { - cachedObj = UINT_CACHE[value]; + if (cache = cacheable(value |= 0, false)) { + cachedObj = INT_CACHE[value]; if (cachedObj) return cachedObj; } - obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true); + obj = fromBits(value, value < 0 ? -1 : 0, false); if (cache) - UINT_CACHE[value] = obj; + INT_CACHE[value] = obj; return obj; } } @@ -147,15 +156,19 @@ Long.fromInt = fromInt; * @inner */ function fromNumber(value, unsigned) { - unsigned = !!unsigned; if (isNaN(value) || !isFinite(value)) - return ZERO; - if (!unsigned && value <= -TWO_PWR_63_DBL) - return MIN_VALUE; - if (!unsigned && value + 1 >= TWO_PWR_63_DBL) - return MAX_VALUE; - if (unsigned && value >= TWO_PWR_64_DBL) - return MAX_UNSIGNED_VALUE; + return unsigned ? UZERO : ZERO; + if (unsigned) { + if (value < 0) + return UZERO; + if (value >= TWO_PWR_64_DBL) + return MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) + return MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) + return MAX_VALUE; + } if (value < 0) return fromNumber(-value, unsigned).neg(); return fromBits((value % TWO_PWR_32_DBL) | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); @@ -179,6 +192,15 @@ Long.fromNumber = fromNumber; * @inner */ function fromBits(lowBits, highBits, unsigned) { + //? if (DISPOSE) { + if (disposed.length > 0) { + var inst = disposed.shift(); + inst.low = lowBits | 0; + inst.high = highBits | 0; + inst.unsigned = !!unsigned; + return inst; + } + //? } return new Long(lowBits, highBits, unsigned); } @@ -225,8 +247,9 @@ function fromString(str, unsigned, radix) { var p; if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen'); - else if (p === 0) + else if (p === 0) { return fromString(str.substring(1), unsigned, radix).neg(); + } // Do several (8) digits each time through the loop, so as to // minimize the calls to the very expensive emulated div. @@ -234,8 +257,8 @@ function fromString(str, unsigned, radix) { var result = ZERO; for (var i = 0; i < str.length; i += 8) { - var size = Math.min(8, str.length - i); - var value = parseInt(str.substring(i, i + size), radix); + var size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); if (size < 8) { var power = fromNumber(pow_dbl(radix, size)); result = result.mul(power).add(fromNumber(value)); @@ -284,6 +307,61 @@ function fromValue(val) { * @expose */ Long.fromValue = fromValue; +//? if (DISPOSE) { + +// This is experimental code that will probably be removed in the future. At first glance something like this can seem +// reasonable, but it would require a lot of additional (possibly MetaScript) code to perform disposal of intermediate +// values everywhere. Otherwise, calling dispose as a user would not have much of an effect as any manually disposed +// instances become reused a lot faster internally than a user can provide more. After testing this out for a bit I am +// not convinced that the additional overhead from calling dispose() on literally every intermediate instance is worth +// it. +// +// Alternatively, it has been suggested to add self-mutating methods in #24, but this would also be neglected by the +// sheer number of intermediate instances that are still necessary. +// +// On this basis I'd recommend not to implement anything of this and leave memory optimization efforts to the VM. +// -dcode + +/** + * Disposed Longs. + * @type {!Array.} + * @inner + */ +var disposed = []; + +/** + * @param {!Long} inst + * @returns {boolean} + * @inner + */ +function dispose(inst) { + if (disposed.length > 1023) + return false; + if (!(inst /* compatible */ instanceof Long)) + return false; + // Do not dispose if cached + if (inst.unsigned) { + if (inst.high == 0 && UINT_CACHE[inst.low >>> 0] === inst) + return false; + } else { + if ((inst.high == 0 || inst.high == -1) && INT_CACHE[inst.low] === inst) + return false; + } + disposed.push(inst); + return true; +} + +/** + * Disposes a Long instance and queues it for reuse. If not ultimately necessary, it is recommended not to use this + * method at all. If used however, it must be guaranteed that a disposed instance is never used again and that this + * method is never called more than once with the same instance. + * @function + * @param {!Long} inst Long instance to dispose + * @returns {boolean} Whether actually disposed + * @expose + */ +Long.dispose = dispose; +//? } // NOTE: the compiler should inline these constant values below and then remove these variables, so there should be // no runtime penalty for these. @@ -474,23 +552,22 @@ LongPrototype.toString = function toString(radix) { throw RangeError('radix'); if (this.isZero()) return '0'; - var rem; if (this.isNegative()) { // Unsigned Longs are never negative if (this.eq(MIN_VALUE)) { // We need to change the Long value before it can be negated, so we remove // the bottom-most digit in this base and then recurse to do the rest. - var radixLong = fromNumber(radix); - var div = this.div(radixLong); - rem = div.mul(radixLong).sub(this); - return div.toString(radix) + rem.toInt().toString(radix); + var radixLong = fromNumber(radix), + div = this.div(radixLong), + rem1 = div.mul(radixLong).sub(this); + return div.toString(radix) + rem1.toInt().toString(radix); } else return '-' + this.neg().toString(radix); } // Do several (6) digits each time through the loop, so as to // minimize the calls to the very expensive emulated div. - var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned); - rem = this; + var radixToPower = fromNumber(pow_dbl(radix, 6), this.unsigned), + rem = this; var result = ''; while (true) { var remDiv = rem.div(radixToPower), diff --git a/tests/suite.js b/tests/suite.js index 1507d23..5ee5589 100644 --- a/tests/suite.js +++ b/tests/suite.js @@ -51,6 +51,26 @@ var suite = { test.equal(Long.fromString("-zzzzzz", 36).toString(36), "-zzzzzz"); test.done(); }, + + "dispose": function(test) { + if (!Long.dispose) { + test.log("Not supported"); + test.done(); + return; + } + var inst = Long.fromInt(0); + test.strictEqual(Long.dispose(inst), false); // cached, not reused + Long.dispose(inst); + var inst2 = Long.fromInt(1); + test.notStrictEqual(inst, inst2); + test.done(); + + inst = Long.fromNumber(0); + test.strictEqual(Long.dispose(inst), true); // not cached (our first inst is), reused + inst2 = Long.fromNumber(1); + test.strictEqual(inst, inst2); + test.done(); + }, "unsigned": {