Bug 159657 - [JSC] Array.prototype.join() fails some conformance tests
Summary: [JSC] Array.prototype.join() fails some conformance tests
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on: 159698
Blocks:
  Show dependency treegraph
 
Reported: 2016-07-11 16:57 PDT by Benjamin Poulain
Modified: 2016-07-12 18:26 PDT (History)
10 users (show)

See Also:


Attachments
Patch (19.83 KB, patch)
2016-07-11 17:05 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (887.12 KB, application/zip)
2016-07-11 18:12 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (915.38 KB, application/zip)
2016-07-11 18:16 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews126 for ios-simulator-wk2 (638.41 KB, application/zip)
2016-07-11 18:21 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews116 for mac-yosemite (1.43 MB, application/zip)
2016-07-11 18:25 PDT, Build Bot
no flags Details
Patch (33.89 KB, patch)
2016-07-11 18:55 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (34.08 KB, patch)
2016-07-11 19:59 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2016-07-11 16:57:26 PDT
[JSC] Array.prototype.join() fails some conformance tests
Comment 1 Benjamin Poulain 2016-07-11 17:05:50 PDT
Created attachment 283367 [details]
Patch
Comment 2 Build Bot 2016-07-11 18:12:36 PDT
Comment on attachment 283367 [details]
Patch

Attachment 283367 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1665731

New failing tests:
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T2.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T1.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T3.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T2.html
Comment 3 Build Bot 2016-07-11 18:12:40 PDT
Created attachment 283374 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-07-11 18:16:19 PDT
Comment on attachment 283367 [details]
Patch

Attachment 283367 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1665739

New failing tests:
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T2.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T1.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T3.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T2.html
Comment 5 Build Bot 2016-07-11 18:16:23 PDT
Created attachment 283375 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-07-11 18:21:43 PDT
Comment on attachment 283367 [details]
Patch

Attachment 283367 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1665744

New failing tests:
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T2.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T1.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T3.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T2.html
Comment 7 Build Bot 2016-07-11 18:21:47 PDT
Created attachment 283376 [details]
Archive of layout-test-results from ews126 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews126  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.5
Comment 8 Build Bot 2016-07-11 18:25:28 PDT
Comment on attachment 283367 [details]
Patch

Attachment 283367 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1665753

New failing tests:
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A2_T2.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T1.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T3.html
sputnik/Conformance/15_Native_Objects/15.4_Array/15.4.4/15.4.4.5_Array_prototype_join/S15.4.4.5_A4_T2.html
Comment 9 Build Bot 2016-07-11 18:25:33 PDT
Created attachment 283377 [details]
Archive of layout-test-results from ews116 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 10 Benjamin Poulain 2016-07-11 18:55:23 PDT
Created attachment 283380 [details]
Patch
Comment 11 Benjamin Poulain 2016-07-11 19:59:59 PDT
Created attachment 283382 [details]
Patch
Comment 12 Saam Barati 2016-07-12 12:46:48 PDT
Comment on attachment 283382 [details]
Patch

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

> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:533
> +        r = JSRopeString::create(vm, r, separator, next);

Can this allocation fail?

> Source/JavaScriptCore/runtime/ArrayPrototype.cpp:622
>  {

Suggestion: It might be worth caching a VM in a local variable for exception checks.
Comment 13 Saam Barati 2016-07-12 12:47:37 PDT
Comment on attachment 283382 [details]
Patch

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

> LayoutTests/js/script-tests/array-join.js:76
> +var calleeObject = {
> +    toString: () => { callSequence.push("callee.toString"); return "FAIL!"; },
> +    valueOf: () => { callSequence.push("calle.valueOf"); return "FAIL!"; },
> +    get length () { callSequence.push("calle.length"); return lengthObject; },
> +    get 0 () { callSequence.push("calle.get 0"); return index0Object; },
> +    get 1 () { callSequence.push("calle.get 1"); return index1Object; }
> +};

FWIW, it's quite easy to write these styles of tests using a Proxy object because a single trap will intercept all property accesses.
Comment 14 Benjamin Poulain 2016-07-12 14:47:05 PDT
Comment on attachment 283382 [details]
Patch

(In reply to comment #12)
> Comment on attachment 283382 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=283382&action=review
> 
> > Source/JavaScriptCore/runtime/ArrayPrototype.cpp:533
> > +        r = JSRopeString::create(vm, r, separator, next);
> 
> Can this allocation fail?

I am pretty sure we'd crash.

> > Source/JavaScriptCore/runtime/ArrayPrototype.cpp:622
> >  {
> 
> Suggestion: It might be worth caching a VM in a local variable for exception
> checks.

I don't think that buys up a lot here. The function would have to keep exec and vm live around the function calls. It is not the hot part anyway.

(In reply to comment #13)
> Comment on attachment 283382 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=283382&action=review
> 
> > LayoutTests/js/script-tests/array-join.js:76
> > +var calleeObject = {
> > +    toString: () => { callSequence.push("callee.toString"); return "FAIL!"; },
> > +    valueOf: () => { callSequence.push("calle.valueOf"); return "FAIL!"; },
> > +    get length () { callSequence.push("calle.length"); return lengthObject; },
> > +    get 0 () { callSequence.push("calle.get 0"); return index0Object; },
> > +    get 1 () { callSequence.push("calle.get 1"); return index1Object; }
> > +};
> 
> FWIW, it's quite easy to write these styles of tests using a Proxy object
> because a single trap will intercept all property accesses.

I should really spend some time learning Proxy then!
Comment 15 WebKit Commit Bot 2016-07-12 15:09:17 PDT
Comment on attachment 283382 [details]
Patch

Clearing flags on attachment: 283382

Committed r203131: <http://trac.webkit.org/changeset/203131>
Comment 16 WebKit Commit Bot 2016-07-12 15:09:25 PDT
All reviewed patches have been landed.  Closing bug.
Comment 17 Ryan Haddad 2016-07-12 16:35:01 PDT
This change appears to have caused fast/history/replacestate-nocrash.html to time out on Mac and ios-sim debug testers

https://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=fast%2Fhistory%2Freplacestate-nocrash.html
Comment 18 WebKit Commit Bot 2016-07-12 17:19:53 PDT
Re-opened since this is blocked by bug 159698
Comment 19 Benjamin Poulain 2016-07-12 18:26:11 PDT
Committed r203147: <http://trac.webkit.org/changeset/203147>