Commit Graph

4698 Commits

Author SHA1 Message Date
Johnni Winther c3d8f392c5 Extract WorldImpactBuilder from _ResolutionWorldImpact.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1413543004.
2015-10-19 14:31:49 +02:00
Asger Feldthaus ee0f98ab33 dart2js cps: Ensure parameter default values are emitted.
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1411763002 .
2015-10-16 17:00:32 +02:00
Asger Feldthaus 1e23ef0cbb dart2js cps: Speed up integrity checking some more.
Share the Map instance between different passes, so we don't need to
allocate and resize the hash table from scratch every time.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1397953005 .
2015-10-16 09:52:47 +02:00
Asger Feldthaus 106a36b321 dart2js cps: Do not mark result of type casts as non-null.
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1400113003 .
2015-10-16 09:35:46 +02:00
Harry Terkelsen 356a7c76ed dart2js: use AllInfoJsonCodec to write dumpinfo file
BUG=

Review URL: https://codereview.chromium.org/1413513002 .
2015-10-15 17:50:31 -07:00
Harry Terkelsen b84ac4c3b6 dart2js: use AllInfoJsonCodec to write dump info file
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1407133002 .
2015-10-15 17:25:18 -07:00
Stephen Adams 14dcffa124 dart2js cps_ir: Unary operator improvements
~ and - are reduced to BuiltinOperators.

R=asgerf@google.com

Review URL: https://codereview.chromium.org/1394003008 .
2015-10-15 12:00:15 -07:00
Asger Feldthaus fd3b1d144f dart2js cps: Speed up CPS IR integrity checker.
Building large maps and sets slowed the checker down a lot,
so it has been narrowed down to one map.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org/1409483002 .
2015-10-15 11:01:12 +02:00
Stephen Adams 52d7ad1978 dart2js cps_ir: Use JSNumber_methods where possible
We can often use the JSNumber interceptor directly without choosing
between JSNumber and JSInt.

BUG=
R=asgerf@google.com

Review URL: https://codereview.chromium.org/1395333004 .
2015-10-14 12:57:27 -07:00
Johnni Winther 5a956826a5 Move WorldImpact to universe/world_impact.dart
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1394793004.
2015-10-14 15:22:40 +02:00
Johnni Winther 0fb376928e Remove calls to registerDependency from within resolution.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1405443004.
2015-10-14 15:06:45 +02:00
Johnni Winther 47b83b3bc1 Include class members in dependencies.
BUG=

Review URL: https://codereview.chromium.org/1404763002.
2015-10-14 12:56:47 +02:00
Johnni Winther 23524a8028 Fix after bad merge.
BUG=

Review URL: https://codereview.chromium.org/1407693002.
2015-10-14 11:44:10 +02:00
Asger Feldthaus cd901e7813 dart2js cps: Change type tests to null tests when applicable.
When null is the only value that might fail a type test we can
rewrite it to just compare against null.

Update: Fixed a missing mandatory named parameter.

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

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

Reverted: https://github.com/dart-lang/sdk/commit/e97d32be50504c965b2f598f7f833b54be066fdf

Review URL: https://codereview.chromium.org/1306773005 .
2015-10-14 11:35:44 +02:00
Johnni Winther c77f1527d5 Move otherDependencies to globalDependencies.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1405563002.
2015-10-14 11:19:43 +02:00
Johnni Winther 26d6a8363e Use WorldImpact for element dependencies in deferred_load
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1394923003.
2015-10-14 11:12:19 +02:00
Harry Terkelsen 79134a74fa include entrypoint in dump_info
BUG=
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1403073002 .
2015-10-13 17:08:13 -07:00
Jacob Richman cd2752431e Support user generated custom native JS classes.
BUG=
R=jmesserly@google.com, sra@google.com

Review URL: https://codereview.chromium.org//1318043005 .
2015-10-13 13:15:28 -07:00
Harry Terkelsen b7bb39a062 dart2js: mark FunctionElements as dependencies always
We were only marking FunctionElements as dependencies if they were
closurized class members. This prevented us from adding functions that
were top level.

BUG=
R=floitsch@google.com, sigurdm@google.com

Review URL: https://codereview.chromium.org/1395183004 .
2015-10-13 10:55:05 -07:00
Sigmund Cherem ac8b2af179 Decouple SSA builder from codegen-work-item
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/1398393002 .
2015-10-13 09:32:14 -07:00
Asger Feldthaus a50105543f dart2js cps: Add a pass for eliminating bounds checks.
The analysis uses a watered-down octagon domain which reduces range
analysis to a graph problem.

There are more ideas to try out to improve on this, but I think this is
a nice baseline to work from.

BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//1353443002 .
2015-10-13 16:40:54 +02:00
Johnni Winther c1214e8f99 Avoid creating invalid TypeMask.nonNullExact
BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1402913003.
2015-10-13 15:12:40 +02:00
Asger Feldthaus 7a534459ba dart2js cps: Some fixes for yield.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org/1405503003 .
2015-10-13 14:34:01 +02:00
Asger Feldthaus d43d95aaa3 dart2js cps: Maintain parent pointers instead of recomputing them.
All passes must now preserve valid parent pointers. Several passes
already did this (or tried to do it).

