Commit Graph

70011 Commits

Author SHA1 Message Date
Vyacheslav Egorov ab56c2f841 [runtime/docs] Add custom lexer for shell sessions in runtime wiki.
This was missing from the previous wiki related commit.

TBR=aam@google.com

Change-Id: Ib68ead3bab2841bb8e02cb93fd71bce7515ff335
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134285
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-02-04 09:16:52 +00:00
Vyacheslav Egorov 857b911f3b [vm/docs] Publish "Introduction to Dart VM" source and build tools.
Change-Id: I30068d6492bd6ec4ce42cc50d4a481960a0197fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133985
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-02-04 09:04:32 +00:00
Jens Johansen 18c281c624 [observatory] Allow to say 'break package:foo/file.dart:42'
This CL updates the parsing of "break" statements in the debug console
in observatory, as well as handling that the same script can be a part
of several libraries.

Before one could get stuff like this:
$ break package:front_end/src/fasta/scope.dart:389
Function 'package:front_end/src/fasta/scope.dart:389' not found
$ break scope.dart:389
Script 'scope.dart' is ambiguous

The first one is fixes by this CL: We now allow package uris and thus
no longer think it's a function. In this case it wouldn't have mattered
though, it would just say it was ambiguous, as the last case.
This is caused by the same script being found twice. By using a set
instead of a list, that's fixed too.

Change-Id: I3931c8f2abc0a3a5a77cff516da8767037196bf2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133593
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-02-04 08:57:01 +00:00
Jens Johansen c6aa3a22a7 [vm] [debugger] Fix for not breaking in library with mixin
In the VM, a single script can belong to several libraries because of
mixins.

Previously, when setting a breakpoint, it found the function to set the
breakpoint in by taking the "scripts library" (script.FindLibrary) and
then tried to find a function in that library that matched.
Sometimes it found the "wrong" library and the breakpoint thus wasn't
set.

This CL changes that so it goes though all libraries, finds all maching
libraries and tries all of them.

This solves the issue at hand, but might not solve all corner-cases.

This added test demonstrates the resolved case where before it would
just say that it couldn't add the breakpoint on line 13.

Change-Id: Ie44b0dfb4ea3e8de767d1867ec432b2aef429b76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133592
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2020-02-04 08:43:21 +00:00
Martin Kustermann 83d7048600 [vm/concurrency] Disable isolate groups in AOT mode
This is a preparation for landing the shared heap CL (it will
temporarily regress the isolate spawning time and memory use).

Once the shared heap CL is in, we can make a follow-up change to actually take
advantage of it by sharing the entire program structure (cl in
preparation by aam@). Once that lands we will enable the isolate groups
in AOT and reduce spawning latency by 10x :)

Regarding testing: We have already made all our isolate related tests in the
SDK run with/without isolate groups (irrespective of the default), so we
should continue to have test coverage in both modes.

Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: Ib7e5101dfe8527948cd9ceed09d50051b04fb874
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134280
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-02-04 07:58:01 +00:00
Dmitry Stefantsov 3183573a79 [cfe] Account for signatures when inserting noSuchMethod forwarders
It is possible for an abstract member to be overridden with another
abstract member with different signature (that has, for example, more
optional parameters).  In such cases, the noSuchMethod forwarders should
be generated for each distinct signature.

Closes #40248.

Bug: http://dartbug.com/40248
Change-Id: I7974415f0ecb78f05d7265ecf9d57cc0d38e6c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132661
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-04 07:58:00 +00:00
Johnni Winther 7c837ce30a [dart2js] Remove all unneeded casts
Some of the implicit casts were need for covariance checks. Now these
can be identified and actively preserved.

Change-Id: Ibfff4f68cc4af7956372adb2f4d846b079f0b508
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134162
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-04 07:01:09 +00:00
Srujan Gaddam 851912cc1d Change nnbd_src files to be null-safe
Translates the forked nnbd_src files to address analyzer issues.

