Commit Graph

2058 Commits

Author SHA1 Message Date
Johnni Winther b0ecbef3cc Introduce isAbstractlyInstantiated to avoid exact masks of abstract classes.
Classes can be instantiated directly, abstractly or indirectly:

When [cls] is directly instantiated: This means that at runtime instances of exactly [cls] are assumed to exist.

When [cls] is abstractly instantiated: This means that at runtime instances of [cls] or unknown subclasses of [cls] are assumed to exist.

This is used to mark native and/or reflectable classes as instantiated. For native classes we do not know the exact class that instantiates [cls] so [cls] here represents the root of the subclasses. For reflectable classes we need event abstract classes to be 'live' even though they cannot themselves be instantiated.

When [cls] is indirectly instantiated: This means that a subclass of [cls] is directly or abstractly instantiated.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2443953002 .
2016-10-28 08:45:57 +02:00
Stephen Adams 7eaad70e2f Improve condition strengthening for last test in short-circuit.
This strengthens

   t1 = s == null || t == null;
   if (t1) return;
   known-here:  t != null

There are not many hits since the 'interesting' tests are usually
earlier in the short-circuit expression.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2438543004 .
2016-10-25 04:48:35 -07:00
Sigmund Cherem 02a14cd937 Add kernel generation to the compiler/perf script
R=het@google.com

Review URL: https://codereview.chromium.org/2436333002 .
2016-10-21 10:02:13 -07:00
Sigmund Cherem 3c44a09882 make kerneltask an actual task
R=het@google.com

Review URL: https://codereview.chromium.org/2442503004 .
2016-10-20 16:27:33 -07:00
Sigmund Cherem 61bf1c2dc0 Re-add null check for closure-data (Originally removed in 177dee8f16)
Review URL: https://codereview.chromium.org/2438823002 .
2016-10-20 14:21:00 -07:00
Florian Loitsch 6beb1fdd11 Change Set.difference API to accept Set<Object>.
Fixes #27573
BUG= http://dartbug.com/27573
R=lrn@google.com

Review URL: https://codereview.chromium.org/2413233002 .
2016-10-20 14:37:15 +02:00
Stephen Adams 50e557d176 Prevent inlining of js_library core.RegExp constructor
Inlining was achieving no beneficial effect.

- Enabled GVN of match start.
- Made string quote style uniform.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2437863002 .
2016-10-19 16:25:11 -07:00
Stephen Adams 3b5c154138 Don't gvn HForeignCode without source text
There are a few synthetic templates that are generated from trees instead of source text. I don't think any are marked for GVN, but this is a hazard so best fix it.

TBR=sigmund@google.com

BUG=

Review URL: https://codereview.chromium.org/2431103003 .
2016-10-19 14:46:54 -07:00
Stephen Adams 5a646b7827 Property extraction getters (tear-offs) are effect-free
This mostly allows better scheduling of the surrounding instructions.

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2430683003 .
2016-10-18 20:13:26 -07:00
Johnni Winther b262be749e Optimize needNoSuchMethodHandling computation
This greatly improves the number of lookups needed to establish the relation.
For the two most prolific tests we have:

html/element_test: 44939 -> 6557
html/mirrors_js_typed_interop_test (mirrors+jsinterop!): 1638455 -> 171326

R=sigmund@google.com

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

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

Reverted: https://github.com/dart-lang/sdk/commit/5397c5427e9102a8ea7602174be2664d4c15bb8b
2016-10-18 16:06:03 +02:00
Johnni Winther 37afcd5197 Change TypeInference to handle super calls as direct invocations.
This also makes calls of known target registered as static uses and thus
removes the need for misusing type masks to select super methods.

Closes #25716

R=sigmund@google.com

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

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

Reverted: https://github.com/dart-lang/sdk/commit/5397c5427e9102a8ea7602174be2664d4c15bb8b
2016-10-18 14:02:55 +02:00
Erik Ernst b5d2b38aa3 Relaxes treatment of method type parameter in as expressions.
This CL changes the semantics of `dart2js --generic-method-syntax`
generated code for `e as T` where `T` is a method type parameter.

The old behavior was to raise a `TypeError` at runtime when such an
expression was evaluated. The new behavior is to consider `T` as an
alias for `dynamic`, i.e., `e as T` will then always succeed.

Addresses part of issue 27460, omits a part that is not yet agreed upon.

