Commit Graph

5559 Commits

Author SHA1 Message Date
Florian Schneider cbc1d9fc63 Don't print variable descriptors by default when printing disassembly.
Since variable descriptors are generated lazily, printing disassembly
could trigger re-parsing. This should not hurt in general, but running with
--disassemble should not invoke the parser just for printing -- hereby triggering GC or otherwise altering the execution in unexpected ways.

BUG=#26441
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2133443002 .
2016-07-08 10:12:24 -07:00
Harry Terkelsen 10691da9f8 dart2js: allow trailing commas in parameter and argument lists
Fixes https://github.com/dart-lang/sdk/issues/26646

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

Review URL: https://codereview.chromium.org/2068003002 .
2016-07-08 10:03:51 -07:00
Johnni Winther 6c2cb212d6 Remove analyzer warning from test.
Review URL: https://codereview.chromium.org/2132903003 .
2016-07-08 14:12:24 +02:00
Erik Ernst 6942e0df63 Fixes bug in scoping for generic methods.
The updates to tests/language/generic_local_functions_test.dart use a
local function type argument in its return type, which had not been
tested and did not work.

After a bunch of attempts to change the order in which the resolution
is performed, it suddenly turned out that the offending statement
`visit(node.returnType)` in `ResolverVisitor.visitFunctionExpression`
might be redundant! (.. a subsequent re-resolution in
`ResolverVisitor.analyze` performs the same job, and uses the correct
scope).

So this CL simply removes that `visit..` statement, and the resulting
`dart2js` passes all tests.

Adresses issue https://github.com/dart-lang/sdk/issues/26805.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2128243002 .
2016-07-08 13:28:36 +02:00
Johnni Winther 1f1e00f012 Handle redirects to unresolved redirects
The solves the handling of redirecting factories that redirects to other
redirecting factories whos immediate redirection target is unresolved.

For instance

  class C {
    factory C.a() = C.b;
    factory C.b() = Unresolved;
  }

The implementation normalizes the properties 'immediateRedirectionTarget',
'redirectionDeferredPrefix', 'effectiveTarget', 'effectiveTargetType', and
'isEffectiveTargetMalformed' by always storing the information on the
implementation element.

R=het@google.com

Review URL: https://codereview.chromium.org/2125823002 .
2016-07-08 11:14:20 +02:00
Johnni Winther 5f243e6bd0 Update tests to make latent errors explicit.
R=het@google.com

Review URL: https://codereview.chromium.org/2121143002 .
2016-07-08 10:41:23 +02:00
Lasse R.H. Nielsen 3459d41472 Allow VM precompiled to pass trailing-comma test.
R=whesse@google.com

Review URL: https://codereview.chromium.org/2117293002.
2016-07-05 11:24:51 +02:00
William Hesse 020b6db84e Update statuses for failing tests
BUG=https://github.com/dart-lang/pub/issues/1429
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/2125563002 .
2016-07-05 10:58:08 +02:00
Florian Loitsch 951bb7750b Update test and status file.
Review URL: https://codereview.chromium.org/2120383002 .
2016-07-04 23:12:00 +02:00
Florian Loitsch fcd006e8ac Update test and status file for precompiler.
Review URL: https://codereview.chromium.org/2121853002 .
2016-07-04 22:38:15 +02:00
Lasse R.H. Nielsen 6a4af257cc Allow trailing comma in parameter and argument lists.
R=hausner@google.com

Review URL: https://codereview.chromium.org/1991043004 .
2016-07-04 12:51:07 +02:00
Ryan Macnak eb20b68e87 Add --hot-reload to the test harness.
./tools/build.py -mdebug,release runtime
./tools/test.py -mdebug,release --checked --hot-reload

BUG=http://dartbug.com/26809
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2114083002 .
2016-07-01 11:28:00 -07:00
Erik Ernst 442fc53b3c Implementation of modified scoping for initializing formals.
In order to make an implementation of initializing formal access in
`dart2js` available as specified in issue #26655 now, this CL changes
the scope management such that initializing formals are not in scope in
the constructor body, only in the initializer list.

