Commit Graph

1895 Commits

Author SHA1 Message Date
Sigmund Cherem a47c9167cd Delete CPS IR.
We can always revert this CL if we want to bring it back later on.

R=sra@google.com

Review URL: https://codereview.chromium.org/2246623002 .
2016-08-12 14:40:50 -07:00
Stephen Adams b5efb1c0c1 Don't use library tag for private name prefixes
Use only the Uri.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2245533002 .
2016-08-12 10:20:58 -07:00
Stephen Adams b7aa65528c Rerun formatter
TBR=het@google.com

Review URL: https://codereview.chromium.org/2239193002 .
2016-08-11 19:05:59 -07:00
Johnni Winther b6a6b19a1e Ensure correct current element for field initializers.
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2230853002 .
2016-08-11 13:19:36 +02:00
Stephen Adams b6f84a01d6 dart2js: Sort libraries by Uri only.
Avoid using the 'library' tag.

Remove compareTo method from CompilationUnitElement and LibraryElement.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2221273002 .
2016-08-10 17:09:27 -07:00
Sigmund Cherem e71fa2b05c Improve error reporting: use colors and associate the appropiate file with
bazel-root uris.

The latter makes it possible to show errors that highlight the original source
code.

BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2237543002 .
2016-08-10 14:41:08 -07:00
Sigmund Cherem 9968b369b9 simplify the bazel-provider to use a search path appraoch
R=het@google.com

Review URL: https://codereview.chromium.org/2228913004 .
2016-08-10 09:57:45 -07:00
Johnni Winther 5af09978e7 Fix Resolution.getResolvedAst for serialization in production mode
- and split analysis_test into 4 subtests.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2220333007 .
2016-08-10 10:30:05 +02:00
Kevin Moore 3c2fcdd3c3 pkg/compiler: clean up imports
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2223133003 .
2016-08-08 19:28:01 -07:00
Sigmund Cherem b995d06a12 dart2js: fix bot failures - I made this private without realizing it was accessed for testing
TBR=het@google.com

Review URL: https://codereview.chromium.org/2226173002 .
2016-08-08 18:19:35 -07:00
Kevin Moore f33edeafe1 pkg/compiler: remove samples
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2221243002 .
2016-08-08 17:10:44 -07:00
Sigmund Cherem eac954b3dc Introduce a bazel provider
R=het@google.com

Review URL: https://codereview.chromium.org/2204593010 .
2016-08-08 16:57:19 -07:00
Kevin Moore 406d5e0c48 pkg/compiler: fix imports
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2221893003 .
2016-08-08 14:41:50 -07:00
Stephen Adams 101a83f2f4 dart2js: Reduce overhead of --verbose measurements
ZoneSpecification and zoneValues are now per-task, rather than per measurement.
This reduces total LinkedHashMap allocations by 30%

In the large compile I am using to measure these things, there are still
~3M zones created via Zone.fork and 10M _ZoneFunction objects allocated, and the Zone.fork copies the (now cached) LinkedHashMap.
So cross-task measurements are still quite expensive.

R=ahe@google.com
BUG=

Review URL: https://codereview.chromium.org/2133913002 .
2016-08-08 14:18:21 -07:00
Sigmund Cherem be28b088d6 Split js_backend into multiple libraries.
R=sra@google.com

Review URL: https://codereview.chromium.org/2220993005 .
2016-08-08 13:33:06 -07:00
Sigmund Cherem 53d968bd02 delete send-info measurements. This experiment is not being maintained
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2214263002 .
2016-08-08 09:27:46 -07:00
Johnni Winther e6241bc12d Include constants in deferred computation.
This ensures that in-code constants are included in the deferred computation.

Currently the set of live constants is not computed in itself, so the constants
used in the computation are not the same - and they are generally larger than needed.

R=het@google.com

Review URL: https://codereview.chromium.org/2194173002 .
2016-08-08 14:39:58 +02:00
Johnni Winther b036a29cbf Add kind to ConstantValue.
In preparation for testing deferred constants.

R=het@google.com

Review URL: https://codereview.chromium.org/2199593003 .
2016-08-08 14:30:16 +02:00
Stephen Adams 36f52dd43f Avoid modifying the set returned by getInterceptorsOn()
The returned set is shared.

This program generates a broken short-circuit interceptor ($n -> $din) due to modifying the cached shared set {n} to {d,i,n}
--------
J.toInt$0$n = function(receiver) {
  return J.getInterceptor$din(receiver).toInt$0(receiver);
};
--------
import 'package:expect/expect.dart';

@NoInline()
@AssumeDynamic()
confuse(x) => x;

@NoInline()
foo(x) {
  print(x.toInt());
  bar(x);
}

