Commit Graph

28 Commits

Author SHA1 Message Date
Régis Crelier 893d3e86dd [VM/nnbd] Add nullable Object type to object store and use it.
Simplify handling of Never and add comments in AbstractType::IsSubtypeOf.

Change-Id: Ie312944b380ff6a3f4ba59bf2a564d402110faa8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135352
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-11 23:37:05 +00:00
Liam Appelbe 93c5134a69 [vm] Add nullability variations for snapshot singletons
This fixes snapshot_test.cc in legacy mode.

Bug: https://github.com/dart-lang/sdk/issues/40169
Change-Id: Ibb47634be296b3b9159af9fe0500d64f9d279b60
Fixes: https://github.com/dart-lang/sdk/issues/40169
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133148
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-01-27 18:27:39 +00:00
Régis Crelier df678dbec0 [VM/nnbd] Introduce type Never in VM and bytecode.
Introduce enum NNBDMode for subtype test checking mode.

Change-Id: Id9c39ee8c975c664ac58e313b7dd05e6e219dfc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123557
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-11-01 00:43:59 +00:00
Ryan Macnak 7d7e7c268e [vm] Work around interaction between type and instance canonicalization in isolate messages.
Type canonicalization is deferred between in may involve cycles. Instances are canonicalized eagerly, but their type arguments are not necessarily canonical yet, which can lead to incorrect canonicalization of the instance.

The work around is to include the most popular type arguments in the serializer's set of base objects, bypassing deferred canonicalization. Other type arguments will continue to fail.

Bug: https://github.com/dart-lang/sdk/issues/33430
Change-Id: Ia992b3ebc2974b54acb5c88b3e1d836f6ec1f1b8
Reviewed-on: https://dart-review.googlesource.com/61721
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-06-21 23:45:05 +00:00
Martin Kustermann 3b057dea98 [VM] Remove legacy Object::empty_context() and CTX constant
Our generated code does not keep the context in a special register
anymore (for quite some time now).  The context is just another definition
in the IR language and gets assigned register locations by the linearscan
register allocator.

Furthermore we no longer use an empty context for closures which have no
captured states, instead the context of those closures is just `null`.

This CL therefore removes Object::empty_context() and the CTX constant.

Change-Id: Iea171e0d0fd56c48f1c456e08e060a12267e39cc
Reviewed-on: https://dart-review.googlesource.com/51129
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-04-19 20:09:38 +00:00
Samir Jindel 8aa36b75c5 Re-land "[vm/kernel] Fix non-canoncialized type arguments in partial instantiation."
Original revision is in Patchset 1.

Run against failing kernel-precomp tests in "cl-linux-try".

Change-Id: I997de294150ef7dd0874eeccb8b6187ae64ea813
Reviewed-on: https://dart-review.googlesource.com/51220
Reviewed-by: Erik Corry <erikcorry@google.com>
2018-04-18 13:44:25 +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
Ryan Macnak a2c41bd926 Move the canonical empty context to the VM isolate.
R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2780393005 .
2017-03-31 14:43:01 -07:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

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

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Srdjan Mitrovic cea892f234 Cache initial (empty) ic_data arrays so that they are not repeatedly allocated. Factor out descriptor and data array allocation. Will be used later when we copy the descriptor for background compilation.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1410573006 .
2015-10-27 15:05:14 -07:00
Siva Annamalai 228e8f6edd - Turn on writing of ic_data_array so that we have that information for script snapshots that would allow for code to be optimized right away
- Use snapshot Ids for singleton VM isolate singleton objects instead of writing them out into the snapshot

- Add support for writing function objects as an Id, this is needed to serialize function objects from the core library in a script snapshot (these function objects could potentially appear in the ICData).

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1337083004 .
2015-09-15 17:18:21 -07:00
Siva Annamalai 6b2ae767fd Changes to prepare for allowing script snapshots to be taken after running the main application
- Create singleton empty context scope object
 - Add an implicit field in the context scope so we can distinguish implict context scope objects
 - Allow serialization of extractor_parameter_types, extractor_parameter_names

BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//1323813004 .
2015-08-31 15:41:41 -07:00
Ryan Macnak 7055e4862b Toward precompiled snapshots.
R=asiva@google.com, fschneider@google.com

Review URL: https://codereview.chromium.org//1290933002 .
2015-08-19 15:34:17 -07:00
asiva@google.com cfb2df1020 Fix for issue 20992 - Allow sending static/top-level functions to other isolates which are spawned using the 'spawn function' functionality.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44297 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-06 18:50:19 +00:00
koda@google.com c645b0ab71 Object ids in snapshots are assigned sequentially, and can in many cases be omitted by the writer and inferred by the reader. The exceptions are the classes that are serialized in two steps (arrays and user-level Dart instances), where the second step must include the id.
For standalone, makes full snapshot 5% smaller, and startup ~1.5% faster when measured on a Nexus 10.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38261 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-15 21:47:00 +00:00
iposva@google.com dd7d6dd375 - Handle doubles transferred in message snapshots specially.
- Do not encode doubles using integer compression.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34681 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-03 00:58:14 +00:00
regis@google.com d599ea7d9b Simplify type argument instantiation cache lookup by introducing an array
of 1 zero Smi.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32756 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-18 19:30:03 +00:00
regis@google.com 01a31275bd Make creation of list literal more resilient to changes in the underlying
dart implementation of List in the core library.
Do the same for map literal creation.
Review URL: https://codereview.chromium.org//11299020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14997 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-16 01:31:15 +00:00
lrn@google.com 1555c1db26 Convert String to a class.
Remove the StringImplementation class.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14779 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-12 08:16:59 +00:00
iposva@google.com c8df70b904 Fix bug 5575:
- Remove residue of typed arrays from dart:core.
Review URL: https://codereview.chromium.org//11031063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13274 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-05 06:52:42 +00:00
lrn@google.com 292da5cc48 Make int an abstract class.
This looks deceptively simple (the only real change is in init, which
just copies the code for double, and the rest are just renaming for
consistency). It seems to work.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12304 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-13 07:17:27 +00:00
hausner@google.com 5692051e4e Convert double interface into abstract class
In a future change, we can implement double in the core
library, eliminating class Double (using the patch class
feature).
Review URL: https://chromiumcodereview.appspot.com//10876100

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11631 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:29:49 +00:00
hausner@google.com c7f5bcd0ca Eliminate interface bool
Replace with concrete class bool instead, and getting rid of class Bool in core_impl library.
Review URL: https://chromiumcodereview.appspot.com//10874071

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 21:09:23 +00:00
asiva@google.com d9e71facc7 Add smi_type, mint_type and double_type to the predefined types list for script snapshots.
Review URL: https://chromiumcodereview.appspot.com//10869035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11275 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 23:36:37 +00:00
hausner@google.com 0300d88b1b Gentle start with removing explicit interfaces
Review URL: https://chromiumcodereview.appspot.com//10832401

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11248 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 18:32:10 +00:00
asiva@google.com 5fd180cdfc 1. Register canonical names for internal VM classes and get rid of the method GetSingletonClassName
2. Create the empty_array object as a singleton in the VM isolate and remove it from the object store
3. Remove eager population of the functions_cache entry in the class. This results in a pretty impressive reduction of the initial isolate heap size:
    - on IA32 it goes from 1331k to 1071k
    - on X64 it goes from 2431k to 1911k
    - snapshot size also is reduced from 859219 bytes to 789147 bytes.
    (as a follow up change I will consider completely removing functions cache)
Review URL: https://chromiumcodereview.appspot.com//10827249

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10535 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 21:43:00 +00:00
asiva@google.com d4d781d636 - Unify class ids and snapshot object ids list so that we don't have disparate
and sometimes confusing values.
- Remove instance_kind_ field from RawClass.
- Rename all class id names to have a Cid suffix.
- Remove code from object.h and object_store.h which dealt with object ids
  of predefined classes for snapshots.
Review URL: https://chromiumcodereview.appspot.com//10827209

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 19:46:23 +00:00