Bob Nystrom
60ad9a8585
Don't include node in downcast error message.
...
The error itself has the node's location, and putting it in the
message can be ugly if the relevant node is a particularly long one.
Fixes https://github.com/dart-lang/dev_compiler/issues/377 .
R=brianwilkerson@google.com , vsm@google.com
Review URL: https://codereview.chromium.org/1622763002 .
2016-01-22 16:53:17 -08:00
keertip
946ae8f807
set LibraryElement documentation to docs of first directive in CU
...
BUG=
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1620203006 .
2016-01-22 16:13:19 -08:00
Konstantin Shcheglov
0025a8383e
Copy 'ConstructorName.staticElement' in ConstantAstCloner.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/1625473004 .
2016-01-22 15:19:06 -08:00
Brian Wilkerson
1ecd06d39c
Add a count of total lines to status performance page
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1622713002 .
2016-01-22 14:37:29 -08:00
Paul Berry
f1d7130d27
Fix resynthesis of abstract classes and methods.
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1625633002 .
2016-01-22 17:05:45 -05:00
John Messerly
9a4b1c36ce
fixes #25482 , flatten futures in strong mode so Future.then works
...
Also fixes https://github.com/dart-lang/dev_compiler/issues/228
A few tweaks were made to the propagatedType inference for Future.then:
* only record type if better than static type
* only go down this path when strong mode is off
also renames tests: test_pseudoGeneric to test_genericMethod.
R=brianwilkerson@google.com , vsm@google.com
Review URL: https://codereview.chromium.org/1609093003 .
2016-01-22 13:29:58 -08:00
Paul Berry
52386076f5
Drop implicit types from summaries.
...
Previously, implicit types were serialized in the summary as
references to `dynamic`. Now, we simply omit the types from the
summary and the dynamic type is inferred at resynthesis time.
This should reduce the summary size and simplify the implementation of
inferred types.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1622673002 .
2016-01-22 14:57:33 -05:00
Paul Berry
d1f3290c38
Use the explicit string 'void' to refer to void in summaries.
...
Previously we used a null EntityRef as a special case to mean "void".
This saved a tiny amount of space in the summary file, but it's not
worth it because (a) it will complicate some error handling scenarios,
and (b) it would be more worthwhile to use a null EntityRef to
represent implicit types. Both (a) and (b) will be addressed in
future CLs.
This CL changes "void" so that it's serialized as though it were
defined in the defining compilation unit of each library.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1625543002 .
2016-01-22 13:26:35 -05:00
Paul Berry
ef3935b590
Use the explicit string 'dynamic' to refer to dynamic in summaries.
...
Previously we used reference 0 as a special case to mean "dynamic".
This saved a tiny amount of space in the summary file, but it's not
worth it because it will complicate some error handling scenarios
(which will be addressed in future CLs).
This CL changes "dynamic" so that it's serialized as though it were
defined in the defining compilation unit of each library.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1621763002 .
2016-01-22 12:57:01 -05:00
Paul Berry
daa7a4ee32
Add a test of summaries that uses strong mode.
...
This will be expanded once we start storing inferred types in
summaries.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1615073007 .
2016-01-21 20:13:48 -05:00
Paul Berry
dd209aa19c
Rename TypeRef to EntityRef.
...
Now that we're storing constants in the summary, the we can have
legitimate references to things other than types.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1619913005 .
2016-01-21 17:53:59 -05:00
Konstantin Shcheglov
068b886543
Disable incremental resolution for constructor parameter names changes.
...
R=brianwilkerson@google.com
BUG=
Review URL: https://codereview.chromium.org/1620453002 .
2016-01-21 14:33:42 -08:00
Konstantin Shcheglov
b78decfa8f
Issue 25522. Insert a synthetic '>' for incomplete type arguments.
...
If we don't do this and insert 'f' instead, later when we attempt to
search 'f' by its offset we find the type instead of the identifier 'f'.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25522
Review URL: https://codereview.chromium.org/1615963003 .
2016-01-21 13:03:24 -08:00
Paul Berry
5e27219e9a
Modify summary codegen so that builder getters return builders.
...
This should allow more flexibility in the code that creates summaries,
since it will be possible to things like:
FooBuilder foo = new FooBuilder(bar: new BarBuilder);
foo.bar.baz = ...;
(Previously this would have been disallowed because foo.bar would have
returned a `Foo` rather than a `FooBuilder`, and the `Foo` class doesn't
have a setter for `baz`).
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1606283003 .
2016-01-21 11:26:53 -08:00
Konstantin Shcheglov
b0704262d9
Generate documentation for enumeration values.
...
I missed it previous time, now noticed that format.dart does not change
when I update the idl.dart file constant operations.
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1617123002 .
2016-01-21 10:59:49 -08:00
Konstantin Shcheglov
709cbcd76c
Add named arguments support into constant ASTs.
...
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1616023002 .
2016-01-21 10:25:44 -08:00
danrubel
0e3416fffe
fix embedder url mapping on Windows
...
see https://github.com/dart-lang/sdk/issues/25498
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1600933007 .
2016-01-21 09:56:42 -08:00
Konstantin Shcheglov
2d47247b73
Serialize long integers as unsigned 32-bit pieces.
...
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1612863002 .
2016-01-21 08:26:01 -08:00
Konstantin Shcheglov
6794b47c38
Use Uint32 for int in IDL.
...
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1615453002 .
2016-01-20 14:40:44 -08:00
Konstantin Shcheglov
0a495243c6
Validate that int values that we write to summaries are >= 0.
...
Also make tweaks for TestTypeProvider to ensure that this is true.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1605763007 .
2016-01-20 13:38:10 -08:00
Konstantin Shcheglov
e53f7e7a88
Add support for Uint32 fields and lists in Flat Buffers.
...
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1612533002 .
2016-01-20 09:48:55 -08:00
Konstantin Shcheglov
203e16919a
Issue 25515. Don't incrementally resolve if a constructor initializer is changed.
...
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25515
Review URL: https://codereview.chromium.org/1606103003 .
2016-01-20 08:49:29 -08:00
Konstantin Shcheglov
23e9fbcf30
Issue 25514. Harden parents validation in incremental resolver.
...
R=brianwilkerson@google.com , skybrian@google.com
BUG= https://github.com/dart-lang/sdk/issues/25514
Review URL: https://codereview.chromium.org/1605263002 .
2016-01-20 08:02:07 -08:00
Paul Berry
c6dd4a3967
Add propagated types to summary files.
...
Note: the prelinker doesn't support type propagation, since type
propagation may require looking at files beyond direct imports and the
transitive closure of exports. However, to pave the way for a future
implementation of a full linker, we still maintain the distinction
between linked and unlinked data. The unlinked data for a propagated
type is simply a unique "slot id" for each type in the compilation
unit which may be propagated. The linked data is the propagated type
to fill into each slot, if any.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1610043002 .
2016-01-20 06:36:04 -08:00
Paul Berry
738b835b0b
Split _LibrarySerializer into two classes.
...
The new class, _CompilationUnitSerializer, is responsible for
serializing a single compilation unit. In a future CL, this will allow
us to serialize all the compilation units for a given library in phases,
retaining state information in each of the _CompilationUnitSerializers.
Also, this fixes a previously undiscovered bug where we were trying to
use the same reference index to represent unresolved references across
compilation units; the correct behavior is for each compilation unit to
have its own index for unresolved references.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1601973006 .
2016-01-19 21:09:53 -08:00
Paul Berry
1db9d760fc
Rename UnlinkedTypeRef to TypeRef.
...
This data structure is going to be re-used in the "linked" section of
summaries to refer to propagated and inferred types.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1610003002 .
2016-01-19 18:52:05 -08:00
Konstantin Shcheglov
633b09698d
Enable most of the constant AST serialization for AST-based summaries.
...
Class member references - constructors (both ambigue and not) and static
methods.
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1606113002 .
2016-01-19 16:14:59 -08:00
John Messerly
8aa3df862b
remove unused method in ElementResolver
...
I forgot to delete this in a previous CL
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1606043003 .
2016-01-19 15:54:53 -08:00
Konstantin Shcheglov
07f8831bc2
Serialize constant initializers.
...
No implementation for element references in this CL.
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1602203004 .
2016-01-19 13:42:51 -08:00
Paul Berry
cbe4248f4e
Fix summarization of trailing dynamic type arguments.
...
Serialization code now matches the comments in the IDL, which say that
trailing `dynamic` type arguments (e.g. `Map<int, dynamic>`) are omitted
from the summary.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1602263002 .
2016-01-19 13:34:41 -08:00
Paul Berry
1cbf8cfd5f
Introduce code for computing an unlinked summary directly from an AST.
...
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1602883003 .
2016-01-19 10:25:49 -08:00
Brian Wilkerson
c2f5b876c7
Improve failure mode when there is no SDK (issue 25528)
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1605923005 .
2016-01-19 10:16:55 -08:00
Paul Berry
832512a2d0
Properly resynthesize field formal parameter elements.
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1603643007 .
2016-01-19 10:15:12 -08:00
John Messerly
f82b8ae978
strong_mode.dart: remove extra asserts and throw
...
this was an old TODO we discussed a while back
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1596733002 .
2016-01-19 09:18:03 -08:00
Brian Wilkerson
21ecb14548
Clean-up imports
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1602803002 .
2016-01-18 15:42:16 -08:00
Brian Wilkerson
539f0dff4a
Move AST implementation out of generated
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1595243003 .
2016-01-18 13:02:12 -08:00
Brian Wilkerson
6f56368747
Create a public interface for AST nodes and rename the implementation classes
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1594313002 .
2016-01-18 09:53:40 -08:00
Konstantin Shcheglov
37c2eca20d
Prepare for chaining resynthesizers from AC to SDK AC.
...
AboutToComputeResultHelper for each AnalysisContext should be set
externally, because analysis engine does not know where summaries are
stored.
R=brianwilkerson@google.com , paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1591483002 .
2016-01-17 09:25:24 -08:00
Paul Berry
2f99679042
Don't include implicit initializing formal types in summaries.
...
These can be easily inferred at resynthesis time.
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1597893003 .
2016-01-17 09:12:07 -08:00
Konstantin Shcheglov
028254cea1
Generate code UnlinkedConst / UnlinkedConstOperation.
...
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1596703002 .
2016-01-17 08:58:35 -08:00
Brian Wilkerson
d116322f7d
Do not produce hint on constructor when class is deprectated (issue 25503)
...
R=scheglov@google.com
Review URL: https://codereview.chromium.org/1598773004 .
2016-01-16 15:09:56 -08:00
Dan Rubel
1ef8fc8cec
simplify EmbedderUrlResolver
...
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1596693002 .
2016-01-15 21:21:11 -05:00
Konstantin Shcheglov
7121c09b7d
Fix dart2js build - don't use Int64.
...
TBR
I again attempted to use it :-(
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1581773015 .
2016-01-15 17:32:27 -08:00
Konstantin Shcheglov
6f5082ea7c
Generate enum readers.
...
This is just nicer for the clients, plus also will allow us to use
these readers in lists.
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1589823007 .
2016-01-15 15:05:56 -08:00
Brian Slesinsky
648e62243c
fix a nondeterministic error messsage by sorting the field names
...
BUG=
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1590533003 .
2016-01-15 14:46:57 -08:00
Konstantin Shcheglov
21d0fb26c9
Write and read support for Float64 lists in FlatBuffers.
...
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1588043006 .
2016-01-15 14:40:48 -08:00
Paul Berry
3dcef185d6
Fix newline normalization in _PhysicalFile.readAsStringSync().
...
Most clients of _PhysicalFile read the file by translating it into a
Source object using createSource() and then reading it using
FileBasedSource.contentsFromFile, which normalizes newlines using
FileBasedSource.fileReadMode.
However, a few clients read the file directly using
_PhysicalFile.readAsStringSync(), which wasn't doing the
normalization. This CL adds the normalization to that code path.
One such client was the code generation logic for summaries; this
caused code generation to produce different results on Windows, which
led to a test failure.
Fixes #25470 .
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1584313010 .
2016-01-15 12:54:22 -08:00
Konstantin Shcheglov
6b56451788
Issue 25504. Fix for ignoring expression bodies in incremental resolver.
...
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25504
Review URL: https://codereview.chromium.org/1584653007 .
2016-01-15 12:20:49 -08:00
Dan Rubel
b7303a3409
plumb through enableAsync
...
and mock async library elements if enableAsync is false
R=brianwilkerson@google.com
Review URL: https://codereview.chromium.org/1591653003 .
2016-01-15 14:15:02 -05:00
Konstantin Shcheglov
183144562d
Chaining not just element requests but also summaries access.
...
We need to do this when during resynthesizing a package library we
need to create a Location referencing something in the Dart SDK.
R=paulberry@google.com
BUG=
Review URL: https://codereview.chromium.org/1585843009 .
2016-01-15 09:06:56 -08:00