Commit Graph

4835 Commits

Author SHA1 Message Date
Johnni Winther 565b30123c Fix code-size regression
This reinserts the native spec-string interpretation.

The CL https://codereview.chromium.org/2004833003/ changed the interpretation of `List` from `List<E>` to `List<dynamic>` causing these native classes to be added through subtyping:

NativeUint8List <: List
NativeUint8ClampedList <: List
NativeUint32List <: List
NativeUint16List <: List
NativeInt8List <: List
NativeInt32List <: List
NativeInt16List <: List
NativeFloat64List <: List
NativeFloat32List <: List
NativeTypedArrayOfInt <: List
NativeTypedArrayOfDouble <: List

R=sra@google.com

Review URL: https://codereview.chromium.org/2021723003 .
2016-06-02 10:16:44 +02:00
Erik Ernst 5b72755837 Revert "Introduces "--initializing-formal-access"."
This reverts commit b80a73775c
because introduced new failures in co19 tests.

Review URL: https://codereview.chromium.org/2021133003 .
2016-05-31 18:03:14 +02:00
Erik Ernst b80a73775c Introduces "--initializing-formal-access".
This CL adjusts the treatment of initializing formals, such that they
can be used in initializers and in constructor bodies. E.g., `x` can be
used as in `C(this.x) : y = x { var z = x + 2; }`.

It hides the new feature under the option '--initializing-formal-access'
which is used in the test 'initializing_formal_access_test.dart'.

It also adds an `example` test to `MessageKind.DUPLICATE_DEFINITION` to
verify that name clashes among initializing formals and other
parameters are detected (which was previously not the case).

Finally, it fixes a typo in a comment, `InitializingFormalParameter` ->
`InitializingFormalElement`.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2025853002 .
2016-05-31 15:39:02 +02:00
Johnni Winther 91616103aa Use correct type on evaluated literal symbols.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2018523002 .
2016-05-27 11:05:00 +02:00
Johnni Winther d78290a5b2 Compute import paths using ImportElement and ExportElement
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2005293003 .
2016-05-27 10:58:52 +02:00
Johnni Winther 6cd484ddb5 Correctly skip if-null expressions.
Closes #26543

R=eernst@google.com

Review URL: https://codereview.chromium.org/2016693002 .
2016-05-27 10:44:47 +02:00
Johnni Winther dd4368e217 Fix several element properties in serialization.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2012163003 .
2016-05-27 10:37:36 +02:00
Johnni Winther 326af10bc8 Add names and support for preserialized data to serialization tests
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2013763002 .
2016-05-26 09:36:32 +02:00
Sigmund Cherem 266ad7fd0f Remove reference to compiler from libary loader, fix analyzer warning
R=het@google.com

Review URL: https://codereview.chromium.org/2009773004 .
2016-05-25 15:27:32 -07:00
Harry Terkelsen 779465d862 fix warning in noSuchMethod registry
BUG=

Review URL: https://codereview.chromium.org/2006143007 .
2016-05-25 11:38:13 -07:00
Harry Terkelsen b5fbea4f4a accept null type casts in dummy noSuchMethod checks
Fixes #23843

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2009853003 .
2016-05-25 10:14:53 -07:00
Harry Terkelsen 7476560209 run dartfmt on dart2js
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2007353002 .
2016-05-25 10:14:02 -07:00
Sigmund Cherem b741e3f0df Make CompilerTask independent of compiler.
Now this base class only has logic for measuring time.

R=het@google.com, johnniwinther@google.com

Review URL: https://codereview.chromium.org/2000323006 .
2016-05-25 09:11:08 -07:00
Johnni Winther 42435f2643 Support multiple resolution inputs from command line.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2004833003 .
2016-05-25 11:02:34 +02:00
Erik Ernst acc5f59a99 Changes dart2js to warn at reified usage of method type variables.
This CL changes the response to `x is T`, `x is! T`, `x as T`, and `T`
used as a type expression (say, `foo(T)`) where `T` is a method type
variable: It will now emit a warning in these cases.

Test examples associated with `TYPE_VARIABLE_FROM_METHOD_NOT_REIFIED`
have been activated and corrected, such that this behavior is tested.

As a result 'language/generic_methods_type_expression_test.dart' will
now cause warnings when compiled with `dart2js`.

Note that this does not break any tests, because `dart2js` does not make
the compilation fail when there is a warning (also, the analyzer and the
vm are unaffected because this is about a change to `dart2js`, not a
change to the test file).

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2001093006 .
2016-05-25 10:46:50 +02:00
Sigmund Cherem ea5f49c969 Delete support for source mirrors
R=johnniwinther@google.com

