Commit graph

47021 commits

Author SHA1 Message Date
pq 7e7a446ec5 Bump analyzer version to latest published (0.30.0+2).
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2897783002 .
2017-05-22 06:11:00 -07:00
Peter von der Ahé de7edcde74 Fix crash with generalized function types in type tests.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2899693003 .
2017-05-22 14:53:46 +02:00
Erik Corry cad93bb844 Fix x64 precompiled target after prologue changed size
R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2897943002 .
2017-05-22 14:30:49 +02:00
Johnni Winther 915383a17a Add KernelCodegenWorkItem stub
With this change we can run the compilation of hello_world from .dill
(with --read-dill --disable-type-inference) to where we need to run
the KernelSsaBuilder.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2888413004 .
2017-05-22 10:18:48 +02:00
Johnni Winther 789fce309f Add ElementCodegenWorldBuilder
Reusable parts are left in CodegenWorldBuilderImpl and a stub KernelCodegenWorldBuilder is added.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2894893002 .
2017-05-22 10:05:57 +02:00
Erik Corry aa60a2ea90 More compact string representation on 64 bit.
This moves the hash code into the header word for strings on 64 bit
platforms.  With the old layout, 9 character strings became 48-byte
objects.  With the new layout you have to go to 17 characters before
you are bumped from 4 to 6 words (32 to 48 bytes).

As a side effect, the class ID field is now 16 bits on all platforms
instead of having two different sizes, and the size field is 8 bits
on all platforms.

This also paves the way for moving the hash code for instance objects
into the header, so we won't need the side-lookup in the
hash-table-of-hash-codes on 64 bit platforms.

This is a reapplication of https://codereview.chromium.org/2893553002/
after issues were fixed in https://codereview.chromium.org/2888413002/
and https://codereview.chromium.org/2896583002/

R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2895183002 .
2017-05-22 10:04:59 +02:00
Vyacheslav Egorov 20a0e75ef8 VM: Constant fold more loads from constants in the optimizer.
We have limited support for folding away length loads from constant
arrays and strings. However we were not folding away loads in code
like:

    enum E { V }

    isV(flags) => (flags & (1 << E.V.index)) != 0;

Here we would emit load index and shift for mask computation
instead of simply emitting 1.

This change fixes the oversight by enabling folding away loads
of final fields from constants.

This relands the original commit 746ab58f46
with a fix for precompiler crashes: ArgumentError.value constructor is
added to the precompiler roots.

TBR=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2897803002 .
2017-05-21 19:45:38 +02:00
Vyacheslav Egorov 0eb44ec68f Use same range info when emitting code and computing if instruction can deopt.
For BinarySmiOpInstr and ShiftMintOpInstr we use range information to both
decide if instruction can deopt and decide which checks should be emitted
when emitting native code for this instruction.

However because range information is attached to the definition and not
uses it often gets out of sync as we mutate the graph. For example we might
first make a decision that an instruction can't deoptimize based on more
precise range information but then use less precise information in the
backend for deciding which parts of the instruction to emit (because
redifinition or a phi-instruction was removed from the graph). This mismatch
can lead to a crash if less precise information tells backend that one of the
inputs need to be checked - because there is no deoptimization label to jump
to.

This CL is addressing this problem by ensuring that range information is
cached at the use and both ComputeCanDeoptimize() and backend use the same
range information.

Additionally this CL kills overly generic MergedMath instruction and replaces it
with TruncDivModInstr.

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

Review-Url: https://codereview.chromium.org/2891113002 .
2017-05-21 19:01:49 +02:00
Zachary Anderson 81e428fd39 [infra] Assembles the SDK using GN rather than create_sdk.py
This has a few advantages:
- We can track dependencies more precisely
- ninja can assemble things in parallel as they're ready rather than
  sequentially all at once.
- It is easier to customize SDKs depending on target platform, e.g.
  Fuchsia.

This CL also has a number of cleanups:
- Defining is_fuchsia and is_fuchsia host so we don't always have to check
- Piping through toolchain overrides in more places
- Fixing bugs in copy_tree.py, not using list_files.py, which is broken on Windows

related #29558

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2848943003 .
2017-05-20 23:30:09 -07:00
Paul Berry bf15116d0f Handle FutureOr type when inferring async closures.
R=asgerf@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2892593005 .
2017-05-20 20:16:59 -07:00
Dan Rubel 3c447ab35d add fasta.scanner support for lazy assignment operators
R=paulberry@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2895803002 .
2017-05-20 23:02:47 -04:00
Paul Berry 4e3f10669d Flatten futures when inferring the type of an async function expression.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2895063003 .
2017-05-20 20:00:18 -07:00
Paul Berry d68f6ad603 Add statement hooks to TypeInferenceListener.
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2894343002 .
2017-05-20 18:56:59 -07:00
Konstantin Shcheglov d7be9e36e8 Local declarations take precedence over exports.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2894183002 .
2017-05-20 18:35:52 -07:00
Sigmund Cherem 011f8c5873 Reapply CL: first step for modular support in fasta
BUG=
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2894283002 .
2017-05-19 19:47:37 -07:00
Jacob Richman 58851f2f06 Add ignoreAllErrors option to dart:_runtime
Supports users who want to try to run broken code while porting a Dart
app to strong mode.

