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

Issue 9368049: Add external byte array API and finalize external strings and byte arrays. (Closed)

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

Description

Add external byte array API and finalize external strings and byte arrays. This change adds peer and callback arguments to the external byte array constructor and moves the peer, callback, and data storage into a VM peer object. At construction time, a weak persistent handle and VM callback is associated with the VM peer. The VM callback will delete the VM peer and invokes the user callback to reclaim the user peer. This change also activates the callback support for the various classes of external strings. Committed: https://code.google.com/p/dart/source/detail?r=4164

Patch Set 1 #

Patch Set 2 : fix simarm and other minor changes #

Total comments: 4

Patch Set 3 : address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+458 lines, -80 lines) Patch
M runtime/include/dart_api.h View 1 2 3 chunks +33 lines, -3 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 5 chunks +70 lines, -7 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 2 4 chunks +147 lines, -2 lines 0 comments Download
M runtime/vm/dart_api_state.h View 1 2 3 chunks +14 lines, -8 lines 0 comments Download
M runtime/vm/gc_marker.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/object.h View 12 chunks +29 lines, -17 lines 0 comments Download
M runtime/vm/object.cc View 1 2 10 chunks +85 lines, -25 lines 0 comments Download
M runtime/vm/object_test.cc View 1 5 chunks +32 lines, -8 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 2 chunks +42 lines, -4 lines 0 comments Download
M runtime/vm/raw_object_snapshot.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M runtime/vm/scavenger.cc View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
cshapiro
8 years, 10 months ago (2012-02-10 01:50:22 UTC) #1
siva
LGTM after addressing the issue of deleting the WeakPersistentHandle when there is no user specified ...
8 years, 10 months ago (2012-02-11 03:00:58 UTC) #2
cshapiro
8 years, 10 months ago (2012-02-11 04:11:49 UTC) #3
http://codereview.chromium.org/9368049/diff/1010/runtime/vm/dart_api_impl.cc
File runtime/vm/dart_api_impl.cc (right):

http://codereview.chromium.org/9368049/diff/1010/runtime/vm/dart_api_impl.cc#...
runtime/vm/dart_api_impl.cc:1656: DARTSCOPE(Isolate::Current());
Sure, done.  I think it is okay for data to be NULL when length is 0.  I have
added code to fail all other cases with a NULL data value and when length is
negative.

http://codereview.chromium.org/9368049/diff/1010/runtime/vm/object.cc
File runtime/vm/object.cc (right):

http://codereview.chromium.org/9368049/diff/1010/runtime/vm/object.cc#newcode...
runtime/vm/object.cc:7344: weak_ref->set_callback(callback);
Yes, done.  The strategy I chose was to add a new type for the
WeakPersistentHandle finalizer.  This simplified the code in several places. 
For example, the callback passed into this function will always delete the
handle it is called with.

Powered by Google App Engine
This is Rietveld 408576698