Change-Id: Ida21988bff63a6c5a037b548d0c8b11208317b3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130131
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-02-04 01:57:39 +00:00
Ben Konyi 8f7d3fca69 [ VM / dart:typed_data ] Change fmaxf/fminf to fmax/fmin for Float64x2.clamp
Fixes https://github.com/dart-lang/sdk/issues/40446

Change-Id: Ic610ecd024a6fc9bab3095ceb049139e21a519f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134242
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-02-04 01:06:19 +00:00
Ryan Macnak 342535bb88 Mark typed_data/zeroed_allocation_test as slow on reload bots.
Change-Id: I7008ce0b5e68b092067f34e1f7ef6ee32487dc51
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134260
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-02-04 00:41:36 +00:00
Nicholas Shahan 3ca719b44c [dartdevc] Enforce omit_local_variable_types lint
Change-Id: I50d9c073ec337d5f05203b30abf289877fdeb08f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134082
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2020-02-03 23:41:17 +00:00
Nicholas Shahan 703bc0086d [tests] Create null is T tests in legacy and null safe libraries
Change-Id: I2054b6da8b66e7c6de81d9fb18fdc1c264db376c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132420
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2020-02-03 23:12:02 +00:00
Paul Berry b01eb17669 Migration: remove test file containing no tests
Change-Id: Ib15940732ccd9e4f36de12cbe10a2ce631a4a24c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134145
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-02-03 23:10:21 +00:00
Sam Rawlins 44814d320f Final fix for analyzer windows bots; don't canonicalize
Something is weird with our ResourceProviders and Context.canonicalize.
It causes the following:

newFolder(convertPath("/p3"));
resourceProvider.getResource(convertPath("/p3")) is File; // false
resourceProvider.getResource(
    context.canonicalize(convertPath("/p3"))) is File; // true

Change-Id: Iafbfb6ad1bfc912a6850faf063778879dc97fe62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134143
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-02-03 23:03:56 +00:00
Konstantin Shcheglov 239a278b84 Remove TypeSystem.isOverrideSubtypeOf()
It is replaced with CorrectOverrideHelper.

Change-Id: Iab8162b9ffbca02000587ece1215717346b0a3a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134203
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-03 23:02:16 +00:00
Konstantin Shcheglov 49e2ed34a2 Issue 40304. Use runtime type equality for checking overrides.
Bug: https://github.com/dart-lang/sdk/issues/40304
Bug: https://github.com/dart-lang/sdk/issues/40279
Change-Id: I55a27335cfa923297ee580de6e79df15de004879
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-03 22:52:46 +00:00
Jaime Wren e5d5434715 Standard output improvement from metrics_util.dart to print "<no counts>" if the counter has no counts.
Change-Id: I3d01f539670bb8d57f6b04b16cc4f92aaa2aa1c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134201
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
2020-02-03 22:50:07 +00:00
Ben Konyi 30f25ba735 [ VM / typed_data ] Fixed inconsistent results for -Float32x4.zero().clamp and -Float64x2.zero().clamp
The fuzzer found an issue where clamping negative zero would result in
conflicting answers depending on whether or not the clamp operation had
been optimized in JIT mode.

The MINPS and MAXPS instructions will always return the second operand
if the values being compared are -0 and 0, which is the opposite of what
the C implementation of clamp was doing.

Fixes https://github.com/dart-lang/sdk/issues/40426.

Change-Id: I3afb725bd0c8643758dbe753d863ba93c86ad747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134093
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-03 21:59:48 +00:00
Konstantin Shcheglov a0ca3e720e Update dev_compiler/tool/dart2js_nnbd_sdk_error_golden.txt after analyzer change.
TBR

