[v8-users] why is it adding 0x2?

2014-05-26 Thread Ilya Kantor
Hello, I'm exploring v8 disasm or this code: ``` function walkLength(x) { for(var i=0; i res In section B4 of walkLength I see: ``` ;;; <@48,#40> bounds-check 0x2e34f629 105 3bd1 cmp edx,ecx ;; debug: position 271 0x2e34f62b 107 0f833e00

Re: [v8-users] why is it adding 0x2?

2014-05-26 Thread Ilya Kantor
Hi Ben, Thanks for the reply. Will the code get further optimizations at run-time or --print-opt-code gives the maximum optimization? --- Best Regards, Ilya Kantor 2014-05-26 22:16 GMT+03:00 Ben Noordhuis : > On Mon, May 26, 2014 at 8:40 PM, Ilya Kantor wrote: > > Hello, &g

[v8-users] Many functions memory optimization

2014-06-10 Thread Ilya Kantor
Hi, When I create many objects new Machine like this ``` function Machine(power) { var enabled = false; this.enable = function() { enabled = true; }; this.disable = function() { enabled = false; }; } var machines = [] for(var i=0; i<1; i++) machines.push(new Machine) ``` .

Re: [v8-users] Many functions memory optimization

2014-06-10 Thread Ilya Kantor
Hi Ben, Is that somehow related with "Hidden classes" for objects or that's a completely another optimization technique? среда, 11 июня 2014 г., 0:29:07 UTC+4 пользователь Ben Noordhuis написал: > > On Tue, Jun 10, 2014 at 9:58 PM, Ilya Kantor > wrote: > > Hi

Re: [v8-users] Many functions memory optimization

2014-06-10 Thread Ilya Kantor
of the internal state. > > function Machine(power) { > this.enabled = true; > } > > Machine.prototype.enable = function() { > this.enabled = true; > }; > > Machine.prototype.disable() { > this.enabled = false > }; > > > On Tue, Jun 10, 2014 at 4:31

[v8-users] Re: Many functions memory optimization

2014-06-12 Thread Ilya Kantor
> > > Hi, Do I get it right that unoptimized code is shared but optimize code is not (or shared partially or...)? If closure is the root of all evil, will it help with sharing if I remove the closure completely? Like this: ``` function Machine(power) { this.enable = function() { this