Commit graph

2455 commits

Author SHA1 Message Date
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
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
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
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 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
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
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 a0a214a8e2 Update status for moved test
Review URL: https://codereview.chromium.org/1938403002 .
2016-05-03 11:43:42 +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
Johnni Winther 52b45145f0 Fix source information positions for deserialized patched elements.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1935933002 .
2016-05-03 10:52:33 +02:00
Johnni Winther 0e537d8086 Refactor unittests
Move serialization tests into subfolder
Move data files into data subfolders
Move tests with errors/warnings into quarantined subfolder
Skip packages/ folder in test

The latter three improves workflow in IntelliJ; providing error/warning free analysis of unittests (by exclusion of folders).

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1934883002 .
2016-05-03 10:44:13 +02:00
Erik Ernst 33478e2ab5 Rebased and retested version of CL 1915123008.
This CL is a rebased and retested version of CL 1915123008,
'Implements support for ignoring method type arguments in
resolution'. That CL caused failures on dart2js-jsshell but it is
now confirmed that the failures were caused by another CL.

Review URL: https://codereview.chromium.org/1942763002 .
2016-05-02 11:50:06 +02:00
Johnni Winther 832d87341f Handle deserialized compilation of closures
- and fix some errors in serialization and equivalence (test) of ResolvedAst

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1932183003 .
2016-04-30 11:20:20 +02:00
Erik Ernst c2d18fe065 Revert "Implements support for ignoring method type arguments in resolution."
This reverts commit e44e667ca7, because that
commit introduced many timeouts on dart2js-jsshell, ia32.

Review URL: https://codereview.chromium.org/1933403002 .
2016-04-29 21:36:54 +02:00
Erik Ernst e44e667ca7 Implements support for ignoring method type arguments in resolution.
Extends `FunctionExpression` to hold the formal type variable
declaration syntax. Introduces `GenericElement` as a new superclass of
`TypeDeclarationElement`, allowing `FunctionElement` to have a getter
`typeVariables`. Changes `SignatureResolver.analyze` in several ways
to create and handle the new type variables. In order to avoid circular
ordering dependencies, introduced new scope classes such that the
function signatures can be computed without relying on themselves to
look up type variables (e.g., `FunctionSignatureBuildingScope`).

Finally, the mock_compiler and resolver_test.dart were adjusted to give
a `scope` argument to `new ResolverVisitor(..)` in order to get the
correct scopes in the new setup.

A few words about the approach:

The type of every method type parameter behaves as `dynamic`, because
its bound is (unconditionally, ignoring any bound syntax that might be
present) set to `const DynamicType()`. This preserves the property
that diagnostic messages about the type variables will refer to the
correct location in the source code.

Type arguments passed in send expressions are parsed but not added to
the abstract syntax and therefore not passed on to the resolution
phase; this means that all sends are treated as if they had no actual
type arguments, even when they do have them. Hence, actual method type
arguments are completely ignored.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1915123008 .
2016-04-29 19:46:12 +02:00
Johnni Winther b361d8ce97 Support compilation of Hello World
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1927963002 .
2016-04-29 12:57:45 +02:00
Johnni Winther 4c563fecbf Serialize more properties of ConstructorElement.
Review URL: https://codereview.chromium.org/1924053003 .
2016-04-29 10:00:53 +02:00
Johnni Winther 4acfa253d3 Add toStructuredText to ConstantExpression and align method names with ConstantValue
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1916053003 .
2016-04-27 12:48:50 +02:00
Johnni Winther d1ca90aba6 Store constant variable initializers in elements.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1919143002 .
2016-04-27 10:01:58 +02:00
Stephen Adams 7684794b8b Fix for issue 26243 - illegal motion of assignments in instruction merging
Fix by treating some HLocalGet instructions as pure and others as
impure.  Simply making HLocalGet impure caused a lot of code quality
regressions with the single-assignment exception and stack-trace
variables.

R=kmillikin@google.com, sigmund@google.com

Committed: e9b06a9cd7

Reverted: 5fd51e6340

Review URL: https://codereview.chromium.org/1914623002 .
2016-04-26 15:26:37 -07:00
Johnni Winther 4c9e6ff345 Replace _analyzeElementEagerly with Resolution.ensureResolved
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1917863002 .
2016-04-26 09:54:24 +02:00
Stephen Adams 5fd51e6340 Revert "Fix for issue 26243 - illegal motion of assignments in instruction merging"
TBR=sigmund@google.com
BUG=

