1 function value() { return 'v'; }
6 for (let v = val; v; v >>>= 1) c += v & 1;
7 return val * 2 + val / 2 + c;
11 constructor(x) { this._v = x; }
12 set v(x) { this._v = x; }
13 get v() { return this._v; }
16 set v(x) { super[value()] = x; }
17 get v() { return calc(super[value()]); }
20 const bench = (init, num) => {
22 for (let i = 0; i != num; ++i) arr.push(new B(init));
23 for (let i = 0; i != num; ++i) arr[i].v += i;
25 for (let i = 0; i != num; ++i) sum += arr[i].v;
29 bench(1 << 30, 10000);
31 bench(42.5e10, 10000);