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

Issue 9195031: Add ByteArray interface and provide internal and external implementations. (Closed)

Created:
8 years, 11 months ago by cshapiro
Modified:
8 years, 11 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Add ByteArray interface and provide internal and external implementations. The new ByteArray interface supersedes the ByteBuffer type which allowed only external data storage. This type has been removed and replaced by the more flexible ByteArray with a default implementation that stores its elements on the managed heap. Committed: https://code.google.com/p/dart/source/detail?r=3613

Patch Set 1 #

Total comments: 34

Patch Set 2 : memorial macrology #

Patch Set 3 : fewer templates #

Total comments: 16

Patch Set 4 : remove copy paste error, use GET_NATIVE_ARGUMENT #

Patch Set 5 : fix bad upload #

Patch Set 6 : address remaining review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1376 lines, -578 lines) Patch
M runtime/include/dart_api.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
A runtime/lib/byte_array.cc View 1 2 3 4 1 chunk +258 lines, -0 lines 0 comments Download
A runtime/lib/byte_array.dart View 1 2 3 4 5 1 chunk +489 lines, -0 lines 0 comments Download
D runtime/lib/byte_buffer.cc View 1 chunk +0 lines, -233 lines 0 comments Download
D runtime/lib/byte_buffer.dart View 1 chunk +0 lines, -226 lines 0 comments Download
M runtime/lib/lib_sources.gypi View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/bootstrap_natives.h View 1 chunk +42 lines, -22 lines 0 comments Download
M runtime/vm/class_finalizer.cc View 2 chunks +7 lines, -4 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 5 2 chunks +19 lines, -1 line 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 1 chunk +53 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 4 5 4 chunks +95 lines, -7 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 7 chunks +91 lines, -34 lines 0 comments Download
M runtime/vm/object_store.h View 4 chunks +23 lines, -5 lines 0 comments Download
M runtime/vm/object_store.cc View 5 chunks +12 lines, -4 lines 0 comments Download
M runtime/vm/object_test.cc View 1 5 chunks +128 lines, -24 lines 0 comments Download
M runtime/vm/raw_object.h View 2 chunks +23 lines, -3 lines 0 comments Download
M runtime/vm/raw_object.cc View 2 chunks +28 lines, -3 lines 0 comments Download
M runtime/vm/raw_object_snapshot.cc View 1 chunk +97 lines, -10 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
cshapiro
8 years, 11 months ago (2012-01-20 00:40:55 UTC) #1
siva
http://codereview.chromium.org/9195031/diff/1/runtime/lib/byte_array.cc File runtime/lib/byte_array.cc (right): http://codereview.chromium.org/9195031/diff/1/runtime/lib/byte_array.cc#newcode1 runtime/lib/byte_array.cc:1: // Copyright (c) 2011, the Dart project authors. Please ...
8 years, 11 months ago (2012-01-20 22:51:04 UTC) #2
Søren Gjesse
Drive by comments... http://codereview.chromium.org/9195031/diff/1/runtime/lib/byte_array.dart File runtime/lib/byte_array.dart (right): http://codereview.chromium.org/9195031/diff/1/runtime/lib/byte_array.dart#newcode22 runtime/lib/byte_array.dart:22: int getUint16(int byteOffset); I think that ...
8 years, 11 months ago (2012-01-23 10:38:51 UTC) #3
cshapiro
PTAL http://codereview.chromium.org/9195031/diff/1/runtime/lib/byte_array.cc File runtime/lib/byte_array.cc (right): http://codereview.chromium.org/9195031/diff/1/runtime/lib/byte_array.cc#newcode7 runtime/lib/byte_array.cc:7: #include "vm/assembler.h" True. In fact, both assembler.h and ...
8 years, 11 months ago (2012-01-24 02:14:23 UTC) #4
siva
lgtm http://codereview.chromium.org/9195031/diff/1/runtime/lib/byte_array.dart File runtime/lib/byte_array.dart (right): http://codereview.chromium.org/9195031/diff/1/runtime/lib/byte_array.dart#newcode22 runtime/lib/byte_array.dart:22: int getUint16(int byteOffset); Ok got it. On 2012/01/24 ...
8 years, 11 months ago (2012-01-25 17:22:47 UTC) #5
cshapiro
http://codereview.chromium.org/9195031/diff/9001/runtime/lib/byte_array.cc File runtime/lib/byte_array.cc (right): http://codereview.chromium.org/9195031/diff/9001/runtime/lib/byte_array.cc#newcode76 runtime/lib/byte_array.cc:76: value ^= value_instance.raw(); \ How embarrassing. You are correct.
8 years, 11 months ago (2012-01-25 23:48:46 UTC) #6
Ivan Posva
LGTM with comments. -Ivan https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/lib/byte_array.cc File runtime/lib/byte_array.cc (right): https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/lib/byte_array.cc#newcode34 runtime/lib/byte_array.cc:34: const Instance& index_instance = Instance::CheckedHandle(arguments->At(1)); ...
8 years, 11 months ago (2012-01-25 23:49:57 UTC) #7
cshapiro
8 years, 11 months ago (2012-01-26 02:25:42 UTC) #8
https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/lib/byte_arr...
File runtime/lib/byte_array.cc (right):

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/lib/byte_arr...
runtime/lib/byte_array.cc:34: const Instance& index_instance =
Instance::CheckedHandle(arguments->At(1));
Removed entirely.

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/lib/byte_arr...
runtime/lib/byte_array.cc:57: const Instance& array_instance =                  
                   \
Yes, that looks much better.  Done.

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/lib/byte_arr...
runtime/lib/byte_array.cc:82: const Instance& array_instance =                  
                   \
Yup.  Done.

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/lib/byte_arr...
File runtime/lib/byte_array.dart (right):

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/lib/byte_arr...
runtime/lib/byte_array.dart:52: class ByteArrayBase {
Done.

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/lib/byte_arr...
runtime/lib/byte_array.dart:71: return Collections.map(this, new
GrowableObjectArray.withCapacity(length), f);
Fixed

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/vm/object.cc...
runtime/vm/object.cc:7479: result.SetLength(len);
Right.  I assumed we zero initialized.  Fixed.

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/vm/object.h
File runtime/vm/object.h (right):

https://chromiumcodereview.appspot.com/9195031/diff/9001/runtime/vm/object.h#...
runtime/vm/object.h:3308: static RawInternalByteArray* New(const uint8_t*
characters,
Well, they are characters in the C sense.  That is probably a bit confusing.  I
have renamed this data, like we have in the definition of the implementation.

Powered by Google App Engine
This is Rietveld 408576698