Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Issue 124383007: Fix 15413: setRange for views with overlapping buffers. (Closed)

Created:
6 years, 11 months ago by srdjan
Modified:
6 years, 11 months ago
Reviewers:
Cutch, sra1
CC:
reviews_dartlang.org, vm-dev_dartlang.org, sra1
Visibility:
Public.

Description

Fix 15413: setRange for views with overlapping buffers. R=johnmccutchan@google.com Committed: https://code.google.com/p/dart/source/detail?r=31528

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -46 lines) Patch
M runtime/lib/typed_data.dart View 1 2 7 chunks +37 lines, -7 lines 4 comments Download
M runtime/vm/bootstrap_natives.h View 5 chunks +33 lines, -33 lines 0 comments Download
M tests/lib/lib.status View 1 2 3 3 chunks +1 line, -6 lines 0 comments Download
A tests/lib/typed_data/setRange_4_test.dart View 1 2 3 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
srdjan
6 years, 11 months ago (2014-01-06 22:05:25 UTC) #1
srdjan
Added a test for unclamped to clamped setRange. Marked dart2js as failing.
6 years, 11 months ago (2014-01-06 23:57:12 UTC) #2
Cutch
lgtm
6 years, 11 months ago (2014-01-07 00:02:40 UTC) #3
srdjan
Moved the clamping failure into its own test.
6 years, 11 months ago (2014-01-07 00:41:24 UTC) #4
srdjan
Committed patchset #4 manually as r31528 (presubmit successful).
6 years, 11 months ago (2014-01-07 00:48:52 UTC) #5
sra1
https://chromiumcodereview.appspot.com/124383007/diff/140001/runtime/lib/typed_data.dart File runtime/lib/typed_data.dart (right): https://chromiumcodereview.appspot.com/124383007/diff/140001/runtime/lib/typed_data.dart#newcode536 runtime/lib/typed_data.dart:536: if (this.buffer._setRange( this.buffer is a ByteBuffer. There is no ...
6 years, 11 months ago (2014-01-07 18:55:47 UTC) #6
srdjan
6 years, 11 months ago (2014-01-07 19:20:35 UTC) #7
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/124383007/diff/140001/runtime/lib/type...
File runtime/lib/typed_data.dart (right):

https://chromiumcodereview.appspot.com/124383007/diff/140001/runtime/lib/type...
runtime/lib/typed_data.dart:536: if (this.buffer._setRange(
OK.

On 2014/01/07 18:55:48, sra1 wrote:
> this.buffer is a ByteBuffer.
> There is no guarantee that is is a typed list.
> 
> Even this.buffer it is a typed list, this could be a Int8List view of a
> Float32List.
> 
> I have created a test for
underlying-buffer-has-different-element-size-to-view,
> which fails on the VM.

https://chromiumcodereview.appspot.com/124383007/diff/140001/runtime/lib/type...
runtime/lib/typed_data.dart:545: // an intermediate structure.
Yes, next CL.

On 2014/01/07 18:55:48, sra1 wrote:
> You never need an intermediate structure.
> You might need two loops going in different directions.
> 
> In setRange_3_test, the first copy needs
> (1) an up-loop copying a to aaaa, b to bbbb, c to cccc and d to dddd
> (2) a down-loop copying h to hhhh, g to gggg, f to ffff and e to eeee
> 
> The point of switch-over is the element that is copied to the same address.
> If there is no such address, then one loop is sufficient, but it might be the
> up-loop or the down-loop.  This is just a more general case of choosing loop
> direction in libc's memmove.

Powered by Google App Engine
This is Rietveld 408576698