BUG=
R=alanknight@google.com

Review-Url: https://codereview.chromium.org/2893803006 .
2017-05-19 15:53:08 -07:00
Konstantin Shcheglov 00525a056c Update cli description for a couple of benchmarks.
R=ahe@google.com, paulberry@google.com, sigmund@google.com
BUG=

Review-Url: https://codereview.chromium.org/2896613003 .
2017-05-19 15:11:17 -07:00
Konstantin Shcheglov 658ff7ba99 Remove IncrementalResolvedAstGenerator.
It is not used anymore, and there is a compilation errors accidentally
introduced. So, I guess it is easier to remove it than to fix it.

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

Review-Url: https://codereview.chromium.org/2892203003 .
2017-05-19 15:07:27 -07:00
Sigmund Cherem 54dcc29835 Revert "First step for modular output in fasta."
This reverts commit d9e9382373.

There were bot failures on incremental_kernel_generator test and in
incremental_resolved_ast_test, I'm not sure yet why tests passed locally though.

BUG=

Review-Url: https://codereview.chromium.org/2894273002 .
2017-05-19 15:02:48 -07:00
Sigmund Cherem d9e9382373 First step for modular output in fasta.
Some details:
 - Adds the tree-shaker logic and unit tests for it,

   Note: I'm still not clear on what degree of tree-shaking we can get away
   with. For now I have a mode to delete anything that is not seen explicitly.
   This passes verification for all of our tests so far, but breaks both the
   mixin and the async/await transformer in some scenarios.

 - Writes a prototype of kernelForBuildUnit (although no automated tests for it
   yet).

 - Moves a few more pieces to ProcessedOptions

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2893493004 .
2017-05-19 13:59:15 -07:00
Siva Annamalai 7aed6c0a74 Minor code reorg to ensure we don't include parts of the Library tag handler in the precompiled runtime builds.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2896523003 .
2017-05-19 13:41:23 -07:00
Siva Annamalai 92a516e703 Pull loader.[cc|h] file out of libdart_builtin rule and instead include it in each of the targets (dart|gen_snapshot|dart_bootstrap) that need it. It is not needed in dart_precompiled_runtime but to really remove it from there some refactoring of main.cc is needed. This CL does not address that.
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2887153006 .
2017-05-19 13:27:43 -07:00
Ryan Macnak 1a5571904d Fuchsia SDK: Also copy zlib to the SDK's bin directory.
So we run with the one built in the Fuchsia tree instead of the (potentially absent) one from the host.

R=jamesr@google.com

Review-Url: https://codereview.chromium.org/2892223002 .
2017-05-19 13:23:14 -07:00
Jacob Richman 728f71f740 Ship dart2js output for dev_compiler/web in the sdk.
These tools are used to support applying source maps to stack traces
and running the Dart dev compiler in the browser as part of an extension.

This CL adds the following files
dart-sdk/lib/dev_compiler/web/ddc_web_compiler.js
dart-sdk/lib/dev_compiler/web/dart_stack_trace_mapper

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

Review-Url: https://codereview.chromium.org/2889253002 .
2017-05-19 13:21:53 -07:00
Brian Wilkerson 80fd95bb70 Fix parser bug found while trying to reproduce a different bug
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2895743002 .
2017-05-19 13:07:59 -07:00
Steve Messick 5455f21565 Fix reparent on windows
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2892963002 .
2017-05-19 10:28:44 -07:00
Brian Wilkerson a8dc041543 Capture the request time for performance data and support forced shutdown
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2893803004 .
2017-05-19 08:49:47 -07:00
Brian Wilkerson c1a7070770 Add the ability to whitelist plugins
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2897653002 .
2017-05-19 08:48:32 -07:00
Brian Wilkerson a6214b3129 Remove more libraries directives from server
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2894883002 .
2017-05-19 08:42:30 -07:00
Vyacheslav Egorov 1040fefdea Revert "VM: Constant fold more loads from constants in the optimizer."
This reverts commit 746ab58f46.

Reason: precompiler tests broke

    python tools/test.py -mrelease -cprecompiler -rdart_precompiled -aarm -sandroid --use-blobs -t480 corelib/string_test
    python tools/test.py -mrelease -cprecompiler -rdart_precompiled -aarm -sandroid --use-blobs -t480 corelib/list_test/none
    python tools/test.py -mrelease -cprecompiler -rdart_precompiled -aarm -sandroid --use-blobs -t480 corelib/list_test/01

