Ryan Macnak
f1aa58931d
[vm] Remove Isolate, IsolateGroup and global Random.
...
The per Thread instance is sufficient.
TEST=ci
Change-Id: Iff2c4279937637089f7ae4194cb1097b5e6eef67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/452881
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Alexander Aprelev <aam@google.com >
2025-10-07 15:13:14 -07:00
Alexander Markov
b48008ebd0
[vm] Remove unused dart:math and Double native methods
...
Flow graph builder implementation of certain dart:math and Double
methods is now used unconditionally, so corresponding native
methods are never used and can be removed.
This is a follow-up to
https://dart-review.googlesource.com/c/sdk/+/371980 .
TEST=ci
Change-Id: Ibca2729f70f39af26a899d99724ce62efc3c8dae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/372180
Commit-Queue: Alexander Markov <alexmarkov@google.com >
Reviewed-by: Ryan Macnak <rmacnak@google.com >
2024-06-18 21:51:16 +00:00
Ryan Macnak
4176d8a02c
[vm] Update NULL to nullptr in runtime/lib.
...
TEST=build
Change-Id: I883dd0516519b175eb15b530776499248a3e0759
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292061
Reviewed-by: Alexander Aprelev <aam@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2023-03-30 19:28:28 +00:00
Ryan Macnak
4faf01a66c
[vm] Cleanup workarounds for removed flag --throw_on_javascript_int_overflow.
...
TEST=ci
Change-Id: I65936b5cd6e5933eadc37f3cd6bba1f0fa1b81a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/231328
Reviewed-by: Alexander Markov <alexmarkov@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2022-02-03 21:10:46 +00:00
Daco Harkes
dfcd594ebd
[vm] Delete dead runtime entries
...
We do not have a byte code interpreter anymore, these runtime entries
are dead.
With enabling inlining for external functions (previous CL), the
`external-name` annotations can also be removed.
TEST=removes dead code
TEST=hashes: runtime/vm/compiler/recognized_methods_list.h
Change-Id: Ibf7f9598cfe52756f6645473f619cf8456f8f593
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/229961
Reviewed-by: Tess Strickland <sstrickl@google.com >
Commit-Queue: Daco Harkes <dacoharkes@google.com >
2022-01-26 13:09:58 +00:00
Ryan Macnak
b1c09ecd8f
[vm] Make naming more consistent when converting between handles, tagged and untagged pointers.
...
Currently we have things called XPtr which are not what you get from ptr().
Old world:
handle->raw() returns RawObject* (tagged)
raw_obj->ptr() returns RawObject* (untagged)
After 6fe15f6df9 :
handle->raw() returns ObjectPtr
obj_ptr->ptr() returns ObjectLayout*
New world:
handle->ptr() returns ObjectPtr
obj_ptr->untag() returns UntaggedObject*
TEST=ci
Change-Id: I6c7f34014cf20737607caaf84979838300d12df2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149367
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Martin Kustermann <kustermann@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
2021-01-15 23:32:02 +00:00
Ryan Macnak
6fe15f6df9
[vm] Represent tagged pointers as C++ value types instead of C++ pointer types.
...
This works around bugs in UndefinedBehaviorSanitizer and Clang.
Bug: b/28638298
Change-Id: I6be595f9664516019d28017d24559583a1ae3a21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144354
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
2020-04-25 05:21:27 +00:00
Daco Harkes
14ff2110ce
[vm] refactor native entry and native entry type arguments
...
Change-Id: I03efbbf4340de1c8f23c60854ed991671ca2b647
Reviewed-on: https://dart-review.googlesource.com/c/87077
Commit-Queue: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Samir Jindel <sjindel@google.com >
2018-12-13 19:29:26 +00:00
Ryan Macnak
94f93f788a
[vm] Remove Dart scanner.
...
Change-Id: I6435aef9574167dda71f7d15852e32e40d38e381
Reviewed-on: https://dart-review.googlesource.com/c/83224
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2018-11-09 00:13:26 +00:00
Ryan Macnak
30b0b9b723
[vm] Code size reductions:
...
- Remove dead Isolate::IsTopLevelParsing.
- Remove dead TraceFunctionEntry/Exit.
- Migrate more tracing flags to flag_list.h to allow code elimination in non-debug modes.
- Require an explicit Zone parameter for CheckedHandles.
- Remove side-effects from RuntimeEntry constructor.
out/ProductX64/exe.stripped/dart_precompiled_runtime 4063464 -> 4046952 (-16k)
Change-Id: Iffd3de25a03d2354cdecf2d79aa761c33ab08bd3
Reviewed-on: https://dart-review.googlesource.com/c/83120
Reviewed-by: Ben Konyi <bkonyi@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2018-11-08 02:02:39 +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
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
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
Matthias Hausner
425b9a36b9
Use symbols when looking up fields in a class
...
The slow string comparison is only necessary when looking up
non-symbols or untangled private names.
Compiling all of dart2js seems to be about 1% faster, but it's really in the noise.
BUG=
R=asiva@google.com
Review URL: https://codereview.chromium.org/1868803002 .
2016-04-07 16:36:35 -07:00
Siva Annamalai
f7d2b2e31e
- Fix for issue 25950 (add registration of a thread exit callback)
...
- Moved some of the file and entropy callbacks to class Dart from
class Isolate as they are not isolate specific.
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1807293002 .
2016-03-17 13:40:20 -07:00
Regis Crelier
09954546fb
Add a 'secure' constructor to Random in dart:math returning a cryptographically
...
secure random generator which reads from the entropy source provided by the
embedder for every generated random value.
Add a test.
Fixes #1746 .
R=lrn@google.com
Review URL: https://codereview.chromium.org/1398453004 .
2015-10-15 10:16:03 -07:00
Srdjan Mitrovic
e520dd567f
Remove isolate argument from handle allocation: Part I
...
BUG=
R=hausner@google.com
Review URL: https://codereview.chromium.org/1393373003 .
2015-10-12 11:32:08 -07: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
iposva@google.com
383f9c03c2
- Avoid exposing the 64-bit state of the PRNG to Dart code.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//199263005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33778 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-17 21:27:24 +00:00
iposva@google.com
214ecc0e2a
- Do not rely on time to seed the default PRNG.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//200483003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33704 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-14 17:30:05 +00:00
lrn@google.com
d63af4cdc8
Add more complex mixing of random seed.
...
This changes the sequences generated by Random for a given seed,
since the internal state will not be the same as for the unmixed
seed.
It is consistent between VM and dart2js.
The provided integer seed is hashed as follows:
uint64 hash = 0;
while (seed > 0) {
hash = hash * 1037 + mix64((int64)seed);
seed >>= 64;
}
where mix64 mixes the bits of a 64-bit value.
The hash is used to initialize the random generator's internal state.
R=floitsch@google.com , iposva@google.com
Review URL: https://codereview.chromium.org//156533002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32412 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-07 08:42:43 +00:00
iposva@google.com
aeb751f670
- Large constants need to be marked as such.
...
Review URL: https://codereview.chromium.org//140213003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31861 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 00:09:15 +00:00
iposva@google.com
8db30180b4
Fix http://dartbug.com/16111
...
- Use all bits from the seed value even if passed a Bigint.
- Fix out of bounds access in BigintOperations.
- Remove obsolete implementation note.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//136453012
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31859 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 00:01:55 +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
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
332bfdc7d6
- Remove obsolete random number generator from the VM code.
...
Review URL: https://codereview.chromium.org//11417049
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15058 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-19 06:12:32 +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
asiva@google.com
87a504bf0a
Fix for issue 4808 (The vm crashes when parseInt is called with string containing a $).
...
Review URL: https://chromiumcodereview.appspot.com//10909152
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12145 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-10 18:55:29 +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
ajohnsen@google.com
d0585730ec
Rename MathNatives_2atan to MathNatives_atan2.
...
The comment doesn't appear to be valid anymore.
BUG=
Review URL: https://chromiumcodereview.appspot.com//10836006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10012 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 13:31:50 +00:00
asiva@google.com
ec7f44f025
Create frequently used symbols in the vm isolate
...
- Avoids the need for doing a NewSymbol on these everytime
- saves space as they get shared by isolates
Review URL: https://chromiumcodereview.appspot.com//10783035
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9834 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 00:01:50 +00:00
srdjan@google.com
9e77768c91
Fix for bug 1229: Unary operator plus is not allowed ... except for literals.
...
Add tests for incorrect literals, e.g. "+ 5".
Added a temporary token kTIGHTADD that represents an ADD not terminated by a whitespace. It is temporary and eliminated in the parser (code generator ot AST do not see it). It is used to recognize correct literals.
Review URL: https://chromiumcodereview.appspot.com//9264051
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3745 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-31 20:05:24 +00:00
srdjan@google.com
88878148ac
Fix crashes when going to natives. Throw an exception instead.
...
Review URL: http://codereview.chromium.org//8678025
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1817 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-23 22:03:51 +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
dgrove@google.com
4c0f559d23
Initial checkin.
...
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00