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

Issue 8775039: Add Dart_IsExternalString and Dart_ExternalStringGetPeer to the dart (Closed)

Created:
9 years ago by turnidge
Modified:
9 years ago
Reviewers:
siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Nikolay, Anton Muhin
Visibility:
Public.

Description

Add Dart_IsExternalString and Dart_ExternalStringGetPeer to the dart embedding api. Committed: https://code.google.com/p/dart/source/detail?r=2080

Patch Set 1 #

Total comments: 8

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+148 lines, -0 lines) Patch
M runtime/include/dart_api.h View 1 1 chunk +48 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 1 chunk +30 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_impl_test.cc View 1 6 chunks +49 lines, -0 lines 0 comments Download
M runtime/vm/object.h View 1 4 chunks +21 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
turnidge
9 years ago (2011-12-02 01:05:33 UTC) #1
siva
lgtm http://codereview.chromium.org/8775039/diff/1/runtime/include/dart_api.h File runtime/include/dart_api.h (right): http://codereview.chromium.org/8775039/diff/1/runtime/include/dart_api.h#newcode730 runtime/include/dart_api.h:730: DART_EXPORT bool Dart_IsString16(Dart_Handle object); to make the API ...
9 years ago (2011-12-02 01:53:01 UTC) #2
turnidge
9 years ago (2011-12-05 17:54:27 UTC) #3
http://codereview.chromium.org/8775039/diff/1/runtime/include/dart_api.h
File runtime/include/dart_api.h (right):

http://codereview.chromium.org/8775039/diff/1/runtime/include/dart_api.h#newc...
runtime/include/dart_api.h:730: DART_EXPORT bool Dart_IsString16(Dart_Handle
object);
On 2011/12/02 01:53:01, asiva wrote:
> to make the API uniform maybe we need a Dart_IsString32 also?

I wondered the same thing.  When I looked at the code, I found that each of
these tests is inclusive of the size below.  For example, Dart_IsString16
returns true for an 8 and 16 bit string and false for a 32 bit string.  Because
it is inclusive of all smaller sizes, Dart_IsString32 would have the same
semantics as Dart_IsString, which is why I think that it must have been left
out.

If you and I both found this to be confusing, then probably others will too.  Do
you want to chat about this offline?

http://codereview.chromium.org/8775039/diff/1/runtime/vm/dart_api_impl_test.cc
File runtime/vm/dart_api_impl_test.cc (right):

http://codereview.chromium.org/8775039/diff/1/runtime/vm/dart_api_impl_test.c...
runtime/vm/dart_api_impl_test.cc:357: UNIT_TEST_CASE(IsString) {
On 2011/12/02 01:53:01, asiva wrote:
> I am wondering why many of the tests in this file don't use TEST_CASE instead
of
> UNIT_TEST_CASE as they seem to right away create an Isolate. Not for this
change
> list but maybe we could look at that possibility later.

True.  Yes.

http://codereview.chromium.org/8775039/diff/1/runtime/vm/dart_api_impl_test.c...
runtime/vm/dart_api_impl_test.cc:430: // NULL peer
On 2011/12/02 01:53:01, asiva wrote:
> missing '.'

Fixed.

http://codereview.chromium.org/8775039/diff/1/runtime/vm/object.h
File runtime/vm/object.h (right):

http://codereview.chromium.org/8775039/diff/1/runtime/vm/object.h#newcode2754
runtime/vm/object.h:2754: return raw_ptr()->external_data_->peer_;
On 2011/12/02 01:53:01, asiva wrote:
> Not sure what the official C++ style guide says but we have always tried to
club
> the 'static' methods together, so in this case the method InstanceSize would
be
> after these two functions.

Done.

Powered by Google App Engine
This is Rietveld 408576698