Re: [PHP-DEV] Object getter method optimization

2016-04-01 Thread Dmitry Stogov
execution. Thanks. Dmitry. From: Lin Yo-An <cornelius.h...@gmail.com<mailto:cornelius.h...@gmail.com>> Sent: Saturday, March 19, 2016 10:08 To: Dmitry Stogov Cc: internals; Xinchen Hui Subject: Re: [PHP-DEV] Object getter method optimization Hi Dmitry, Thanks f

Re: [PHP-DEV] Object getter method optimization

2016-04-01 Thread Lin Yo-An
s a >>> "getter method" >>> >>> And the next time, when we execute the same method, we found the "getter >>> method" flag, we simply execute FETCH_OBJ_R on that object and return the >>> value to avoid extra op code execution time. &

Re: [PHP-DEV] Object getter method optimization

2016-04-01 Thread Lin Yo-An
Yo-An Lin >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >&

Re: [PHP-DEV] Object getter method optimization

2016-04-01 Thread Xinchen Hui
e.g. methods without arguments and FETCH_OBJ_R UNUSED, >> CONST -> TMP; RETURN TMP). >> >> Then INIT_METHOD_CALL may check this flag and execute "optimized code >> sequence" instead of pushing stack frame and real call. >> >> >> However, I'm not sure wh

Re: [PHP-DEV] Object getter method optimization

2016-04-01 Thread Lin Yo-An
y make, > because we will have to make additional check on each INIT_METHOD_CALL > execution. > > > Thanks. Dmitry. > > > -- > *From:* Lin Yo-An <cornelius.h...@gmail.com> > *Sent:* Saturday, March 19, 2016 10:08 > *To:* Dmitry Stogov > *Cc:* internals; Xinchen Hu

Re: [PHP-DEV] Object getter method optimization

2016-03-22 Thread Dmitry Stogov
From: Lin Yo-An <cornelius.h...@gmail.com> Sent: Saturday, March 19, 2016 10:08 To: Dmitry Stogov Cc: internals; Xinchen Hui Subject: Re: [PHP-DEV] Object getter method optimization Hi Dmitry, Thanks for your reply! You're correct. let me try to explain your points: If I have a

Re: [PHP-DEV] Object getter method optimization

2016-03-20 Thread Dmitry Stogov
. Thanks. Dmitry. From: Lin Yo-An <cornelius.h...@gmail.com> Sent: Friday, March 18, 2016 05:23 To: internals Subject: [PHP-DEV] Object getter method optimization Hello Everyone, I am recently trying to write an optimizer that could optimize the getter

Re: [PHP-DEV] Object getter method optimization

2016-03-20 Thread Nikita Nefedov
On Sat, 19 Mar 2016 23:40:09 +0300, Andrea Faulds wrote: Hi Lin, Lin Yo-An wrote: Since the original approach doesn't work, here comes another new idea: When executing method call on an object, if we found the method body are just 2 op codes (FETCH_OBJ_R and RETURN), we then

Re: [PHP-DEV] Object getter method optimization

2016-03-19 Thread Andrea Faulds
Hi Lin, Lin Yo-An wrote: Since the original approach doesn't work, here comes another new idea: When executing method call on an object, if we found the method body are just 2 op codes (FETCH_OBJ_R and RETURN), we then denote the method is a "getter method" And the next time, when we execute

[PHP-DEV] Object getter method optimization

2016-03-19 Thread Lin Yo-An
Hello Everyone, I am recently trying to write an optimizer that could optimize the getter method call into just one object fetch opcode. I'd like to know thoughts from you guys, here is the note: https://c9s.hackpad.com/INLINE-OP-TVGo9WcshbZ -- Best Regards, Yo-An Lin https://github.com/c9s

Re: [PHP-DEV] Object getter method optimization

2016-03-19 Thread Lin Yo-An
; > > From: Lin Yo-An <cornelius.h...@gmail.com> > Sent: Friday, March 18, 2016 05:23 > To: internals > Subject: [PHP-DEV] Object getter method optimization > > Hello Everyone, > > > I am recently trying to write an optimizer tha