This is done by introducing a new notion of scopes implemented
by `ExtensionScope`: Such a scope will extend an existing
`NestedScope` rather than adding a new nested scope to it.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2059883002 .
2016-06-29 11:42:03 +02:00
Lasse R.H. Nielsen f6d6792bc8 Add test for trailing commas in parameter lists and argument lists.
Test is marked as failing for everyone.
When implementing the feature for a platform, the platform should mark itself
as no longer failing.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2087863003 .
2016-06-27 08:58:05 +02:00
Matthias Hausner 26593c7688 Parse field initializer expressions in the correct scope class
When parsing a field initializer expression or mixin fields,
the current_class must be the mixin application class, not the
mixin class. This is necessary so that type arguments are
resolved in the correct scope class.

Dart2js fails the new regression test language/regress_18713.
Filed issue #26743.

BUG=18713
R=regis@google.com

Review URL: https://codereview.chromium.org/2085003002 .
2016-06-21 12:32:36 -07:00
William Hesse a4d514ae2a Update status for flaky browser tests
BUG=
R=kustermann@google.com

Review URL: https://codereview.chromium.org/2080773003 .
2016-06-21 13:57:31 +02:00
Johnni Winther c3085e3164 Enforce use of the forEachInstanceField ordering for constructed constants.
This ensures that constructed constants use the same field layout as the emitted classes.

R=het@google.com

Committed: https://github.com/dart-lang/sdk/commit/67b71d0cb793d5faaa2ee6f070741cc775a3f59a

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

Reverted: https://github.com/dart-lang/sdk/commit/f817910fd03d49b42ec10346ae6f589d3dadae4e
2016-06-20 12:49:30 +02:00
Matthias Hausner 7a88b69d79 Allow rethrow in nested try statements
Fixes bug where rethrow was rejected when the enclosing catch clause
was not part of the innermost try statement.

BUG=26530
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2075813003 .
2016-06-16 16:04:53 -07:00
Regis Crelier 962353674b Delete stray comment in tests.
R=hausner@google.com

