The CL is a step towards have a more restricted and wellstructured
handled of references and canonical names.
The CL moves Reference to canonical_name.dart and makes
CanonicalName.reference private, and replaces CanonicalName.getReference
with a 'reference' getter.
It also removes NamedNode.canonicalName, Field.getterCanonicalName and
Field.setterCanonicalName so that these can only be accessed through the
corresponding reference. This is to reduce the reliance on the
canonical names which, ideally, should only be part of serialization and
deserialization.
TEST=existing
Change-Id: I955fb7d52d4e112d8741f7c12dcf38b74ae0c91a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190442
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
* Add InstanceGetterInvocation for getter/field invocation in web
backends
* Add localFunction getter to LocalFunctionInvocation
* Remove isNot from EqualsCall and EqualsNull - the encoding didn't
carry its weight.
* Remove uses of Name.name
* Remove BottomType code from VM
TEST=existing
Change-Id: I99d05d35b9ef193d092cc151c99ad472dbd60834
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188725
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
The CFEs FormattedMessage always had two getters to get the text inside
one that would supposedly give an ansi formated version of the message
and one that would supposedly give a plaintext formated version of the
message. They both returned the same string, though, which would either
be with ansi escape codes or plain text depending on the environment at
compile time.
This CL fixes that by having both messages, and letting the reporting
(i.e. whenever the message is read) decide which to use. That way we
can - for instance - report errors with color if the terminal supports
it correctly when reusing a dill (and reissuing problems, but where the
terminal support changes) and if printing the problem to an html <pre>
field (like observatory does).
It also cleans up two different implementations of whether we think
the terminal supports colors or not, by deleting one of them.
This is the second try. Patchset #1 is the original.
Patchset #2(and possibly beyond) is the changes.
TEST=Existing test suites.
Change-Id: I8e483049ce81ce1bd8e5396b588a31e0ad3a8630
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187402
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This reverts commit f63f7736c5.
Reason for revert: This somehow breaks the Windows bots. `python tools/test.py -n dartk-win-release-x64 standalone_2/io/process_shell_test`.
Original change's description:
> [cfe] Actually have both ansi and plain text formatted messages
>
> The CFEs FormattedMessage always had two getters to get the text inside
> one that would supposedly give an ansi formated version of the message
> and one that would supposedly give a plaintext formated version of the
> message. They both returned the same string, though, which would either
> be with ansi escape codes or plain text depending on the environment at
> compile time.
>
> This CL fixes that by having both messages, and letting the reporting
> (i.e. whenever the message is read) decide which to use. That way we
> can - for instance - report errors with color if the terminal supports
> it correctly when reusing a dill (and reissuing problems, but where the
> terminal support changes) and if printing the problem to an html <pre>
> field (like observatory does (1)).
>
> It also cleans up two different implementations of whether we think
> the terminal supports colors or not, by deleting one of them.
>
> (1) At least sometimes. It works - I think - only for 'evaluateInFrame',
> but that's another story (and will be fixed in a follow-up CL).
>
> TEST=Existing test suites.
>
> Change-Id: Iedaedd9a5c41458d40c23ed4b706324c004ae943
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186291
> Commit-Queue: Jens Johansen <jensj@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
Change-Id: I0b53f943a61f76705badfead30d9e1ee35baff57
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186941
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
The CFEs FormattedMessage always had two getters to get the text inside
one that would supposedly give an ansi formated version of the message
and one that would supposedly give a plaintext formated version of the
message. They both returned the same string, though, which would either
be with ansi escape codes or plain text depending on the environment at
compile time.
This CL fixes that by having both messages, and letting the reporting
(i.e. whenever the message is read) decide which to use. That way we
can - for instance - report errors with color if the terminal supports
it correctly when reusing a dill (and reissuing problems, but where the
terminal support changes) and if printing the problem to an html <pre>
field (like observatory does (1)).
It also cleans up two different implementations of whether we think
the terminal supports colors or not, by deleting one of them.
(1) At least sometimes. It works - I think - only for 'evaluateInFrame',
but that's another story (and will be fixed in a follow-up CL).
TEST=Existing test suites.
Change-Id: Iedaedd9a5c41458d40c23ed4b706324c004ae943
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186291
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The front end previously enforced a stricter-than-spec requirement on
conflicting imports on its own code. The check was included of the
kernel snapshot and therefore always enforced, even in published sdks.
The extra check was removed a month ago and now tools/sdks/ have been
updated to use a later version of the sdk, so the unneeded hide
combinators can now be removed from the source code.
Closes#44667
TEST=existing
Change-Id: I1d1053b1ef9a40b6a918eef515a02d7b404906c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185084
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Null sources appear to come from files that contain only external
declarations. These sources can simply be ignored in the summation
of the sizes of dart files that make up a module.
Change-Id: I38864c7f4a3e208b19e26d5a887445fdf4622479
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184901
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This assertion fails when compiling the SDK because the types
dynamic, Null, and void all have `Nullability.nullable`.
They are safe to allow through unchanged because each has their own
visitor that avoids the nullability wrapper at runtime.
Change-Id: I0ce345ce11dddb345eab3708804cbde6a540fdd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184880
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.
TEST=Refactoring
Change-Id: Ie8fa5d41b99850d9e4abb59634c72920c64128d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183691
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
- Fix violations
- Ignore lint in js_ast directory. Still holding onto hope that we will
merge this with dart2js version and move out of the ddc package.
- Import all lints from pedantic 1.9.0
Change-Id: I834b4b197dcf0b6924417cdd337cda9a1b6249d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183043
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
This is in preparation to migrate package:kernel to null safety.
For the visitor interfaces to support non-nullable return types, the
implementations must avoid using `null` as return value in its base case.
TEST=Refactoring
Change-Id: Ie5e4153f8d3779d94957bb13b3d2d2a942040ff2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179760
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
- Added support for --define to the VM and dart2js
- Added support for -D and --define for `dart run` and `dart compile js`
Remaining improvements:
- Add support for providing multiple comma separated values for `dart
run`, `dart`, and `dart2js`
Related issue: https://github.com/dart-lang/sdk/issues/44562
TEST=Updated CLI tests and added new dart2js tests.
This reverts commit e49937769f.
Change-Id: I5f9275b829665eb5e8695403d67f230e752ab0e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183180
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
In non foreign-js calls this is immediatelly passed to wrapType which will
normalize it to the same value. So this is only added as a small optimization.
Change-Id: I145d58ad0244a2e7068a928b231f69a9491c465e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180444
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This change prepares for an upcoming CFE normalization.
Today kernel AST shows type literals as TypeLiteral nodes. Soon the CFE
will change the representation and canonicalize type literals and
represent them using constnats.
With this change, the compiler will recognize both the old and new
patterns.
Change-Id: I5aa3d99743c95c2dda04d299e586e77540fb7f7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180266
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Used in the SDK runtime library like the getGenericClass helper but this
is intended to be used when we statically know the type of the class to
be retrieved. Helps avoid breaks caused by an upcoming CFE change that
turns type literals into constants.
Change-Id: I262dd2dae347170050d2fe5cd2722ab132951036
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180265
Reviewed-by: Sigmund Cherem <sigmund@google.com>
- load summaries on updateDependencies and replace them by full
kernel files for current module on expression evaluation
- add tests for compiling expressions in various modules
- add tests for compiling expressions after updating dependencies
- test expression compilation in sound null safety mode
Change-Id: I243e8d1535e9510bc51f094545743d82bdbf23ca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179404
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Dart2js allows to declare JS-interp members, even if the enclosing library
doesn't have a JS annotation. This relaxes DDC to do the same.
Change-Id: I733d1cbb308692d89b8cd443cbde0ed30637e48e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177780
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This adds a new messages kind 'info' to the CFE for showing general
information during compilation. A 'configuration' options is added
to `CompilerOptions` for telling the CFE how it is run.
The configuration 'compile' is added for when the CFE is invoked to
produces an "executable" as when running `dart compile`. When
configuration is set, the CFE emits an info message about the
null safety compilation mode.
Support for `dart compile exe` and `dart compile js` is added in this
CL. Support for `dart compile kernel|app-jit|aot` is not included.
In response to https://github.com/dart-lang/sdk/issues/44234
TEST=pkg/dartdev/test/commands/compile_test.dart
Change-Id: I08f51e2a3f5ad4841c4d703bcd266b7afb63c7c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178982
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
This consists of a few combined changes:
* support `@Native` on tests: This entails calling registerExtensions
on user code, but only when running on native tests (which are explicitly
added to an allow list).
* support for invoking external top-level methods also on native tests.
* support for running `applyExtension` later in tests. This is because
tests introduce the JavaScript definitions after the calls to
registerExtensions happen. Note: this wouldn't be necessary if we one
day change how tests are loaded (e.g. if we can load the JavaScript
portion of the test before the module compiled by dartdevc is loaded).
That would entail more infrastructure work and given that this is only
used for ~200 tests, it doesn't seem worthwhile at this time.
* ensure extension symbols are also stored in `dartx.*` from a native
test. This is to ensure dynamic calls are fully supported.
* changes to the dart2js runtime to ensure the test code can run in both
dartdevc and dart2js with the same API.
* one updated test: all native tests need to be updated and I'll follow
up with those, but the changes on this test are included in this CL to
illustrate how this all fits together.
After this change (and parent changes), you can now run:
./tools/test.py -m release -c dartdevk -r d8 dart2js/native/native_checked_arguments1_frog_test
Change-Id: I4c2615a80b0e7611aa6f57abaa55b4e03b42bfe4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177180
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Bug: https://github.com/flutter/flutter/issues/73176
This reverts commit 825f56c6aa.
Both ddc and dart2js keep a set of native class names to make sure
@JS() classes don't conflict. Instead of processing native classes
for every component, this CL caches the set of native classes. This
should address the recompile time issues related to the original
revert.
Change-Id: If8028f0842440e8b9354bec9d7f72d0d42fcd8bd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178926
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
commands
- Added support for --define to the VM and dart2js
- Added support for -D and --define for `dart run` and `dart compile js`
Remaining improvements:
- Add support for providing multiple comma separated values for `dart
run`, `dart`, and `dart2js`
Related issue: https://github.com/dart-lang/sdk/issues/44562
TEST=Updated CLI tests and added new dart2js tests.
Change-Id: I9379c7aee1eab377adb3438393d9ad79c4938cc4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178262
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
LiteralExpression used to be the mechanism for 'interpolating' the
`JS` pseudo-function, but that long ago was reimplemented via the
js_ast template feature.
There are a few vestigial uses of LiteralExpression, but as none of
them use the `inputs`, this field is removed.
Change-Id: I4cd7c64766a7d6d9dd2c196c134bbfcb536fd2f4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/178400
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
During expression evaluation, we are collecting all variables in
all scopes that contain the current breakpoint line, and adding them
as available in current scope, which makes variables declared below
the current breakpoint line declared but undefined in JavaScript.
There is one exception to this seen so far - a variable
declared on the current breakpoint line might appear as not declared
in JavaScript and cause expression evaluation not to work due to
JS compilation errors.
This change fixes the issue by not collecting variables that are
declared on or after the current breakpoint line, making them undeclared
in dart (which also is correct according to dart scoping rules).
Closes: https://github.com/flutter/flutter/issues/72094
Change-Id: I113b69531171e0348d44edb8db6dd08a599c9db3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177760
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Mark Zhou <markzipan@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This CL adds stub for each concrete mixed in member into mixin
applications. The body of the stub calls the original member via
a super call.
This addition means that resolution of super access now use the
stub and not the original declaration as the target, which means
that it will be correct even when mixed in members are cloned. For
this reason, dart2js no longer needs to perform its own super
member resolution.
When a super call targets a mixin super stub (after cloning) it
can be optimized away by redirecting the call to the `stubTarget`
of the call. This optimization is performed in dart2js.
Since dart2js now uses the correct super target, its runtime
mixin application needs to avoid overriding members already
declared in the mixin application. These members are the
forwarding super stubs which ensure that correct runtime types
when members with covariant parameters are implemented.
Change-Id: Iab71ffcc400aa6a683987bc20b9553a263ebc8e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176526
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>