Commit graph

15748 commits

Author SHA1 Message Date
Sigmund Cherem f5a03eb0ef fix bot: remove analyzer error
(I'm not sure why I didn't see this error before submitting)

TBR=aam@google.com

Review-Url: https://codereview.chromium.org/2940863004 .
2017-06-14 21:34:15 -07:00
Paul Berry 44f19d1a60 Lift nearly all top-level type inference restrictions.
This CL lifts all of the restrictions on top level type inference
except for one: the restriction that expressions used for top level
type inference cannot depend on the types of instance getters,
instance setters, or instance fields.  (That restriction will be
lifted in a later CL).

The technique is: to determine the dependencies of an expression,
rather than recurse through the expression applying the rules for what
constitutes an "immediately evident" expression, we simply do a dry
run of the inference algorithm and record what static fields were
accessed.  To avoid recording bogus dependencies on fields whose type
doesn't matter, this dry run skips subexpressions whose type isn't
needed.

To facilitate experimentation, I've left the old code in place, but
disabled it using a const bool `extendedTopLevelInference`.  The old
code can be re-enabled by setting this bool to `false`.  Once we are
sure that we want to proceed with this approach, we can remove the old
code.

Note that this makes the behavior begin to diverge with analyzer
behavior, so I've created a new test directory:
pkg/front_end/testcases/inference_new/, to hold test cases which
aren't expected to match analyzer.  Analyzer is only tested against
the test cases in pkg/front_end/testcases/inference/.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2935323002 .
2017-06-14 20:34:06 -07:00
Sigmund Cherem 5a63b0e339 Add flutter mode to patched_sdk
This is needed to create a platform.dill for flutter.

R=aam@google.com

Review-Url: https://codereview.chromium.org/2931773003 .
2017-06-14 17:29:36 -07:00
Emily Fortuna 1e599fd213 Edit docs as per Siggi's feedback.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2937143002 .
2017-06-14 17:13:54 -07:00
Emily Fortuna 7302ea43cf Make requiresContextBox a getter as per Siggi's suggestion.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2936323003 .
2017-06-14 17:12:33 -07:00
Emily Fortuna e6d7c0500c Rename ClosureClassMaps to CLosureDataLookup
(doing small tasks while I wait to talk to Siggi).

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2938853004 .
2017-06-14 16:55:57 -07:00
Konstantin Shcheglov a3d9f5303c Cache transitive files in FileState.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2937103002 .
2017-06-14 13:53:28 -07:00
Emily Fortuna a05f5000ad Modify types in dump_info to make kernel checked mode happy.
This is a follow up CL from https://codereview.chromium.org/2933363003

BUG=

Review-Url: https://codereview.chromium.org/2940883006 .
2017-06-14 13:39:46 -07:00
Peter von der Ahé 87700d381c Start making dart2js strong mode clean.
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2938823002 .
2017-06-14 20:34:07 +02:00
Emily Fortuna a27ebd0c94 Add ClosureRepresentationInfo, the new public face of ClosureClassMap
(removal of methods exposing ClosureClassMap coming in follow up CL).

BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2933363003 .
2017-06-14 11:15:08 -07:00
Sigmund Cherem 5e5e62f9d8 Remove deps from reloader
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2937983002 .
2017-06-14 10:57:25 -07:00
Paul Berry e03744a740 Fix fasta testcase to avoid a super call to an abstract method.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2941813002 .
2017-06-14 10:55:31 -07:00
Peter von der Ahé 246334011a Ignore recoverable parser errors in outline_builder to avoid double reporting.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2940843003 .
2017-06-14 19:14:53 +02:00
Dan Rubel f8655ca568 update invalid hex digit recovery
* update invalid hex digit recovery for compatibility with analyzer
* address comments from https://codereview.chromium.org/2915093002

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2941583003 .
2017-06-14 11:18:34 -04:00
Dan Rubel b03ff5c772 update analyzer tests for fasta scanner
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2940783002 .
2017-06-14 11:17:31 -04:00
Dan Rubel 305f358fa4 update statement completion for fasta scanner
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2936143002 .
2017-06-14 11:15:50 -04:00
Konstantin Shcheglov 8925c68a71 Extract computing UnlinkedUnit(s) and cache them in ByteStore.
So, we usually don't have to parse most of the files in order to
compute imports/exports/parts and API signatures.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2939823002 .
2017-06-14 08:09:58 -07:00
Peter von der Ahé 3cc27ab40a [gardening] Mark test as slow.
Review-Url: https://codereview.chromium.org/2942603002 .
2017-06-14 15:21:30 +02:00
Paul Berry 92a878f276 Fix argument names for handleIndexedExpression.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2935833002 .
2017-06-14 06:05:53 -07:00
Peter von der Ahé a189be6786 Copy fasta analyze_test to dart2js.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2942573002 .
2017-06-14 15:00:43 +02:00
Peter von der Ahé 6302a5b31b Implement metadata on classes and additional semantic checks.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2938793002 .
2017-06-14 14:59:53 +02:00
Johnni Winther 195470419e Fix strong mode warning
Review-Url: https://codereview.chromium.org/2942583002 .
2017-06-14 13:45:05 +02:00
Johnni Winther 6a6a330623 Parameterize and move JumpTarget/LabelDefition to elements/jumps.dart
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2930293002 .
2017-06-14 12:27:38 +02:00
Johnni Winther 52b1ea04e8 Refactor LoopHandler to avoid calling KernelAstAdapter.getNode
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2932023003 .
2017-06-14 12:18:34 +02:00
Dmitry Stefantsov 32eed0892d Update expectations for closure conversion tests
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2935223003 .
2017-06-14 11:03:46 +02:00
Jens Johansen 4bbda48a7c [kernel] Stream everything. Replace .kernel_function with .kernel_offset
- Put pointer to kernel data into Script.
- Replace function.kernel_function pointer to AstNode with
  kernel_offset():
- Replace field.kernel_field pointer to AstNode with kernel_offest().
- Stream the previously unstreamed AstNodes: FunctionDeclaration and
  FunctionExpression.
- Move special handling for _buildin.getMainClosure into the streaming
  flowgraph builder.
- Delete big parts of kernel_to_il.

R=kmillikin@google.com

Committed: 948e2f5d79
Review-Url: https://codereview.chromium.org/2901533002 .
2017-06-14 10:59:57 +02:00
Johnni Winther ea070c7264 Add ClosedWorld.elementEnvironment and remove Compiler.elementEnvironment
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2935063002 .
2017-06-14 10:27:38 +02:00
Johnni Winther 5afe65e891 Remove Compiler.commonElements
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2935663002 .
2017-06-14 10:18:42 +02:00
Jens Johansen de5ebc5a4e Revert "[kernel] Stream everything. Replace .kernel_function with .kernel_offset"
The commit somehow made e.g. vm-linux-release-ia32-be turn red.

This reverts commit 948e2f5d79.

BUG=

Review-Url: https://codereview.chromium.org/2941483003 .
2017-06-14 09:12:38 +02:00
Jens Johansen 948e2f5d79 [kernel] Stream everything. Replace .kernel_function with .kernel_offset
- Put pointer to kernel data into Script.
- Replace function.kernel_function pointer to AstNode with
  kernel_offset():
- Replace field.kernel_field pointer to AstNode with kernel_offest().
- Stream the previously unstreamed AstNodes: FunctionDeclaration and
  FunctionExpression.
- Move special handling for _buildin.getMainClosure into the streaming
  flowgraph builder.
- Delete big parts of kernel_to_il.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2901533002 .
2017-06-14 08:27:21 +02:00
Peter von der Ahé 3c17c44d52 Implement metadata on methods and fields.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2935993002 .
2017-06-14 08:25:17 +02:00
Brian Wilkerson a0d7d64f0b Convert more tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2936123002 .
2017-06-13 19:38:59 -07:00
Devon Carew e523061acc Minor tweaks to the diagnostics page.
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2937623005 .
2017-06-13 19:22:28 -07:00
Jennifer Messerly c848476643 fix super from constructors
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2938713002 .
2017-06-13 16:47:20 -07:00
Max Kim e57d9b608f Change to accommade Angular plugin and finalize removal of dependency to analysis_server
BUG=
R=brianwilkerson@google.com, mfairhurst@google.com

