Bug 159286

Summary: [JSC] Minor TypedArray fixes
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, keith_miller, mark.lam, msaboff, ossy, rniwa, sbarati
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews114 for mac-yosemite
none
Archive of layout-test-results from ews102 for mac-yosemite
none
Archive of layout-test-results from ews104 for mac-yosemite-wk2
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch for landing
none
Patch none

Description Benjamin Poulain 2016-06-29 17:50:42 PDT
[JSC] Minor TypedArray fixes
Comment 1 Benjamin Poulain 2016-06-29 18:03:40 PDT
Created attachment 282399 [details]
Patch
Comment 2 Build Bot 2016-06-29 18:45:22 PDT
Comment on attachment 282399 [details]
Patch

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

Number of test failures exceeded the failure limit.
Comment 3 Build Bot 2016-06-29 18:45:25 PDT
Created attachment 282403 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-06-29 18:50:36 PDT
Comment on attachment 282399 [details]
Patch

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

New failing tests:
js/dom/constructor-length.html
Comment 5 Build Bot 2016-06-29 18:50:39 PDT
Created attachment 282404 [details]
Archive of layout-test-results from ews102 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-06-29 18:54:50 PDT
Comment on attachment 282399 [details]
Patch

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

New failing tests:
js/dom/constructor-length.html
Comment 7 Build Bot 2016-06-29 18:54:53 PDT
Created attachment 282406 [details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 8 Build Bot 2016-06-29 19:01:12 PDT
Comment on attachment 282399 [details]
Patch

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

New failing tests:
js/dom/constructor-length.html
Comment 9 Build Bot 2016-06-29 19:01:15 PDT
Created attachment 282408 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 10 Keith Miller 2016-06-29 19:52:05 PDT
Comment on attachment 282399 [details]
Patch

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

r=me with comment. Assuming the other failing test is just a rebaseline.

> Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp:77
>      JSArrayBufferView* thisObject = jsDynamicCast<JSArrayBufferView*>(exec->argument(0));
> -    if (!thisObject)
> +    if (!thisObject || thisObject->mode() == DataViewMode)
>          return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view"));

I think this would be better as: 

if (!exec->argument(0).isCell() || !isTypedView(exec->argument(0).asCell()->type()))
    return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view"));

JSArrayBufferView* thisObject = jsCast<JSArrayBufferView*>(exec->argument(0));
Comment 11 Keith Miller 2016-06-29 19:54:15 PDT
Comment on attachment 282399 [details]
Patch

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

>> Source/JavaScriptCore/runtime/JSTypedArrayViewPrototype.cpp:77
>>          return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view"));
> 
> I think this would be better as: 
> 
> if (!exec->argument(0).isCell() || !isTypedView(exec->argument(0).asCell()->type()))
>     return throwVMError(exec, createTypeError(exec, "Receiver should be a typed array view"));
> 
> JSArrayBufferView* thisObject = jsCast<JSArrayBufferView*>(exec->argument(0));

actually I think the return can be:

return throwVMTypeError(exec, "Receiver should be a typed array view");
Comment 12 Benjamin Poulain 2016-06-29 20:49:06 PDT
Created attachment 282411 [details]
Patch for landing
Comment 13 Benjamin Poulain 2016-06-29 20:49:40 PDT
Comment on attachment 282411 [details]
Patch for landing

WTF WebKit-patch :(
Comment 14 Benjamin Poulain 2016-06-29 20:52:36 PDT
Created attachment 282412 [details]
Patch
Comment 15 WebKit Commit Bot 2016-06-29 21:25:16 PDT
Comment on attachment 282412 [details]
Patch

Clearing flags on attachment: 282412

Committed r202667: <http://trac.webkit.org/changeset/202667>
Comment 16 WebKit Commit Bot 2016-06-29 21:25:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 17 Joseph Pecoraro 2016-06-29 21:31:56 PDT
Comment on attachment 282412 [details]
Patch

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

> LayoutTests/platform/mac/js/dom/constructor-length-expected.txt:45
> -PASS Uint16Array.length is 3
> -PASS Uint32Array.length is 3
> -PASS Uint8Array.length is 3
> -PASS Uint8ClampedArray.length is 3
> +FAIL Uint16Array.length should be 3. Was 0.
> +FAIL Uint32Array.length should be 3. Was 0.
> +FAIL Uint8Array.length should be 3. Was 0.
> +FAIL Uint8ClampedArray.length should be 3. Was 0.

These are FAILs. Probably should update the test to expect 0?
Comment 18 Benjamin Poulain 2016-06-29 21:58:18 PDT
(In reply to comment #17)
> These are FAILs. Probably should update the test to expect 0?

Duh! I did a rebaseline without looking at the result.
I'll fix that.
Comment 19 Benjamin Poulain 2016-06-29 22:10:48 PDT
Follow up: http://trac.webkit.org/changeset/202672
Comment 20 Csaba Osztrogon√°c 2016-06-30 01:10:06 PDT
(In reply to comment #15)
> Comment on attachment 282412 [details]
> Patch
> 
> Clearing flags on attachment: 282412
> 
> Committed r202667: <http://trac.webkit.org/changeset/202667>

This patch ( or bug159285 ) made many JSC tests assert:
https://build.webkit.org/builders/Apple%20El%20Capitan%20Debug%20JSC%20%28Tests%29/builds/3307
Comment 21 Csaba Osztrogon√°c 2016-06-30 08:45:07 PDT
Just to document, fixed by https://trac.webkit.org/changeset/202673