R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2388843002 .
2016-10-18 11:11:44 +02:00
Johnni Winther 5397c5427e Revert "Change TypeInference to handle super calls as direct invocations." and "Optimize needNoSuchMethodHandling computation"
This reverts commit 70159b7418.
This reverts commit a8b2bfb5eb.

Review URL: https://codereview.chromium.org/2425933002 .
2016-10-18 11:00:42 +02:00
Johnni Winther a8b2bfb5eb Optimize needNoSuchMethodHandling computation
This greatly improves the number of lookups needed to establish the relation.
For the two most prolific tests we have:

html/element_test: 44939 -> 6557
html/mirrors_js_typed_interop_test (mirrors+jsinterop!): 1638455 -> 171326

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2428543002 .
2016-10-18 10:52:12 +02:00
Johnni Winther 70159b7418 Change TypeInference to handle super calls as direct invocations.
This also makes calls of known target registered as static uses and thus
removes the need for misusing type masks to select super methods.

Closes #25716

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2423953002 .
2016-10-18 09:46:28 +02:00
Johnni Winther 74b74a13f7 Decouple TypeMask from ClassElement
- by typing FlatTypeMask.base with Entity
- moving needsNoSuchMethodHandling to ClosedWorld
- and testing needsNoSuchMethodHandling

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2420073002 .
2016-10-17 09:47:20 +02:00
Stephen Adams 790b9d9cb1 Enable GVN on HForeignNew
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2422003002 .
2016-10-14 17:34:07 -07:00
Sigmund Cherem 997581ccec Fix custom elements in startup emitter
R=sra@google.com

Review URL: https://codereview.chromium.org/2424553002 .
2016-10-14 16:58:47 -07:00
Sigmund Cherem ee42a0a0aa Add js-interop support to the fast-startup emitter
BUG=
R=jacobr@google.com

Review URL: https://codereview.chromium.org/2420173002 .
2016-10-14 14:22:11 -07:00
Lasse R.H. Nielsen efb9a12811 Add = as default-value separator for named parameters.
Fixes issue #27559.

BUG= http://dartbug.com/27559
R=asiva@google.com, eernst@google.com, floitsch@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/2411633002 .
2016-10-14 11:25:25 +02:00
Stephen Adams 476ffbda5e Revert "Build CFG for various JS() foreign methods"
TBR=het@google.com
BUG=

Review URL: https://codereview.chromium.org/2411793007 .
2016-10-13 19:02:41 -07:00
Stephen Adams a897bc3832 Build CFG for various JS() foreign methods
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2404123002 .
2016-10-13 17:11:35 -07:00
Sigmund Cherem 1324220ede Create entrypoint to measure performance of the dart2js frontend
BUG=
R=het@google.com

Review URL: https://codereview.chromium.org/2385893002 .
2016-10-10 14:47:29 -07:00
Sigmund Cherem b39b0d1811 Fixes in dart2js parser to be able to parse files without the diet-parser
R=ahe@google.com

Review URL: https://codereview.chromium.org/2385643003 .
2016-10-10 12:21:56 -07:00
Johnni Winther 9f5a4b231e Handle type of constructor invoke in deferred_load
Review URL: https://codereview.chromium.org/2404813002 .
2016-10-10 12:01:55 +02:00
Johnni Winther 090f20fc5d Handle constructor declarations.
+ default values
+ if-null and set-if-null

R=het@google.com

Review URL: https://codereview.chromium.org/2396173003 .
2016-10-10 11:35:54 +02:00
Johnni Winther 9c1ad56116 Handle const constructor invocation in kernel_impact.
This includes a move toward registering the type together with constructors which is need for this CL and (later) for not registering classes with factories as instantiated.

R=het@google.com

Review URL: https://codereview.chromium.org/2392943003 .
2016-10-10 11:03:11 +02:00
Stephen Adams e60fee914a Bug fix - use type of input, not type of result, for throw-on-null check
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2396323004 .
2016-10-09 00:31:56 -07:00
Stephen Adams 808c35cbee String.codeUnitAt has no side-effects
BUG=

Review URL: https://codereview.chromium.org/2401573004 .
2016-10-08 12:39:47 -07:00
Stephen Adams c91cbe1fc5 dart2js: Constant fold num.round()
Also num.round() is pure

R=sigmund@google.com

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

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

Reverted:  https://github.com/dart-lang/sdk/commit/2eadef53b722dede80153450900bf86497d13b8a
2016-10-07 18:22:52 -07:00
Stephen Adams 2eadef53b7 Revert "dart2js: Constant fold num.round()"
This reverts commit 3d28d08413.