Review-Url: https://codereview.chromium.org/2934133002 .
2017-06-13 16:31:39 -07:00
Jennifer Messerly 1f50f0d126 fix mixins with factory constructors
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2935933005 .
2017-06-13 15:58:50 -07:00
Paul Berry 211e578273 Chase imports in analyzer's front_end_inference_test.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2936043002 .
2017-06-13 14:27:54 -07:00
Emily Fortuna 0753ac689e Handle named mixin application in emitter
Fixes regression in language/regress_18713_test with --csp

Closes #29844
Closes #29843

This reapplies Johnni's change from here: https://codereview.chromium.org/2934783002/

I am submitting it instead of Johnni because without this change we are blocking the new dart update internally in Google.
BUG=
TBR

Review-Url: https://codereview.chromium.org/2936063002 .
2017-06-13 14:23:20 -07:00
Brian Wilkerson 4337a3aeee Cleanup some unused code in some of the tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2942433002 .
2017-06-13 14:01:17 -07:00
Alan Knight 9e3fdbf94d Update DDC core patch for ConstantExpressionError
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2941593002 .
2017-06-13 13:57:42 -07:00
Siva Chandra a879f91420 Remove dart:_vmservice and dart:vmservice_io from platform.dill.
A mirrors test which now passes has been removed from the blacklist.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2931193002 .
2017-06-13 13:49:38 -07:00
Konstantin Shcheglov ba189d1fd3 Fix for mismatch between existing FileState data and UnlinkedUnit.
I started implementing using of UnlinkedUnit, and found that I like
isShow and names better. Also, parts are always only URIs. And I think
that we are not going to need setters.

R=paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2936833003 .
2017-06-13 13:33:23 -07:00
Paul Berry e2c2733556 Add expectations to infer_local_function_return_type.
Previously this test didn't really test anything.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2939523003 .
2017-06-13 13:31:12 -07:00
Paul Berry a1ecb46a4c Fix top level type inference for binary operators.
Multiple changes were required:

- The analyzer's mock SDK had an incorrect return type for
  `num.operator/`.

- We weren't considering the RHS of the binary operators `+`, `-`,
  `*`, and `%` to be an inference dependency (we need to, since the
  special overload rules for int depend on the type of the RHS).

- We weren't executing the overload logic when doing top level type
  inference.

- The logic for deciding what operators are overloaded was incorrect.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2940703002 .
2017-06-13 13:07:00 -07:00
Sam Rawlins c6d6a69a78 Add an alwaysThrows annotation to indicate that a function always throws.
BUG=https://github.com/dart-lang/sdk/issues/17999
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2170643003 .
2017-06-13 12:42:25 -07:00
Brian Wilkerson 4da8380881 Convert more tests to use the new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2939803002 .
2017-06-13 12:04:25 -07:00
Konstantin Shcheglov 0912f3c640 Use API signatures for library cycle signatures when possible.
If there are mixin applications, we still have to use full content hashes.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2939743002 .
2017-06-13 11:39:29 -07:00
Konstantin Shcheglov 751c71f034 Store also 'hasMixinApplication' flag with UnlinkedUnit.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2940673002 .
2017-06-13 11:20:04 -07:00
Brian Wilkerson 1e9ae646ff Clean up some hints
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2939723002 .
2017-06-13 09:24:50 -07:00
Konstantin Shcheglov fbaa7d45c4 FlatBuffers formats for storing unlinked units.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2939653002 .
2017-06-13 08:50:49 -07:00
Peter von der Ahé 73107ed49e Fix memory leak in test.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2940643002 .
2017-06-13 17:16:53 +02:00
Peter von der Ahé 1a66215a8e Skip testing/test/analyze_test on browsers.
Review-Url: https://codereview.chromium.org/2934953005 .
2017-06-13 17:13:03 +02:00
Peter von der Ahé dcf133589a Trim the String, not the Future.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2940653002 .
2017-06-13 16:16:23 +02:00
Peter von der Ahé db2e915aac Improve recovery from compile-time errors.
R=danrubel@google.com, paulberry@google.com

Review-Url: https://codereview.chromium.org/2938573002 .
2017-06-13 16:00:15 +02:00
Peter von der Ahé 14e9d0bd89 Prepare for improved error recovery from compile-time errors.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2931423002 .
2017-06-13 15:59:18 +02:00
Peter von der Ahé 964384424a Analyze package:testing.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2941493002 .
2017-06-13 15:46:04 +02:00
Jens Johansen 76336b225f [kernel] Streaming ScopeBuilder
The old ScopeBuilder is replaced with StreamingScopeBuilder
that does not use the Ast.

