Commit Graph

4698 Commits

Author SHA1 Message Date
Johnni Winther dc4758d6bc Move resolve* from NativeResolutionEnqueuer to NativeDataResolver
This is a step towards making NativeResolutionEnqueuer model independent.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2778803002 .
2017-03-28 11:08:47 +02:00
Johnni Winther 5aa715b7a8 Use Entity in native_data.
NativeBasicDataImpl and NativeDataImpl are now reusable for J/K-elements.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2775283002 .
2017-03-28 11:02:49 +02:00
Johnni Winther 40072e2cce Mostly use Entity in InterceptorData
This is a step towards making InterceptorDataImpl reusable for J/K-elements.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2781483002 .
2017-03-28 10:53:06 +02:00
Johnni Winther e7a72961c8 Make codegen and optimizations depend more directly on data objects.
This is a move towards passing all information through data objects
computed by previous phases rather than pulling it directly from
Backend or Compiler.

This is needed to support a shift from model K to model J between
resolution and codegen.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2777163002 .
2017-03-28 10:38:29 +02:00
Johnni Winther a2286d6eb1 Derive CommonElements directly from ElementEnvironment.
This prepares for a merge of CommonElements(Impl) and BackendHelpers.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2775223002 .
2017-03-28 10:32:23 +02:00
Peter von der Ahé 02573b3caa Remove Fasta's copy of accessors.dart.
R=asgerf@google.com, jensj@google.com

Review-Url: https://codereview.chromium.org/2777883002 .
2017-03-27 14:04:43 +02:00
Johnni Winther a9811024cf Split NativeBasicDataImpl
- into NativeBasicDataBuilderImpl and NativeBasicDataImpl

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2756103003 .
2017-03-27 11:58:57 +02:00
Johnni Winther 65b06efb58 Split MirrorsAnalysis
- into MirrorsResolutionAnalysis(Impl), MirrorsCodegenAnalysis(Impl)

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2748383003 .
2017-03-27 11:33:25 +02:00
Emily Fortuna 184c2a5778 Lazily initialize library elements.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2771303002 .
2017-03-24 13:43:55 -07:00
Emily Fortuna 4156ca6a2b Eliminate multi-callback structure for LibraryLoader.
BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2760923004 .
2017-03-24 12:20:46 -07:00
Peter von der Ahé ee591a87d2 Fix warnings in dart2js and analyzer caused by Fasta.
Review-Url: https://codereview.chromium.org/2766323005 .
2017-03-23 15:39:03 +01:00
Sigmund Cherem 585829f755 Fix #29130: only consider classes allocated with generative constructors as potential closures
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2767103003 .
2017-03-22 16:03:43 -07:00
Stephen Adams d6e324f056 Rerun GVN if load elimination creates GVN candidates.
This does not fire often but is occasionally useful. e.g

      t3 = t2._collection$_length;
      if (t3 === 0)
        timer = null;
      else {
        if (t3 === 0)
          H.throwExpression(new P.StateError("No such element"));
        timer = t2._collection$_first;
      }

-->

      if (t2._collection$_length === 0)
        timer = null;
      else
        timer = t2._collection$_first;

After load-elimination creates t3 = t2._collections$_length, t3 == 0 becomes a GVN candidate. Then the inner "x" in "if (x) ... else { if (x) ... }" is replaced by "false".
The original code was something like "timer = t2.isEmpty ? null : t2.first".

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2441463003 .
2017-03-22 12:17:18 -07:00
Peter von der Ahé 002d5c7150 Update messages.yaml with asynchronous messages.
R=karlklose@google.com

Review-Url: https://codereview.chromium.org/2754793004 .
2017-03-22 12:27:38 +01:00
Peter von der Ahé 819b226598 Add begin events for const and new expressions.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2767543003 .
2017-03-22 12:06:23 +01:00
Peter von der Ahé cf5d9e4c39 Missing import.
Review-Url: https://codereview.chromium.org/2765183002 .
2017-03-22 10:01:57 +01:00
Peter von der Ahé 983a47293c Fix IdentifierContext for primary expressions. Also pass IdentifierContext to handleThisExpression and handleSuperExpression.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2768523002 .
2017-03-22 09:39:29 +01:00
Jacob Richman a5e9674010 Fix compiler formatter errors.
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2767723003 .
2017-03-21 20:47:49 -07:00
Stephen Adams ff26d99868 Type tracing bug fix for issue 28919.
Storing a traced value into a non-traced list should escape the traced value.

Also: changes to graph dumper to include all call nodes.

BUG= https://github.com/dart-lang/sdk/issues/28919
R=efortuna@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2762493002 .
2017-03-21 10:55:34 -07:00
Jens Johansen a1a34a1c84 [kernel] Debugging of switch statement
BUG=
R=ahe@google.com, kmillikin@google.com

Review-Url: https://codereview.chromium.org/2750013002 .
2017-03-21 11:36:48 +01:00
Jens Johansen 4d208e2ffb [fasta] Add and correct even more offsets
E.g. kernel debugging of async functions should now work.

