[webkit-dev] useless mov instructions

Oliver Hunt oliver at apple.com
Wed Aug 5 09:41:28 PDT 2009


For "program" and "eval" code the result of the execution is result of  
the last evaluated expression.  To deal with this we somewhat  
pessimistically always copy results to the return register.  We could  
theoretically improve this, but some testing i did a while ago (that  
broke correctness by simply returning undefined for program and eval  
code) did not impact performance in any real way.  If you have an  
example that you believe is impacted by this pessimism it would be  
great if you could file a bug at http://bugs.webkit.org

--Oliver

On Aug 5, 2009, at 8:35 AM, Ágoston Róbert wrote:

> hi!
>
> I just experiment with squirrelfish bytecode generating, and I think I
> find something
> strange. After each mov instruction, where the source is a constant
> register, there is
> an other mov instruction, which moves the previous destination to r0.
> I think these instructions are useless. Is there any reason why are
> they generated?
>
> There is an example:
> js:
>
> var r_15;
> var r_16;
> var r_17;
> var r_18;
> r_15 = 1;
> r_16 = 2;
> r_17 = 3;
> r_17 = 4;
>
> generated:
> [   0] enter
> [   1] mov               r-15, r1073741824
> [   4] mov               r-16, r1073741824
> [   7] mov               r-17, r1073741824
> [  10] mov               r-18, r1073741824
> [  13] mov               r0, r1073741824
> [  16] mov               r-15, r1073741825
> [  19] mov               r0, r-15
> [  22] mov               r-16, r1073741826
> [  25] mov               r0, r-16
> [  28] mov               r-17, r1073741827
> [  31] mov               r0, r-17
> [  34] mov               r-17, r1073741828
> [  37] mov               r0, r-17
> [  40] end               r0
>
> -Robert
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev



More information about the webkit-dev mailing list