@NoInline()
bar(x) {
  print(x.toInt());
  print(x.runtimeType);
}

main() {
  int i = confuse(1);
  foo(i);
  double d = confuse(2.3);
  foo(d);
}
--------

TBR=sigmund@google.com

Review URL: https://codereview.chromium.org/2215133003 .
2016-08-05 16:13:03 -07:00
Sigmund Cherem 0eee4027a6 Delete dart_backend from compiler.
R=sra@google.com

Review URL: https://codereview.chromium.org/2213673002 .
2016-08-04 15:57:04 -07:00
Sigmund Cherem 9aee504527 Remove unnecessary imports to tree.dart
R=het@google.com

Review URL: https://codereview.chromium.org/2203013003 .
2016-08-03 08:27:50 -07:00
Stephen Adams 478106bce2 dart2js inferrer: don't infer widened type when unreachable
'&' and '|' were missing the case to return 'empty' if the argument was empty, causing the widened (default) type to be propagated.

There are a few bitwise operations in the streams code that have better code from being slightly more precise.

BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1583623002 .
2016-07-27 17:25:56 -07:00
Jacob Richman 8e787a74b0 Fix case caught by test where getUnescapedJSInteropName wasn't called.
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/2187893003 .
2016-07-27 13:53:53 -07:00
Kevin Moore 17a2ddfd42 Update dependency on pkg/package_compiler
For analysis_server, analyzer, analyzer_cli, compiler packages