Committed: https://github.com/dart-lang/sdk/commit/6586b3696eae6f750644273ece5cb68dc3d304a5

Review URL: https://codereview.chromium.org/1799283002 .
2016-05-24 13:05:47 -07:00
Sigmund Cherem 0b29970605 Build sdk.json without source-mirrors.
This basically removes the dependency on source-mirrors from the try site and will let us delete source-mirrors from the compiler.

I was a torn for a bit about how to replace the logic here. I considered these 4
options:

(a) directly use the compiler internal APIs to crawl for reachable libraries.
(b) use `analyze-all`, then iterate over the resolved libraries.
(c) avoid parsing altogether, just enumerate recursively all files under
    sdk/lib/ and create the json file that way.
(d) submit a fixed version of the sdk, since we unlikely need it up-to-date
    for the site/try tests

I decided decided to go with (c) in this CL. It's simple and, given that the
only purpose is to preserve the site/try tests until we replace them, it seems
like the option that will slow us down the least (it makes the .json file
bigger, but that's OK now that this is not a service in use). It seemed
unnecessary to do full resolution, so I wasn't convinced of doing (b), but I did experiment with (a) now that we are
making the frontend libraries easier to use on their own. The result was OK (see
https://codereview.chromium.org/2003233002/), but probably not worth submitting
because we'd have to remember to update the code every time we modify the
internal dart2js APIs. I rather have the code in that CL be a test instead.

R=het@google.com

Review URL: https://codereview.chromium.org/2006993002 .
2016-05-24 09:50:06 -07:00
Erik Ernst af79c19a53 Revision of "Adjusts dart2js backend to handle method type arguments"
Adjusted version of CL https://codereview.chromium.org/1976213002/,
only changed by adding entries in status files for the test
'tests/language/generic_methods_type_expression_test.dart'.

Review URL: https://codereview.chromium.org/2001393003 .
2016-05-24 11:12:02 +02:00
Johnni Winther 552dc14877 Support multiple serialization sources in DeserializerSystemImpl.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2007573002 .
2016-05-24 10:23:11 +02:00
Johnni Winther 7877bfe64e Yet another unnecessary ElementX reference
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2005843002 .
2016-05-24 10:02:21 +02:00
Johnni Winther e0594d7b7e Handle constant function references.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2000153002 .
2016-05-24 09:52:00 +02:00
Erik Ernst 912bcc8418 Revert "Adjusts dart2js backend to handle method type arguments."
This reverts commit 04e45eb634.

BUG=

Review URL: https://codereview.chromium.org/2000223002 .
2016-05-23 18:35:53 +02:00
Erik Ernst 04e45eb634 Adjusts dart2js backend to handle method type arguments.
This CL has the same purpose as 1969753002, stated in the title line,
but it works for checked mode execution (where 1969753002 was broken),
and for usage of method type arguments in additional situations.

Approach: `DartType` and subtypes have been extended with new methods
to erase `MethodTypeVariableType` to `DynamicType`. This is done early
(after resolution, before SsaBuilder), such that only few parts of the
compiler need to deal with anything new. This approach handles method
type variables in checked mode, in `new` expressions, and in function
typed parameters. Finally, tests are added for the new cases, and
status files updated.

UPDATE: See message #10 and #12 for an updated description of the approach.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1976213002 .
2016-05-23 17:17:29 +02:00
Johnni Winther 95fa410d53 Handle resolvedAst for forwarding constructors and callType on unnamed mixin applications.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2000663002 .
2016-05-23 10:42:45 +02:00
Johnni Winther b3f8cd31a0 Handle use of constant constructors with default values.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1994613004 .
2016-05-20 11:40:35 +02:00
Johnni Winther 529c251546 Handle redirecting factories.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1992733002 .
2016-05-20 11:26:25 +02:00
Johnni Winther bfb8a077e2 Fix ForwardingConstructorElementZ.computeEffectiveTargetType
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1981313002 .
2016-05-20 11:20:23 +02:00
Johnni Winther 9ce98cada8 Support serialized dart:core in batch-mode
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1973333002 .
2016-05-18 13:05:09 +02:00
Johnni Winther 627c18a7e7 Use ResolvedAst in constant initializers
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1979613002 .
2016-05-18 12:23:45 +02:00
Johnni Winther f3ff2a6302 Handle explicit constructor.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1969313007 .
2016-05-18 12:13:20 +02:00
Johnni Winther 6571bdb95e Support (de)serialization from command-line
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1975153002 .
2016-05-18 11:52:32 +02:00
Jacob Richman be5c8e1a33 Fix "break" vs "continue" bug in js interop codegen that was the real source of missing js interop stubs not using codegenWorld vs resolutionWorld.
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1982413002 .
2016-05-17 10:42:26 -07:00
Johnni Winther 039473f349 Store ResolvedAst on AstElement
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1970703002 .
2016-05-17 14:00:03 +02:00
Johnni Winther 50b85640b3 Change dart2js.dart to use compiler_new.dart
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1973753004 .
2016-05-17 12:27:23 +02:00
Jacob Richman 07cc57d110 Switch to using resolverWorld from codegenWorld to determine whether JS interop interceptors need to be generated as codegenWorld is incorrectly reporting that some JS interop methods are not invoked even when they are.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1975133004 .
2016-05-13 17:20:19 -07:00
Harry Terkelsen 1745ba77f5 fix all instances of "the the"
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1980573003 .
2016-05-13 12:38:25 -07:00
Greg Littlefield cd8124cdcf JS: Use direct function invocation when possible for calls with 4 or 5 args (#26268)
* Use direct function invocation when possible for calls with 4 or 5 args

* Add test for Function.apply called with 0-5 arguments
2016-05-13 10:13:46 -07:00
Johnni Winther fdb49caefd Fix inference reference to .initializer
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1966763003 .
2016-05-12 10:10:58 +02:00
Johnni Winther cb2fcd8117 Check closure data for serialization
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1967073002 .
2016-05-12 09:59:02 +02:00
Erik Ernst a76745e18f Revert "Adjusts dart2js SSA builder to tolerate method type arguments."
This reverts commit ee926fac8d.

Also revert "Removed generic method tests from status file.",
commit fa48b7e17b.

Review URL: https://codereview.chromium.org/1971763002 .
2016-05-11 16:15:01 +02:00
Erik Ernst ee926fac8d Adjusts dart2js SSA builder to tolerate method type arguments.
This CL changes `Types.getClassContext` to return null for method type
arguments (indicating that the given `type` does not contain any type
variables, which fits the current "ignore them" approach to that kind
of type variable). It introduces a new class `MethodTypeVariableType`
which models a method type variables and ensures that it is treated
as `dynamic` (such that type annotations are permissive, and usages
as a type expression `T` in `.. is T` or `.. as T` are treated like
a malformed type). For RTI, method type variables are ignored (such
that no additional classes are claimed to be needed for RTI due to
method type variables, no matter how they are used). Finally,
`SsaBuilder.addTypeVariableReference` generates code yielding the
value `dynamic` for method type variables.

Adresses issue 26436.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1969753002 .
2016-05-11 15:04:15 +02:00
Johnni Winther 681c3e6a89 Register mixin use from modelz.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1961323002 .
2016-05-11 09:53:40 +02:00
Johnni Winther b1f2c2cd3a Register NativeBehavior from WorldImpact.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1957343002 .
2016-05-10 09:50:11 +02:00
Johnni Winther 24c548f5bd Skip spurious constants in deferred computation.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1955403002 .
2016-05-10 09:41:19 +02:00
Johnni Winther 6e491cf152 Only call .hasResolvedAst in assertions.
R=sra@google.com

Review URL: https://codereview.chromium.org/1949713004 .
2016-05-09 10:34:01 +02:00
Johnni Winther a5078ea5f2 Serialize ParameterElement.node and ParameterElement.initializer for type inference
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1945263003 .
2016-05-09 10:23:34 +02:00
Sigmund Cherem ed9826894a Do not evaluate on-demand to prevent breaking the deferred loading task
BUG= https://github.com/dart-lang/sdk/issues/26406
R=sra@google.com

Review URL: https://codereview.chromium.org/1950243002 .
2016-05-04 18:23:37 -07:00
Johnni Winther 3f11e131ae Report UNMATCHED_TOKEN instead of EXTRANEOUS_MODIFIER
Closes #25308

R=ahe@google.com

Review URL: https://codereview.chromium.org/1943723003 .
2016-05-04 13:42:29 +02:00
Sigurd Meldgaard e47e8af364 Fix missing functionality with --allow-native-extensions
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1945183002 .
2016-05-04 10:53:15 +02:00
Johnni Winther f79ff62b2e Don't crash on deserialized type inference.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1939703002 .
2016-05-03 11:29:24 +02:00