Change-Id: I8da2f14102973dd738a19d4e0c13687f10767486
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134202
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-02-03 21:42:11 +00:00
Jaime Wren 78fe10c3be Completion metrics change- add missing documentation in the relevance_analyzers.dart file, as well as adding DartCompletionRequest as an input to the analyzers
Change-Id: I31c2523252f2574f092b44ec8b67d346804ac856
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134220
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-03 20:50:26 +00:00
Konstantin Shcheglov 1fff623c19 Use TypeSystemImpl instead of TypeProvider in DartObjectImpl.
We need to be able to use TypeSystemImpl in DartObjectImpl.== to
call runtimeTypesEqual() instead of DartType.==

Change-Id: I2021a0d86a7c304072fd8fee2d1a7e6e979100a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134146
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-03 20:38:46 +00:00
Konstantin Shcheglov a165b62561 Use CorrectOverrideHelper in InheritanceManager3.
Change-Id: I3ceee509d8e78b7f35cb4bb596beeee0d2d9aeb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134148
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-03 20:34:26 +00:00
Alexander Markov e1e2604ff1 [vm/nnbd] Use NNBD flags from AsExpression, IsExpression
This is the VM-specific follow-up to
https://dart-review.googlesource.com/c/sdk/+/133100

Change-Id: Iaa8728d2e0afebf421f9c65c3b3a48b286af5970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134200
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-03 20:20:26 +00:00
Paul Berry a97c23b939 Migration: plumb ElementTypeProvider through FlowAnalysisVisitor.
This ensures that when type promotion happens while running the fix
builder, the promoted types are the correct post-migration types.

Change-Id: I15fe2cd8a6399527ded782dbbf252f9aeb530827
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134083
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-02-03 19:59:38 +00:00
Paul Berry e989e90346 Migration: avoid ambiguities when adding a cast after a function expression.
When adding a cast to a function expression like `() => null`, we need
to add parentheses, so that we produce `(() => null) as Type`, rather
than `() => null as Type`, which makes the cast appear to apply to the
function body expression.

Change-Id: Ib5ae93df5b840a832c10941e47fa092a4f764eea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134044
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-02-03 19:59:38 +00:00
Paul Berry 763ce812ea Migration: properly handle type parameter types with nullable bounds.
This required adding logic to the `TypeParameterType` case of the
`toFinalType` function, so that we look up the decorated type of the
type parameter bound, and convert it to a final type as well.
(Previously we were just using the bound stored in the element model,
which was in many cases the bounds from prior to migration, and hence
it was a `*` type so it behaved as though it was non-nullable).

This required moving `toFinalType` into the `Variables` class so that
it could look up the decorated types of type parameter bounds.

Fixes #40355.

Change-Id: I53c2636aef6954500589e924b9755a297c2b30f9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134061
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-02-03 19:59:38 +00:00
Konstantin Shcheglov bbb4ab9153 Include types of candidates into INCONSISTENT_INHERITANCE.
Change-Id: Ide9f7da4f4d70bdea53f44ea0a8cdc2daa560b01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134144
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-03 19:18:36 +00:00
Mark Zhou e7a524e8c4 Cleaning up corelib test migrations.
Change-Id: Ib235c213861f819ed11a887283cad085582eaac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132941
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2020-02-03 19:06:17 +00:00
Jaime Wren b00f0ff5fd For 'dartdev format' and 'dartdev format --help', return the output from dartfmt --help, instead of the default output from FormatCommand.printUsage(). This is follow up on https://dart-review.googlesource.com/c/sdk/+/133042
Change-Id: I497e983a2302fbb010256a4961b6121294a9de82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134106
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
2020-02-03 17:51:36 +00:00
Ryan Macnak 1efba58d22 Reapply "[vm] Initialize large typed arrays only once."
Change-Id: I92eb6c96db97e0951ae34315ad8d744e06064b3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133764
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-02-03 17:22:05 +00:00
Ryan Macnak 24418e6c6d [vm, gc] Remove BumpAllocationScope.
This scope can sneak objects larger than kAllocatablePageSize directly into non-large heap pages.

This scope also holds a heap lock outside of the GC, which is likely to create issues when multiple isolates run on the same heap.