The IR integrity checker can now check that parent pointers are valid.
This has caught a number of missing parent pointers assignments in
passes that otherwise tried to preserve them.

All node constructors now set parent pointers. This is very convenient
for simple transformations, but also a bit of a trap since updating a
field on an existing node does not update the parent pointer.

This is a pretty heavy-handed change. The main rationale for it are:

- The helpers methods require parent pointers, so they are more useful
  when parent pointers are always set.

- The integrity checker can catch bogus parent pointers after passes
  that have to maintain them anyway.

- The integrity checker is super slow, but this can finally be fixed
  if it can assume parent pointers are valid (not part of this CL).

The IR visitors have been changed a bit to support a generic parent
visitor that does not have to implement every visit method.

The 'parent index' fields have been removed.

BUG=
R=kmillikin@google.com

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

Review URL: https://codereview.chromium.org/1375213003 .
2015-10-13 10:50:41 +02:00
Stephen Adams 5ac49b5f29 dart2js cps_ir: BuiltinOperation improvements
Type propagation:

Added better type_propagation rules for various operators to detect more uint31/uint32/non-negative cases.
Moved the rules to per-operator code so the rules can be shared by invokes (e.g. '<') and the builtin operations they are lowered to (NumLt).
In the case of NumLt, this removes lower bounds checks from injected bounds checks (i.e. NumLt(index, 0)) for constant indexes by simple constant folding.

Bit operations:

The '>>> 0' coercion is often not needed.

If we can tell the result is in the uint31 range then the result
generated by JavaScript's bit operations will not have become
negative.

Added a tree analysis to codegen to tell if the result fits in uint31.
This works quite well and removes about as many coercions as SSA.
It misses some coercions due to lack of type information in tree_ir.

Added missing operators:

NumShr aka '>>>', valid on limited inputs.
NumDiv (Seems like a simple omission, boost some math code)
NumTruncatingDivideToSigned32

R=asgerf@google.com

Review URL: https://codereview.chromium.org/1393763004 .
2015-10-12 12:29:09 -07:00
Harry Terkelsen e067a52e44 dart2js: set effective target for patched constructors
Closes #24461

BUG=
R=johnniwinther@google.com, sra@google.com

Review URL: https://codereview.chromium.org/1382313002 .
2015-10-12 11:19:00 -07:00
Asger Feldthaus 77eb3fb60f Revert "dart2js cps: Maintain parent pointers instead of recomputing them."
This reverts commit 6cc9b43535.

BUG=

Review URL: https://codereview.chromium.org/1386343003 .
2015-10-12 16:50:37 +02:00
Asger Feldthaus 6cc9b43535 dart2js cps: Maintain parent pointers instead of recomputing them.
All passes must now preserve valid parent pointers. Several passes
already did this (or tried to do it).

The IR integrity checker can now check that parent pointers are valid.
This has caught a number of missing parent pointers assignments in
passes that otherwise tried to preserve them.

All node constructors now set parent pointers. This is very convenient
for simple transformations, but also a bit of a trap since updating a
field on an existing node does not update the parent pointer.

This is a pretty heavy-handed change. The main rationale for it are:

- The helpers methods require parent pointers, so they are more useful
  when parent pointers are always set.

- The integrity checker can catch bogus parent pointers after passes
  that have to maintain them anyway.

- The integrity checker is super slow, but this can finally be fixed
  if it can assume parent pointers are valid (not part of this CL).

The IR visitors have been changed a bit to support a generic parent
visitor that does not have to implement every visit method.

The 'parent index' fields have been removed.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1375213003 .
2015-10-12 16:26:32 +02:00
Sigurd Meldgaard a763c71d92 Introduce the "Embedded" category.
It is not visible from the dart2js command line.

BUG=
R=brianwilkerson@google.com, johnniwinther@google.com

Committed: https://github.com/dart-lang/sdk/commit/0aef0efb6a38a65fa676fa9e8daa85a972521745
Reverted: https://codereview.chromium.org/1401513002

Review URL: https://codereview.chromium.org/1395863002 .
2015-10-12 12:15:48 +02:00
Johnni Winther ab5225a353 Introduce DartType.unaliased to avoid use of Resolution in the backend.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1397053002.
2015-10-12 11:28:56 +02:00
Johnni Winther 1414d9b27e Use common.dart to re-export commonly used entities.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1394063004.
2015-10-12 09:34:02 +02:00
Johnni Winther ec41c5f141 Introduce BackendImpact to separate enqueueing from data.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1397043002.
2015-10-09 15:00:54 +02:00
Sigurd Meldgaard 01d6977030 Revert "Introduce the "Embedded" category."
This reverts commit 0aef0efb6a.

BUG=