R=kmillikin@google.com

Review-Url: https://codereview.chromium.org/2886873008 .
2017-06-13 11:39:31 +02:00
Peter von der Ahé 11f82b12d2 Update golden files.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2937683002 .
2017-06-13 10:46:04 +02:00
Peter von der Ahé ea30fb6a0d Follow-up to CLs 2933723002 and 2932973003.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2933813002 .
2017-06-13 09:45:41 +02:00
Peter von der Ahé 5095646191 Apply transformations after comparing to golden files.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2939533002 .
2017-06-13 09:40:35 +02:00
Peter von der Ahé b06a3602b4 Update golden files.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2933763002 .
2017-06-13 09:25:22 +02:00
Peter von der Ahé a78250d931 Support metadata on local variables.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2936503002 .
2017-06-13 09:15:54 +02:00
Peter von der Ahé 092ef81f95 Complain about cyclic typedefs.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2931303002 .
2017-06-13 09:13:23 +02:00
Peter von der Ahé 8da7993d63 Attempt to instantiate an enum class is a compile-time error.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2935593002 .
2017-06-13 09:12:51 +02:00
Peter von der Ahé f559a6d1e9 Throw NSM on unresolved factory redirection.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2933733002 .
2017-06-13 09:12:20 +02:00
Paul Berry 24bb748bc7 Implement type inference for "not" expressions.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2935763004 .
2017-06-12 17:44:25 -07:00
Konstantin Shcheglov c4de2886b1 Build reverse dependencies between LibraryCycle(s).
I plan using it for adding libraries that have not been affected by
the changed files, but must be sent to VM because of possible inlining.
We will find affected libraries and then climb up until we reach the
entry point.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2934933002 .
2017-06-12 17:30:52 -07:00
Jennifer Messerly 71c7914061 fix checking of dsend generic type bounds
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2935553002 .
2017-06-12 16:17:39 -07:00
Jennifer Messerly cb038cda2f fix test runner to understand mutlitests that expect an error
R=rnystrom@google.com, vsm@google.com

Review-Url: https://codereview.chromium.org/2930203002 .
2017-06-12 16:07:17 -07:00
Jennifer Messerly e79fbd167b fix #29789, avoid unneccessary dcalls and checks in dart:_runtime
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2932043003 .
2017-06-12 15:44:45 -07:00
Jennifer Messerly 334354f968 fix #29753, use ES5 constructors for ddc
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2934623003 .
2017-06-12 15:31:32 -07:00
Emily Fortuna 32e0be82ff Reapply "Separate out loop closure information."
This reverts commit d85512e0ad.

BUG=

Review-Url: https://codereview.chromium.org/2936693002 .
2017-06-12 14:55:17 -07:00
Brian Wilkerson 67ff4d4c47 Convert more tests to the new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933943002 .
2017-06-12 14:10:14 -07:00
Paul Berry 31e2b4ac84 Add offsets to the == null calls inserted by null-aware desugaring.
This makes it possible to close a gap in testing instrumentation:
previously any annotations that were missing a file offset got
silently dropped.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2940453002 .
2017-06-12 14:06:51 -07:00
Paul Berry d4a64e52e7 Add type inference for assignments to this[...]
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2938443003 .
2017-06-12 14:00:59 -07:00
Paul Berry 5d58191948 Add type inference for assignments to super[...]
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2935783003 .
2017-06-12 13:34:38 -07:00
Konstantin Shcheglov 16833bce7c Add FileState.hasMixin/hasMixinLibrary properties.
We will use them to decide which kind of key to use for cache.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2928393004 .
2017-06-12 12:43:31 -07:00
Paul Berry cdb1e858d2 Add type inference for assignments to properties.
This covers explicit property accesses (using both `.` and `?.`) as
well as implicit properties of `this`.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2931363003 .
2017-06-12 11:33:06 -07:00
Brian Wilkerson 65d05524ce Remove some unnecessary tests for non-driver mode
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2935733003 .
2017-06-12 11:31:09 -07:00
Brian Wilkerson d9749ef0ac Get the highlights test to work with the new driver
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2934863002 .
2017-06-12 11:30:24 -07:00
Emily Fortuna d85512e0ad Revert "Separate out loop closure information."
This reverts commit 5636a225d7.

