Commit Graph

56 Commits

Author SHA1 Message Date
Ryan Macnak 9b5a931b06 [vm] Replace most runtime/vm uses of OS::Print with OS::PrintErr.
Leave --print-snapshot-sizes on stdout because it is parsed by Flutter benchmarks.

Replace all runtime/bin uses of OS::Print with Log::Print.

Bug: https://github.com/dart-lang/sdk/issues/32134
Change-Id: I74aacfb410cdfa9270d06e7f6ab0534520c7c7ba
Reviewed-on: https://dart-review.googlesource.com/60021
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-06-13 19:51:40 +00:00
Alexander Markov c3b5939965 [vm] Remove --limit-ints-to-64-bits option and old _Bigint class
Closes https://github.com/dart-lang/sdk/issues/33306

Change-Id: I7088d8b7143edbe24f5cefe4be037ad2006e0625
Reviewed-on: https://dart-review.googlesource.com/58101
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-06-04 20:10:40 +00:00
Alexander Markov 59cdc65dc7 [VM] Relax constraints for integer literals according to int64 spec
Handling of integer literals is corrected according to the informal spec
for the fixed-size integers:

https://github.com/dart-lang/sdk/blob/master/docs/language/informal/int64.md

This change allows unsigned 64-bit hexadecimal literals and MIN_INT64
to be used when running on the VM with --limit-ints-to-64-bits option.

Change-Id: Ied7a7688768bcf4ff40ab5b499dd71622d2c3948
Reviewed-on: https://dart-review.googlesource.com/19400
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-09 16:58:38 +00:00
Kasper Lund 1db8615e29 Avoid just truncating to the nearby int in double.hashCode.
Preserves the property that doubles and ints that are equal
share the same hash code, but gives different doubles a much
higher chance of having different hash codes.

BUG=https://github.com/dart-lang/sdk/issues/2884

Change-Id: Ia97164087db568f26ffbbd6854ed9c19f81e9611
Reviewed-on: https://dart-review.googlesource.com/15140
Commit-Queue: Kasper Lund <kasperl@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-10-23 06:47:20 +00:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Alexander Markov 7a20b6b8d8 Option to truncate integers to 64 bits, part 1 (core VM changes)
This changeset revises --limit-ints-to-64-bits option to
change range of integers from unlimited to int64.
On overflow, integer arithmetic operations silently wrap around and
discard extra bits. No Bigints are allocated in case of overflow.

This changeset is the 1st part in the series of changes, it revises the implementation of integer arithmetic operations. More changes will follow.

R=regis@google.com, zra@google.com

Issue: https://github.com/dart-lang/sdk/issues/30103
Review-Url: https://codereview.chromium.org/2974633003 .
2017-07-10 15:16:40 -07:00
Ryan Macnak 8b96a31c7f Move runtime functions to the more logical runtime_entry.cc.
Make --trace-runtime-calls respect the isolate filter.

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2827873002 .
2017-04-19 10:22:04 -07:00
Ryan Macnak 877284947b Rename TARGET_OS_* to HOST_OS_*.
Like HOST_ARCH_*, HOST_OS_* describes the OS the VM is running on, which may be different from the OS the VM is generating code for during AOT compilation.

Currently we conflate the two when emitting AOT as assembly, and we get away with it because Flutter only uses assembly for targeting iOS and one can only target iOS from a Mac, but we expect to use assembly for Android as well so native tools can unwind Dart frames.

R=zra@google.com

Review-Url: https://codereview.chromium.org/2750843003 .
2017-03-15 13:11:05 -07:00
Zachary Anderson 2e4dfd3a2d clang-format runtime/lib
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2468093007 .
2016-11-04 12:14:41 -07:00
Siva Annamalai de5a1c8dac Remove support for pretenuring as it is not fully implemented and is currently turned on for a very specific case (double to string for one byte strings).
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2119633002 .
2016-07-01 12:59:19 -07:00
Florian Schneider be298b60e9 VM: Remove unnecessary _Num class from runtime/lib.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1874853002 .
2016-04-08 16:25:52 -07:00
Srdjan Mitrovic 7b04897743 Fix fix
BUG=

Review URL: https://codereview.chromium.org//1166523005
2015-06-03 12:39:59 -07:00
Srdjan Mitrovic 12da412110 Fix build
BUG=

Review URL: https://codereview.chromium.org//1160623004
2015-06-03 11:22:46 -07:00
Srdjan Mitrovic c0824e7725 Fix 23563: double unary- operator unstable for NANs
BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1160453003
2015-06-03 11:00:28 -07:00
regis@google.com a1c9e2b6b0 Simplify double to bigint conversion.
Remove 3 bigint mutators.
Remove unused support to create vm internal error.

R=rmacnak@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42842 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-13 21:29:44 +00:00
regis@google.com 0220e41d72 New bigint implementation in the vm.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40061 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 21:47:44 +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
zra@google.com 9e6655f810 Fixes Android build by using C++ math header instead of C one.
This change also requires prefacing the math calls with
std::, i.e. isinf -> std::isinf.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37839 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-30 22:15:26 +00:00
asiva@google.com f97858fb06 Move the double isNegative test back to double.cc as it seems to cause some compile issues when it is in object.h
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35695 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-02 16:49:59 +00:00
asiva@google.com 6cd6e8b52a - implement IsNegative for class Double
- move IsZero under class Integer as it is not used in class Double

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35648 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-01 18:26:34 +00:00
regis@google.com 7830430adf Implement eager instantiation and canonicalization of type arguments at run
time using a cache in uninstantiated type arguments.
Remove InstantiatedTypeArguments class.
Fix a bug in optimized code: do not update unused type test cache for Smi.
Fix a bug in optimized code on ARM and MIPS in type test cache lookup.

