Commit Graph

22 Commits

Author SHA1 Message Date
lrn@google.com 479386335b Make pow fail for non-number arguments.
Previous change removed a check that was expected by a co19 test.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26351 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 12:57:52 +00:00
lrn@google.com 5343ef8d32 Add documentation to dart:math pow function.
Also add test, and modify implementation to match on the single case where it didn't.

BUG= http://dartdog.com/1952
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26347 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 12:23:00 +00:00
lrn@google.com 653ee92bfb Remove int.pow and double.pow from VM library.
BUG= http://dartbug.com/10268
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26340 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 08:13:13 +00:00
srdjan@google.com c891612920 Adapt Random class to be able to run in javascript integer compatibility mode.
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25753 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 23:07:55 +00:00
iposva@google.com 4271b30c89 - Extend the coin test for slightly different scenarios.
- Crank the generator a couple of times before returning
  a newly allocated one.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23309 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-28 22:15:07 +00:00
srdjan@google.com 22624fd4e0 Intrinsify random nextState, improve perfromance significantly.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22912 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-20 23:59:36 +00:00
srdjan@google.com d0c639e474 Fix for issue 10534. Implement int.pow correctly using exponentiation by squaring.
Note that int.pow is now considerably slower than double.pow.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22635 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-13 17:41:58 +00:00
ager@google.com 431954b584 Rename dart:typeddata to dart:typed_data.
R=asiva@google.com, floitsch@google.com, srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21871 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 11:54:54 +00:00
fschneider@google.com 86da5111ad Replace scalarlist optimizations and split external array loads into two IL instructions.
This CL removes optimized access for scalarlist, and only the new TypedData classes
are optimized. I changed the runtime libraries core and math to use typedData
instead of scalarlist (Uint16List is used in StringBuffer, Uint32List by Math.random).

Instead of using LoadIndexed for internal and external arrays,
split external loads into a load of the backing store and a load
of the element.

v3 <- LoadIndexed(v1, index)

becomes

v2 <- LoadUntagged(v1, ExternalTypedData::data_offset)
v3 <- LoadIndexed(v2, index);

For this I introduce two new representations in the IL:

 kUntagged (for values that hold a untagged pointer) and
 
 kNoRepresentation (for instructions accept any input
 representation)

Deoptimization does not need to know about kUntagged
since these values can never occur in the environment.

Also with this change:
* fix COMPILE_ASSERT and use it in one place.
* Cleanup IL printer output of deopt ids.
Review URL: https://codereview.chromium.org//12871010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20198 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 12:06:23 +00:00
iposva@google.com b25d694633 - Avoid wrapping into Mints when generating random numbers.
- Update Random number tests.
- Fix String.fromCharCodes signature.
Review URL: https://codereview.chromium.org//12622002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19642 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-07 17:19:47 +00:00
lrn@google.com 6b4f4b1bab Change new List(n) to return fixed length list.
Deprecate List.fixedLength, add List.filled.

Make Iterable.toList and List.from take "growable" argument,
defaulting to false.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19112 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 08:45:04 +00:00
floitsch@google.com fb7b9e3c5c Rename Date to DateTime.
BUG=http://dartbug.com/1424

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17549 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 12:16:37 +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
srdjan@google.com 44f4011196 Improve performance of String.split for 1 and 0 character results.
Other cleanups/improvements in Random.
Review URL: https://codereview.chromium.org//11419194

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15429 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-28 01:17:25 +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
iposva@google.com 624273f372 - Avoid going into BigInteger domain for most of the Random state calculation.
- Makes it much easier to intrinsify the operation.
Review URL: https://codereview.chromium.org//11339027

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14235 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 00:20:13 +00:00
lrn@google.com a1faa6f135 Change IllegalArgumentException to ArgumentError.
Review URL: https://codereview.chromium.org//10989013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12841 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 12:27:52 +00:00
iposva@google.com 820d2b33d5 - Fix the implementation of Random.nextBool() and add test.
Review URL: https://codereview.chromium.org//10919323

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12458 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-17 21:33:39 +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
iposva@google.com 327ff5d70e - Change "static final" to "static const" in the runtime/ directory.
- Fixed parsing of top-level static const.
Review URL: https://chromiumcodereview.appspot.com//10883071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11425 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 23:51:37 +00:00
ager@google.com 722c1a3ce6 Deprecate Math object in corelib in favor of dart:math library.
Review URL: https://chromiumcodereview.appspot.com//10829459

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11155 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-22 14:33:01 +00:00
iposva@google.com a7959423cd - Use the unified dart:math library in the VM.
Review URL: https://chromiumcodereview.appspot.com//10831301

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10698 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 04:50:14 +00:00