Review URL: https://codereview.chromium.org/1401513002 .
2015-10-09 13:29:53 +02:00
Sigurd Meldgaard 0aef0efb6a Introduce the "Embedded" category.
It is not visible from the dart2js command line.

BUG=
R=brianwilkerson@google.com, johnniwinther@google.com

Review URL: https://codereview.chromium.org/1395863002 .
2015-10-09 13:08:26 +02:00
Johnni Winther da0a18de44 Split RuntimesTypes into RuntimeTypes and RuntimeTypesEncoder
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org/1394213002.
2015-10-08 13:59:16 +02:00
Stephen Adams 5265eeebaa Use interceptors for is-checks (version 2).
Use the $isXXX properties for type tests on raw (non-parameterized) types.

Use special builtin operations for the weird JSArray type hierarchy.

Still TODO:

If the only use of an interceptor is a single 'getInterceptor(value).$isXXX', and XXX is not a supertype of a native type, replace with 'value instanceof XXX'.

R=kmillikin@google.com

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

Reverted: https://github.com/dart-lang/sdk/commit/89b6d8e74960dec2fd87011538227ab515d0fc8d

Review URL: https://codereview.chromium.org/1385423002 .
2015-10-07 17:06:57 -07:00
Stephen Adams 89b6d8e749 Revert "Use interceptors for is-checks (version 2)."
Need to fix some analyzer warnings.

TBR=kmillikin@google.com

Review URL: https://codereview.chromium.org/1396663002 .
2015-10-07 16:29:11 -07:00
Stephen Adams 3b4e12f00b Use interceptors for is-checks (version 2).
Use the $isXXX properties for type tests on raw (non-parameterized) types.

Use special builtin operations for the weird JSArray type hierarchy.

Still TODO:

If the only use of an interceptor is a single 'getInterceptor(value).$isXXX', and XXX is not a supertype of a native type, replace with 'value instanceof XXX'.

R=kmillikin@google.com

Review URL: https://codereview.chromium.org/1385423002 .
2015-10-07 15:47:25 -07:00
John McCutchan 98638457ce Remove final users of dart:profiler library
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org/1394533002 .
2015-10-07 09:27:22 -07:00
Stephan Herhut 80aa2a4cc0 Do not emit type metadata for classes that are only emitted for rti.
Classes only emitted for rti are empty shells and, even if they are
marked as reflectable, are not otherwise referenced from the program. So
we should not try to emit type metatdata because it is neither needed
for is it always complete (as most of the class, including its type
variables, is missing).

Fixes #24493.

BUG= http://dartbug.com/24493
R=sigmund@google.com

Review URL: https://codereview.chromium.org/1394483002 .
2015-10-07 17:38:50 +02:00
Johnni Winther b3b7dc94ac Make computeSignature private to modelx.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1391193002.
2015-10-07 14:15:30 +02:00
Johnni Winther 5a68d6fa0e Avoid eager enqueueing from resolution
BUG=
R=sigurdm@google.com

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

Reverted: https://github.com/dart-lang/sdk/commit/a0ca16a77361baa6e51a789471236e4e87167e18

Review URL: https://codereview.chromium.org/1376863004.
2015-10-07 10:41:23 +02:00
Johnni Winther e49a3e7d44 Limit hints on empty hide on package imports.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1382143005.
2015-10-06 15:13:13 +02:00
Johnni Winther a0ca16a773 Revert "Avoid eager enqueueing from resolution"
This reverts commit dda38dfe47.

BUG=

Review URL: https://codereview.chromium.org/1385183002.
2015-10-06 14:36:23 +02:00
Johnni Winther dda38dfe47 Avoid eager enqueueing from resolution
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1376863004.
2015-10-06 13:53:15 +02:00
Johnni Winther 76b7203c19 Extract DiagnosticReporter implementation from Compiler.
BUG=
R=sigurdm@google.com

Review URL: https://codereview.chromium.org/1383483006.
2015-10-06 10:24:44 +02:00
Florian Loitsch c2aa04db8b dart2js: Don't use "void" as field.
Although legal now, some engines don't like `void` as property name.

R=sra@google.com

Review URL: https://codereview.chromium.org/1377523007 .
2015-10-05 12:50:21 +02:00
Sigmund Cherem f2d97d17c5 dart2js: rename folder (stats -> info)
R=het@google.com

Review URL: https://codereview.chromium.org/1385443003 .
2015-10-02 11:31:32 -07:00
Sigmund Cherem 16ef5ef93b dart2js: fix analyzer warning
TBR=het@google.com

Review URL: https://codereview.chromium.org/1377293003 .
2015-10-02 11:30:24 -07:00
Sigmund Cherem 93f61f383e dart2js send stats, includes:
- initial visitor to collecting data about sends (incomplete)
- logic to emit data in a json summary file.
- logic to print summary information on the command-line
- logic to display some of the data in a web UI.

BUG=
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1220043005 .
2015-10-02 11:10:41 -07:00