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

Issue 11360114: - Add functionality to morph a string into an external string (Closed)

Created:
8 years, 1 month ago by siva
Modified:
8 years, 1 month ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

- Add functionality to morph a string into an external string - Add Dart API call Dart_MakeExternalString Committed: https://code.google.com/p/dart/source/detail?r=14978

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 23

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Total comments: 8

Patch Set 8 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+373 lines, -40 lines) Patch
M include/dart_api.h View 1 2 3 4 5 6 7 1 chunk +39 lines, -0 lines 0 comments Download
M vm/dart_api_impl.cc View 1 2 3 4 5 6 7 1 chunk +45 lines, -0 lines 0 comments Download
M vm/dart_api_impl_test.cc View 1 2 3 4 5 6 7 1 chunk +146 lines, -0 lines 0 comments Download
M vm/object.h View 1 2 3 4 5 6 7 3 chunks +15 lines, -0 lines 0 comments Download
M vm/object.cc View 1 2 3 4 5 6 7 4 chunks +128 lines, -40 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
siva
8 years, 1 month ago (2012-11-07 00:11:25 UTC) #1
Tom Ball
lgtm. http://codereview.chromium.org/11360114/diff/10001/vm/dart_api_impl.cc File vm/dart_api_impl.cc (right): http://codereview.chromium.org/11360114/diff/10001/vm/dart_api_impl.cc#newcode1719 vm/dart_api_impl.cc:1719: RETURN_TYPE_ERROR(isolate, str, String); Is passing in an external ...
8 years, 1 month ago (2012-11-07 00:38:43 UTC) #2
Anton Muhin
http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h File include/dart_api.h (right): http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h#newcode1487 include/dart_api.h:1487: * Converts a String into an ExternalString. From the ...
8 years, 1 month ago (2012-11-07 10:05:46 UTC) #3
siva
http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h File include/dart_api.h (right): http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h#newcode1487 include/dart_api.h:1487: * Converts a String into an ExternalString. On 2012/11/07 ...
8 years, 1 month ago (2012-11-07 21:43:26 UTC) #4
Anton Muhin
http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h File include/dart_api.h (right): http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h#newcode1487 include/dart_api.h:1487: * Converts a String into an ExternalString. On 2012/11/07 ...
8 years, 1 month ago (2012-11-08 08:05:28 UTC) #5
Ivan Posva
http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h File include/dart_api.h (right): http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h#newcode1487 include/dart_api.h:1487: * Converts a String into an ExternalString. On 2012/11/08 ...
8 years, 1 month ago (2012-11-08 08:50:46 UTC) #6
Anton Muhin
http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h File include/dart_api.h (right): http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h#newcode1487 include/dart_api.h:1487: * Converts a String into an ExternalString. I am ...
8 years, 1 month ago (2012-11-08 08:56:08 UTC) #7
siva
Added an API function to determine the storage size. http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h File include/dart_api.h (right): http://codereview.chromium.org/11360114/diff/10001/include/dart_api.h#newcode1500 include/dart_api.h:1500: ...
8 years, 1 month ago (2012-11-09 02:55:06 UTC) #8
Anton Muhin
lgtm and thanks a lot, Siva.
8 years, 1 month ago (2012-11-09 12:51:28 UTC) #9
siva
synched up to TOT.
8 years, 1 month ago (2012-11-12 19:37:31 UTC) #10
siva
synched up to TOT and resolved conflicts (hint hint).
8 years, 1 month ago (2012-11-15 01:53:43 UTC) #11
Ivan Posva
LGTM with comments. -Ivan https://codereview.chromium.org/11360114/diff/25005/include/dart_api.h File include/dart_api.h (right): https://codereview.chromium.org/11360114/diff/25005/include/dart_api.h#newcode1495 include/dart_api.h:1495: DART_EXPORT Dart_Handle Dart_StringStorageSize(Dart_Handle str, intptr_t* ...
8 years, 1 month ago (2012-11-15 06:17:15 UTC) #12
siva
8 years, 1 month ago (2012-11-15 21:34:13 UTC) #13
https://codereview.chromium.org/11360114/diff/25005/include/dart_api.h
File include/dart_api.h (right):

https://codereview.chromium.org/11360114/diff/25005/include/dart_api.h#newcod...
include/dart_api.h:1495: DART_EXPORT Dart_Handle
Dart_StringStorageSize(Dart_Handle str, intptr_t* size);
Added comments to both Dart_StringStorageSize and
Dart_MakeExternalString.

On 2012/11/15 06:17:15, Ivan Posva wrote:
> I read the description and it is not clear to me whether this is the per
indexed
> value storage size or the size needed to store this String. Maybe you can add
an
> example how this is supposed to be used in conjunction with
> Dart_MakeExternalString?
> 
> Basically should I do:
> 
> intptr_t size;
> Dart_StringStorageSize(str, &size);
> void* data = malloc(size);
> 
> or
> 
> intptr_t len;
> Dart_StringLength(str, &len);
> intptr_t size;
> Dart_StringStorageSize(str, &size);
> void* data = malloc(size * len);

https://codereview.chromium.org/11360114/diff/25005/vm/object.cc
File vm/object.cc (right):

https://codereview.chromium.org/11360114/diff/25005/vm/object.cc#newcode486
vm/object.cc:486: ASSERT(!obj.IsNull());
On 2012/11/15 06:17:15, Ivan Posva wrote:
> ASSERT(original_size >= used_size);

Done.

https://codereview.chromium.org/11360114/diff/25005/vm/object.cc#newcode500
vm/object.cc:500: ((leftover_size - Array::InstanceSize(0)) / kWordSize);
On 2012/11/15 06:17:15, Ivan Posva wrote:
> ASSERT(Array::InstanceSize(leftover_len) == leftover_size);

Done.

https://codereview.chromium.org/11360114/diff/25005/vm/raw_object.h
File vm/raw_object.h (right):

https://codereview.chromium.org/11360114/diff/25005/vm/raw_object.h#newcode1215
vm/raw_object.h:1215: friend class String;
On 2012/11/15 06:17:15, Ivan Posva wrote:
> I don't think this is needed any longer.

Done.

Powered by Google App Engine
This is Rietveld 408576698