Change-Id: Ic56277c83ffccfe2e1396ed773dd30b8d172bbba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134040
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2020-02-03 17:22:05 +00:00
Ryan Macnak d9a0359843 [vm, gc] Document safepointing.
Change-Id: I35eca64eb6be8cd72f527644ef8fd644f30287a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134109
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-02-03 16:58:22 +00:00
Janice Collins bd2e6adb74 Implement FantasySubPackage.
Also splits FantasyRepo into FantasyRepoImpl and an abstract class,
and unifies some of the filesystem mocking in a helper class.

Change-Id: Idb9ac7bf13238116448a46f551236e41cda83471
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134121
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-02-03 16:55:25 +00:00
Brian Wilkerson 00e4d8f33d Change the tests of quick fixes so they can use real lint results
This adds support so that tests of lint-based quick fix tests can use
the output of the linter rather than cons-ing up a fake lint to drive
the test. It also converts many of the existing tests to use real lints.

There were/are an amazing number of tests that were invalid and needed
to be fixed. This includes fixes for some of them, but there are still
several tests that have not been converted because they fail when run
using the output of the linter. Some of these are invalid tests, but
some might indicate bugs in the quick fix generation that should be
fixed.

Change-Id: Iea806849ea111dc8454073e8fe44fd42c5208652
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134141
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-03 15:34:55 +00:00
Jonas Termansen 4cd6243d77 [dart:io] Backport semantic changes from the dart:io NNBD migration.
The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports these
semantic changes to the unmigrated SDK so any issues can be discovered
now instead of blocking the future SDK unfork.

The Process class will now throw a StateError if the process is detached
upon accessing the stdin, stdout, stderr, and exitCode getters.

The Socket class will now throw a SocketException if the socket has been
destroyed or upgraded to a secure socket upon setting or getting socket
options.

Change-Id: I956fd07e713e51ebd479ebbfe4790d8d2fdf0744
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133989
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-02-03 15:10:45 +00:00
Johnni Winther 4d32ec8d21 [cfe] Non-nullify legacy types in opt-in libraries
+ preserve promotion for synthetic variables.

Closes #40255

Change-Id: I2ebe43c31a05ff0121d971205bf8ff5f0e084113
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134161
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-03 14:52:55 +00:00
Johnni Winther 281ce7c14c [cfe] Rename LibraryBuilder.uri to importUri
Change-Id: If576b2b0bca0e27ec63891a53c760d870b2bcd01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133997
Reviewed-by: Jens Johansen <jensj@google.com>
2020-02-03 14:52:55 +00:00
Martin Kustermann ce27d1a539 [vm] Specialize TTS stubs only for legacy types
This is a follow-up to 62835950d which was using the condition
`type.IsNullable()` for determining whether to generate TTS stubs.

It turns out `type.IsNullable()` is false for legacy types (for whatever
reason, because legacy types are nulable).

Instead we'll change the condition to `type.IsLegacy()`.

Issue https://github.com/flutter/flutter/issues/49893

Change-Id: I4c8a728382c7b7c65ddb6bff41778b384634d83d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134164
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2020-02-03 14:07:55 +00:00
Johnni Winther 3210109ccf [cfe] Detects writes during initialization in late final field lowering
Closes #40219

Change-Id: I8519a35cef96262df0dc68101e43ec5ea8b9de3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133987
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-03 13:40:50 +00:00
Johnni Winther 8991dc33d2 Fix language/operator/invalid_operators_test
Closes #40415

Change-Id: If179bc6802e6193aea4c011d889f9ecbfa3020b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133993
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-02-03 13:35:15 +00:00
Dmitry Stefantsov 5af05598eb [cfe] Disallow non-nullable fields without initializers
Closes #40081.

Bug: http://dartbug.com/40081
Change-Id: I4032af18164af05034c2706cba8f62be39c636c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133994
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-02-03 13:32:45 +00:00
Johnni Winther 905a380258 [cfe] Handle explicit extension operator access from dill.
Closes #39938