BUG=

Review-Url: https://codereview.chromium.org/2936683002 .
2017-06-12 11:01:09 -07:00
Emily Fortuna 5636a225d7 Separate out loop closure information.
BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2932103002 .
2017-06-12 10:07:09 -07:00
Konstantin Shcheglov e92aadb72f Report unused files to watch.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2933153002 .
2017-06-12 10:01:31 -07:00
Konstantin Shcheglov 5e8ceb60ab Implement GC for FileState(s).
Also fix for invoking watch().

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2929363002 .
2017-06-12 08:48:03 -07:00
Devon Carew 10a5bfaa08 Reduce the test scope of get_fixes_test.dart.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2932343002 .
2017-06-12 08:24:53 -07:00
Devon Carew 32071cffc3 Remove an unused local variable.
BUG=

Review-Url: https://codereview.chromium.org/2933103002 .
2017-06-12 07:48:35 -07:00
Devon Carew a96ef1b420 Fix a race condition in an analysis server test.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2934813002 .
2017-06-12 07:43:01 -07:00
Brian Wilkerson 62d0376231 Run the sorter to reduce code churn
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933753002 .
2017-06-12 07:37:14 -07:00
Brian Wilkerson d824acbf71 Update AssistProcessor to use ChangeBuilder
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2928313002 .
2017-06-12 07:28:02 -07:00
Devon Carew 44854543ea Tweak the look of the ast and element links in the diagnostics page.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2933043003 .
2017-06-12 07:15:35 -07:00
Peter von der Ahé d8783acfb3 Revert "Handle named mixin application in emitter"
This reverts commit d109fad7f3.

Also, update status and ignore strong mode warning.

R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2933093002 .
2017-06-12 14:21:34 +02:00
Johnni Winther d109fad7f3 Handle named mixin application in emitter
Fixes regression in language/regress_18713_test with --csp

Review-Url: https://codereview.chromium.org/2934783002 .
2017-06-12 11:49:29 +02:00
Dmitry Stefantsov 1c544012c3 Re-validate command line options after changing them in fasta
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2934763002 .
2017-06-12 11:30:42 +02:00
Peter von der Ahé 080a25f3a6 Various semantic checks on field initializers.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2929383002 .
2017-06-12 11:15:49 +02:00
Peter von der Ahé 2867303232 Various issues with duplicated names.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2934713002 .
2017-06-12 11:11:45 +02:00
Peter von der Ahé 0c7d657333 Complain about duplicated defer.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2933723002 .
2017-06-12 10:33:40 +02:00
Peter von der Ahé 35d77460e4 Various semantic checks regarding const and final.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2932973003 .
2017-06-12 10:27:22 +02:00
Johnni Winther 44258bc8eb Support field initializers and static/top-level fields in compile_with_dill_test
+ a String literal!

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2931153002 .
2017-06-12 10:01:25 +02:00
Johnni Winther 7bd8cfe670 Handle instance fields in compile_from_dill_test
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2929143002 .
2017-06-12 09:46:37 +02:00
Johnni Winther b1f129d258 Add MemberEntity.member and refactor Emitter.getReflectionName to avoid mixin Selector and Entity
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2933553002 .
2017-06-12 09:42:22 +02:00
Johnni Winther bed356cd46 Add FrontendStrategy.commonElements and remove Backend.commonElements
This a step towards support different models between the frontend and the backend.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2932883002 .
2017-06-12 09:35:22 +02:00
Johnni Winther 61c100da49 Rename FrontEndStrategy to FrontendStrategy
It hurts my eyes to see

  FrontEndStrategy frontEndStrategy ...
  BackendStrategy backendStrategy ...

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2932793005 .
2017-06-12 09:30:18 +02:00
Brian Wilkerson c0617d2015 Add access to AST ane element model data to the status pages
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2928033006 .
2017-06-11 09:44:15 -07:00
Brian Wilkerson b928683560 Add a couple of lints to the options files
R=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2933713002 .
2017-06-11 09:12:48 -07:00
Peter von der Ahé 4e8203f9cd Improve error messages and recovery.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2924363002 .
2017-06-10 10:43:03 +02:00
Peter von der Ahé 202655ebb6 Add option for printing tokens produced by the scanner.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2933533002 .
2017-06-10 10:14:36 +02:00
Peter von der Ahé 96e494d534 Complain about external methods with a body.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2930093002 .
2017-06-10 10:13:04 +02:00
Peter von der Ahé 043c0096ad Complain about use before declaration.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2924423003 .
2017-06-10 10:12:18 +02:00
Peter von der Ahé dcbac2be00 Complain about incorrect use of null-aware operations.
R=danrubel@google.com, johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2932723003 .
2017-06-10 10:11:36 +02:00
Peter von der Ahé fd9716fa95 Various semantic checks on formal parameters.
R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2926953004 .
2017-06-10 10:10:07 +02:00
Paul Berry 6b65fc22f7 Annotate targets of implicit this property gets/sets in inference tests.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933663002 .
2017-06-09 17:41:13 -07:00
Paul Berry 8f5bcddc31 Implement type inference for assignments to a static variable.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2933643002 .
2017-06-09 17:36:20 -07:00
Paul Berry ef94f715a9 Add type inference for assignment to local variables.
Also fix some upwards inference cases for assignment to index
expressions.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2928033005 .
2017-06-09 15:13:14 -07:00
Konstantin Shcheglov c2f18fc930 Implement promised watch behaviour.
1. There are no reasons to use different watch function between
   computeDelta() invocations, so I moved it to the constructor.

