Commit Graph

4835 Commits

Author SHA1 Message Date
Konstantin Shcheglov cc91d04514 Use FileSystem to read files in SourceLoader and TranslateUri.
This is a prerequisite for writing fast unit tests, as I would like
to do while working on the incremental kernel driver.

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

Review-Url: https://codereview.chromium.org/2865843002 .
2017-05-06 13:09:28 -07:00
Stephen Adams dc8a4f21b8 dart2js allocation tweaks
In compiling a large app:

50% reduction in number of strings allocated.
20% reduction in number of closures allocated.

It is hard to tell if there is a performance improvement because it is in the noise.

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

Review-Url: https://codereview.chromium.org/2864573002 .
2017-05-05 14:40:41 -07:00
Johnni Winther b7225cf533 Find native classes with mixins in NativeClassFinder
We were skipping for instance NativeTypedArrayOfDouble because it mixes
in ListMixin and FixedLengthListMixin.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2859133003 .
2017-05-05 10:27:30 +02:00
Johnni Winther 36af30ff42 Handle const Symbol(...) in closed_world2_test
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2857333003 .
2017-05-05 10:22:11 +02:00
Johnni Winther 85f6d69872 Handle more constants in Constantifier
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2857373002 .
2017-05-05 10:17:15 +02:00
Johnni Winther cace0b556d Make JavaScriptBackend.processAnnotations element-model agnostic
R=sigmund@google.com, sra@google.com

Committed: https://github.com/dart-lang/sdk/commit/859bb784eda9ab35b0ce9004adb5d5117544b288

Reverted: https://github.com/dart-lang/sdk/commit/457c277f6f0aa719b7be94cbe6fedf7a749b56e0
Review-Url: https://codereview.chromium.org/2854013002 .
2017-05-05 09:43:02 +02:00
Jens Johansen 30d9bf2ed3 Revert "Void is not required to be null anymore."
This reverts commit 6caf9ef443.

Commit breaks vm-kernel-linux-debug-x64-be.

Triggers asserts like
../../runtime/vm/flow_graph_compiler_x64.cc: 658: error: expected: dst_type.IsMalformedOrMalbounded() || (!dst_type.IsDynamicType() && !dst_type.IsObjectType() && !dst_type.IsVoidType())

Quick-check with python tools/test.py -cdartk -t120 --builder-tag no_ipv6 --vm-options --no-enable-malloc-hooks isolate

BUG=

Review-Url: https://codereview.chromium.org/2865603003 .
2017-05-05 08:56:26 +02:00
Florian Loitsch 6caf9ef443 Void is not required to be null anymore.
In checked mode, `void` now accepts any value.

Fixes #28937.
Fixes #28938.

BUG= http://dartbug.com/28937
BUG= http://dartbug.com/28938
R=johnniwinther@google.com, lrn@google.com, regis@google.com

Committed: https://github.com/dart-lang/sdk/commit/521dc6620fd2c4591aa975745c14b304428f17eb
Reverted: https://github.com/dart-lang/sdk/commit/a3c0cb65af4bbbdde756208dcccdcdf896902b5b
Committed: https://github.com/dart-lang/sdk/commit/4e52c457a9ac412b6b0a3a350020998c7e2f7d9a
Reverted: https://github.com/dart-lang/sdk/commit/4b35d3995b2b273728751c19976ece0edca0eddc
Review-Url: https://codereview.chromium.org/2718513002 .
2017-05-04 16:27:52 +02:00
Johnni Winther add1d2723a Handle const Symbol(...) in kernel_impact
This includes moving towards using ConstantValue instead of
ConstantExpression in ElementAdapter and friends.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2861733002 .
2017-05-04 10:28:34 +02:00
Johnni Winther f2ae4db280 Implement KernelNoSuchMethodResolver.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2857943002 .
2017-05-04 10:17:15 +02:00
Stephen Adams 457c277f6f Revert "Make JavaScriptBackend.processAnnotations element-model agnostic"
This reverts commit 859bb784ed.

The change caused a 2% code size regression on some large angular apps.

TBR=johnniwinther@google.com
BUG=

Review-Url: https://codereview.chromium.org/2860893003 .
2017-05-03 20:03:15 -07:00
Stephen Adams 1472eba52d js_runtime: Split _asyncHelper into separate functions
The separate functions have smaller call-sites and less overhead.

_asyncStart uses Future._nullFuture to avoid 1 allocation.

BUG=
R=floitsch@google.com

Review-Url: https://codereview.chromium.org/2858463002 .
2017-05-03 12:38:35 -07:00
Florian Loitsch 4b35d3995b Revert "Void is not required to be null anymore."
This reverts commit 4e52c457a9.

BUG=

Review-Url: https://codereview.chromium.org/2863463002 .
2017-05-03 19:22:22 +02:00
Florian Loitsch 4e52c457a9 Void is not required to be null anymore.
In checked mode, `void` now accepts any value.

Fixes #28937.
Fixes #28938.

