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

Issue 9235067: Use ByteArray's native for Socket and File. (Closed)

Created:
8 years, 11 months ago by Anders Johnsen
Modified:
8 years, 10 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Use ByteArray's native for Socket and File. Committed: https://code.google.com/p/dart/source/detail?r=3812

Patch Set 1 #

Total comments: 19

Patch Set 2 : '' #

Total comments: 32

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 8

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 18

Patch Set 7 : '' #

Total comments: 16

Patch Set 8 : '' #

Total comments: 4

Patch Set 9 : '' #

Patch Set 10 : '' #

Total comments: 6

Patch Set 11 : '' #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+293 lines, -42 lines) Patch
M runtime/bin/buffer_list.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M runtime/bin/file_impl.dart View 1 2 3 4 5 6 7 8 9 10 3 chunks +15 lines, -10 lines 0 comments Download
M runtime/bin/socket_impl.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +11 lines, -6 lines 0 comments Download
M runtime/bin/socket_stream_impl.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -3 lines 0 comments Download
M runtime/lib/byte_array.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +26 lines, -5 lines 0 comments Download
M runtime/lib/byte_array.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +24 lines, -0 lines 5 comments Download
runtime/platform/utils.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +12 lines, -0 lines 0 comments Download
M runtime/vm/bootstrap_natives.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +24 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +39 lines, -15 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +26 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +51 lines, -2 lines 0 comments Download
A tests/standalone/src/ByteArrayTest.dart View 1 2 3 4 5 6 7 8 1 chunk +60 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
Anders Johnsen
Utilize the new ByteArray for Socket and File. This also makes the API methods Dart_ListGetAsBytes, ...
8 years, 11 months ago (2012-01-26 19:38:13 UTC) #1
cshapiro
http://codereview.chromium.org/9235067/diff/1/runtime/bin/socket_impl.dart File runtime/bin/socket_impl.dart (right): http://codereview.chromium.org/9235067/diff/1/runtime/bin/socket_impl.dart#newcode312 runtime/bin/socket_impl.dart:312: List<int> outBuffer; I think this can safely be retyped ...
8 years, 11 months ago (2012-01-27 23:00:04 UTC) #2
Anders Johnsen
Let me know if you want me to move the ByteArray-case down below the ArrayCase. ...
8 years, 11 months ago (2012-01-27 23:42:39 UTC) #3
cshapiro
http://codereview.chromium.org/9235067/diff/9001/runtime/bin/file_impl.dart File runtime/bin/file_impl.dart (right): http://codereview.chromium.org/9235067/diff/9001/runtime/bin/file_impl.dart#newcode22 runtime/bin/file_impl.dart:22: List<int> result = new ByteArray(bytesToRead); This can be a ...
8 years, 11 months ago (2012-01-28 02:25:48 UTC) #4
Anders Johnsen
Thank you for the review, spotted some very good corners! I've fixed the cases in ...
8 years, 10 months ago (2012-01-30 21:15:28 UTC) #5
Anders Johnsen
Spotted a very bad bug! Fixed and uploaded.
8 years, 10 months ago (2012-01-30 21:30:48 UTC) #6
cshapiro
lgtm http://codereview.chromium.org/9235067/diff/16002/runtime/lib/byte_array.dart File runtime/lib/byte_array.dart (right): http://codereview.chromium.org/9235067/diff/16002/runtime/lib/byte_array.dart#newcode99 runtime/lib/byte_array.dart:99: if (value is! int || !(value >= 0 ...
8 years, 10 months ago (2012-01-31 03:04:29 UTC) #7
cshapiro
http://codereview.chromium.org/9235067/diff/16002/runtime/vm/object.cc File runtime/vm/object.cc (right): http://codereview.chromium.org/9235067/diff/16002/runtime/vm/object.cc#newcode7544 runtime/vm/object.cc:7544: ASSERT(Utils::RangeCheck(dst_offset, length, dst.Length())); This function does not yet seem ...
8 years, 10 months ago (2012-01-31 03:12:03 UTC) #8
Anders Johnsen
Updated with utils.h. It would be great if you could give a quick look (utils.h), ...
8 years, 10 months ago (2012-01-31 03:34:56 UTC) #9
Anders Johnsen
Added Ivan as review.
8 years, 10 months ago (2012-01-31 20:18:40 UTC) #10
Anders Johnsen
Kept the local RangeCheck in byte_array.cc, but uses it a few more places. It's a ...
8 years, 10 months ago (2012-01-31 20:41:17 UTC) #11
Ivan Posva
http://codereview.chromium.org/9235067/diff/23001/runtime/lib/byte_array.cc File runtime/lib/byte_array.cc (right): http://codereview.chromium.org/9235067/diff/23001/runtime/lib/byte_array.cc#newcode33 runtime/lib/byte_array.cc:33: static void RangeCheck(const ByteArray& array, const Smi& index, Why ...
8 years, 10 months ago (2012-02-01 01:05:27 UTC) #12
Ivan Posva
More comments. -Ivan http://codereview.chromium.org/9235067/diff/23001/runtime/bin/file_impl.dart File runtime/bin/file_impl.dart (right): http://codereview.chromium.org/9235067/diff/23001/runtime/bin/file_impl.dart#newcode431 runtime/bin/file_impl.dart:431: } else { How about not ...
8 years, 10 months ago (2012-02-01 01:12:41 UTC) #13
Anders Johnsen
Thank you for the feedback! Since I get some minor contradictions, I've left several of ...
8 years, 10 months ago (2012-02-01 02:12:10 UTC) #14
Søren Gjesse
dbc nits https://chromiumcodereview.appspot.com/9235067/diff/28003/runtime/bin/file_impl.dart File runtime/bin/file_impl.dart (right): https://chromiumcodereview.appspot.com/9235067/diff/28003/runtime/bin/file_impl.dart#newcode424 runtime/bin/file_impl.dart:424: // When using the Dart C API ...
8 years, 10 months ago (2012-02-01 08:16:08 UTC) #15
Anders Johnsen
Thank you for the feedback Soeren! I've added a new test file that actually exposed ...
8 years, 10 months ago (2012-02-01 18:54:53 UTC) #16
Ivan Posva
https://chromiumcodereview.appspot.com/9235067/diff/23001/runtime/bin/file_impl.dart File runtime/bin/file_impl.dart (right): https://chromiumcodereview.appspot.com/9235067/diff/23001/runtime/bin/file_impl.dart#newcode431 runtime/bin/file_impl.dart:431: } else { On 2012/02/01 02:12:11, ajohnsen wrote: > ...
8 years, 10 months ago (2012-02-01 20:01:34 UTC) #17
Anders Johnsen
I've updated the code to reflect the lasts comments both on and off this list. ...
8 years, 10 months ago (2012-02-01 20:20:41 UTC) #18
Ivan Posva
LGTM with comments. -Ivan https://chromiumcodereview.appspot.com/9235067/diff/22004/runtime/bin/file_impl.dart File runtime/bin/file_impl.dart (right): https://chromiumcodereview.appspot.com/9235067/diff/22004/runtime/bin/file_impl.dart#newcode429 runtime/bin/file_impl.dart:429: if (buffer is ByteArray) { ...
8 years, 10 months ago (2012-02-01 21:28:57 UTC) #19
Anders Johnsen
Fixed, and committed. Thank you all for the reviews. I've learned a lot here! https://chromiumcodereview.appspot.com/9235067/diff/22004/runtime/bin/file_impl.dart ...
8 years, 10 months ago (2012-02-01 21:48:14 UTC) #20
jat
http://codereview.chromium.org/9235067/diff/28035/runtime/lib/byte_array.dart File runtime/lib/byte_array.dart (right): http://codereview.chromium.org/9235067/diff/28035/runtime/lib/byte_array.dart#newcode5 runtime/lib/byte_array.dart:5: interface ByteArray extends List default _InternalByteArray { How will ...
8 years, 10 months ago (2012-02-01 23:09:29 UTC) #21
Anders Johnsen
http://codereview.chromium.org/9235067/diff/28035/runtime/lib/byte_array.dart File runtime/lib/byte_array.dart (right): http://codereview.chromium.org/9235067/diff/28035/runtime/lib/byte_array.dart#newcode5 runtime/lib/byte_array.dart:5: interface ByteArray extends List default _InternalByteArray { On 2012/02/01 ...
8 years, 10 months ago (2012-02-01 23:19:30 UTC) #22
Ivan Posva
8 years, 10 months ago (2012-02-02 08:26:42 UTC) #23
http://codereview.chromium.org/9235067/diff/28035/runtime/lib/byte_array.dart
File runtime/lib/byte_array.dart (right):

http://codereview.chromium.org/9235067/diff/28035/runtime/lib/byte_array.dart...
runtime/lib/byte_array.dart:5: interface ByteArray extends List default
_InternalByteArray {
On 2012/02/01 23:09:29, jat wrote:
> How will this interoperate with WebGL buffers?  Can an instance of this be
> passed directly, or will it have to be copied?  Likewise with XHR/WebSocket.

The plan was that if an internal ByteArray is handed to the WebGL bindings, then
we do either copy the contents or convert it to an external ByteArray (for
reference please see how the V8 bindings can convert heap allocated strings to
external strings to avoid further copies).

Handing out raw pointers into garbage collected heaps to graphics cards
guarantees crashes, long debugging sessions and I will get another plaque.

Powered by Google App Engine
This is Rietveld 408576698