2. We need to call it, and await, before reading files, not after.

3. Added tests.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2931183003 .
2017-06-09 15:04:30 -07:00
Konstantin Shcheglov 90f12aa802 Fix for resynthesizing generic functions during linking.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2931123002 .
2017-06-09 14:21:02 -07:00
Emily Fortuna d9015a73ea Separate out ClosureAnalysisInfo to separate interfaces between what
the SSA builder needs to know and what the locals handler needs.

BUG=
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2928063002 .
2017-06-09 13:29:17 -07:00
Florian Loitsch a8c2d1adba Add library tag to common_usage_sorter.dart.
Review-Url: https://codereview.chromium.org/2931163002 .
2017-06-09 21:33:21 +02:00
Florian Loitsch 377093841f Report an error when a part-of refers to an unnamed library.
Fixes #28522
BUG= http://dartbug.com/28522
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2931893004 .
2017-06-09 21:08:26 +02:00
Devon Carew c7373ec565 Fix a status file.
BUG=

Review-Url: https://codereview.chromium.org/2929193002 .
2017-06-09 11:54:13 -07:00
Konstantin Shcheglov 6f4bba5f03 Compute API signatures of files.
Note, that in non-incemental case this change has negative performance
implications - compilation is 10% slower. Computing MD5 hashes is very
expensive.

In real life scenarios we will cache API signatures and URIs as
part of unlinked information for each file.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2926883003 .
2017-06-09 11:41:29 -07:00
Paul Berry 4abff2291b Rework type inference of assignments to index expressions.
The approach from the las CL (try to figure out the structure of the
assignment expression from the desugared result) turned out to be
unsustainably complex.  In this version we keep track of the structure
while doing the desugaring, and then store the result in a wrapper
object the kernel AST.  The wrapper object defers visit methods to the
object it wraps, so when the kernel objects are serialized to disk,
the wrapper disappears.

I also took the liberty of removing the code that inserts types
into the temporary variables and conditional expressions
introduced by desugaring.  I will add this in a later CL if it
proves to be necessary.

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

