Commit graph

47896 commits

Author SHA1 Message Date
Johnni Winther
1b580129bf Fix unittests
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2939943005 .
2017-06-16 13:00:59 +02:00
Johnni Winther
795e078f21 Remove Compiler.mainApp and Compiler.mainFunction
This prepares for switching between K and J elements between resolution and codegen.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2936233003 .
2017-06-16 13:00:21 +02:00
Jens Johansen
0a1583aa04 [kernel] Fix assert message.
This mimics the behaviour of the source-based pipeline,
i.e. instead of "manually" calling _AssertionError._create and giving
the correct parameters (wrong parameters, actually), use the helper
method _AssertionError.ThrowNew.

BUG=
R=ahe@google.com, vegorov@google.com

Review-Url: https://codereview.chromium.org/2940283002 .
2017-06-16 12:28:18 +02:00
Peter von der Ahé
e24970ef40 dart2js isn't strong mode clean yet.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2939313003 .
2017-06-16 12:21:54 +02:00
Dmitry Stefantsov
7ccfd3599c Remove one more unused import
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2943653002 .
2017-06-16 12:01:21 +02:00
Johnni Winther
482502705a Revert "Towards compiling Hello World!" and "Compile and run Hello World!"
This reverts commit 778feb0504 and 1214e6fba6.

Review-Url: https://codereview.chromium.org/2938193003 .
2017-06-16 11:34:05 +02:00
Johnni Winther
1214e6fba6 Compile and run Hello World!
Review-Url: https://codereview.chromium.org/2942863002 .
2017-06-16 11:23:00 +02:00
Dmitry Stefantsov
fb290206a0 Remove unused imports to make analyzer happy
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2945493004 .
2017-06-16 11:09:17 +02:00
Dmitry Stefantsov
6ebe771a71 Remove unnecessary contexts in closure conversion
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2939043002 .
2017-06-16 11:01:10 +02:00
Johnni Winther
778feb0504 Towards compiling Hello World!
R=efortuna@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2939033002 .
2017-06-16 10:45:23 +02:00
Karl Klose
6e7011320b Mark top_level_main_t05 as still failing in dartk-debug
R=jensj@google.com

Review-Url: https://codereview.chromium.org/2945573002 .
2017-06-16 10:43:55 +02:00
Dmitry Stefantsov
c4f4d010fb Remove ContextClass that is not needed since we're using Vectors
Previously reified representation of contexts, also known as
ContextClass, was used in closure conversion.  Now that we've switched
to Vectors, we no longer need that class.

R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2937213002 .
2017-06-16 10:32:36 +02:00
William Hesse
f99509ad42 Fix bad merge in refactoring
The land of https://codereview.chromium.org/2933973002 merged badly
with https://codereview.chromium.org/2934243002/

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

Review-Url: https://codereview.chromium.org/2938383002 .
2017-06-16 10:10:54 +02:00
Peter von der Ahé
2e6e44a69b Strong mode cleaning of many dart2js tests.
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2939063002 .
2017-06-16 09:31:29 +02:00
Paul Berry
953399512a Enable top level inference of instance property gets/sets.
To facilitate experimentation, I've left the old code in place, but
disabled it using a const bool `fullTopLevelInference`.  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.

I believe that with this change, all expressions that can be type
inferred inside a method body can now be type inferred at top level,
provided that there are no circular dependencies.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2942153002 .
2017-06-15 20:51:19 -07:00
Paul Berry
cd1cd49f49 Remove an unnecessary null check
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2940843005 .
2017-06-15 20:44:36 -07:00
Paul Berry
79bf5f5931 Fuse top level type inference with dependency generation.
This CL combines the two parts of top level type inference
(determining dependencies and inferring a type) into a single
operation.

The technique is: instead of evaluating top level types in
topologically sorted order (which requires that we figure out the
dependencies first, so that we can do topological sorting), we simply
iterate over the fields requiring inference and begin inferring them
in whatever order they are encountered.  If, while trying to infer the
type of one field, we discover a reference to field that hasn't been
type inferred yet, we make a recursive call to infer the second field.
If this recursion leads to a loop, then we mark all of the fields in
the loop as participating in a circularity (and set their types to
`dynamic` for error recovery purposes).

