Commit Graph

4698 Commits

Author SHA1 Message Date
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 1cb70133af Update ClosureScope.toString
R=sra@google.com

Review URL: https://codereview.chromium.org/1901053002 .
2016-04-20 09:39: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
Stephen Adams b887563dff dart2js: Reduce calls to Uri.toString()
Uri.toString() shows up at 2% of a full dart2js compile.
Avoid by using Uri components or reusing result of toString()

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1887313002 .
2016-04-15 09:00:11 -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
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
Erik Ernst 377b806bbc Adds support for remaining generic method syntax constructs.
CL https://codereview.chromium.org/1863053003/ added support for most
syntactic constructs in relation to generic methods/functions, and
this one adds the missing ones: Declarations of function typed arguments
with type parameters, declarations of generic local functions, and
declarations of generic literal function expressions. It also adds
support for `super` bounds, because they were discussed recently and
may be quite useful (and it turns out to be no problem to parse them).
Finally, a new test file is added to tests the additional constructs.

BUG=
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1878253002 .
2016-04-14 15:25:44 +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
Harry Terkelsen 01e839c732 dart2js cleanup: remove unused imports and variables
BUG=
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1880323002 .
2016-04-13 09:11:39 -07:00
Harry Terkelsen acf33e480c dart2js: use IdGenerator for all id generation
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1881293002 .
2016-04-13 09:02:06 -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 058441e1fa Add deep equivalence test for Send/NewStructures.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1881743004 .
2016-04-13 10:09:58 +02:00
Johnni Winther 68a92257b3 Add structural equivalence test for AST nodes.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1884583002 .
2016-04-13 09:47:04 +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 fefa2188ce Serialize TreeElements
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1873573004 .
2016-04-11 11:16:10 +02:00
Johnni Winther 4080c1b410 Update elements, nodes and visitors for serialization.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1873823002 .
2016-04-11 10:33:10 +02:00
Johnni Winther 7196ff091f Add kinds for serialization.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1867333002 .
2016-04-11 10:09:47 +02:00
Johnni Winther a6b61035c9 Replace LateConstInvokeStructure after analysis.
This is in preparation for serialization.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1869383002 .
2016-04-11 09:54:57 +02:00
Harry Terkelsen 9f8427d041 Begin refactoring compiler out of diet parser and scanner
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1867243004 .
2016-04-08 14:11:19 -07:00
Harry Terkelsen c38de336c7 Throw an error early when dump info is used with the startup emitter.
The compiler will crash at the very end of the compilation with a cryptic
error message if dump info is used with the fast startup emitter.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1866403002 .
2016-04-07 12:38:48 -07:00
Harry Terkelsen 29cf477139 dartfmt pkg/compiler
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1859343004 .
2016-04-07 10:00:53 -07:00
Johnni Winther 450116f9d8 Add Visitor1<R, A>
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1863403002 .
2016-04-07 11:16:21 +02:00
Johnni Winther ee2fc29142 Test closed world model after deserialization.
We still need better tracking of native/foreign elements.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1856953003 .
2016-04-06 11:30:20 +02:00
Stephen Adams 551546622b Avoid Object.hashCode on a few objects
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1861563002 .
2016-04-05 09:13:28 -07:00
Erik Ernst 586c43ac7e Repeats and fixes the changes landed & reverted as CL 1789553003.
When landed, CL 1789553003 turned out to cause bot failures because
some libraries outside the compiler are importing compiler libraries
which have been updated. For instance, the tests in 'compiler/dart2js'
depend on several internal elements of the 'dart2js' compiler.

This CL updates these external dependents to work with the modified
library structure and class APIs of the compiler. A small adjustment
was applied to 'dart2js_incremental' as well.

No further dependents are believed to exist: Grepping in sdk for
relevant imports does not reveal any further imports of any of the
libraries in the compiler where the "interface" has changed, and
external clients are not supported (that is, imports in arbitrary
github repositories may or may not break if they use the compiler
internals, but we do not support this type of dependency so we won't
do anything to protect them against that type of breakage).

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1864433004 .
2016-04-05 17:26:07 +02:00
Johnni Winther e914716bb7 Test ResolutionImpact equivalence.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1856713002 .
2016-04-05 09:36:05 +02:00
Erik Ernst 355888457a Revert "Introduces ParserOptions."
This reverts commit d4c9a499d5.

Review URL: https://codereview.chromium.org/1859543002 .
2016-04-04 15:16:13 +02:00
Erik Ernst d4c9a499d5 Introduces ParserOptions.
In preparation for support for generic methods (with an associated
command line option), this CL introduces a `ParserOptions` class and
uses that to pass the existing option `enableConditionalDirectives` to
all parsers. With that, the addition of an `enableGenericMethodSyntax`
option will be concise and well localized.

