Commit Graph

7128 Commits

Author SHA1 Message Date
Konstantin Shcheglov 581c2b71c4 Repalce shiftOr with pushLongInt, tweak makeSymbol.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1648783002 .
2016-01-28 14:34:13 -08:00
John Messerly 9733a88c9f fixes #25610, infer JS builtin in strong mode like we used to
R=vsm@google.com

Review URL: https://codereview.chromium.org/1643033002 .
2016-01-28 14:18:25 -08:00
pq e902b07ed4 Engine test fix to keep up with SourceFactory changes.
BUG=
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1645173002 .
2016-01-28 12:57:45 -08:00
Konstantin Shcheglov 425cd5444e Compute literal constant values.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1649533005 .
2016-01-28 11:33:04 -08:00
Bob Nystrom 4af641864f A missing enum case in a switch is a warning, not a compile-time error.
Fixes #25576.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1644683002 .
2016-01-28 11:12:25 -08:00
danrubel d486870787 * fixes embedder bugs on Windows
* updates embedder tests to properly test Windows

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1612393002 .
2016-01-28 10:50:57 -05:00
Brian Wilkerson b33f1380d0 Add tests, including test for issue
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1647613002 .
2016-01-27 12:44:14 -08:00
Paul Berry d24548220a Add the ability to resynthesize class members from summaries.
This is needed to support type inference, since an inferred type may
point to a parameter of a class member.

I believe it will also be useful for reserializing constant ASTs.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1647553002 .
2016-01-27 12:35:12 -08:00
danrubel 296c99c004 (TBR) fix embedder windows test
See https://github.com/dart-lang/sdk/issues/25498

Review URL: https://codereview.chromium.org/1643643002 .
2016-01-27 13:44:41 -05:00
Konstantin Shcheglov 59925f9f4a Support for static method references in constants.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1640813002 .
2016-01-27 10:16:33 -08:00
Konstantin Shcheglov e4ab45aa65 Improve 'length' instance property reference encoding.
UnlinkedConstOperation.length is used not only if we can prove that
the target is a StringLiteral (and actually we cannot encode it as a
reference).

The new ReferenceKind.length was added - it is used to encode reference
to the the only instance property we support - 'length'.

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1642483002 .
2016-01-27 09:55:36 -08:00
Brian Wilkerson a1feb55137 Replace isAppropriateFor with suitabilityFor and start using it
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1645643002 .
2016-01-27 09:26:13 -08:00
Brian Wilkerson 9c56d05746 Stop creating duplicate enum members when the element model has already been built
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1633233002 .
2016-01-26 14:00:02 -08:00
Paul Berry 70cb431737 Test some additional corner cases of type inference for summaries.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1635213003 .
2016-01-26 13:42:07 -08:00
Konstantin Shcheglov 43621246eb Serialize static constant field references.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1636113002 .
2016-01-26 13:01:40 -08:00
Paul Berry f93e2d3212 Remove some summary TODOs that have already been addressed.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1636893003 .
2016-01-26 11:13:10 -08:00
Konstantin Shcheglov 8485e42a27 Record static constant public fields.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1639533003 .
2016-01-26 10:44:21 -08:00
Brian Wilkerson 5d9274bd79 Move Modifier out of the public API
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1633823003 .
2016-01-26 09:27:44 -08:00
Konstantin Shcheglov b0836ee7b9 Support for constructor references in constant serializer and prelinker.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1633863002 .
2016-01-26 08:23:12 -08:00
Paul Berry 4e86a006db Stop precomputing ClassElement.isValidMixin.
Previously, we would precompute the value of ClassElement.isValidMixin
and store it in the Modifier.MIXIN.  But this didn't really save any
time, because (a) isValidMixin isn't used inside analyzer, and (b) it
is easily derivable from other information already present in the
element model.

Also, we were computing it incorrectly when the `--supermixin` flag
was present.

This CL replaces the precomputation logic with a direct implementation
in ClassElement.isValidMixin which is correct regardless of the
presence of the `--supermixin` flag.  The tests are beefed up so that
(a) they validate correct behavior for both states of the flag, (b)
they validate correct behavior in the presence of factory
constructors, and (c) they validate that the behavior of
`isValidMixin` is consistent with the error messages produced by the
analyzer.

In addition to fixing bugs, the removal of Modifier.MIXIN means we
have one less piece of information to store in summaries.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1635063003 .
2016-01-26 07:29:48 -08:00
John Messerly a5ee0a435e remove obsolete UninferredClosure type
fixes https://github.com/dart-lang/dev_compiler/issues/290

R=vsm@google.com

Review URL: https://codereview.chromium.org/1627503002 .
2016-01-25 16:08:31 -08:00
Brian Slesinsky ccf3870ffc final fields shouldn't be dependencies of const variables
(They are only dependencies of const constructors.)

This was causing bogus error messages to appear
when a const expression mistakenly references
a final field.

BUG=https://github.com/dart-lang/sdk/issues/25526
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1620963003 .
2016-01-25 15:53:41 -08:00
Brian Slesinsky 28ecd1bbef Oops, move ReferenceTest to constant_test.dart as well
BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1623673003 .
2016-01-25 13:28:05 -08:00
Brian Wilkerson 5a07d5c559 Add support for tasks to determine whether they are appropriate for a given target
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1633823002 .
2016-01-25 12:28:41 -08:00
Konstantin Shcheglov 013f0066ff Include explicit constructors and static methods into UnlinkedPublicName
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1619253003 .
2016-01-25 09:27:24 -08:00
Brian Wilkerson 032aa11711 Add minimal yaml support to the engine
R=paulberry@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1622313003 .
2016-01-25 09:00:56 -08:00
Paul Berry e97db5219c Store the result of type inference in summaries.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1624853002 .
2016-01-25 08:04:50 -05:00
Konstantin Shcheglov 205a2a9c28 Don't add sources to DartSdk contexts.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1625273003 .
2016-01-24 15:49:18 -08:00
Brian Wilkerson dd0c42cb72 Moved the AST related tests to their new locations
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1612933006 .
2016-01-23 09:45:01 -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 Slesinsky 001f64b564 print nicer errors for a const dependency graph failure
BUG=
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org/1618103002 .
2016-01-22 14:47:18 -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
Brian Slesinsky 771fea4502 move constant tests to constant_test.dart
BUG=
R=brianwilkerson@google.com, paulberry@google.com

Review URL: https://codereview.chromium.org/1616743006 .
2016-01-22 12:44:15 -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 afbac7a887 Add a test of summary resynthesis 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/1621603005 .
2016-01-22 13:19:27 -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
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
John Messerly 0b407a2c61 Tweak reflective_tests _invokeSymbolIfExists to not swallow exceptions
I had a bug in my code, that caused a bunch of test failures without meaningful stack trace. It was caused by _invokeSymbolIfExists swallowing all NoSuchMethodErrors from setUp/tearDown calls. Instead, it now guards only the method lookup, not the call.

R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1607103003 .
2016-01-20 13:39:00 -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
Paul Berry 9ad3ef570b Split summary_test into multiple files.
The file has over 1000 tests, takes 8 seconds to run, and breaks
naturally into 3 nearly equal-sized pieces.  It seems reasonable to
split it up.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1606123003 .
2016-01-20 10:42:51 -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