Progress on https://github.com/dart-lang/sdk/issues/26711

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2172683002 .
2016-07-27 08:42:05 -07:00
Stephen Adams 9d5fd9d5bd Avoid using call-through stub on calls to fields.
This usually removes the demand for the call-through stub and sometimes enables optimizations on the field load, e.g.:

    WhereIterator: {
      "^": "Iterator;_iterator,_f",
      moveNext$0: function() {
        for (var t1 = this._iterator; t1.moveNext$0();)
          if (this._f$1(t1.get$current()) === true)
            return true;
        return false;
      },
      _f$1: function(arg0) {
        return this._f.call$1(arg0);
      }
      ...
-->
    WhereIterator: {
      "^": "Iterator;_iterator,_f",
      moveNext$0: function() {
        var t1, t2;
        for (t1 = this._iterator, t2 = this._f; t1.moveNext$0();)
          if (t2.call$1(t1.get$current()) === true)
            return true;
        return false;
      },
      ...

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

Review URL: https://codereview.chromium.org/2180363002 .
2016-07-26 18:02:05 -07:00
Stephen Adams 94df5a0c24 dart2js: Avoid empty else clauses in generators.
R=sigurdm@google.com

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

Review URL: https://codereview.chromium.org/1916863002 .

Reverted: https://github.com/dart-lang/sdk/commit/803826256d0be2c3560705c084d20ed78d1fca74
2016-07-26 09:58:34 -07:00
Stephen Adams 803826256d Revert "dart2js: Avoid empty else clauses in generators."
BUG=

Review URL: https://codereview.chromium.org/2177403003 .
2016-07-25 18:53:32 -07:00
Stephen Adams a02c5798a4 dart2js: Avoid empty else clauses in generators.
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1916863002 .
2016-07-25 18:43:16 -07:00
Jacob Richman 96ca5db7e5 Add JSNative utility class with static methods methods to efficiently manipulate typed JSInterop objects in cases where the member name is not known statically. These methods would be extension methods on JSObject if Dart supported extension methods. Update package js to export these methods. Implement in Dart2JS. Implement JS$ in dart2js.
BUG=
R=alanknight@google.com, sra@google.com

Review URL: https://codereview.chromium.org/2150313003 .
2016-07-25 09:59:01 -07:00
Stephen Adams 5923966da3 Feature-detect browser for assignment to __proto__.
Assigning to __proto__ is a fast way to stitch together a number of
object literals into a prototype chain without copying all the
properties.

Unfortunately this leads to very slow execution on Firefox (and
jsshell).  So now we feature-detect Chrome (and d8) since that is the
only browser we know currently can use the 'fast' startup path without
penalizing subsequent performance.

This speeds up some jsshell benchmarks by 30%.

R=het@google.com

Review URL: https://codereview.chromium.org/2180533002 .
2016-07-23 11:42:24 -07:00
Harry Terkelsen 8b1a84c0e0 remove unused message
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2173473002 .
2016-07-21 12:46:15 -07:00
Jacob Richman bbb0c3f727 Seems like this is all that is required to support callable JS objects. dartbug.com/25321
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/2164483004 .
2016-07-20 13:16:37 -07:00
Harry Terkelsen c5728623b9 remove dependency on compiler from resolution
This is the first step of a refactoring that splits the resolution
phase from the backend. The end goal is that resolution can be run
without having to instantiate an entire compiler.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2123073003 .
2016-07-18 10:40:21 -07:00
Johnni Winther 3305201211 Serialize this-types in NativeBehavior separately.
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2150333002 .
2016-07-18 10:42:23 +02:00
Stephen Adams 7749b715d4 dart2js: get:hashCode methods to avoid Object.hashCode
R=het@google.com

Review URL: https://codereview.chromium.org/2154583002 .
2016-07-15 13:31:48 -07:00
Johnni Winther 5c5a46a6e1 Serialize data for LibraryElement.getImportsFor
R=het@google.com

Review URL: https://codereview.chromium.org/2150533002 .
2016-07-15 10:16:51 +02:00
Johnni Winther f2e435ba88 Serialize prefix members.
R=het@google.com

Review URL: https://codereview.chromium.org/2150493002 .
2016-07-15 09:55:34 +02:00
Johnni Winther 9214293d29 Test ImportElement and fix PrefixElementZ.isTopLevel
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2150473002 .
2016-07-15 09:47:29 +02:00
Johnni Winther 38dd1553e8 Support checked mode
Checked mode checks are now always stored in the WorldImpact meaning that
data doesn't have to be serialized with checked mode enabled.

R=het@google.com

Review URL: https://codereview.chromium.org/2129183002 .
2016-07-12 10:10:12 +02:00
Erik Ernst 1011686cf8 Renamed isParameter to isRegularParameter.
This rename was planned a while ago, but it seemed reasonable to take
it in a separate CL because of the number of locations affected.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2132383002 .
2016-07-12 09:31:04 +02:00
Harry Terkelsen f7878a179d fix handling of malformed typedefs
BUG=

Review URL: https://codereview.chromium.org/2136663002 .
2016-07-08 14:52:23 -07:00
Harry Terkelsen 10691da9f8 dart2js: allow trailing commas in parameter and argument lists
Fixes https://github.com/dart-lang/sdk/issues/26646

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

Review URL: https://codereview.chromium.org/2068003002 .
2016-07-08 10:03:51 -07:00
Erik Ernst 6942e0df63 Fixes bug in scoping for generic methods.
The updates to tests/language/generic_local_functions_test.dart use a
local function type argument in its return type, which had not been
tested and did not work.

After a bunch of attempts to change the order in which the resolution
is performed, it suddenly turned out that the offending statement
`visit(node.returnType)` in `ResolverVisitor.visitFunctionExpression`
might be redundant! (.. a subsequent re-resolution in
`ResolverVisitor.analyze` performs the same job, and uses the correct
scope).

So this CL simply removes that `visit..` statement, and the resulting
`dart2js` passes all tests.

Adresses issue https://github.com/dart-lang/sdk/issues/26805.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2128243002 .
2016-07-08 13:28:36 +02:00
Johnni Winther ddf8a9ddd2 Serialize WarnOnUseElement
R=het@google.com

Review URL: https://codereview.chromium.org/2125793003 .
2016-07-08 11:22:07 +02:00
Johnni Winther 1f1e00f012 Handle redirects to unresolved redirects
The solves the handling of redirecting factories that redirects to other
redirecting factories whos immediate redirection target is unresolved.

For instance

  class C {
    factory C.a() = C.b;
    factory C.b() = Unresolved;
  }

The implementation normalizes the properties 'immediateRedirectionTarget',
'redirectionDeferredPrefix', 'effectiveTarget', 'effectiveTargetType', and
'isEffectiveTargetMalformed' by always storing the information on the
implementation element.

R=het@google.com

Review URL: https://codereview.chromium.org/2125823002 .
2016-07-08 11:14:20 +02:00
Johnni Winther 41535b3b5b Serialize parameter nodes for local functions.
R=het@google.com

Review URL: https://codereview.chromium.org/2125643002 .
2016-07-08 10:57:10 +02:00
Johnni Winther 4a7b1bb57e Support enclosingClass on deserialized local elements
R=het@google.com

Review URL: https://codereview.chromium.org/2124773002 .
2016-07-08 10:47:33 +02:00
Johnni Winther 185d4d5900 Fix serialization of IndexSetIfNullStructure.
R=het@google.com

Review URL: https://codereview.chromium.org/2103833002 .
2016-07-08 10:21:11 +02:00
Johnni Winther 3fcadea405 Compute correct names for closures in operator methods.
Operators were not correctly recognized because of the use of identical
instead of == and thus closures contained untransformed operators in
their names.

R=het@google.com

Review URL: https://codereview.chromium.org/2119193002 .
2016-07-08 10:10:31 +02:00
Johnni Winther d650d0059b Support serialization of generic methods.
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2121743002 .
2016-07-08 10:03:02 +02:00