Bug 159542 - We may add a ReadOnly property without setting the corresponding bit on Structure
Summary: We may add a ReadOnly property without setting the corresponding bit on Struc...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-07-07 20:11 PDT by Saam Barati
Modified: 2016-07-08 18:30 PDT (History)
12 users (show)

See Also:


Attachments
patch (3.02 KB, patch)
2016-07-08 17:21 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-07-07 20:11:43 PDT
...
Comment 1 Saam Barati 2016-07-07 20:13:06 PDT
<rdar://problem/27084591>
Comment 2 Saam Barati 2016-07-08 17:21:07 PDT
Created attachment 283228 [details]
patch
Comment 3 Saam Barati 2016-07-08 17:22:08 PDT
Comment on attachment 283228 [details]
patch

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

> Source/JavaScriptCore/runtime/JSObject.h:1569
> +    if (attributes & ReadOnly)
> +        structure->setContainsReadOnlyProperties();

I put this here to be consistent with JSObject::putDirectInternal,
but I almost feel like putting it inside Structure::addPropertyWithoutTransition
is a more natural place for it.
Comment 4 Benjamin Poulain 2016-07-08 17:29:21 PDT
Comment on attachment 283228 [details]
patch

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

>> Source/JavaScriptCore/runtime/JSObject.h:1569
>> +        structure->setContainsReadOnlyProperties();
> 
> I put this here to be consistent with JSObject::putDirectInternal,
> but I almost feel like putting it inside Structure::addPropertyWithoutTransition
> is a more natural place for it.

I think that makes sense in addPropertyWithoutTransition() for both call sites. What's wrong with that?
Comment 5 Saam Barati 2016-07-08 17:33:50 PDT
Comment on attachment 283228 [details]
patch

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

>>> Source/JavaScriptCore/runtime/JSObject.h:1569
>>> +        structure->setContainsReadOnlyProperties();
>> 
>> I put this here to be consistent with JSObject::putDirectInternal,
>> but I almost feel like putting it inside Structure::addPropertyWithoutTransition
>> is a more natural place for it.
> 
> I think that makes sense in addPropertyWithoutTransition() for both call sites. What's wrong with that?

I agree. I'm going to open another bug to consider this. I think we should also consider the Structure::addNewPropertyTransition to have it mark the bit on the new transition it's returning.
Comment 6 Saam Barati 2016-07-08 18:09:59 PDT
I opened:
https://bugs.webkit.org/show_bug.cgi?id=159593
Comment 7 WebKit Commit Bot 2016-07-08 18:30:35 PDT
Comment on attachment 283228 [details]
patch

Clearing flags on attachment: 283228

Committed r203015: <http://trac.webkit.org/changeset/203015>
Comment 8 WebKit Commit Bot 2016-07-08 18:30:40 PDT
All reviewed patches have been landed.  Closing bug.