R=iposva@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32447 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 19:54:33 +00:00
srdjan@google.com b6b3e1f400 Factor out throwing of argument error.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28109 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-01 18:48:37 +00:00
kmillikin@google.com 4f80ef09df Change Bool::Get to return a handle instead of a pointer to a raw object.
Replace occurrences of 'expr ? Bool::True() : Bool::False()' with simply
'Bool::Get(expr)' and analogously for its negation.  The pointer to the raw
object can still be extracted with 'Bool::Get(expr).raw()'.

R=iposva@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26770 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 08:38:56 +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
zra@google.com 78ed504ed0 Adds a flag to the standalone vm to throw an exception on 53-bit integer overflow.
R=asiva@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23640 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 17:18:07 +00:00
zra@google.com 40f0800c10 Ensures that Bigints returned to Dart are all checked by Integer::AsValidInteger.
Rather than by ad-hoc checks at the point of return.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23151 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 15:45:17 +00:00
floitsch@google.com 09d7da9250 Rewrite double.parse.
BUG= http://dartbug.com/5654
R=lrn@google.com, srdjan@google.com

Committed: https://code.google.com/p/dart/source/detail?r=23062

Reverted: https://code.google.com/p/dart/source/detail?r=23065

Committed: https://code.google.com/p/dart/source/detail?r=23066

Reverted: https://code.google.com/p/dart/source/detail?r=23068

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23071 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 14:30:16 +00:00
floitsch@google.com 9849fb8900 Revert "Rewrite double.parse."
This reverts commit r23066.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23068 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 13:28:37 +00:00
floitsch@google.com 75cafec89d Rewrite double.parse.
BUG= http://dartbug.com/5654
R=lrn@google.com, srdjan@google.com

Committed: https://code.google.com/p/dart/source/detail?r=23062

Reverted: https://code.google.com/p/dart/source/detail?r=23065

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23066 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 13:09:05 +00:00
floitsch@google.com 724fb6b4aa Revert "Rewrite double.parse."
This reverts commit r23062.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23065 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 13:00:05 +00:00
floitsch@google.com d39ef26225 Rewrite double.parse.
BUG= http://dartbug.com/5654
R=lrn@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23062 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 12:00:45 +00:00
srdjan@google.com dd6ca671d7 Cleanups: addressed your comments from https://codereview.chromium.org/14962008/
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22881 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 23:45:08 +00:00
srdjan@google.com 142b49316a Fix issue 5275: The VM must always generate the most compact form of an integer (Smi, Mint or Bigint). Hide methods that can be used to bypass that assumption and require the use of Integer::NewXXX which is guaranteed to return the most compact integer form.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22816 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-16 20:49:06 +00:00
vegorov@google.com a273179ac8 Use locale insensitive method to parse double literals.
Using strtod does not work because Dart grammar does not necessary match grammar used by strtod. Some locales (e.g. Russian and Danish) use comma instead of dot for radix point.

R=iposva@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21074 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-08 14:32:46 +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
srdjan@google.com 8a4e4cbadc Fix Issue 8259: dart:math pow broken for large integers.
Review URL: https://codereview.chromium.org//12180022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18150 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-05 18:09:12 +00:00
srdjan@google.com 35ef4ddbd5 Enable correct optimized double modulo operation. (TODO: enable remainder optimization).
Review URL: https://codereview.chromium.org//12082063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17859 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-30 17:40:28 +00:00
srdjan@google.com 020b5893db Cleanups.
Review URL: https://codereview.chromium.org//11801023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16756 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-07 22:13:47 +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
asiva@google.com 7022b39e35 Convert all symbol accessors to return read only handles so that it is not necessary to create a new handle in the code that uses it.
Added a few more strings to the symbols list.
Review URL: https://codereview.chromium.org//11667012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16584 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 19:31:59 +00:00
asiva@google.com 8af296c9c8 Cleanup the exceptions create code to use Arrays instead GrowableArrays so
that it is consistent with the DartEntry invoke code that it calls finally.
Review URL: https://codereview.chromium.org//11639007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16295 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-18 23:47:35 +00:00
regis@google.com dd6a0ec349 Rename GET_NATIVE_ARGUMENT macro to GET_NON_NULL_NATIVE_ARGUMENT.
Introduce new GET_NATIVE_ARGUMENT macro accepting null.
Add test.
Review URL: https://codereview.chromium.org//11468016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15919 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-10 17:59:40 +00:00
aprelev@gmail.com b09632ab95 Fix floating point issues on Windows.
BUG=dartbug.com/5407
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15546 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-29 22:40:12 +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
hausner@google.com 7eb3efc2ba Fix native argument handling
Native functions need to fetch arguments differently if they are
called through a closure.

fixes issue 6696.
Review URL: https://codereview.chromium.org//11293290

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14937 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-15 01:14:01 +00:00
floitsch@google.com 27cadf2b66 isEven, isOdd, isNegative, isMaxValue, isMinValue, isInfinite, isPositive, isSingleValue.
Review URL: https://codereview.chromium.org//11227042

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13974 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 16:15:36 +00:00
srdjan@google.com 5158c55cce Trace intrinsified native calls for doubles.
Review URL: https://codereview.chromium.org//11087061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13494 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-10 20:15:48 +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
turnidge@google.com 14f614da12 Use the return value of vm native methods to set the return value,
based on Siva's earlier suggestion (he actually suggested putting it
in the generated stub, which I haven't done).

Added SetReturnUnsafe and use it exactly one place so far.
Review URL: https://chromiumcodereview.appspot.com//10874072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11633 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:41:19 +00:00
rnystrom@google.com 0bc9b19740 Rename BadNumberFormatException -> FormatException.
Review URL: https://chromiumcodereview.appspot.com//10850034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10354 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 20:56:59 +00:00