[webkit-reviews] review denied: [Bug 195928] Compress CodeOrigin into a single word in the common case : [Attachment 365215] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 19 15:18:34 PDT 2019

Saam Barati <sbarati at apple.com> has denied Robin Morisset
<rmorisset at apple.com>'s request for review:
Bug 195928: Compress CodeOrigin into a single word in the common case

Attachment 365215: Patch


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

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

> Source/JavaScriptCore/ChangeLog:8
> +	   The trick is that pointers only take 45 bits on x86_64 in practice,
and even less on ARM64.

Don't you mean 48?

> Source/JavaScriptCore/bytecode/CodeOrigin.h:78
> +	       if (UNLIKELY(this->m_compositeValue & 1))

Can we make the value "1" here some constant?

Or perhaps have a getter saying if we're out of line?

> Source/JavaScriptCore/bytecode/CodeOrigin.h:79
> +		   delete bitwise_cast<OutOfLineCodeOrigin*>(m_compositeValue &

can we have a getter called outOfLineCodeOrigin or something?

Then this could be:

if (isOutOfLine()) delete outOfLineCodeOrigin()

> Source/JavaScriptCore/bytecode/CodeOrigin.h:124
> +	   return !(m_compositeValue & 2);

can we give "2" a name?

> Source/JavaScriptCore/bytecode/CodeOrigin.h:201
> +    static const uintptr_t s_maskCompositeValueForPointer =

This seems wrong. It doesn't line up with s_freeBitsAtTop

> Source/JavaScriptCore/bytecode/CodeOrigin.h:237
> +	       return reinterpret_cast<uintptr_t>(inlineCallFrame) | 2;

style nit: bitwise_cast instead of reinterpret_cast here and elsewhere

> Source/JavaScriptCore/bytecode/CodeOrigin.h:245
> +	   ASSERT(!(encodedBytecodeIndex &

can we also assert this in a stronger way with some mask for the max bytecode
index bits?

> Source/JavaScriptCore/bytecode/CodeOrigin.h:250
> +#if CPU(X86_64) || CPU(ARM64)

You really want:
... || (CPU(ARM64) && ADDRESS(64))

Not just arm64

> Source/JavaScriptCore/bytecode/CodeOrigin.h:272
> +#if CPU(X86_64) || CPU(ARM64)

instead of using this everywhere, can we just define some bit that stands for
this type of memory model?

More information about the webkit-reviews mailing list