It is necessary to keep a `ParserOptions` object in `Parsing`, because
that's the only convenient channel for providing the options to the new
`Parser` and `ClassElementParser` created from the top-level function
`parse` in 'partial_elements.dart', and a from
`PartialClassElement.parseNode`, respectively.

The `ParserOptions` class is located in 'parser.dart'; from the current
import structure the most natural choice might be to put it in
'element_listener.dart', but considering the nature of that file it
seems less natural: What does `ParserOptions` have to do with element
listeners? So I put it in 'parser.dart', even though this causes a few
additional import statements.

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

Review URL: https://codereview.chromium.org/1789553003 .
2016-04-04 14:45:20 +02:00
Kevin Millikin 78998a518c dart2js: Do not use the async rewriter on nested functions.
Nested functions in JS can be introduced by foreign code in our own
libraries.  They are always plain synchronous non-generator JS functions so
it is unnecessary to rewrite them.  Trying to do so will crash, because the
pre-translation analysis does not analyze them.  The translation wouldn't
do the right thing anyway.

Closes https://github.com/dart-lang/sdk/issues/25396

BUG=
R=sigmund@google.com, sigurdm@google.com

Review URL: https://codereview.chromium.org/1848283002 .
2016-04-04 09:33:29 +02:00
Johnni Winther 46beb25f43 Add *IndexSetIfNull methods to SemanticSendVisitor.
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1842033004 .
2016-04-01 09:46:42 +02:00
Johnni Winther 27b2c36ec1 Serialize ResolutionImpact instead of WorldImpact.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1839243003 .
2016-03-31 09:55:03 +02:00
Johnni Winther 4b4718a53c Support per-library serialization.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1811173003 .
2016-03-29 11:27:44 +02:00
Johnni Winther ff31372564 Fix exit_code_test after refactoring.
The test was broken by https://codereview.chromium.org/1819053002

Review URL: https://codereview.chromium.org/1836033003 .
2016-03-29 11:18:01 +02:00
Johnni Winther b4b67c3d2a Don't serialize unnamed mixin applications.
This change is needed to allow for per-library serialization.

These elements should not be part of the element model, anyway.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/1815693002 .
2016-03-29 10:26:27 +02:00
Sigmund Cherem f2700cc0ab Fix warning after loader refactor discovered by a red bot.
TBR=het@google.com

Review URL: https://codereview.chromium.org/1830863002 .
2016-03-23 18:17:05 -07:00
Sigmund Cherem bada3cac9d Split loader from the rest of the compiler. This adds several abstractions to
make the decoupling easier. Some of the new abstractions should be revisited,
but it's a step forward :).

R=het@google.com

Review URL: https://codereview.chromium.org/1819053002 .
2016-03-23 16:02:33 -07:00
Kevin Millikin 6efe664788 Use exact instruction names in the SSA tracer.
Before the mapping from HInstruction names to printed representations
used by the tracer was arbitrary.  Change it to use the HInstruction
name with a colon separating the arguments from the instruction name.
The first colon on the line is recognized by the tool as delimiting
the opcode.

Seeing the precise structure of the IR is more important than
having human-writable surface syntax.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1819833002 .
2016-03-21 13:25:20 +01:00
Johnni Winther 5d97c6176f Support serialization of WorldImpact
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1809533004 .
2016-03-18 09:05:27 +01:00
Johnni Winther 37ad6d2d14 Use JS backend in serialization_analysis_test
BUG=
R=sigmund@google.com

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

Reverted: https://github.com/dart-lang/sdk/commit/408f4edee375e7b207215ed9b6b5b2e7a813e243

Review URL: https://codereview.chromium.org/1802883002 .
2016-03-18 07:57:30 +01:00
Greg Littlefield bc68abe486 Fix typo that causes generation of duplicate parameters 2016-03-17 17:33:41 -07:00
Sigmund Cherem 4f3a7cb86e Move all flags to CompilerOptions (first step to stop passing the compiler to
just get the options in the future).

BUG=
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1803303002 .
2016-03-17 16:42:02 -07:00
Johnni Winther 408f4edee3 Revert "Use JS backend in serialization_analysis_test"
This reverts commit cc8aa23c16.

BUG=

Review URL: https://codereview.chromium.org/1808133002 .
2016-03-17 10:03:18 +01:00
Johnni Winther cc8aa23c16 Use JS backend in serialization_analysis_test
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1802883002 .
2016-03-17 09:23:29 +01:00