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

Issue 14142008: Add support for more typed data types on native ports (Closed)

Created:
7 years, 8 months ago by Søren Gjesse
Modified:
7 years, 8 months ago
CC:
reviews_dartlang.org, siva
Visibility:
Public.

Description

Add support for more typed data types on native ports Renamed the kUint8Array type for a Dart_CObject structure to kByteArray to support all typed data types. The specific type is stored in a separate type field. No matter what the specific type is, the length of the byte array is always in bytes. R=ager@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=21423

Patch Set 1 #

Total comments: 8

Patch Set 2 : Addressed review comments #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+515 lines, -119 lines) Patch
M runtime/bin/dartutils.h View 1 5 chunks +70 lines, -11 lines 4 comments Download
M runtime/bin/dartutils.cc View 1 3 chunks +14 lines, -12 lines 0 comments Download
M runtime/bin/file.cc View 1 5 chunks +25 lines, -7 lines 0 comments Download
M runtime/include/dart_api.h View 1 3 chunks +20 lines, -4 lines 1 comment Download
M runtime/vm/dart_api_message.h View 1 1 chunk +3 lines, -2 lines 0 comments Download
M runtime/vm/dart_api_message.cc View 1 6 chunks +140 lines, -42 lines 2 comments Download
M runtime/vm/snapshot_test.cc View 1 8 chunks +149 lines, -41 lines 0 comments Download
M sdk/lib/io/common.dart View 1 chunk +2 lines, -0 lines 0 comments Download
M tests/standalone/io/file_typed_data_test.dart View 2 chunks +92 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Søren Gjesse
Added Int8, Int16 and Uint16. I will add the rest in a separate CL when ...
7 years, 8 months ago (2013-04-11 14:00:46 UTC) #1
Mads Ager (google)
LGTM https://codereview.chromium.org/14142008/diff/1/runtime/bin/dartutils.h File runtime/bin/dartutils.h (right): https://codereview.chromium.org/14142008/diff/1/runtime/bin/dartutils.h#newcode208 runtime/bin/dartutils.h:208: Dart_CObject::ByteArrayType byte_array_type() { Instead of ByteArray maybe we ...
7 years, 8 months ago (2013-04-12 09:03:45 UTC) #2
Søren Gjesse
Committed patchset #2 manually as r21423 (presubmit successful).
7 years, 8 months ago (2013-04-15 09:02:11 UTC) #3
Søren Gjesse
https://codereview.chromium.org/14142008/diff/1/runtime/bin/dartutils.h File runtime/bin/dartutils.h (right): https://codereview.chromium.org/14142008/diff/1/runtime/bin/dartutils.h#newcode208 runtime/bin/dartutils.h:208: Dart_CObject::ByteArrayType byte_array_type() { On 2013/04/12 09:03:46, Mads Ager wrote: ...
7 years, 8 months ago (2013-04-15 09:14:34 UTC) #4
siva
7 years, 8 months ago (2013-04-15 23:28:45 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/14142008/diff/6001/runtime/bin/dartutils.h
File runtime/bin/dartutils.h (right):

https://codereview.chromium.org/14142008/diff/6001/runtime/bin/dartutils.h#ne...
runtime/bin/dartutils.h:208: Dart_CObject::TypedDataType byte_array_type() {
for consistency should we name this typed_data_type() as well?

https://codereview.chromium.org/14142008/diff/6001/runtime/bin/dartutils.h#ne...
runtime/bin/dartutils.h:459: uint8_t* Buffer() const { return
cobject_->value.as_typed_data.values; }
probably need accessors:

Peer
Callback

etc. for the external typed data cases.

https://codereview.chromium.org/14142008/diff/6001/runtime/bin/dartutils.h#ne...
runtime/bin/dartutils.h:475: };
Is this class CObjectUint8Array still needed I could not find any references to
it in the code.

https://codereview.chromium.org/14142008/diff/6001/runtime/bin/dartutils.h#ne...
runtime/bin/dartutils.h:494: };
Can the code in file.cc that creates objects of ths class
(CObjectExternalUint8Array) be made to create CobjectTypedData objects. Then we
could get rid of this class too.

https://codereview.chromium.org/14142008/diff/6001/runtime/include/dart_api.h
File runtime/include/dart_api.h (right):

https://codereview.chromium.org/14142008/diff/6001/runtime/include/dart_api.h...
runtime/include/dart_api.h:969: kUint8Array,
Don't we also need the kUint8ClampedArray type here?

https://codereview.chromium.org/14142008/diff/6001/runtime/vm/dart_api_messag...
File runtime/vm/dart_api_message.cc (right):

https://codereview.chromium.org/14142008/diff/6001/runtime/vm/dart_api_messag...
runtime/vm/dart_api_message.cc:149: intptr_t length_in_bytes = SizeInBytes(type)
* length;
The code for SizeInBytes is duplicated here and in file.cc

Why not use
TypedData::ElementSizeInBytes(kInt8ArrayCid + (type -
Dart_Cobject::kInt8Array));

(Once kUint8ClampedArray is also added to the type list).

https://codereview.chromium.org/14142008/diff/6001/runtime/vm/dart_api_messag...
runtime/vm/dart_api_message.cc:259: }
Ditto comment about GetTypedDataTypeElementSize, maybe we could just use
TypedData::ElementSizeInBytes(cid);

Powered by Google App Engine
This is Rietveld 408576698