lrn@google.com
28937c86ae
Optimize _GrowableArray._join and _StringBase._interpolate.
...
R=fschneider@google.com
Review URL: https://codereview.chromium.org//551823002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40800 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-30 08:28:00 +00:00
lrn@google.com
2ef0e0b993
Fix bad call of RangeError.value in String.fromCharCodes.
...
Review URL: https://codereview.chromium.org//608213002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40760 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-29 09:33:08 +00:00
lrn@google.com
de514055bf
Change restrictions on start/end on String.fromCharCodes.
...
Must now be 0 <= start <= end <= iterable.length.
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//605213002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40755 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-29 08:15:49 +00:00
lrn@google.com
d57732d359
Optimize int.parse with a radix.
...
Handles bignums by parsing chunks of of digits into smis, then
combining the smi into a (potential) bignum, using smi arithmetic as
much as possible.
Use the optimized version for radix 10 and 16 too, instead of going to runtime.
R=fschneider@google.com
Committed: https://code.google.com/p/dart/source/detail?r=40702
Review URL: https://codereview.chromium.org//596763002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40703 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 12:13:47 +00:00
lrn@google.com
15ad26af35
Optimize int.parse with a radix.
...
Handles bignums by parsing chunks of of digits into smis, then
combining the smi into a (potential) bignum, using smi arithmetic as
much as possible.
Use the optimized version for radix 10 and 16 too, instead of going to runtime.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//596763002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40702 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 12:04:43 +00:00
lrn@google.com
8bba32d131
Make String.fromCharCodes take start/end.
...
This avoids having to make a sublist of a list of character codes before passing it to String.fromCharCodes.
new String.fromCharCodes(codes.sublist(start, end))
becomes just
new String.fromCharCodes(codes, start, end)
R=floitsch@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//515183002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40672 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-25 10:45:24 +00:00
lrn@google.com
54ffc4f000
Call special VM interpolate for single element interpolation.
...
Fixed at the intermediate language level.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//563973004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40232 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-15 07:19:23 +00:00
lrn@google.com
29ad62131d
Add optional startIndex to String.replaceFirst
...
BUG= https://code.google.com/p/dart/issues/detail?id=3194
R=lrn@google.com
Review URL: https://codereview.chromium.org//462463003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39490 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-22 11:27:32 +00:00
lrn@google.com
7b516974b2
Add optional start index to Pattern.allMatches.
...
This is a non-breaking change.
Very few classes implement Pattern, so it's also a mostly non-intrusive change.
If we add startIndex to other methods, like replaceFirstMatch, we can use the extra parameter only for non-zero start indices without breaking existing code.
R=ajohnsen@google.com
Review URL: https://codereview.chromium.org//460613002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39119 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-12 07:13:01 +00:00
lrn@google.com
1ea907017a
Special case substring(0, length) to return itself.
...
R=ajohnsen@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//442693002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38919 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-06 07:00:59 +00:00
lrn@google.com
ca66944f5a
Performance tweak on int.parse.
...
Slower for strings with trailing, but no leading,
whitespace, but significantly faster for strings with no whitespace,
which is presumed to be the most common case.
R=floitsch@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//398813002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38848 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-04 07:56:18 +00:00
lrn@google.com
f48e9cb218
Address comments on double-parse implementation from earlier CL.
...
Comments at https://codereview.chromium.org/368483004/#msg7
R=fschneider@google.com , iposva@google.com
Review URL: https://codereview.chromium.org//381603002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38224 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 08:25:12 +00:00
lrn@google.com
7a32a75dcc
Avoid unnecessary copying when parsing doubles.
...
R=sgjesse@google.com , vegorov@google.com
Review URL: https://codereview.chromium.org//368483004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37863 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-01 11:59:31 +00:00
srdjan@google.com
97021b5861
Add class id constants fields to dart:_internal class 'ClassID'. Use the fields in the library (more uses to come).
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//351673002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37628 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-23 22:41:59 +00:00
srdjan@google.com
d44423b766
Add VM internal Dart class 'ClassID' used to manage class-ids of known classes. Next CL: add constant fields corresponding to each class id (smiCid, oneByteStringCid, etc).
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//345223003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37567 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-20 20:56:55 +00:00
lrn@google.com
88ba8efed9
Optimize one-byte string's toUpperCase.
...
R=ajohnsen@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//213293002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34812 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-08 07:19:33 +00:00
ajohnsen@google.com
a9f357b4b6
Speed up toLowerCase, by manually inlining the upper-case part.
...
Some benchmarks show up to 25% faster toLowerCase.
BUG=
R=lrn@google.com
Review URL: https://codereview.chromium.org//212163005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34423 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 12:19:55 +00:00
lrn@google.com
249d09fd82
Optimize String.fromCharCode.
...
BUG= http://dartbug.com/17781
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//212423003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34419 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-26 11:37:01 +00:00
ajohnsen@google.com
fbdb9a85d8
Add optimized _OneByteString.toLowerCase.
...
BUG=
R=sgjesse@google.com , sra@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//209443005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34393 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-25 21:44:09 +00:00
lrn@google.com
f95e190651
Add string.trimLeft/trimRight.
...
BUG= http://dartbug.com/5589
R=floitsch@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//190853009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33638 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-13 07:16:51 +00:00
lrn@google.com
69145994de
Allow multi-codeunit padding in String.padLeft/padRight.
...
Also allow negative repeats.
Based on suggestions from Stephen.
R=sra@google.com
Review URL: https://codereview.chromium.org//171773003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32843 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-20 07:17:11 +00:00
lrn@google.com
a3ad46de0d
Add String.repeat, String.padLeft, String.padRight.
...
We keep seeing reimplementations everywhere, and reimplementing it ourselves.
BUG= http://dartbug.com/16919
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//172153002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32784 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 12:32:56 +00:00
ajohnsen@google.com
03c7cf69f3
Add optimized String.fromCharCodes path for Uint8List and Int8List.
...
BUG=
R=srdjan@google.com
Review URL: https://codereview.chromium.org//74423005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30496 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-21 06:12:01 +00:00
hausner@google.com
c96bc29ab5
Compile time error if name is used before variable is declared
...
Implement proper semantics if a name has been referenced in a
block and later a variable with that same name is declared.
Fix library code that was wrong.
Add new language test, delete a couple of tests that are
outdated, file co19 bug 649.
Dart2js and dart2dart are not yet implementing these compile-time
errors.
R=iposva@google.com
Review URL: https://codereview.chromium.org//51533003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29770 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 21:28:31 +00:00
srdjan@google.com
98aad1b1d0
Optimize OneByteString’s contains function for one character patterns (similar to indexOf).
...
R=zra@google.com
Review URL: https://codereview.chromium.org//54503004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29701 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 21:13:46 +00:00
sgjesse@google.com
36a67fa046
Implement fromEnvironment on bool, int and String
...
This implements const constructor fromEnvironment on bool, int and
String.
The VM have the added -Dname=value option to define the value for the
properties. All values are provided by using the -D - nothing is read
from the environment.
If the resulting value is null or - in the case of int.fromEnvironment
- not a number an ArgumentError is thrown.
This CL does not have any implementation for dart2js.
This is a continuation of the change
https://chromiumcodereview.appspot.com/24975002 by iposva@
BUG=
R=iposva@google.com
Review URL: https://codereview.chromium.org//50983002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29642 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 05:46:57 +00:00
srdjan@google.com
cacd63cf7b
Improve indexOf for one byte string receiver to work with other string classes.
...
Optimize access to core class’s class-ids.
R=zra@google.com
Review URL: https://codereview.chromium.org//47073009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29610 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 23:51:42 +00:00
srdjan@google.com
15d2afdca4
Fix performance degradation in string buffer benchmarks: concat in native instead of in Dart.
...
R=zra@google.com
Review URL: https://codereview.chromium.org//52813002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29567 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-30 17:25:23 +00:00
srdjan@google.com
a81288c8ca
Improve string library performance. String concat and indexOf.
...
Rename String concatAll to concatRange. Optimize concatRange for OneByteStrings (avoids natives), optimize indexOf for one character onByteStrings.
R=iposva@google.com
Review URL: https://codereview.chromium.org//42443002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29472 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-29 18:18:40 +00:00
srdjan@google.com
255ffb6947
Specialize string equality for various string classes. Add intrinsics for one/two-byte string equality. Improves sudoku_solver by 10%.
...
R=regis@google.com , zra@google.com
Review URL: https://codereview.chromium.org//41573003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29266 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-25 18:00:27 +00:00
lrn@google.com
ff1d105a0f
Remove deprecated 'str' getter on Match.
...
BUG= http://dartbug.com/12843
R=floitsch@google.com
Review URL: https://codereview.chromium.org//36073010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29167 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 12:06:41 +00:00
srdjan@google.com
1676113897
Fix runtimeType for strings, integers and double: return their interface type.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//25674017
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28286 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-04 22:08:55 +00:00
iposva@google.com
e7e2e4bf03
- Rename arrays to lists:
...
_ObjectArray -> _List
_GrowableObjectArray -> _GrowableList
_ImmutableArray -> _ImmutableList
R=srdjan@google.com
Review URL: https://codereview.chromium.org//25813002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28189 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 00:15:14 +00:00
srdjan@google.com
30197aab9d
Improve performance of string buffer by modifying concatAll native to allow growable array and an interval. Eliminate unnecessary check for String elements in release mode.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//25087006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28102 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 16:48:12 +00:00
lrn@google.com
df78198c50
Remove String.concat from implementation classes.
...
It was removed from the interface a long time ago.
BUG= http://dartbug.com/13128
R=floitsch@google.com
Review URL: https://codereview.chromium.org//23464040
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27286 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 11:04:45 +00:00
lrn@google.com
3f23ba6d14
Fix implementations of Match too, to use "input", not "str".
...
Fix accidental rename of str to src.
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//23490008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26781 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 11:33:56 +00:00
lrn@google.com
e73a721d8e
Make String.startsWith take an optional start index.
...
R=floitsch@google.com , ngeoffray@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//17281002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24142 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-18 13:59:19 +00:00
lrn@google.com
9b67f92679
Use Pattern.matchAsPrefix to let String.indexOf/lastIndexOf/startsWith accept Pattern.
...
Rearranged co19-runtime.status to only have one section for each configuration,
and tried to keep them in a logical order.
BUG=http://dartbug.com/11129
R=floitsch@google.com
Review URL: https://codereview.chromium.org//16957002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23974 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 12:49:44 +00:00
lrn@google.com
9614a603bb
Proof-of-concept matchPrefix on Pattern.
...
Can be used to implement startsWith (and endsWith with a loop).
R=floitsch@google.com
Review URL: https://codereview.chromium.org//15709018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23897 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 08:37:36 +00:00
asiva@google.com
937da3dd4a
Delete some dead code
...
Strings.concatAll
Strings.join
R=srdjan@google.com
Review URL: https://codereview.chromium.org//16654007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23882 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 21:13:27 +00:00
lrn@google.com
7dd35ed656
Better documentation on Sets and Maps.
...
Small updates on other documentation too.
BUG= http://dartbug.com/474 , http://dartbug.com/1289 , http://dartbug.com/5516 , http://dartbug.com/10902 , http://dartbug.com/10315
R=floitsch@google.com , ngeoffray@google.com
Review URL: https://codereview.chromium.org//16285004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23734 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-07 08:51:35 +00:00
floitsch@google.com
5d058bb0eb
Adding isNotEmpty property to collection and string.
...
BUG= http://dartbug.com/3074
R=floitsch@google.com
Review URL: https://codereview.chromium.org//15263004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23294 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 17:30:37 +00:00
floitsch@google.com
c5bd888acb
Fix string.trim (adding more runes).
...
R=lrn@google.com , srdjan@google.com
Review URL: https://codereview.chromium.org//15348003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23006 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-22 11:10:11 +00:00
asiva@google.com
551cde79fa
Reuse _isOneByteWhitespace in all the classes for implementing _isWhitespace.
...
R=srdjan@google.com
Review URL: https://codereview.chromium.org//15339002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22882 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 23:49:50 +00:00
asiva@google.com
4ba1fdafba
Remove obsolete code (FourByteString).
...
R=srdjan@google.com
Review URL: https://codereview.chromium.org//15330002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22871 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 20:59:39 +00:00
srdjan@google.com
7797d39362
Added Object._cid getter, optimized it. Added to (some) classes a static final _clCid. Use those to test for exact type in VM's libraries.
...
R=iposva@google.com
Review URL: https://codereview.chromium.org//14703005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22695 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 18:16:44 +00:00
srdjan@google.com
70d8860c17
Optimize concatenation of lists of onebyte strings by implementing it in Dart.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//14820013
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22532 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-08 21:33:03 +00:00
srdjan@google.com
ddc9d23610
Inline _OneByteString._setAt. The key knowledge is that _setAt is an internal method that has to be called with correct arguments, therefore no checks are needed.
...
R=fschneider@google.com , zra@google.com
Review URL: https://codereview.chromium.org//14917020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22528 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-08 20:03:33 +00:00
srdjan@google.com
ab188d327c
Improve performance of String.fromCharCodes by implementing it in Dart. Add tow internal natives to Dart in order to be able to allocate and fill a String. Next step is to implement String.concatAll in Dart as well and to inline String._setAt operation (currently intrinsified).
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//14862006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22399 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-03 23:48:10 +00:00
srdjan@google.com
596f203f2a
Do not copy immutable arrays in String.createFromCharCodes. Tighten the types a little in string_patch.dart.
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//14868002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22338 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-02 20:45:06 +00:00