TBR=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2894913002 .
2017-05-19 17:17:52 +02:00
Erik Corry bd6f0800fc Fix flaky test that makes assumptions about other things on the heap
R=whesse@google.com
BUG=

Review-Url: https://codereview.chromium.org/2896583002 .
2017-05-19 16:58:35 +02:00
John McCutchan ed821439ba Remove johnmccutchan from observatory watchlist 2017-05-19 07:56:54 -07:00
Vijay Menon 92d39a4e08 One more minor mixin fix
We need to preserve the Mixin constructor to make sure metadata (e.g.,
implements) is injected in the right place.

R=jacobr@google.com

Review-Url: https://codereview.chromium.org/2779063002 .
2017-05-19 07:41:29 -07:00
Vyacheslav Egorov 746ab58f46 VM: Constant fold more loads from constants in the optimizer.
We have limited support for folding away length loads from constant
arrays and strings. However we were not folding away loads in code
like:

    enum E { V }

    isV(flags) => (flags & (1 << E.V.index)) != 0;

Here we would emit load index and shift for mask computation
instead of simply emitting 1.

This change fixes the oversight by enabling folding away loads
of final fields from constants.

BUG=
R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2897603002 .
2017-05-19 16:06:59 +02:00
Aske Simon Christensen c8f9e0f3f9 Use Function::ZoneHandle for StaticCallInstr targets
R=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2897643002 .
2017-05-19 15:56:38 +02:00
Erik Ernst 3b5874a332 Adjusted initializer rules, changing a run-time error to compile-time.
R=lrn@google.com

Review-Url: https://codereview.chromium.org/2843733002 .
2017-05-19 14:22:35 +02:00
Peter von der Ahé 6e0fd8ebb2 Update mini_ast.dart to new Listener interface.
R=kustermann@google.com

Review-Url: https://codereview.chromium.org/2896573002 .
2017-05-19 14:10:52 +02:00
Peter von der Ahé fb8c445e92 Update status files.
Review-Url: https://codereview.chromium.org/2897483004 .
2017-05-19 13:40:46 +02:00
Aske Simon Christensen 9a1b6c3198 Eliminated PolymorphicInstanceCallInstr with_checks_ field
Create static calls instead of polymorphic calls without checks

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

Review-Url: https://codereview.chromium.org/2877713003 .
2017-05-19 13:36:56 +02:00
Peter von der Ahé f19e46e946 Update Listener implementations.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2892173002 .
2017-05-19 13:32:23 +02:00
Martin Kustermann 22c7536d36 Reduce temporarily flakiness rate of dart2js-drt by re-running until they have been fixed
We should either remove dart2js-drt or use a stable version of
content_shell from upstream chromium (instead of our dartium-based one)
for dart2js-drt.

Issue #29655

R=whesse@google.com

Review-Url: https://codereview.chromium.org/2891343002 .
2017-05-19 13:13:40 +02:00
Asger Feldthaus 1ea216e6de Add metadata annotations to library definitions.
BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2893803003 .
2017-05-19 11:35:26 +02:00
Peter von der Ahé ef3d2c8ce2 Unsort methods from CL 2872903005.
Review-Url: https://codereview.chromium.org/2894583005 .
2017-05-19 11:17:52 +02:00
Peter von der Ahé 547b2cdcce Implement generalized function types.
Fixes https://github.com/dart-lang/sdk/issues/6972

Fixes https://github.com/dart-lang/sdk/issues/26581

R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2876813002 .
2017-05-19 11:03:24 +02:00
Johnni Winther a52cc66a30 Handle super accesses loaded from .dill
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2890153002 .
2017-05-19 10:21:04 +02:00
David Morgan 32c4094d04 Analyzer: add ignore_for_file comment that ignores a type of problem for the whole file; add tests.
BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2888953002 .
2017-05-19 10:01:53 +02:00
Erik Corry 5182eeab26 Remove unused variable
TBR=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2892793004 .
2017-05-19 09:07:27 +02:00
Erik Corry 4aa5e1d7aa Cleanup: Make CheckClassId instruction more general so it
can be used uniformly in the polymorphic inliner.

R=kustermann@google.com
BUG=

Review-Url: https://codereview.chromium.org/2891713002 .
2017-05-19 08:49:41 +02:00
Erik Corry bd01ce38ce Fix off-by-one error in DBC interpreter
TBR=zra@google.com
BUG=

Review-Url: https://codereview.chromium.org/2888413002 .
2017-05-19 08:46:30 +02:00
Vijay Menon 1f94f3dc0a Fix status for FF
TBR=alanknight@google.com

Review-Url: https://codereview.chromium.org/2895543002 .
2017-05-18 19:29:40 -07:00