Ryan Macnak
8a5e2a688b
[vm, compiler] Consistently produce OutOfMemoryErrors for large variable-length object allocations.
...
Bug: https://github.com/dart-lang/sdk/issues/38575
Change-Id: I3f93488511519ac1dca04f91465efad3d2a0c66d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118886
Commit-Queue: Ryan Macnak <rmacnak@google.com >
Reviewed-by: Aart Bik <ajcbik@google.com >
2019-09-30 20:19:03 +00:00
Matthew Dempsky
4ce3aa7af1
[vm] Replace ^= assignments with = where possible
...
Change-Id: I04ac2e9c4b8bb654b7c660e728be3867aa4e1513
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100923
Reviewed-by: Ryan Macnak <rmacnak@google.com >
Commit-Queue: Matthew Dempsky <mdempsky@google.com >
2019-05-01 00:04:44 +00:00
Ryan Macnak
971f4845d7
[build] Remove last platform -> vm and bin -> vm dependencies. Fix some ODR violations.
...
Change some static_libraries to source_sets to make ODR violations link-time errors.
This is needed to enable (stop suppressing) -fvisibility=hidden in Fuchsia product builds.
Change-Id: I699cec8d4b516beab9cebf9db0a522a7ff99e004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99822
Reviewed-by: Zach Anderson <zra@google.com >
Commit-Queue: Ryan Macnak <rmacnak@google.com >
2019-04-22 20:15:43 +00:00
Martin Kustermann
d445d29fa3
[VM] Define layout of _*ArrayView/_ByteDataView in C+++
...
This removes the 3 fields from the classes in Dart and instead describes
the layout in C++ via a RawTypedDataView class (as already do with
normal RawTypedData). The existing "semi" TypedDataView handle class is
changed to be a real handle class.
This decreases performance of some microbenchmarks due to field guards
not being used anymore (before the JIT could add a field guard to view classes
guarding that only normal typed data is used as backing store (and not e.g. external
typed data)
Issue https://github.com/dart-lang/sdk/issues/35154
Issue https://github.com/dart-lang/sdk/issues/31954
Change-Id: I7a0022b843a4c0fa69f53dedcc4c7bd2117cdc37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96806
Commit-Queue: Martin Kustermann <kustermann@google.com >
Reviewed-by: Ryan Macnak <rmacnak@google.com >
2019-03-15 21:24:15 +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
Vyacheslav Egorov
4985165e76
[VM] Make "Hello, World!" run in strong mode (through DFE).
...
Includes the following changes:
- Disable type checking in the service isolate when strong mode is
turned on. We don't yet have strong mode clean vmservice Kernel
binary available (Issue #31203 );
- Introduce new Dart VM API to allow creating List<T> (T in {String, int}).
Current API only allows to create List<dynamic> and in strong mode
List<dynamic> is not assignable to List<T>. For now we limit this API to
a fixed number of core types for performance considerations (type
arguments can be canonicalized and cache ahead of time). We will
extend the API allowing creation of arbitrary List<T> if we will
discover the need for it later;
- Use this new API to fix CreateRuntimeOptions to create List<String>
and not List<dynamic>;
- Likewise fix OneByteString_splitWithCharCode to return List<String>
and not List<dynamic>;
Additionally this CL refactors how getters and setters are created
in object_store.h removing 500 lines of largely boilerplate code.
Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: I3fdcd2d54ff3f307db0913c67a7c2f009ea9d7a7
Reviewed-on: https://dart-review.googlesource.com/15884
Commit-Queue: Vyacheslav Egorov <vegorov@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2017-10-24 11:43:48 +00:00
Vyacheslav Egorov
5b14ee115a
[VM] Make _StringBase implement String
...
_StringBase is used everywhere as if it was assignable to String,
however it itself does not implement String, its subclasses do.
This change addresses this.
Also removes unused native runtime method from one of subclasses.
Bug: https://github.com/dart-lang/sdk/issues/31052
Change-Id: Iea2389d1b48a3689fb11c99c0e230747ab1c5962
Reviewed-on: https://dart-review.googlesource.com/12444
Reviewed-by: Martin Kustermann <kustermann@google.com >
Commit-Queue: Vyacheslav Egorov <vegorov@google.com >
2017-10-10 10:33:31 +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
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
Siva Annamalai
964a659470
- reset 'dirty' flag to false after the libraries mirrors is computed, this ensures that we compute the libraries only when new library modules are loaded and the 'dirty' flag is set to true.
...
- Use passed in 'zone' argument in the native string functions
- Use passed in 'thread' argument in the library mirror creation functions
R=rmacnak@google.com
Review URL: https://codereview.chromium.org/1935703002 .
2016-04-29 15:15:19 -07:00
Ivan Posva
5be5d54529
- Refactor Symbol allocation to expect a thread parameter.
...
- Preallocate all tokens as symbols to avoid repeated lookups.
- Pass thread/zone where useful while doing this change.
- Avoid allocating symbols for error messages.
BUG=
R=fschneider@google.com
Review URL: https://codereview.chromium.org/1870343002 .
2016-04-11 16:28:29 -07:00
Florian Loitsch
55630a5e90
Support 'dart.library.X' env variables in the VM.
...
BUG= http://dartbug.com/24587
R=iposva@google.com , johnmccutchan@google.com
Committed: https://github.com/dart-lang/sdk/commit/c2a06e22cb83f491fd3accc33d7738c87490c26d
Reverted: https://github.com/dart-lang/sdk/commit/5eb5b429895987519a00daa81b5ab261debbca3f
Review URL: https://codereview.chromium.org/1640853004 .
2016-02-29 20:58:32 +01:00
Florian Loitsch
5eb5b42989
Revert "Support 'dart.library.X' env variables in the VM."
...
This reverts commit c2a06e22cb .
Review URL: https://codereview.chromium.org/1668253002 .
2016-02-04 22:26:06 +01:00
Florian Loitsch
c2a06e22cb
Support 'dart.library.X' env variables in the VM.
...
BUG= http://dartbug.com/24587
R=iposva@google.com , johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1640853004 .
2016-02-04 13:04:31 +01:00
Srdjan Mitrovic
465cf10a7c
Remove some Isolate::current_zone() calls, as it gets the zone from mutator thread not the current thread
...
BUG=
R=zra@google.com
Review URL: https://codereview.chromium.org/1414493003 .
2015-10-19 10:27:36 -07:00
Lasse R.H. Nielsen
d755dd65b9
Update range errors to agree on the numbers.
...
Also ensure that typed-data errors are consistent with other lists.
Fixes issue #24295
BUG= http://dartbug.com/24295
R=floitsch@google.com , iposva@google.com , sra@google.com
Review URL: https://codereview.chromium.org//1318943005 .
2015-09-11 13:05:36 +02:00
koda@google.com
e3a345a84b
Rename NoGCScope -> NoSafepointScope.
...
The old name makes less sense in the context of concurrent GC (and multiple threads in general).
Document the intended semantics of this (DEBUG-only) guard scope.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1016503005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44616 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 22:08:25 +00:00
koda@google.com
92a8c39d3c
Keep zone cached in SnapshotReader to allow removing ZoneHandle(Isolate*) interface.
...
Add a StackZone around API snapshot reading call.
Also remove CheckedHandle(Isolate*) interface by migrating its users to Zone*.
R=asiva@google.com
Review URL: https://codereview.chromium.org//1012333002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44580 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-19 17:42:40 +00:00
koda@google.com
9c181ec6d5
Thread/Isolate refactoring: new(Isolate*) -> new(Zone*)
...
Refactor all remaning cases where the current zone is used through new(Isolate*) and remove this interface.
Removing this interface is needed to move towards multiple threads per isolate, and also makes the caller more aware of the scope of the zone used, reducing the risk of use-after-free.
Make the current thread and the stack zone created around native/runtime entries directly available in their body, saving an indirection (and optimized away if unused).
R=iposva@google.com
Review URL: https://codereview.chromium.org//982873004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44541 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-17 19:24:26 +00:00
lrn@google.com
ab51ccc9f0
Create string efficiently from Uint16List/View.
...
R=asiva@google.com , fschneider@google.com
Review URL: https://codereview.chromium.org//864463002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43235 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 12:44:44 +00:00
lrn@google.com
ab2d914ae3
Avoid extra duplication of substrings during string.replaceAll.
...
R=asiva@google.com , zerny@google.com
Review URL: https://codereview.chromium.org//858543002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43059 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 08:27:42 +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
koda@google.com
667454a233
Support old-space allocation in generated code (bump block only for now).
...
First steps towards general pretenuring support.
* Generalize Heap::Top/EndAddress.
* Add testing flag to exercise new code paths.
* Also update the slow-case runtime calls, to ensure a fresh block will be allocated in old.
Next steps are general invalidation of the generated code and adding a policy that doesn't blow up the store buffers), and freelist allocation.
Review URL: https://codereview.chromium.org//578443003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40530 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 23:46:22 +00:00
rmacnak@google.com
cefb21b6a3
Narrow String::CharAt from int32_t to uint16_t.
...
R=asiva@google.com
Review URL: https://codereview.chromium.org//560113002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40178 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 20:55:36 +00:00
iposva@google.com
92f2698abe
- Refactor the way X.fromEnvironment is implemented.
...
- Predefine 'dart.isVM' to be 'true'.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//546053002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39986 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 18:23:05 +00:00
vegorov@google.com
c431dbcb3f
Cleanup throwing of the RangeError in the runtime to remove duplicated code.
...
Improve List._copyFromObjectArray native performance for large arrays by using PassiveObject instead of Object.
R=iposva@google.com
BUG=
Review URL: https://codereview.chromium.org//533483003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39911 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 13:15:56 +00:00
ajohnsen@google.com
38bfed114d
Fix memory-issue String::fromCharCodes, where a GC could invalidate an address.
...
The constructions is now reordered, so the address is not extracted
until after allocation of the new string.
BUG=https://code.google.com/p/dart/issues/detail?id=17602
R=iposva@google.com
Review URL: https://codereview.chromium.org//209003009
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34320 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-24 18:56:36 +00:00
ajohnsen@google.com
b26561d41d
Fix last commit.
...
BUG=
Review URL: https://codereview.chromium.org//187813011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33364 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 09:24:54 +00:00
ajohnsen@google.com
c3dfdbe772
Fix fromEnvironment when called from isolates.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//180243022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33363 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 09:16:41 +00:00
ajohnsen@google.com
1ce402ec78
Revert "Re-apply 'Fix fromEnvironment when called from isolates.'"
...
This reverts commit 1f2ddd083424a93dc0822c2ae86be971d5a97e21.
BUG=
Review URL: https://codereview.chromium.org//185233016
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33278 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 16:05:21 +00:00
ajohnsen@google.com
fb97ee0fe1
Re-apply 'Fix fromEnvironment when called from isolates.'
...
Old Review URL: https://codereview.chromium.org//186393004
BUG=
Review URL: https://codereview.chromium.org//177353006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33274 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 14:22:54 +00:00
ajohnsen@google.com
e8ad108bec
Revert "Fix fromEnvironment when called from isolates."
...
This reverts commit f5886c3a1fe96580c13d83d6422a6bb6931ae95a.
BUG=
Review URL: https://codereview.chromium.org//186573002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33266 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 11:06:39 +00:00
ajohnsen@google.com
7e55a59ce4
Fix fromEnvironment when called from isolates.
...
BUG=
R=sgjesse@google.com
Review URL: https://codereview.chromium.org//186393004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33264 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-04 10:26:17 +00:00
fschneider@google.com
16857e0b13
Revert r32930 (Add more timing information in the VM to track time...)
...
It caused severe performance regressions that should be addressed.
TBR=asiva@google.com
Review URL: https://codereview.chromium.org//177733002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32959 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-24 12:15:55 +00:00
asiva@google.com
6d313d3797
Add more timing information in the VM to track time spent is dart code Vs native code.
...
R=johnmccutchan@google.com , turnidge@google.com
Review URL: https://codereview.chromium.org//137483010
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32930 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-21 21:30:29 +00:00
iposva@google.com
f2a6f1b4b6
Another round of cleanups for http://www.dartbug.com/15922
...
- Address warnings about 64-bit to 32-bit conversions.
R=ajohnsen@google.com , asiva@google.com
Review URL: https://codereview.chromium.org//169893003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32831 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-19 23:35:55 +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
lrn@google.com
66959d9dbf
Change int.fromEnvironment in VM to use same code as int.parse.
...
R=fschneider@google.com , sgjesse@google.com
Review URL: https://codereview.chromium.org//54663002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29670 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-31 13:45:39 +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
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
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
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
srdjan@google.com
37e66b3350
Treat final variables initialized with a literal as constants. Also sneak in a small cleanup.
...
R=hausner@google.com
Review URL: https://codereview.chromium.org//24673003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27973 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-26 21:06:56 +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
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
lrn@google.com
bab488a4fc
Allow String.fromCharCodes to work directly on a GrowableObjectArray.
...
Avoids copying the data from the internal ObjectArray into a new
ObjectArray before creating the string.
Review URL: https://codereview.chromium.org//12632014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20060 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-15 07:22:12 +00:00
lrn@google.com
a5a93492d9
Change VM's string-buffer patch to use a Uin16Array as backing buffer.
...
Review URL: https://codereview.chromium.org//12421002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19679 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 10:21:52 +00:00