It appears that Safari does not round the same as other browsers.

TBR=sigmund@google.com

Review URL: https://codereview.chromium.org/2395243008 .
2016-10-07 16:59:46 -07:00
Stephen Adams 0eae263076 Optimize out checkInt, checkNum and checkString
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2392343004 .
2016-10-07 15:18:07 -07:00
Stephen Adams 3d28d08413 dart2js: Constant fold num.round()
Also num.round() is pure

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2400853003 .
2016-10-07 13:39:20 -07:00
Johnni Winther 177dee8f16 Fix access to ClosureToClassMap
- avoid abstract members
- pull ClosureClassElement info from its methodElement

Review URL: https://codereview.chromium.org/2400153002 .
2016-10-07 12:01:01 +02:00
Johnni Winther dd2f0a9bd0 Eagerly compute closure classes
- and use elements instead of nodes as key

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2387353002 .
2016-10-07 10:53:34 +02:00
Harry Terkelsen 8d746645e3 Include ClosureInfo in dump info.
Uses the 0.5.0 version of dart2js_info

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2398133002 .
2016-10-06 13:48:52 -07:00
Stephen Adams 646af36e93 Improvement to SsaLoadElimination
nonEscapingReceivers was always empty at the top of a loop, making
scalar replacement candidates susceptible to spurious may-alias
invalidations.

R=het@google.com

Review URL: https://codereview.chromium.org/2395623002 .
2016-10-05 10:03:24 -07:00
Johnni Winther 2595d34940 Handle invalid default cases.
Review URL: https://codereview.chromium.org/2392303002 .
2016-10-05 12:11:08 +02:00
Johnni Winther 1b2e857f19 Roll kernel to latest
+ fix default constructor encoding
+ match fall-through error handling
+ handle typedef tests
+ speed up visitor_test by reusing the Compiler object

R=het@google.com

Review URL: https://codereview.chromium.org/2392863002 .
2016-10-05 10:36:37 +02:00
Harry Terkelsen 90b54ed78b roll dart2js_info to 0.3.0
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2379573010 .
2016-09-30 16:02:55 -07:00
Johnni Winther c3421b5586 Rename Universe to WorldBuilder.
R=sigmund@google.com

Review URL: https://codereview.chromium.org/2381793003 .
2016-09-30 10:34:07 +02:00
Johnni Winther ead7f7030a Remove Enqueuer argument from Backend.registerStaticUse
- and from CustomElementsAnalysis, TypeVariableHandler, and LookupMapAnalysis methods

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2378063002 .
2016-09-30 10:26:03 +02:00
Johnni Winther 3fb04e3495 Handle getters/setters and try in kernel_impact.
R=het@google.com

Review URL: https://codereview.chromium.org/2375613003 .
2016-09-30 10:03:01 +02:00
Johnni Winther ee42a0524a Handle constructor invocation, is, as, throw, for-in and (a)sync(*) in kernel_impact
R=het@google.com

Review URL: https://codereview.chromium.org/2377623002 .
2016-09-30 09:58:11 +02:00
Johnni Winther 93d7c65cc9 Handle fields with initializers in kernel_impact
- and use Feature.TYPE_VARIABLE_BOUNDS_CHECK only for new-expressions.

R=het@google.com

Review URL: https://codereview.chromium.org/2366263004 .
2016-09-30 09:50:53 +02:00
Harry Terkelsen 81e13861fb kernel->ssa: implement assert statements
R=johnniwinther@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org/2380573004 .
2016-09-29 14:17:13 -07:00
Harry Terkelsen a56cf2cac4 Some kernel->ssa cleanups.
* add --disable-inlining flag to top-level command for testing
* merge pushCheckNull into GraphBuilder now that compiler is in there
* fix typo

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2378113004 .
2016-09-28 12:39:59 -07:00
Harry Terkelsen 71613d72a8 kernel->ssa: implement for-in loops
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2377813002 .
2016-09-28 10:20:26 -07:00
Johnni Winther 06d7fb2fc5 Replace ClosedWorld.backend with ClosedWorld.backendClasses
R=het@google.com

Review URL: https://codereview.chromium.org/2370833002 .
2016-09-27 10:33:51 +02:00
Johnni Winther a1cd695612 Move remaining functionality from ClassWorld to ClosedWorld
... and rename ClassWorld to World.

R=het@google.com

Review URL: https://codereview.chromium.org/2366363002 .
2016-09-27 10:23:03 +02:00