To facilitate experimentation, I've left the old code in place, but
disabled it using a const bool `fusedTopLevelInference`.  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 there are some minor user-visible behavioral changes:

- When there is a circularity, we no longer consider the entire
  strongly connected component to be part of the circularity; we only
  consider the loop formed by following the first unresolved
  dependency of each field.  (I did this because of ease of
  implementation, and because it made it easier to reassure myself
  that the outcome of the algorithm is independent of the order in
  which fields are visited).  See
  pkg/front_end/testcases/inference_new/strongly_connected_component.dart
  for the user-visible consequence of this change.

- We no longer need to speculatively assume that method invocations
  depend on the types of their parameters when not supplying generic
  types; now they only depend on the types of their parameters when
  the method being invoked is known to be generic.  See
  pkg/front_end/testcases/inference_new/dependency_only_if_generic_method.dart.

- We no longer need to speculatively assume that invocations of `+`,
  `-`, `*`, and `%` depend on the types of their RHS; now they only
  depend on the types of their RHS when the type of the LHS is
  `int`. See
  pkg/front_end/testcases/inference_new/dependency_only_if_overloaded.dart.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2942623004 .
2017-06-15 18:13:51 -07:00
Emily Fortuna
0edf55ceab Change type of ClosureTask to ClosureConversionTask (new supertype) in one other file.
BUG=

Review-Url: https://codereview.chromium.org/2943023002 .
2017-06-15 17:24:07 -07:00
Ryan Macnak
9cb92858f7 Do not run standalone tests on dart2js.
Review-Url: https://codereview.chromium.org/2939223002 .
2017-06-15 16:52:07 -07:00
Siva Annamalai
5e7bc9f162 Adjust status file for issue 29895
BUG=

Review-Url: https://codereview.chromium.org/2941183002 .
2017-06-15 16:42:28 -07:00
Sigmund Cherem
dc329bdcf3 fix inferrer bug
BUG=https://github.com/dart-lang/sdk/issues/29885
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2940023004 .
2017-06-15 16:18:05 -07:00
Bob Nystrom
5ee0f27725 Fix static errors (and hints) in test.
BUG=
R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/2942083002 .
2017-06-15 15:56:43 -07:00
Ben Konyi
b57f7b4c12 [Gardening] fixing bad test.
TBR=rnystrom@google.com
BUG=

Review-Url: https://codereview.chromium.org/2944543002 .
2017-06-15 15:38:24 -07:00
Emily Fortuna
932dcd7145 Modify backend strategy and how we access the closure converter.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2939163002 .
2017-06-15 15:29:30 -07:00
Bob Nystrom
0a8475e26e Fix test.dart tests.
R=bkonyi@google.com

Review-Url: https://codereview.chromium.org/2942073002 .
2017-06-15 14:55:38 -07:00
Terry Lucas
1e1bab0bff Updated to latest WebKit changes
TBR=asiva@google.com

Review-Url: https://codereview.chromium.org/2939193002 .
2017-06-15 14:31:48 -07:00
Bob Nystrom
a6ca718e98 Simplify Command classes.
- Get rid of separate CommandBuilder class and singleton pattern. It
  was being passed around explicitly even though half of the places
  that received a CommandBuilder as a parameter still directly called
  CommandBuilder.instance instead of using it.
- Get rid of Command caching. As far as I can tell, it makes no
  measurable difference in runtime performance or memory usage. Even
  with a large invocation of a lot of configurations and tests, the
  Command classes don't seem to be a significant use of memory.
- Shorten the factory names. "get" adds no value, and we know it
  returns a "Command" since it's on Command.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2933973002 .
2017-06-15 14:19:03 -07:00
Paul Berry
da3d611aaf Remove pkg/front_end's remaining dependencies on pkg/analyzer.
The remaining dependencies were in code that isn't being used anymore,
so I just removed the dead code.

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

Review-Url: https://codereview.chromium.org/2941083002 .
2017-06-15 13:47:29 -07:00
Paul Berry
058c29f0a5 Only attempt to do type inference on fields that lack a declared type.
This avoids the need for KernelField._implicitlyTyped.

R=danrubel@google.com

