Bug 186898

Summary: ensureWritableX should only convert away from CoW when it will succeed
Product: WebKit Reporter: Saam Barati <saam>
Component: JavaScriptCoreAssignee: Saam Barati <saam>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, fpizlo, ggaren, gskachkov, jfbastien, keith_miller, mark.lam, msaboff, rmorisset, ticaiolima, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
keith_miller: review+
patch for landing none

Description Saam Barati 2018-06-21 15:09:17 PDT
Otherwise, we'll end up seeing non CoW in the array profile during OSR exit
Comment 1 Saam Barati 2018-06-21 16:34:18 PDT
Created attachment 343288 [details]
patch
Comment 2 Keith Miller 2018-06-21 16:38:08 PDT
Comment on attachment 343288 [details]
patch

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

> Source/JavaScriptCore/runtime/JSObject.cpp:1482
> +        if (hasInt32(indexingMode())) {

Nit I would do: leastUpperBoundOfIndexingTypes(indexingType() & IndexingShapeMask, Int32Shape) == Int32Shape

> Source/JavaScriptCore/runtime/JSObject.cpp:1517
> +        if (hasDouble(indexingMode()) || hasInt32(indexingMode())) {

Nit I would do: leastUpperBoundOfIndexingTypes(indexingType() & IndexingShapeMask, DoubleShape) == DoubleShape

> Source/JavaScriptCore/runtime/JSObject.cpp:1556
> +        if (hasContiguous(indexingMode()) || hasInt32(indexingMode()) || hasDouble(indexingMode())) {

Nit I would do: leastUpperBoundOfIndexingTypes(indexingType() & IndexingShapeMask, ContiguousShape) == ContiguousShape
Comment 3 Keith Miller 2018-06-21 16:38:27 PDT
r=me
Comment 4 Saam Barati 2018-06-21 16:59:36 PDT
Created attachment 343290 [details]
patch for landing
Comment 5 WebKit Commit Bot 2018-06-22 14:02:07 PDT
Comment on attachment 343290 [details]
patch for landing

Clearing flags on attachment: 343290

Committed r233098: <https://trac.webkit.org/changeset/233098>
Comment 6 WebKit Commit Bot 2018-06-22 14:02:08 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2018-06-22 14:03:19 PDT
<rdar://problem/41380999>