BUG= http://dartbug.com/28937
BUG= http://dartbug.com/28938
R=johnniwinther@google.com, lrn@google.com, regis@google.com

Committed: https://github.com/dart-lang/sdk/commit/521dc6620fd2c4591aa975745c14b304428f17eb
Reverted: https://github.com/dart-lang/sdk/commit/a3c0cb65af4bbbdde756208dcccdcdf896902b5b
Review-Url: https://codereview.chromium.org/2718513002 .
2017-05-03 17:43:23 +02:00
Florian Loitsch a3c0cb65af Revert "Void is not required to be null anymore."
This reverts commit 521dc6620f.

BUG=

Review-Url: https://codereview.chromium.org/2855173002 .
2017-05-03 17:36:39 +02:00
Florian Loitsch 521dc6620f Void is not required to be null anymore.
In checked mode, `void` now accepts any value.

Fixes #28937.
Fixes #28938.

BUG= http://dartbug.com/28937
BUG= http://dartbug.com/28938
R=johnniwinther@google.com, lrn@google.com, regis@google.com

Review-Url: https://codereview.chromium.org/2718513002 .
2017-05-03 17:31:21 +02:00
Johnni Winther c3e28939b1 Fix Instantiation equivalence
Instantiations of abstract native classes need to be marked as
Instantiation.ABSTRACTLY_INSTANTIATED.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2849363003 .
2017-05-03 11:05:19 +02:00
Johnni Winther 6e508a8f57 Handle symbol literals in closed_world2_test
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2851163002 .
2017-05-03 10:41:59 +02:00
Johnni Winther 6a57511763 Register local functions with async markers
- in kernel computation of WorldImpact.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2848243002 .
2017-05-03 10:32:15 +02:00
Johnni Winther 08474aecdf Add BackendStrategy
This strategy pattern defines the element model used in type inference and codegen.
This allows for creating an element model for the backend that is different from
the frontend model.

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

Review-Url: https://codereview.chromium.org/2858513002 .
2017-05-03 10:24:42 +02:00
Johnni Winther 859bb784ed Make JavaScriptBackend.processAnnotations element-model agnostic
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2854013002 .
2017-05-03 10:14:03 +02:00
Johnni Winther e4131c2d37 Reuse RuntimeTypesNeedBuilderImpl and _RuntimeTypesNeed for kernel based elements
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2850143002 .
2017-05-03 09:54:21 +02:00
Johnni Winther 66ead732b1 Move JsInteropAnalysis.onQueueClosed to AnnotationProcessor.processJsInteropAnnotation
R=sigmund@google.com

Committed: https://github.com/dart-lang/sdk/commit/86671fdd56e1163c2e5e1baa77017f43205adb07

Reverted: https://github.com/dart-lang/sdk/commit/9a1460dc439dcac68e9c2de456e305ee82eea85d
Review-Url: https://codereview.chromium.org/2852603003 .
2017-05-03 09:33:23 +02:00
Stephen Adams 9338844b10 Fix for issue 28196 - constant interceptors for mixin applications
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2862433002 .
2017-05-02 17:53:32 -07:00
Florian Loitsch 0367d955fb Fix typing in dart2js serialization.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2852053003 .
2017-05-02 13:27:10 +02:00
Sigmund Cherem 7ece6d94a2 fix bots: do not analyze front_end when analyzing dart2js, they need to be
analyzed with incompatible options (strong vs not-strong). pkg/front_end is
anyways analyzed in the front_end tests, so I believe this is safe to exclude
here.

BUG=

Review-Url: https://codereview.chromium.org/2853183002 .
2017-05-01 19:39:50 -07:00
Sigmund Cherem de36d11817 Add support for building patched_sdk and platform.dill for dart2js:
- defines a .gn target for patched_dart2js_sdk
 - changes patch_sdk.dart to handle a dart2js target
 - adds support in fasta to understand the `native` clause still used by dart2js
 - add option to fasta to know whether it is generating kernel for the vm or dart2js

I'm not excited about how I added the target distinction in fasta, the reason I
did so is that it affects the behavior in several ways: in how we handle
`native`, in the libraries that are included by default in the platform.dill file,
and in the transformations that need to be done.  I'm happy to change the
approach.

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

Committed: https://github.com/dart-lang/sdk/commit/714523b103598d49295fa06b4ad13c6917c50399
Review-Url: https://codereview.chromium.org/2832353002 .
2017-05-01 17:23:02 -07:00
Stephen Adams 7f3b385d4c dart2js: rewrite_async: Don't call JavaScript factory constructor with 'new'
'new' does an unused allocation in this case, since the factory is a static method.

R=efortuna@google.com

Also: use literal syntax for lists.
Review-Url: https://codereview.chromium.org/2850023002 .
2017-05-01 16:51:02 -07:00
Stephen Adams 02633847ca remove unused imports
TBR=efortuna@google.com

