[webkit-reviews] review granted: [Bug 202711] Post increment/decrement should only call ToNumber once : [Attachment 381002] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Oct 15 11:21:39 PDT 2019


Saam Barati <sbarati at apple.com> has granted Robin Morisset
<rmorisset at apple.com>'s request for review:
Bug 202711: Post increment/decrement should only call ToNumber once
https://bugs.webkit.org/show_bug.cgi?id=202711

Attachment 381002: Patch

https://bugs.webkit.org/attachment.cgi?id=381002&action=review




--- Comment #11 from Saam Barati <sbarati at apple.com> ---
Comment on attachment 381002
  --> https://bugs.webkit.org/attachment.cgi?id=381002
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=381002&action=review

r=me

> Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp:1791
> +    RefPtr<RegisterID> tmp =
generator.emitToNumber(generator.newTemporary(), srcDst);
> +    RefPtr<RegisterID> result = generator.tempDestination(srcDst);
> +    generator.move(result.get(), tmp.get());
> +    emitIncOrDec(generator, result.get(), oper);
> +    generator.move(srcDst, result.get());

why not something like this?
```
RefPtr<RegisterID> result =
generator.emitToNumber(generator.tempDestination(dst), srcDst);
emitIncOrDec(generator, result.get(), oper);
generator.move(srcDst, result.get());
return generator.move(dst, result.get());
```


More information about the webkit-reviews mailing list