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

Issue 12036098: First set of changes towards cleaning up the bytearray access APIs (Closed)

Created:
7 years, 11 months ago by siva
Modified:
7 years, 10 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

First set of changes towards cleaning up the bytearray access APIs - Added unimplemented versions of Dart_ByteArrayAcquireData and Dart_ByteArrayReleaseData - Added infrastructure to prevent callbacks into an API function that allocates a new object on the Dart heap or invokes dart code. - Removed the old Dart_ByteArrayGet* access functions as it was felt that they have become redundant once we provide direct access to the internal data pointers. - Removed DARTSCOPE_NOCHECKS as it seems to be redundant after the change to not create explicit stack zones on each Dart API call. Committed: https://code.google.com/p/dart/source/detail?r=17958

Patch Set 1 #

Patch Set 2 : #

Total comments: 2

Patch Set 3 : #

Total comments: 6

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+267 lines, -720 lines) Patch
M include/dart_api.h View 1 2 3 2 chunks +38 lines, -289 lines 0 comments Download
M vm/base_isolate.h View 1 2 3 3 chunks +18 lines, -4 lines 0 comments Download
M vm/dart_api_impl.h View 1 2 3 3 chunks +23 lines, -5 lines 0 comments Download
M vm/dart_api_impl.cc View 1 2 3 58 chunks +116 lines, -178 lines 0 comments Download
M vm/dart_api_impl_test.cc View 1 2 3 21 chunks +47 lines, -238 lines 0 comments Download
M vm/dart_api_state.h View 1 2 3 3 chunks +16 lines, -1 line 0 comments Download
M vm/dart_entry.cc View 1 2 3 3 chunks +3 lines, -0 lines 0 comments Download
M vm/object.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M vm/snapshot_test.cc View 1 2 3 5 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
siva
7 years, 11 months ago (2013-01-25 00:39:09 UTC) #1
Tom Ball
Looks good so far, couldn't find any mistakes. Since this API exposes raw arrays to ...
7 years, 11 months ago (2013-01-25 02:13:47 UTC) #2
Anton Muhin
https://chromiumcodereview.appspot.com/12036098/diff/7001/include/dart_api.h File include/dart_api.h (right): https://chromiumcodereview.appspot.com/12036098/diff/7001/include/dart_api.h#newcode1737 include/dart_api.h:1737: DART_EXPORT Dart_Handle Dart_ByteArrayAcquireData(Dart_Handle array, Maybe something like ScalarList instead ...
7 years, 11 months ago (2013-01-25 13:11:53 UTC) #3
siva
https://chromiumcodereview.appspot.com/12036098/diff/7001/include/dart_api.h File include/dart_api.h (right): https://chromiumcodereview.appspot.com/12036098/diff/7001/include/dart_api.h#newcode1737 include/dart_api.h:1737: DART_EXPORT Dart_Handle Dart_ByteArrayAcquireData(Dart_Handle array, Agree will change all the ...
7 years, 10 months ago (2013-01-25 17:54:15 UTC) #4
siva
7 years, 10 months ago (2013-01-25 18:45:56 UTC) #5
Ivan Posva
LGTM with a couple of comments. -Ivan https://codereview.chromium.org/12036098/diff/11002/include/dart_api.h File include/dart_api.h (right): https://codereview.chromium.org/12036098/diff/11002/include/dart_api.h#newcode1706 include/dart_api.h:1706: typedef enum ...
7 years, 10 months ago (2013-01-29 01:54:03 UTC) #6
siva
7 years, 10 months ago (2013-01-31 01:54:45 UTC) #7
https://codereview.chromium.org/12036098/diff/11002/include/dart_api.h
File include/dart_api.h (right):

https://codereview.chromium.org/12036098/diff/11002/include/dart_api.h#newcod...
include/dart_api.h:1706: typedef enum {
On 2013/01/29 01:54:03, Ivan Posva wrote:
> Move this up to the beginning of the scalar list section. It will be needed as
> part of creating new scalar lists.

Done.

https://codereview.chromium.org/12036098/diff/11002/vm/dart_api_impl.cc
File vm/dart_api_impl.cc (right):

https://codereview.chromium.org/12036098/diff/11002/vm/dart_api_impl.cc#newco...
vm/dart_api_impl.cc:2306: CHECK_CALLBACK_STATE(isolate);
On 2013/01/29 01:54:03, Ivan Posva wrote:
> Is there a way to make sure that this macro was added for all code that can
> allocate or call into Dart?

I have added an assert in the 3 entrypoints to dart and in Object::Allocate (I
don't think c++ code uses the inline allocations stubs so we should be covered).

https://codereview.chromium.org/12036098/diff/11002/vm/dart_api_impl.h
File vm/dart_api_impl.h (right):

https://codereview.chromium.org/12036098/diff/11002/vm/dart_api_impl.h#newcod...
vm/dart_api_impl.h:107: // Sets up the callback error object after initializing
an Isolate. This
I believe it should be possible to do that, currently null, true, false and this
new object are set up on a per isolate basis. In a separate CL I will make these
handles static fields and initialize them in the VM isolate.

On 2013/01/29 01:54:03, Ivan Posva wrote:
> Can this callback error object be pre-allocated in the VM isolate?

Powered by Google App Engine
This is Rietveld 408576698