Review URL: https://codereview.chromium.org/1913843003 .
2016-04-25 11:53:14 -07:00
Stephen Adams e9b06a9cd7 Fix for issue 26243 - illegal motion of assignments in instruction merging
Fix by treating some HLocalGet instructions as pure and others as
impure.  Simply making HLocalGet impure caused a lot of code quality
regressions with the single-assignment exception and stack-trace
variables.

R=kmillikin@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/1914623002 .
2016-04-25 10:20:27 -07:00
Johnni Winther 09c242e729 Reinsert (and test) handling of exceptions from user code.
Closes issue #26304

R=ahe@google.com

Review URL: https://codereview.chromium.org/1914973002 .
2016-04-25 12:56:10 +02:00
Johnni Winther 8b39e67ac4 Derive source information from ResolvedAst.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1902363002 .
2016-04-25 11:23:35 +02:00
Johnni Winther 7c20fa24d2 Serialize more native data.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1902753002 .
2016-04-20 10:30:19 +02:00
Johnni Winther de1d473529 Store and serialize NativeBehavior in TreeElements.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1896843002 .
2016-04-19 11:04:11 +02:00
Johnni Winther 4b01f4136e Support deserialization of ResolutionImpact for members of unnamed mixin applications
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1901683002 .
2016-04-19 10:26:42 +02:00
Johnni Winther 553eec6047 Fix serialization of forwarding constructors.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1891193003 .
2016-04-19 10:09:47 +02:00
Johnni Winther 2ccfcf438a Support deserialized compilation of the empty program.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1892093003 .
2016-04-18 10:36:34 +02:00
Johnni Winther ea4a562517 Fix some issues in element serialization.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1888393002 .
2016-04-18 09:31:23 +02:00
Harry Terkelsen ce37fbcb3d Refactor Parsing to remove compiler dependency
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1892183002 .
2016-04-15 13:03:02 -07:00
Johnni Winther 14baf6b37b Support serialization of all resolved asts from dart:core
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1888803002 .
2016-04-15 10:34:14 +02:00
Alan Knight 01c543cb0a Revert "Add white-listed for issue 26258"
This reverts commit ec6f03fd5a.

BUG=

Review URL: https://codereview.chromium.org/1892663002 .
2016-04-14 14:36:49 -07:00
Florian Loitsch bcd8ef3dea Enable conditional directives by default.
R=brianwilkerson@google.com, iposva@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/1851753002 .
2016-04-14 19:02:41 +02:00
Johnni Winther ec6f03fd5a Add white-listed for issue 26258
Review URL: https://codereview.chromium.org/1886893003 .
2016-04-14 11:03:55 +02:00
Johnni Winther eecf628d29 Serialize JumpTarget and LabelDefinition.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1883863002 .
2016-04-14 10:51:29 +02:00
Harry Terkelsen 8f3e4cff01 dart2js: remove references to compiler in ResolvedUriTranslator
BUG=
R=johnniwinther@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/1884793002 .
2016-04-13 13:49:59 -07:00
Johnni Winther 7e8e01610e Expand ResolvedAst to handle synthetic constructors.
Main change is to add [ResolvedAstKind] to support ResolvedAst for default and forwarding constructors.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1881013002 .
2016-04-13 12:45:14 +02:00
Johnni Winther b8c9bc3d42 Add summary to analyze_* tests.
R=eernst@google.com

Review URL: https://codereview.chromium.org/1885523002 .
2016-04-12 15:02:53 +02:00
Erik Ernst 440b17901e Adds support for --generic-method-syntax
This CL adds support for parsing and ignoring declarations of type
parameters on methods and functions, and passing type arguments to
method and function invocations. The type parameters thus declared do
not get a representation during static analysis, so any usage will
cause warnings about undefined types; hence, this CL transforms usage
of generic methods from syntax errors to static warnings. A followup
CL will eliminate the static warnings.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1863053003 .
2016-04-11 15:58:35 +02:00
Johnni Winther 601d3e699a Mark serialization tests as slow.
Review URL: https://codereview.chromium.org/1876733002 .
2016-04-11 11:41:05 +02:00
Johnni Winther fefa2188ce Serialize TreeElements
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1873573004 .
2016-04-11 11:16:10 +02:00
Johnni Winther 1f6c0dd14b Refactor serialization test files.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1870133002 .
2016-04-11 10:39:20 +02:00