Review-Url: https://codereview.chromium.org/2941093002 .
2017-06-15 13:41:09 -07:00
Siva Chandra
65a5707189 Add a vmservice_sdk directory in runtime/bin.
This directory has a libraries.json file pointing to vmservice_io and
_vmservice in the source tree. The script tools/patch_sdk.dart has been
updated to use this new directory as the sdk directory when compiling
dart:vmservice_io. This way, to build vmservice_io.dill, we
do not need to copy the dart files pertaining to vmservice_io and
_vmservice.

Fixes #29859

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2938903003 .
2017-06-15 13:08:10 -07:00
Siva Annamalai
114ac0bbd9 Fix status files for issue 29895
BUG=

Review-Url: https://codereview.chromium.org/2943463003 .
2017-06-15 11:27:19 -07:00
Paul Berry
6bc0baf131 Add checks to make sure new front_end package dependencies are not added.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2940893004 .
2017-06-15 11:18:57 -07:00
Ryan Macnak
26336b47a3 Allow enabling --causal-async-stacks in AOT.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2944483002 .
2017-06-15 11:09:51 -07:00
Siva Annamalai
8b7af73daa 1. Dynamically compute the main closure that needs to be run by the main isolate
2. Get rid of _getMainClosure()
3. Adjust the AOT compiler to ensure it retains the function associated with
   the main closure without having to include '_getMainClosure()' in the list
   of embedder specified entry points
4. Get rid of the hack in kernel reader to do a delayed patch of
   '_getMainClosure()' in the builtin library.

BUG=
R=aam@google.com, rmacnak@google.com

Review-Url: https://codereview.chromium.org/2933603002 .
2017-06-15 10:40:45 -07:00
Zachary Anderson
07725f3dfa [Fuchsia] Fix Platform.executable and Platform.resolvedExecutable
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2941873002 .
2017-06-15 09:05:54 -07:00
Dmitry Stefantsov
5982ace801 Add transformLibraries for closure conversion
Closure conversion can now be run on a part of a program.  It allows
using closure conversion in kernel-isolate.  It comes at a cost of
temporarily sacrificing implementation of tear-offs via closures; VM
mechanism for tear-offs is used for now.

R=ahe@google.com

Review-Url: https://codereview.chromium.org/2938773003 .
2017-06-15 14:18:10 +02:00
Peter von der Ahé
ba2cde4607 Switch the defaults: strong mode is now default, but we stil check tests in Dart mode.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2938943003 .
2017-06-15 14:16:39 +02:00
Peter von der Ahé
f71e6fd49b [gardening] Update status file for vm tests that crash in debug mode.
Review-Url: https://codereview.chromium.org/2934423002 .
2017-06-15 14:10:08 +02:00
Peter von der Ahé
0750bc20ed Finish strong mode cleaning of dart2js.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2941033002 .
2017-06-15 13:49:02 +02:00
Jens Johansen
dc72d9c34e Update language_kernel.status for closed issue.
BUG=
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2940073002 .
2017-06-15 13:41:13 +02:00
Jonas Termansen
742822af73 Fix runtime/tools/bin_to_assembly.py not setting symbol type and size.
The absence of symbol sizes broke build comparison that looks for and
ignores snapshots. Add symbol types for good measure to match the compiler
behavior.

Consider unknown operating systems to use as(1)-style assembly, which is
generally true. If an unknown operating system uses another syntax, the
generated files will fail to assemble and the porter should soon find
this script and add support for their operating system.

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2939013002 .
2017-06-15 13:40:46 +02:00
William Hesse
f18601df57 Update status for Firefox 54
BUG=
R=sortie@google.com

Review-Url: https://codereview.chromium.org/2942853002 .
2017-06-15 13:18:57 +02:00
Dmitry Stefantsov
504f55c043 Unbind canonical name of getter after renaming it in closure conversion
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2936203002 .
2017-06-15 10:58:28 +02:00
Peter von der Ahé
b4066914eb Late night strong mode cleaning.
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2942763002 .
2017-06-15 09:44:50 +02:00
Peter von der Ahé
06b8ce5d34 More dart2js strong mode cleanup.
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2934333002 .
2017-06-15 09:42:22 +02:00
Peter von der Ahé
fe2365584b More strong mode cleaning in dart2js.
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2941763002 .
2017-06-15 09:34:47 +02:00
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