[webkit-reviews] review granted: [Bug 194419] [JSC] Shrink sizeof(CodeBlock) more : [Attachment 361482] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 8 15:34:22 PST 2019


Mark Lam <mark.lam at apple.com> has granted Yusuke Suzuki <ysuzuki at apple.com>'s
request for review:
Bug 194419: [JSC] Shrink sizeof(CodeBlock) more
https://bugs.webkit.org/show_bug.cgi?id=194419

Attachment 361482: Patch

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




--- Comment #7 from Mark Lam <mark.lam at apple.com> ---
Comment on attachment 361482
  --> https://bugs.webkit.org/attachment.cgi?id=361482
Patch

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

Very nice.  r=me with suggestions.

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:526
> -    for (const auto& instruction : *m_instructions) {
> +    for (const auto& instruction : instructions()) {

Pre-cache instructions() in a local before the loop so that the compiler knows
that it won't change on each iteration.

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:1074
> +	       auto instruction =
instructions().at(propertyAccessInstructions[i]);

Precache instructions in a local before loop.

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:1204
> +	   const auto curInstruction =
instructions().at(propertyAccessInstructions[i]);

Precache instructions in a local before loop.

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:1711
> +    auto instruction = instructions().at(bytecodeOffset);

Use auto& to make is explicit at a glance that this is a reference.

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:1816
> +    for (const auto& it : instructions()) {

Precache instructions in a local before loop.

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:2755
> +    for (const auto& instruction : instructions()) {

Precache instructions in a local before loop.

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:2944
> +    for (const auto& instruction : instructions()) {

Precache instructions in a local before loop.


More information about the webkit-reviews mailing list