Review-Url: https://codereview.chromium.org/2857433002 .
2017-05-01 16:43:09 -07:00
Stephen Adams 586f4a9ec9 Add HCreateBox
Remove the JS template hack. Later we can add initialized properties.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2844383007 .
2017-05-01 15:51:09 -07:00
Sigmund Cherem e9cd0b0fa5 Revert "Add support for building patched_sdk and platform.dill for dart2js:"
This reverts commit 714523b103.

TBR=ahe@google.com,vegorov@google.com

Review-Url: https://codereview.chromium.org/2849183002 .
2017-05-01 10:29:26 -07:00
Sigmund Cherem 714523b103 Add support for building patched_sdk and platform.dill for dart2js:
- defines a .gn target for patched_dart2js_sdk
 - changes patch_sdk.dart to handle a dart2js target
 - adds support in fasta to understand the `native` clause still used by dart2js
 - add option to fasta to know whether it is generating kernel for the vm or dart2js

I'm not excited about how I added the target distinction in fasta, the reason I
did so is that it affects the behavior in several ways: in how we handle
`native`, in the libraries that are included by default in the platform.dill file,
and in the transformations that need to be done.  I'm happy to change the
approach.

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

Review-Url: https://codereview.chromium.org/2832353002 .
2017-05-01 10:11:42 -07:00
Johnni Winther 9a1460dc43 Revert "Move JsInteropAnalysis.onQueueClosed to AnnotationProcessor.processJsInteropAnnotation"
This reverts commit 86671fdd56.

Review-Url: https://codereview.chromium.org/2855593002 .
2017-05-01 15:12:28 +02:00
Johnni Winther 057a3fdf4b Call resolveLibraryMetadata only when dart:mirrors are loaded
This addresses a comment from https://codereview.chromium.org/2846433003

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2850503005 .
2017-05-01 14:47:47 +02:00
Johnni Winther 86671fdd56 Move JsInteropAnalysis.onQueueClosed to AnnotationProcessor.processJsInteropAnnotation
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2852603003 .
2017-05-01 14:19:57 +02:00
Johnni Winther 8af3ebc020 Fix KernelEquivalence.entityEquivalence for equi-named instance/top-level members
+ add logging to closed_world_tester.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2847143002 .
2017-05-01 09:59:43 +02:00
Johnni Winther 82d47e6b91 Fix InterfaceType.treatAsRaw
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2852683002 .
2017-05-01 09:19:59 +02:00
Erik Corry aa6353b6da Dart SDK Spelling b, c, and d.
R=kmillikin@google.com
BUG=

Review-Url: https://codereview.chromium.org/2850783002 .
2017-05-01 08:28:10 +02:00
Stephen Adams 9ab56a9bb6 dart2js: eliminate redundant stores
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2810493002 .
2017-04-28 16:38:11 -07:00
Stephen Adams 64ab012f2a dart2js: strengthen loop condition in loop body
Just a few improvements in a huge app, e.g.

      for (; node != null;)
        if (node == null ? element == null : node === element)
          return true;
        else
          node = node.parentElement;
--->
      for (; node != null;)
        if (node === element)
          return true;
        else
          node = node.parentElement;

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2832083002 .
2017-04-28 16:19:35 -07:00
Stephen Adams 41ca7f8bf5 kernel backend impact - noSuchMethod helpers are passed a Map literal
Fixes a regression on ~150 tests.
Will be replaced with kernel_impact.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2850933002 .
2017-04-28 14:26:28 -07:00
Johnni Winther ba82b69567 Change toString on ResolutionTypeVariableType to include class/method name
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2846903002 .
2017-04-28 09:58:37 +02:00
Johnni Winther 600ecf5e72 Use more entities in program_builder, collector and registry
This a step towards decoupling the emitter from the choice of codegen element model.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2843283004 .
2017-04-28 09:53:45 +02:00
Johnni Winther 5d71db8385 Handle mixed in members
+ add equivalence testing for ElementEnvironment.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2845093003 .
2017-04-28 09:43:49 +02:00
Johnni Winther 6ee3334a03 Include setters in KClassEnv.forEachClassMember
This correctly enqueue instance setters when using the kernel based element model.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2848553002 .
2017-04-28 09:28:12 +02:00
Stephen Adams 9635a84d32 dart2js-kernel: Bind type variables in generative constructor.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2841213002 .
2017-04-27 16:06:54 -07:00
Dan Rubel dc19d42c54 change fasta.Token.isIdentifier() from method to getter
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2839403004 .
2017-04-27 17:38:54 -04:00
danrubel 10b6e6d56d create "[]" token as SymbolToken
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2849653002 .
2017-04-27 17:30:07 -04:00
Johnni Winther 9b6eb81b01 Handle @NoInline annotations in closed_world2_test
+ make closed_world_tester a bit more flexible.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2835323004 .
2017-04-27 09:30:59 +02:00
Johnni Winther a4960a1507 Run closed_world2_test using the normal compiler pipeline.
This is a step towards running the front end of the compiler from
'.dill' files.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2846433003 .
2017-04-27 08:55:38 +02:00