Commit graph

35061 commits

Author SHA1 Message Date
Konstantin Shcheglov 767b57bafd Extract Local refactoring: skip method names in invocations.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1498523005 .
2015-12-03 15:19:36 -08:00
John Messerly 6cababc94c Fixes incorrect generic function type capture
This improves how generic function types are modeled. In particular, we can now handle types like <T>T -> T, in printing, equality, and the type parameter is correctly removed when it is instantiated.

This preserves the existing lazy "substitute" operation, and makes the "instantiate" operation interact with it correctly. Given a type like:

    {T/T}<S>T -> S

we can substitute S/T to get:

    {S/T}<S>T -> S

then if we instantiate as <int> we'll get the correct:

    {S/T, int/S}T -> S, which == S -> int

This also converts typedefs over to the new system, as this seemed like the most natural thing. (However this does *not* change how the type name is evaluated, in particular given the type name "F", where "F" is a typedef `<T>T -> T`, will result in the function type `{dynamic/T}T->T` exactly as it did before. If we want to write the type `<T>T->T` we will need a different mechanism.)

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

Review URL: https://codereview.chromium.org/1488383004 .
2015-12-03 15:03:03 -08:00
danrubel 4379efb6b4 rework ArgListContributor to use new task model
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1500793003 .
2015-12-03 18:00:50 -05:00
Ryan Macnak 7dfb517618 Revert "Precompilation/x64: Load float vector constants via Thread."
This reverts commit 9cf30c9697.

Review URL: https://codereview.chromium.org/1494323002 .
2015-12-03 14:19:21 -08:00
Brian Wilkerson 090459ca08 Report targets will null entries (prevents an NPE)
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1497083003 .
2015-12-03 13:46:48 -08:00
Leaf Petersen f5b28b7cf3 Checker is defensive against unresolved redirecting constructor
Fixes #25071

BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1500793002 .
2015-12-03 13:42:52 -08:00
Leaf Petersen 2d61ed26b7 Check for void in rules subtyping (fixes #25069)
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1497803003 .
2015-12-03 13:41:28 -08:00
Ryan Macnak 9cf30c9697 Precompilation/x64: Load float vector constants via Thread.
Cannot put these in the object pool because some of these instructions
are used in intrinsics.

BUG=http://dartbug.com/24450
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1488403002 .
2015-12-03 13:35:31 -08:00
Florian Schneider d9b1301821 VM: Fix crash in profile signal handler.
The profile signal handler may interrupt when the current Thread
is in an inconsistent state.

Members of the Thread that is unscheduled are NULLed out before
OSThread::SetCurrent sets a new current Thread. Fix this by resetting
the current Thread's fields after a new Thread is set as current.

BUG=#25702
R=iposva@google.com

Review URL: https://codereview.chromium.org/1491283002 .
2015-12-03 22:00:24 +01:00
Konstantin Shcheglov 072aaaefb6 Issue 25101. Flush TOKEN_STREAM after computing PARSED_UNIT.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25101

Review URL: https://codereview.chromium.org/1495783005 .
2015-12-03 12:52:58 -08:00
Florian Schneider 94fcce2b0c Fix analyzer warning in a unit test.
Add initializer for a final field.

TBR=rmacnak@google.com

BUG=

Review URL: https://codereview.chromium.org/1494233003 .
2015-12-03 21:45:00 +01:00
Florian Schneider dff13bef8d VM: Fix bug in type propagation at conditionals.
Propagating type/cid at conditional branches is not possible because
it may cause invalid code motion.

For this to be safe we need to explicitly represent the dependency
between checks eliminated in a branch and the condition that constrains the type/cid.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1491373005 .
2015-12-03 21:14:35 +01:00
Ryan Macnak d94b68cb41 Precompilation: Don't drop an uncompiled function if it has a compiled implicit closure function.
This ensures the implicit closure function is enumerated in later steps. Fixes crash in co19 test reducible as

import 'dart:math';
main() {
  print(const [1, 2.0, "3"].fold(0, max));
}

Also enumerate invocation dispatchers to avoid a similar situation there, though I cannot find a crashing example involving them.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1489203004 .
2015-12-03 11:03:23 -08:00
danrubel 6fd2fba704 hookup new CompletionContributorFactory
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1500723002 .
2015-12-03 13:34:35 -05:00
Asger Feldthaus 1051962aef dart2js: Mark some tests as slow in checked mode.
R=sra@google.com

Review URL: https://codereview.chromium.org/1500673002 .
2015-12-03 19:23:03 +01:00
Konstantin Shcheglov 93072d7825 Include tokens of Function/MethodDeclaration into AST view.
It helped to identify the "The null object does not have a getter 'variable'" problem.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1493893006 .
2015-12-03 10:00:05 -08:00
Konstantin Shcheglov dc13ac659f Fix for DeclarationResolver and invalid getters/setters.
This fixes the following exception:

Caused by The null object does not have a getter 'variable'.

NoSuchMethodError: method not found: 'variable'
Receiver: null
Arguments: []

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1492373002 .
2015-12-03 09:59:00 -08:00
Leaf Petersen e155b03b26 Fix JS inline regression. We were exiting early instead of moving on to look for JS calls.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1497673002 .
2015-12-03 09:57:57 -08:00
danrubel c2b70c9054 improve annotation argument completion - from https://github.com/dart-lang/sdk/pull/25099
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1497773002 .
2015-12-03 10:34:00 -05:00
danrubel ac63bc8fe4 update completion extension point to use CompletionContributorFactory
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1495933002 .
2015-12-03 10:02:04 -05:00
danrubel e1f6fc7c95 move dart completion contributor instantiation
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1497523004 .
2015-12-03 07:46:00 -05:00
Leaf Petersen 500efa1e7d Fix some inference corner case crashes. Running the DDC language tests against the bleeding edge analyzer exposed a few small issues, this fixes the crashers.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1499533002 .
2015-12-02 21:43:06 -08:00
Konstantin Shcheglov 5f49df1644 Issue 25095. Add 'Change X to Y type annotation' Quick Fix.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25095

Review URL: https://codereview.chromium.org/1492053004 .
2015-12-02 18:50:41 -08:00
Stephen Adams ce03676eba Make JS-form 'returns:' annotation imply 'creates:' unless otherwise specified
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1490103002 .
2015-12-02 18:45:43 -08:00
Stephen Adams 9a5640a7d2 Allow null in more 'special' type rules.
We get extra precision from including argument types that produce errors.
e.g. {int} + {int,null} --> {int}.

Nice improvement on some numerical benchmarks where the result is used as an index where we can now use the builtin indexer.

Review URL: https://codereview.chromium.org/1493673003 .
2015-12-02 15:43:42 -08:00
Natalie Weizenbaum 85dc0454b3 Bring in the latest version of pub.
R=rnystrom@google.com

Review URL: https://codereview.chromium.org/1491933003 .
2015-12-02 14:06:05 -08:00
Stephen Adams aec20f4a5b dart2js: Guard against imprecise inferred types
For some reason html.Element's   static const _tagsForWhichCreateContextualFragmentIsNotSupported is inferred to dynamic instead of a ContainerTypeMask.

This change will also 'do the right thing' if we turn off type inference.

R=asgerf@google.com

Review URL: https://codereview.chromium.org/1490923003 .
2015-12-02 14:04:24 -08:00
pq 94f73224c0 Bump linter DEP to 0.1.9.
Fixes #25092 (NSME on getter analysis).

R=keertip@google.com

Review URL: https://codereview.chromium.org/1492773005 .
2015-12-02 13:45:15 -08:00
pq 43f027fc05 Analysis request getReachableSources (#24893).
Implements a new request to get reachable sources.

This solves a specific issue for flutter (e.g., inferring execution type by checking the transitive closure of reachabe sources for `dart:flutter`) but can be more generallly useful for other client-side smarts (e.g., "is this a web entry point?" or "is this a test?").

More context here: https://github.com/dart-lang/sdk/issues/24893

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

Review URL: https://codereview.chromium.org/1491013002 .
2015-12-02 13:26:35 -08:00
Leaf Petersen daf5f6d258 Hide inference hints. Fixes #24563.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1498573002 .
2015-12-02 13:07:46 -08:00
Paul Berry c030056158 Fix erroneous restoration of task model state.
The test suite PoorMansIncrementalResolutionTest was turning on the
new task model during setup and turning it off during teardown; as a
result, any tests run after it were using the old task model.

The easy fix is to just stop trying to adjust the task model state in
this test suite, since the new task model is on by default now.

This should fix test breakages when run via pkg/analyzer/test_all.dart.

TBR=scheglov@google.com

Review URL: https://codereview.chromium.org/1497573002 .
2015-12-02 11:41:14 -08:00
Konstantin Shcheglov f12da4d00c Issue 25050. Fix for NPE in ConstantEvaluationEngine when duplicate fields.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/25050

Review URL: https://codereview.chromium.org/1493833003 .
2015-12-02 11:29:36 -08:00
Matthias Hausner 4733386ca8 Reset top-level class finalization
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1493533002 .
2015-12-02 09:59:32 -08:00
Ryan Macnak 56239b1476 Use the same clock for the profiler samples and timeline events.
Preparation for overlaying samples in the timeline.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1492653002 .
2015-12-02 09:37:23 -08:00
Konstantin Shcheglov bf54a3bef6 Don't attempt to create a file for non-Dart imports.
This should help to fix the following exception:

Dart analysis server, SDK version 1.13.0-dev.7.12, server version 1.12.0, error: Exception from fix contributor: DefaultFixContributor
Bad state: No element

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1492843003 .
2015-12-02 09:28:58 -08:00
Srdjan Mitrovic abef5cb3ed Correct overflow check; signed integer overflow is undefined in C++.
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1490853002 .
2015-12-02 08:45:41 -08:00
Johnni Winther 1328c98cc2 This CL:
- renames the existing AbstractValue in cps_ir/type_propagation.dart to AbstractConstant
- introduces AbstractValue as an empty superinterface of TypeMask, and
- lift the interface of TypeMaskSystem to the superinterface AbstractValueDomain.

In follow-ups:
- change simple uses from TypeMask(System) to AbstractValue(Domain)
- update names and comment in AbstractValueDomain to more precisely reflect the abstraction
- update the complex uses (mainly type_propagation.dart) to use AbstractValue(Domain)

R=asgerf@google.com

Review URL: https://codereview.chromium.org/1415883005.
2015-12-02 13:52:10 +01:00
Florian Schneider 46f3e7bfe7 VM: Reduce size of AST-nodes vtables.
Make Is## methods of AST nodes non-virtual, like we do for IL instruction nodes.

This saves around 10k in vtables on ia32.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1482153006 .
2015-12-02 13:38:26 +01:00
Florian Schneider dd095404b7 Fix Windows SDK build.
TBR=srdjan@google.com

BUG=

Review URL: https://codereview.chromium.org/1493703002 .
2015-12-02 13:18:06 +01:00
Asger Feldthaus 91e2862a98 dart2js cps: Emit 'return' after throwing call to assist VM analysis.
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1476293003 .
2015-12-02 12:40:19 +01:00
Florian Schneider 59fd6c8397 VM: Small clean up and const-ness fix for Thread/OSThread constants.
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1482243006 .
2015-12-02 12:30:12 +01:00
Florian Schneider 5f073e7be0 VM: More read-only handles for constant null-objects/-instances.
Use Object::null_## for null-constants where possible.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1488773004 .
2015-12-02 11:36:30 +01:00
Rico Wind b1b1eb4864 Trigger bots after googlecode downtime
R=whesse@google.com
BUG=

Review URL: https://codereview.chromium.org/1493633002 .
2015-12-02 07:46:22 +01:00
Leaf Petersen d0ea4371c9 Remove debugging print
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1489183002 .
2015-12-01 16:13:36 -08:00
Leaf Petersen 64ab186b16 Downwards inference. This adds support to the resolver for downwards
type inference in strong mode.  Downwards inference is removed from
the DDC checker in favor of the strong mode analyzer version.

BUG=
R=brianwilkerson@google.com, jmesserly@google.com

Review URL: https://codereview.chromium.org/1462133005 .
2015-12-01 15:40:27 -08:00
Konstantin Shcheglov cfc8ee30b7 Fix for exception in FixProcessor._addFix_illegalAsyncReturnType.
This fixes the following reported exception.

Dart analysis server, SDK version 1.13.0, server version 1.12.0, error: Exception from fix contributor: DefaultFixContributor
The null object does not have a getter 'offset'.

NoSuchMethodError: method not found: 'offset'
Receiver: null
Arguments: []

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1487683006 .
2015-12-01 14:37:11 -08:00
Konstantin Shcheglov 1b9c263b56 New NodeLocator which uses positions of characters, not between them.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1490933002 .
2015-12-01 13:59:11 -08:00
Ryan Macnak 6fc5018282 Standalone: Use new support in dart:core for decoding data uris.
R=iposva@google.com

Review URL: https://codereview.chromium.org/1489603002 .
2015-12-01 13:46:20 -08:00
Konstantin Shcheglov 50d9ec3161 Check types in '_addFix_createConstructorSuperExplicit'.
I was not able to reproduce the problem.
But this might fix the following exception.

Dart analysis server, SDK version 1.13.0, server version 1.12.0, error: Exception from fix contributor: DefaultFixContributor
type 'MethodInvocation' is not a subtype of type 'ConstructorDeclaration' in type cast.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1489823003 .
2015-12-01 13:40:46 -08:00
Ryan Macnak f949a2d132 Mark precompilation_dart2js_test as Pass, Slow in debug mode.
Review URL: https://codereview.chromium.org/1488913003 .
2015-12-01 13:31:23 -08:00