Change-Id: I9798e02c243c1edfbeb1e6f5bb5564bcf9e74a05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133996
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-02-03 12:54:15 +00:00
Victor Lima d3b7909769 [vm] Remove flag unbox_numeric_fields
Change-Id: I57899b239fb942650460377ec0a6cecbb48c6926
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133995
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
2020-02-03 12:43:05 +00:00
Aske Simon Christensen 76c6282de6 [vm/aot] Use a global dispatch table for instance calls in AOT.
This is a Dart-tailored implementation of the "row-displacement
dispatch table" technique for closed-world instance calls:

All interface targets in the program are grouped into selectors such
that all targets that could potentially be called from the same call
site have the same selector (currently just grouped by name).

Each selector is assigned a selector offset such that offset + classid
is unique for all selector/classid combinations where the class
implements the selector.

At every instance call site that has an interface target (i.e. where
the static type of the receiver is not dynamic), the selector offset +
receiver classid is computed and used as index into a global table of
entry points.

If the receiver can be null (as determined by the front-end TFA and the
VM type propagation), a null check is inserted before the call.

An arguments descriptor is provided (only) for selectors that need it
(those which have type parameters or optional/named parameters).

The dispatch table calls don't need the monomorphic entry code, so for
functions that are only called via dispatch table calls (i.e. never
called dynamically), the monomorphic entry code is left out.


Some future improvements to the table dispatch implementation are
mentioned in https://github.com/dart-lang/sdk/issues/40188


The table dispatch flag is disabled by default in this commit. A
separate commit enables the flag.

Change-Id: Ic2911742b4a2c9a8d3bc7df60605454cbe4c0714
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126648
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-03 11:04:15 +00:00
Aske Simon Christensen de0ed1bd4e [vm] Share implementation of LoadClassIdInstr across architectures.
Also avoid executing the tagging instruction in the Smi case for
some LoadTaggedClassIdMayBeSmi implementations.

Change-Id: I067b06ce404ffbba1981539ed3bfef72c4215e8f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133584
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-03 11:04:15 +00:00
Devon Carew 5f5e1db141 [nnbd tool] move nnbd preview tool resources to individual files
Change-Id: I7f3690e34d94e3d7f361b31447a5ae60cf01a1ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134140
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-02-03 00:38:34 +00:00
Konstantin Shcheglov 1bfe26ea48 Extract CorrectOverrideHelper and use for checking mixin applications.
Change-Id: I33c7b2df51cda29721be56c624b44c4ed6126137
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134095
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-02 07:07:04 +00:00
Sigmund Cherem 07675de0c0 Fix type error within _EventStream.onData
The constructor was wrapping the onData handler to hide the type-mismatch. This
copies the same logic to the onData handler.

In non-nnbd code this code was not exercised. The migration of dart:async
made this code reachable on our tests. That's because Stream.first used to
do:

  var subscription;
  this.listen(() => ... cancel subscription here, ...)

it now avoids making subscription nullable by registering the onData handler
later:

  var subscrition = stream.listen(null, ...);
  subscription.onData(() => ... cancel subscription here);

This change fixes the following 6 html tests under nnbd:
html/history_test/history/history
html/transferables_test
html/transition_event_test
html/websocket_test
html/worker_test/functional/functional
html/xhr_test


Change-Id: I095ea8d545e65b047504af0367586884bba84d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134120
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Srujan Gaddam <srujzs@google.com>
2020-02-02 05:58:24 +00:00
Sam Rawlins e4ddd90cd1 NNBD Preview: Fixes for a few edit details
These are bugs found while looking at the collection package.

Change-Id: I5527c873cbe015e723f59f743952b5dc493c5c97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134108
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-02-02 03:33:53 +00:00
Devon Carew c8ed304e97 [dartdev] add a dartdev 'create' command
Change-Id: I95625a9c422335ba5de92c887afce9eb564d6a04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133460
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
2020-02-02 02:23:13 +00:00