Commit graph

17 commits

Author SHA1 Message Date
iposva@google.com f2a6f1b4b6 Another round of cleanups for http://www.dartbug.com/15922
- Address warnings about 64-bit to 32-bit conversions.

R=ajohnsen@google.com, asiva@google.com

Review URL: https://codereview.chromium.org//169893003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32831 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 23:35:55 +00:00
srdjan@google.com ad6a87d6ad Improve performance of String::ToCString for OneByteStrings and parsing of doubles. Leads to significant speedups in json parsing.
Review URL: https://codereview.chromium.org//12317076

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18925 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 22:43:36 +00:00
asiva@google.com 76def187f8 Fix bug in Utf8::CodePointCount which was causing some strings with latin1
characters to be stored as TwoByteStrings.
Review URL: https://codereview.chromium.org//11419259

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15604 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 21:53:58 +00:00
sgjesse@google.com 7fc2230b02 Add support for surrogates when serializing and deserializing for native ports
As Dart allows creating string with UTF-16 surrogate code units which
are not always in lead/trail pairs, we need to support this in the
communication with native ports.

This change allows surrogate code units in messages to/from native
ports and supports them in the UTF-8 encoding used on the Dart_CObject
structure string representation.

R=ager@google.com, erikcorry@google.com, asiva@google.com

BUG=

Review URL: https://codereview.chromium.org//11280150

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15585 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 13:06:44 +00:00
cshapiro@google.com 39ee2fdfeb Move various top-level Unicode definitions into classes and methods.
Review URL: https://codereview.chromium.org//11414249

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15568 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 03:33:37 +00:00
cshapiro@google.com 392ca92d2d Use the code point iterator when computing 16-bit string hash codes.
Review URL: https://codereview.chromium.org//11412258

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15565 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-30 02:36:19 +00:00
cshapiro@google.com 979571d3ee Use a signed 32-bit integer for representing code points.
Review URL: https://codereview.chromium.org//11419086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15188 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-21 00:30:27 +00:00
erikcorry@google.com 84da84c22d Revert "Add some support for the code-point code-unit distinction."
This reverts commit r15150

R=karlklose@google.com
BUG=

Review URL: https://codereview.chromium.org//11411092

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15152 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 15:23:41 +00:00
erikcorry@google.com 547cbf9da6 Add some support for the code-point code-unit distinction.
Adds String.fromCodeUnits and String.codeUnitAt, and modifies
String.fromCodePoints and String.codePointAt to actually use code points.
Fixes String.charCodes to use code points and adds String.codeUnits.
Reenables some tests, and adds new ones for non-BMP characters.
Fixes issues 6418, 6501 and 1357.

R=floitsch@google.com
BUG=

Review URL: https://codereview.chromium.org//11368138

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15150 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 14:51:25 +00:00
cshapiro@google.com bad7873c6a Correct a misnomer regarding supplementary code points.
The supplementary multilingual plane (SMP) code points were assumed to
be equivalent supplementary code points.  In fact, smp code points are
a small subset of all supplementary code points.

Review URL: https://codereview.chromium.org//11299084

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15128 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-20 02:37:21 +00:00
cshapiro@google.com 26a4c5ae66 Provide a code point iterator to the String class to simplify iteration.
Review URL: https://codereview.chromium.org//11416054

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15109 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 20:57:14 +00:00
asiva@google.com e1adedb421 Revert OneByteString back to ISO Latin-1 instead of ASCII
as webkit supports ISO Latin-1 and UTF-16 encodings for strings.
Review URL: https://codereview.chromium.org//11365243

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14989 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-16 00:13:18 +00:00
asiva@google.com ebbb7c4134 - Represent strings internally in UTF-16 format, this makes it
compatible with webkit and will allow for easy externalization of
  strings. One byte strings are retained for pure ASCII strings.
  (The language specification was changed recently to reflect this as
   follows "A string is a sequence of UTF-16 code units").
- Remove four byte string class and all references to it.
- Rename some of the string functions in Dart API to make them
  consistent and better describe the underlying functionality
  Dart_NewString => Dart_NewStringFromCString
  Dart_NewString8 => Dart_NewStringFromUTF8
  Dart_NewString16 => Dart_NewStringFromUTF16
  Dart_NewString32 => Dart_NewStringFromUTF32
  Dart_NewExternalString8 => Dart_NewExternalUTF8String
  Dart_NewExternalString16 => Dart_NewExternalUTF16String
  Dart_NewExternalString32 => Dart_NewExternalUTF32String
  Dart_StringGet8 => Dart_StringToUTF8
  Dart_StringGet16 => Dart_StringToUTF16
  Dart_StringToCString => Dart_StringToCString
  Dart_IsString8 => Removed
  Dart_IsString16 -> Removed
  Dart_StringToBytes -> Removed
  Dart_StringGet32 -> Removed
Review URL: https://codereview.chromium.org//11318018

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14357 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-31 17:56:46 +00:00
cshapiro@google.com 2f3f42e3dc Check that the C string passed to Dart_NewString is valid UTF-8.
BUG=2663

Review URL: https://chromiumcodereview.appspot.com//10584044

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8942 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-20 22:09:20 +00:00
cshapiro@google.com dcaf11db96 Implement a heap profiler for the Dart managed heap.
This profiler will write binary HPROF data to a user provided stream that
can later be viewed by tools such as the Eclipse Memory Analyzer.

While all user defined types are accurately described in the profile data,
internal types that are not self-describing appear as empty objects.  This
will be addressed by a future change.

Review URL: https://chromiumcodereview.appspot.com//10452006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8636 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-14 00:08:07 +00:00
cshapiro@google.com f52039f03c Implement case mapping using the Unicode default case mapping algorithm.
BUG=5425968

Review URL: http://codereview.chromium.org//8333001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@616 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-21 20:33:29 +00:00
cshapiro@google.com 9aca46d2a7 Implement support for reading and writing UTF-8 encoded strings.
In the past, characters in C strings were assumed to encode themselves
and when converting Dart strings to C strings characters were narrowed
to 8-bit values.

With this change, C strings are assumed to be UTF-8 encoded.
Converting a C string to a Dart string applies UTF-8 decoding and
converting a Dart string to a C string applies UTF-8 encoding.

Also part of this change are new methods to construct uninitialized
string objects and to copy string data.

BUG=5343358

Review URL: https://chromereviews.googleplex.com/3557012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@169 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-06 22:42:24 +00:00