BUG=
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2746013003 .
2017-03-21 10:57:30 +01:00
Peter von der Ahé 02b5710a1d Add return value.
Review-Url: https://codereview.chromium.org/2753153003 .
2017-03-17 19:59:01 +01:00
Peter von der Ahé 8979b040ec Improve parsing of async and generator methods.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2759663002 .
2017-03-17 18:03:42 +01:00
Peter von der Ahé 323d5b0b7f Track async state in parser.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2759623003 .
2017-03-17 14:43:07 +01:00
Peter von der Ahé 5934a2c443 Change comments that are interpreted by analyzer.
R=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/2753253003 .
2017-03-17 12:29:26 +01:00
Johnni Winther d29c4e2256 Compute ids for IR nodes and check equivalence with the AST.
This creates a basis for checking type inference based on kernel IR against
the unittests for the original AST based implementation.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2750353003 .
2017-03-17 09:50:01 +01:00
Emily Fortuna 0fa285f880 Pulling the element model out of global type inference.
BUG=
R=johnniwinther@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2746293006 .
2017-03-16 18:03:46 -07:00
Peter von der Ahé c3330b1407 Complain about built-in identifiers.
R=johnniwinther@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2750863002 .
2017-03-16 11:01:27 +01:00
Johnni Winther 4321db0c8b Split MirrorsData
- into MirrorsDataBuilder and MirrorsData both implemented by MirrorsDataImpl

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2743243003 .
2017-03-16 10:12:21 +01:00
Jacob Richman 33717e010a Run dartfmt on dart2js codebase.
BUG=
R=sra@google.com

Review-Url: https://codereview.chromium.org/2746333008 .
2017-03-15 20:38:18 -07:00
Stephen Adams e933720d88 dart2js: replace calls to codeUnitAt when index has favourable type
If the index is known to be a non-negative integer, only a simple
bounds check is required, so call a simpler version of codeUnitAt.

In a large app, about 60% of calls meet this condition.

Benchmarks do not show speedups, but that is because they are too
simple so global type inference can usually tell that the index is not
null, and often that it is always a non-negative integer, so the full version of codeUnitAt is optimized to look like the simple version. This does not happen in large apps.

BUG=
R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2746033006 .
2017-03-15 19:16:23 -07:00
Stephen Adams 4a8ed3c260 Lower shift-left when count is masked into valid range.
This pattern, e.g. (1 << (a & 15)), occurs in Uri parsing.

R=efortuna@google.com

Review-Url: https://codereview.chromium.org/2756543003 .
2017-03-15 18:52:28 -07:00
Paul Berry ef79634132 Re-land "Add support for metadata on type variables to Fasta parser." (with fixes).
Last time I landed this I left a crucial `pop()` out of BodyBuilder,
resulting in test failures.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2750503012 .
2017-03-15 12:42:23 -07:00
Konstantin Shcheglov ae85bcf954 Parse for-loop statements with Fasta.
R=ahe@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/2746333005 .
2017-03-15 11:40:32 -07:00
Stephen Adams 6c76f592a6 Move TreeElementMixin to avoid out-of-library private overrides
This is one of two solutions for Issue 28809
https://codereview.chromium.org/2722923002
https://codereview.chromium.org/2722043002

We should pick one.

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

Review-Url: https://codereview.chromium.org/2722923002 .
2017-03-15 09:56:28 -07:00
Johnni Winther cb8b56523c Pending renames and cleanups after commits
Review-Url: https://codereview.chromium.org/2751983002 .
2017-03-15 15:33:42 +01:00
Peter von der Ahé 99fa028982 Handle 'part of' declarations with URI correctly in Fasta.
R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2747173002 .
2017-03-15 15:11:36 +01:00
Johnni Winther 4414836936 Register type constants through ConstantUse
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2750503003 .
2017-03-15 14:52:09 +01:00
Johnni Winther 0924b17267 Create LookupMapAnalysis late.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2745133002 .
2017-03-15 14:46:02 +01:00
Johnni Winther 5ec55890fa Add ConstantUse to WorldImpact
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2742283002 .
2017-03-15 14:34:40 +01:00
Johnni Winther db7262d4ae Extract CodegenImpactTransformer from ImpactTransformer
+ remove backend use from JavaScriptImpactTransformer
+ almost remove use of backend in CodegenImpactTransformer

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2728393005 .
2017-03-15 14:11:16 +01:00
Johnni Winther 69130277ef Split NativeDataImpl
- into NativeClassDataImpl and NativeDataImpl

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2738513007 .
2017-03-15 13:54:40 +01:00
Johnni Winther 4b9297caad Create ResolutionEnqueuer after library loading.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2735763002 .
2017-03-15 13:46:48 +01:00
Johnni Winther b08686ba67 Prepare for late creation of ResolutionEnqueuer
- late as in 'after library loading'

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2729383002 .
2017-03-15 13:33:19 +01:00
Johnni Winther 8e1e08ce4a Add ClassEntity.library, MemberEntity.library and FunctionEntity.isExternal
- and mostly use entities in native_data.dart

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2731173002 .
2017-03-15 13:18:31 +01:00
Johnni Winther fbbf1e90ec Split js interop registration into library/class/member elements
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2731163002 .
2017-03-15 12:58:55 +01:00
Johnni Winther 69b47ea010 Add NativeDataResolver
- to further align the NativeData computation towards separating builders from data.

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2732793002 .
2017-03-15 11:54:48 +01:00
Johnni Winther f7ec06f210 Add NativeClassData/NativeClassDataBuilder
- for information computed during loading (pre-resolution)

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2727253007 .
2017-03-15 11:24:13 +01:00
Johnni Winther 28f7099f17 Remove backend reference from ResolutionEnqueuerListener.
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2729943004 .
2017-03-15 11:17:26 +01:00
Johnni Winther 452c380db1 Late creation of CodegenEnqueuerListener and CodegenWorldBuilder
- now with no reference to JavaScriptBackend!

R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2727373003 .
2017-03-15 11:08:43 +01:00