Bug 181350 - Add ability to disable indexed property masking for testing
Summary: Add ability to disable indexed property masking for testing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-05 15:24 PST by Michael Saboff
Modified: 2018-01-05 16:37 PST (History)
6 users (show)

See Also:


Attachments
Patch (14.30 KB, patch)
2018-01-05 15:41 PST, Michael Saboff
keith_miller: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2018-01-05 15:24:50 PST
Add the ability to disable indexed property access to simplify testing.
Comment 1 Radar WebKit Bug Importer 2018-01-05 15:26:01 PST
<rdar://problem/36328842>
Comment 2 Michael Saboff 2018-01-05 15:41:11 PST
Created attachment 330599 [details]
Patch
Comment 3 Keith Miller 2018-01-05 15:56:06 PST
Comment on attachment 330599 [details]
Patch

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

r=me with a nit.

> Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:13159
> +        if (m_indexMaskingMode == IndexMaskingEnabled) {
> +            LValue mask = m_out.load32(base, m_heaps.JSObject_butterflyMask);
> +            offset = m_out.shl(m_out.zeroExtPtr(m_out.bitAnd(mask, index)), m_out.constIntPtr(logElementSize(type)));
> +        } else
> +            offset = m_out.shl(m_out.zeroExtPtr(index), m_out.constIntPtr(logElementSize(type)));

I think you can just make this.

if (m_indexMaskingMode == IndexMaskingEnabled)
    index = m_out.bitAnd(index, m_out.load32(base, m_heaps.JSObject_butterflyMask));
LValue offset = m_out.shl(m_out.zeroExtPtr(index), m_out.constIntPtr(logElementSize(type)));
Comment 4 Michael Saboff 2018-01-05 16:02:16 PST
(In reply to Keith Miller from comment #3)
> Comment on attachment 330599 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=330599&action=review
> 
> r=me with a nit.
> 
> > Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:13159
> > +        if (m_indexMaskingMode == IndexMaskingEnabled) {
> > +            LValue mask = m_out.load32(base, m_heaps.JSObject_butterflyMask);
> > +            offset = m_out.shl(m_out.zeroExtPtr(m_out.bitAnd(mask, index)), m_out.constIntPtr(logElementSize(type)));
> > +        } else
> > +            offset = m_out.shl(m_out.zeroExtPtr(index), m_out.constIntPtr(logElementSize(type)));
> 
> I think you can just make this.
> 
> if (m_indexMaskingMode == IndexMaskingEnabled)
>     index = m_out.bitAnd(index, m_out.load32(base,
> m_heaps.JSObject_butterflyMask));
> LValue offset = m_out.shl(m_out.zeroExtPtr(index),
> m_out.constIntPtr(logElementSize(type)));

Sure.  Done locally.
Comment 5 Michael Saboff 2018-01-05 16:37:10 PST
Committed r226474: <https://trac.webkit.org/changeset/226474>