Review-Url: https://codereview.chromium.org/2927013004 .
2017-06-09 10:48:07 -07:00
Devon Carew 64af69ac51 Bind the diagnostics server on ipv4 ports.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2930003002 .
2017-06-09 10:43:51 -07:00
Brian Wilkerson 1a0fa7f211 Copy type information for generic function types
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2928173002 .
2017-06-09 10:33:24 -07:00
pq b502bb6956 Prioritize required name param completions (flutter-intellij#1049).
R=danrubel@google.com

Fixes: https://github.com/flutter/flutter-intellij/issues/1049
Review-Url: https://codereview.chromium.org/2927343002 .
2017-06-09 10:20:16 -07:00
Brian Wilkerson 0e6586492d Make common tests consistent
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2925273003 .
2017-06-09 08:40:16 -07:00
Brian Wilkerson 624f4d8b3d Add tests for recently added mixins and improve plugin tests
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2932553004 .
2017-06-09 07:27:16 -07:00
Peter von der Ahé d9f14d6a2b Add --sdk option.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2929783002 .
2017-06-09 15:52:14 +02:00
Alexandre Ardhuin 617d0f53b6 add hint for @required (#29828) 2017-06-09 06:36:50 -07:00
Peter von der Ahé 39ec420753 Option to enable showOffsets in dump.dart.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2931073002 .
2017-06-09 14:21:28 +02:00
Johnni Winther 2042128817 Include uriToSource from dill-based libraries in output.
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2929103002 .
2017-06-09 14:11:43 +02:00
Johnni Winther 89e2719f2f Support user class in compile_from_dill_test
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2927093002 .
2017-06-09 12:35:53 +02:00
Johnni Winther 29535a6ad9 Handle new Object() in compile_from_dill_test
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2927043002 .
2017-06-09 12:03:55 +02:00
Johnni Winther 0f7ee4a6ed A step towards handling new Object() in compile_from_dill_test
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2925263002 .
2017-06-09 11:58:30 +02:00
Dmitry Stefantsov aa8ca9244a Add getTarget method to CompilerCommandLine
The method is used to create an instance of a backend target class.
CompilerCommandLine already has the necessary information for this ("target"
name string and "strongMode" flag).  Additionally, a backed target instance is
now not created in fasta.dart/parseScriptInFileSystem, but should be passed at
the call site.

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

Review-Url: https://codereview.chromium.org/2932513003 .
2017-06-09 11:04:44 +02:00
Devon Carew 303efec911 Make pkg/dart_messages strong.
BUG=
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2916023004 .
2017-06-08 21:55:05 -07:00
Konstantin Shcheglov cf59b1a0f9 Remove ClassHierarchy factory constructor.
KernelTarget already uses IncrementalClassHierarchy, and other clients
either need ClosedWorldClassHierarchy, so should explicitly create it,
or don't care, and can be switched to IncrementalClassHierarchy.

R=ahe@google.com, kmillikin@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2930973002 .
2017-06-08 18:42:22 -07:00
Vijay Menon 06c4619b3e Fix int test
Fixes #29822

R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/2927703005 .
2017-06-08 17:42:35 -07:00
Vijay Menon a7645f817f Optimize runtime code on hot methods
ochafik: this should include your internal fixes.

Here are generated diffs:

JSArray:
       [dartx._get](index) {
-        if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
-        if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
+        if (index == null || index >= this.length || index < 0) {
+          dart.throw(_js_helper.diagnoseIndexError(this, index));
+        }
         return this[index];
       }
       [dartx._set](index, value) {
         E._check(value);
         this[dartx.checkMutable]('indexed set');
-        if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
-        if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
+        if (index == null || index >= this.length || index < 0) {
+          dart.throw(_js_helper.diagnoseIndexError(this, index));
+        }

R=jmesserly@google.com, ochafik@google.com

JSString:
     [dartx.codeUnitAt](index) {
-      if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
-      if (dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
-      if (dart.notNull(index) >= dart.notNull(this[dartx.length])) dart.throw(_js_helper.diagnoseIndexError(this, index));
+      if (index == null || index < 0 || index >= this.length) {
+        dart.throw(_js_helper.diagnoseIndexError(this, index));
+      }
       return this.charCodeAt(index);
     }
     [dartx.startsWith](pattern, index) {
       if (index === void 0) index = 0;
-      _js_helper.checkInt(index);
-      if (dart.notNull(index) < 0 || dart.notNull(index) > dart.notNull(this[dartx.length])) {
+      let length = this.length;
+      if (dart.notNull(index) < 0 || index > length) {
         dart.throw(new core.RangeError.range(index, 0, this[dartx.length]));
       }
       if (typeof pattern == 'string') {
         let other = pattern;
-        let otherLength = other[dartx.length];
-        let endIndex = dart.notNull(index) + dart.notNull(otherLength);
-        if (endIndex > dart.notNull(this[dartx.length])) return false;
+        let otherLength = other.length;
+        let endIndex = index + otherLength;
+        if (endIndex > length) return false;
         return other == this.substring(index, endIndex);
       }
       return pattern[dartx.matchAsPrefix](this, index) != null;
     }
     get [dartx.isEmpty]() {
-      return this[dartx.length] == 0;
+      return this.length == 0;
     }
     [dartx.compareTo](other) {
-      if (!(typeof other == 'string')) dart.throw(_js_helper.argumentErrorValue(other));
+      if (other == null) dart.throw(_js_helper.argumentErrorValue(other));
       return dart.equals(this, other) ? 0 : this < other ? -1 : 1;
     }
     get [dartx.hashCode]() {
       let hash = 0;
-      for (let i = 0; i < dart.notNull(this[dartx.length]); i++) {
+      let length = this.length;
+      for (let i = 0; i < length; i++) {
         hash = 536870911 & hash + this.charCodeAt(i);
         hash = 536870911 & hash + ((524287 & hash) << 10);
         hash = hash ^ hash >> 6;
         ...
     }
     [dartx._get](index) {
-      if (!(typeof index == 'number')) dart.throw(_js_helper.diagnoseIndexError(this, index));
-      if (dart.notNull(index) >= dart.notNull(this[dartx.length]) || dart.notNull(index) < 0) dart.throw(_js_helper.diagnoseIndexError(this, index));
+      if (index == null || index >= this.length || index < 0) {
+        dart.throw(_js_helper.diagnoseIndexError(this, index));
+      }
       return this[index];
     }
Review-Url: https://codereview.chromium.org/2927763004 .
2017-06-08 17:31:44 -07:00
Dan Rubel 56402976cd more fixes for fasta analyzer integration
* fix scanner adapter setSourceStart
* fix fasta token copy() methods
* replace "is TokenWithComment" with "?.preceedingComments != null"
* update scanner test

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2928773003 .
2017-06-08 18:02:09 -04:00
Ben Konyi 033c18472d Revert "Removed SecurityContext.alpnSupported, as ALPN is now supported on all platforms. Also updated CHANGELOG.md to announce its removal."
This reverts commit 4b6fa0d5fb.

BUG=
R=kevmoo@google.com

Review-Url: https://codereview.chromium.org/2928013002 .
2017-06-08 14:32:41 -07:00
Konstantin Shcheglov 5fe793ec4e Use ClassHierarchy.applyChanges() in MixinFullResolution.
So, we let the hierarchy to decide how to react to the changes, and
instance of which class hierarchy to create.

This makes initial compilation with Kernel Driver about 5% faster.

R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2924333002 .
2017-06-08 14:00:51 -07:00
Konstantin Shcheglov 756cca3222 Catch exceptions in ByteStreamServerChannel._outputLine() and close the channel.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2928703007 .
2017-06-08 12:33:43 -07:00
Konstantin Shcheglov f32e9d01b5 Rewrite byte_stream_channel_test.dart to reflective tests.
R=brianwilkerson@google.com
BUG=

Review-Url: https://codereview.chromium.org/2926323002 .
2017-06-08 11:54:06 -07:00
Brian Wilkerson 38e2bf5897 Remove invalid imports of analysis_server
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2927923003 .
2017-06-08 10:41:25 -07:00
danrubel c54372bdc5 fix test
Review-Url: https://codereview.chromium.org/2929673004 .
2017-06-08 12:58:05 -04:00
danrubel d675a7c375 update errorCodeValues
Add the new fasta Scanner error codes to the errorCodeValues list
and add a test to ensure that any new error codes will also be added.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2932483002 .
2017-06-08 12:35:53 -04:00
Paul Berry 029771d746 Add type inference for complex assignments whose LHS is an index expression.
In later CLs I will expand on this code to handle other kinds of
complex assignments.

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2926763003 .
2017-06-08 09:25:24 -07:00
Brian Wilkerson 6d8b7c8806 Finish refactoring FixProcessor to use ChangeBuilder
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2930793002 .
2017-06-08 07:56:08 -07:00
Brian Wilkerson 91b8b495b3 Add support for fixes
R=maxkim@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2923283002 .
2017-06-08 07:53:06 -07:00
Vyacheslav Egorov e00dce80e0 Gardening: Mark get_server_port_test as failing on non-IPv6 enabled systems
R=whesse@google.com
BUG=https://github.com/dart-lang/sdk/issues/29820

Review-Url: https://codereview.chromium.org/2925203004 .
2017-06-08 15:04:55 +02:00