Review URL: https://codereview.chromium.org/2067453003 .
2016-06-13 11:30:57 -07:00
Regis Crelier e803457081 Silence analyzer choking on new test.
Review URL: https://codereview.chromium.org/2057943002 .
2016-06-09 19:46:57 -07:00
Regis Crelier f4029bf3ee Capture instantiator in async function when required to check result type.
Add regression test (fixes #26668).

Review URL: https://codereview.chromium.org/2057903003 .
2016-06-09 19:14:14 -07:00
Zachary Anderson 6e90ca4e0a DBC: Eager deoptimization and CheckSmi instruction.
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2039913006 .
2016-06-09 09:47:56 -07:00
Erik Ernst c3dfe51295 Adds status entries for initializing_formal tests.
This CL should fix the problem that arose with commit
543a51ff3e. Here's the description from
that CL:

This CL adds tests for previously uncovered elements of the semantics
and includes fixes such that the desired behavior is obtained. In
particular, an `isInitializingFormal` element may now occur in contexts
where it wasn't expected until now, and changes were made to handle it.
It is also checked that a capture of an initializing formal (in a
function literal) captures the parameter, not the field.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2042293002 .
2016-06-08 10:50:33 +02:00
Erik Ernst 6d56db592b Revert "New tests for initializing formal access."
This reverts commit 543a51ff3e
because several status file updates are needed.

Review URL: https://codereview.chromium.org/2039243002 .
2016-06-06 16:07:03 +02:00
Erik Ernst 543a51ff3e New tests for initializing formal access.
This CL adds tests for previously uncovered elements of the semantics
and includes fixes such that the desired behavior is obtained. In
particular, an `isInitializingFormal` element may now occur in contexts
where it wasn't expected until now, and changes were made to handle it.
It is also checked that a capture of an initializing formal (in a
function literal) captures the parameter, not the field.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2039833002 .
2016-06-06 15:55:44 +02:00
Erik Ernst c59d37032e Added missing status entries.
A fix for c35caf253e and
https://codereview.chromium.org/2029003002.

Review URL: https://codereview.chromium.org/2029343003 .
2016-06-02 12:37:47 +02:00
Erik Ernst c35caf253e Introduces "--initializing-formal-access".
This CL is an adjusted version of CL 2025853002, adding updates to
`InitializingFormalElementZ` to match the updates applied to
`InitializingFormalElementX`, and adding the new option to the
`MessageKind.DUPLICATE_DEFINITION` example.

Description from 2025853002:

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/2029003002 .
2016-06-02 11:09:56 +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
Matthias Hausner 7daa2a8915 Fix capturing variables in optimized compilations
Fourth(!) attempt. This CL fixes another instance where parsing a nested function modifies the parser state of the function that is being compiled.

When a local function gets compiled the second time, constant
expressions may not be parsed again, since the constant value
is found in the cache. If the expression refers to an outer
variable, it does not get captured correctly.

Fix: instead of parsing a local function repeatedly to capture
outer variables, use the local function’s context scope to mark
outer variables as captured. This fixes the bug, and makes the
compiler more efficient as well.

BUG= 26453
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2010283004 .
2016-05-27 11:27:10 -07: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
Ryan Macnak ef8baa8760 Add test harness option for app snapshots with unoptimized code.
./tools/test.py -m all -c dart2appjit -r dart_app --use-blobs

Rename 'dart_product' runtime to 'dart_app'.

Rename Dart_PrecompiledJITSnapshotBlob to Dart_CreateAppJITSnapshot and add documentation.

Remove out-of-date scripts in tools/precompilation.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1992703005 .
2016-05-26 10:37:47 -07:00
Florian Schneider 80d6af1e0c Revert "Fix capturing variables in optimized compilations"
This reverts commit 4dca5d0e01.

It seems to cause at least one additional test failure:

Repro:
    python tools/test.py -mrelease -asimarm64 --write-debug-log --write-test-outcome-log --copy-coredumps -cprecompiler -rdart_precompiled --exclude-suite pkg -t480 language/async_star_regression_fisk_test

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2004373004 .
2016-05-25 13:30:24 +02:00
Matthias Hausner 4dca5d0e01 Fix capturing variables in optimized compilations
Third attempt. A latent bug in finally block inlining
caused the previous crashes in optimized functions.
Fix is in https://codereview.chromium.org/2004883004/.

When a local function gets compiled the second time, constant
expressions may not be parsed again, since the constant value
is found in the cache. If the expression refers to an outer
variable, it does not get captured correctly.

Fix: instead of parsing a local function repeatedly to capture
outer variables, use the local function’s context scope to mark
outer variables as captured. This fixes the bug, and makes the
compiler more efficient as well.

BUG=26453
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2008043002 .
2016-05-24 14:40:52 -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
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
Ryan Macnak 7d3cd143f7 Update status for
./tools/test.py -mall
  ./tools/test.py -mdebug,release --checked
  ./tools/test.py -mrelease,product -cdart2app -rdart_product
  ./tools/test.py -mrelease --checked -cdart2app -rdart_product

Missing
  ./tools/test.py -mdebug -cdart2app -rdart_product
  ./tools/test.py -mdebug --checked -cdart2app -rdart_product

R=asiva@google.com

Review URL: https://codereview.chromium.org/1991543002 .
2016-05-18 12:54:34 -07:00
Matthias Hausner b4e6c9d8f0 Revert "Fix capturing variables in optimized compilations"
This reverts commit 117693961f.

BUG=

Review URL: https://codereview.chromium.org/1991533002 .
2016-05-17 16:31:02 -07:00
Matthias Hausner 117693961f Fix capturing variables in optimized compilations
Second attempt, this time also capturing hidden variables
like 'this' in initializer lists. Original CL is
https://codereview.chromium.org/1980193002

When a local function gets compiled the second time, constant
expressions may not be parsed again, since the constant value
is found in the cache. If the expression refers to an outer
variable, it does not get captured correctly.

Fix: instead of parsing a local function repeatedly to capture
outer variables, use the local function’s context scope to mark
outer variables as captured. This fixes the bug, and makes the
compiler more efficient as well.

BUG=26453
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1986393002 .
2016-05-17 15:59:42 -07:00
Ryan Macnak 01e023263e Revert "Fix capturing variables in optimized compilations"
This reverts commit 3968005cc8.

Broke optimization counter and precompilation bots.

TBR=hausner@google.com

Review URL: https://codereview.chromium.org/1985103002 .
2016-05-17 10:05:07 -07:00
Matthias Hausner 3968005cc8 Fix capturing variables in optimized compilations
When a local function gets compiled the second time, constant
expressions may not be parsed again, since the constant value
is found in the cache. If the expression refers to an outer
variable, it does not get captured correctly.

Fix: instead of parsing a local function repeatedly to capture
outer variables, use the local function’s context scope to mark
outer variables as captured. This fixes the bug, and makes the
compiler more efficient as well.

No wall-time improvement found when running dart2js, though.

BUG=26453
R=regis@google.com

Review URL: https://codereview.chromium.org/1980193002 .
2016-05-16 15:53:00 -07: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 fa48b7e17b Removed generic method tests from status file.
CL https://codereview.chromium.org/1969753002/ which was just landed
did not contain one correction: Some generic method related tests used
to cause an internal error in dart2js with --enable-checked-mode, but
1969753002 fixed that. This CL just removes those tests from the status
file.

BUG=
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1966233002 .
2016-05-11 15:33:12 +02:00
Erik Ernst 7da48f3a95 Adds DartOptions to generic method syntax tests (updated CL).
This CL was landed and reverted. The bot failures caused by the first
landing of this CL turned out to be caused by checked mode execution.
This is an adjustment of that CL which marks the relevant tests as
failing. The underlying issue is that the compiler phases after
resolution do not expect to receive method type variables, only class
type variables; that will be addressed in a separate CL.

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

Review URL: https://codereview.chromium.org/1963703003 .
2016-05-11 09:46:32 +02:00
Regis Crelier 508b876ec8 Report wrong async function result type as type error in checked mode (Fixes #26133).
Add regression test.

R=hausner@google.com

Review URL: https://codereview.chromium.org/1847953002 .
2016-05-09 15:06:45 -07:00
Erik Ernst a9d90f4a09 Revert "Adds DartOptions to generic method syntax tests."
This reverts commit ae31db041d,
which seemed to cause failures on dart2js-d8-minified.

BUG=

Review URL: https://codereview.chromium.org/1960193002 .
2016-05-09 18:06:34 +02:00
Erik Ernst ae31db041d Adds DartOptions to generic method syntax tests.
This CL adds a `DartOptions` comment to the '--generic-method-syntax'
related tests specifying that option, and changes the entries for these
tests in status files to expect success for dart2js except when running
in a browser (where the option gets dropped rather than passed on to
the compiler).

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1962633002 .
2016-05-09 17:15:33 +02:00
Brian Wilkerson 8c244f03ad Report when members indirectly inherited through a mixin are not implemented (issue 26411)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1951363003 .
2016-05-06 11:29:44 -07:00
Erik Ernst d55adbed81 Add unit test on dart2js static analysis of method type parameters.
The new test is specifically for `dart2js --generic-method-syntax ..`,
executed programmatically using 'memory_compiler.dart'.
It verifies that each method type variable is treated as if it had
been an alias for `dynamic` (so the static analysis allows almost
all usages of these type variables, silently). Note that this behavior
is unlikely to be available with any other tools, and even `dart2js`
will behave differently when generic methods are implemented fully.
Hence, the new test will only be useful as-is during a transitional
period.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1939053002 .
2016-05-04 15:21:17 +02:00