lrn@google.com
b89409c112
Change type of multiplier to int, not _Smi.
...
Review URL: https://codereview.chromium.org//603353003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40704 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-26 12:30:35 +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
38bb5d2a36
Don't use identical for null.
...
This was just a test to see if it generated the same code (it did),
but I forgot to revert it again.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//578213002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40432 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 11:56:01 +00:00
lrn@google.com
104119e15d
Add argument error for int.parse(null).
...
Slightly tweak _tryParseSmi to generate slightly less code.
BUG= http://dartbug.com/17774
R=fschneider@google.com
Review URL: https://codereview.chromium.org//581593002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40373 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 12:51:20 +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
d983493c1a
Add extra information to FormatException.
...
R=floitsch@google.com
Review URL: https://codereview.chromium.org//389603002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38181 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 07:47:45 +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
floitsch@google.com
8adad2eeb0
Don't throw when there is an "onError" for int.parse.
...
Even though the error is caught immediately we don't want "break on exception" developer tools stop at the parseInt case if there is a handler.
BUG= http://dartbug.com/12776
R=lrn@google.com
Review URL: https://codereview.chromium.org//23685004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27005 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-02 09:36:29 +00:00
srdjan@google.com
f49b5942ab
Check how many Smi digits are acceptable when parsing integers.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//15670009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23331 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 09:14:21 +00:00
srdjan@google.com
81eb689947
Implement a tryParseSmi function in Dart for quick and frequent parsing of Smis.
...
Review URL: https://codereview.chromium.org//14484003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22041 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 17:30:21 +00:00
srdjan@google.com
6a538bdec4
Dart VM compiler cannot optimize methods with try/catch yet, factor the code out -> 30% gain on a Json benchmark.
...
Review URL: https://codereview.chromium.org//12330149
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19085 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 21:48:22 +00:00
lrn@google.com
3c0ac360e7
Remove deprecated string features.
...
Make String.codeUnits return a List.
Review URL: https://codereview.chromium.org//12282038
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18960 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 10:48:09 +00:00
ajohnsen@google.com
32eeecd930
Fix tests for VM in checked mode.
...
BUG=
Review URL: https://codereview.chromium.org//11801008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16689 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 11:59:49 +00:00
floitsch@google.com
4a7dfd2da3
Big merge from experimental to bleeding edge.
...
Review URL: https://codereview.chromium.org//11783009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16687 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 11:23:16 +00:00
iposva@google.com
7ae807a19c
- Move MathNatives from dart:core to dart:math.
...
- Split out double and integer parsing from MathNatives.
Review URL: https://codereview.chromium.org//11316031
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15032 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-16 19:42:02 +00:00
lrn@google.com
26fab5183a
Move parseInt parseDouble to int/double classes as a static method.
...
Remove math dependency from core/coreimpl in dart2js.
The existing Math.parseInt and Math.parseDouble are kept *for now*, but
simply redirect to the static methods.
They will be removed in time (when library code is ready for it).
Review URL: https://codereview.chromium.org//10913271
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12417 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-17 07:25:38 +00:00