Asger Feldthaus
a1ddf50835
dart2js cps: Use a strictness flag on Branch instead of rewriting.
...
The unsugar pass no longer inserts `identical(_, true)` around every
branching condition. Insead, the Branch node has a flag isStrictCheck
denoting whether that check should be there.
The `identical(_, true)` check is now inserted by the Tree IR builder.
The identical nodes obstructed reasoning about branching conditions, in
particular in redundant joint elimination and insertion of type
refinement nodes.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1311353008 .
2015-09-01 14:41:58 +02:00
Johnni Winther
df3b310e68
Cleanup of function_set.dart
...
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1303363006 .
2015-09-01 13:59:07 +02:00
Johnni Winther
ae721be5ae
Prepare for computation of NewStructure in Resolution.
...
BUG=
R=karlklose@google.com
Committed: https://github.com/dart-lang/sdk/commit/1a8f32efc441c4f8603b0d8c83b82d326dbc5d4c
Reverted: https://github.com/dart-lang/sdk/commit/db89bc6574859b93434e98e68bcbe15f0330ab9e
Review URL: https://codereview.chromium.org//1323573002 .
2015-09-01 12:39:47 +02:00
Johnni Winther
db89bc6574
Revert "Prepare for computation of NewStructure in Resolution."
...
This reverts commit 1a8f32efc4 .
BUG=
Review URL: https://codereview.chromium.org//1308153007 .
2015-09-01 10:15:22 +02:00
Johnni Winther
1a8f32efc4
Prepare for computation of NewStructure in Resolution.
...
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1323573002 .
2015-09-01 10:11:19 +02:00
Johnni Winther
82e9622969
Extract ReceiverMask interface from TypeMask.
...
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org//1318383002 .
2015-09-01 09:39:19 +02:00
Asger Feldthaus
2650557f0b
dart2js cps minor change: Add a comment and rename a parameter.
...
This was reverted together with the change to use synthetic constants
for the dummy receiver, but the synthetic constants have some deeper
issues.
BUG=
R=sra@google.com
Review URL: https://codereview.chromium.org//1304943003 .
2015-08-31 16:04:41 +02:00
Johnni Winther
838c8d0423
Move isPrivateName and isPublicName to Name.
...
BUG=
R=sigurdm@google.com
Review URL: https://codereview.chromium.org//1313893004 .
2015-08-31 10:26:51 +02:00
Asger Feldthaus
9ac5099a46
dart2js cps: Interceptor can be null if input is null.
...
This causes nasty regression but it fixes a correctness issue.
Path-sensitive type propagation recovers some of the regression.
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1313183007 .
2015-08-28 17:16:46 +02:00
Kevin Millikin
d074fa69b7
dart2js: A bit more inlining of static invocations.
...
Allow is and is! checks, == and !=, parameter references, and literals.
BUG=
R=asgerf@google.com
Review URL: https://codereview.chromium.org//1320143002 .
2015-08-28 16:14:43 +02:00
Asger Feldthaus
ade4822108
dart2js cps: Generate interceptors at use-site and share afterwards.
...
Previously, interceptors were generated at the definition-site to ensure
sharing, and sometimes sunk to its use-site if desirable.
Now they are (again) generated at use-site, then pulled out of loops,
and replaced by dominating calls to getInterceptor.
This means interceptors are only computed if they really are needed,
but on the other hand, they are sometimes computed more than once, when
there are uses that don't have a common dominator.
Interceptor constants are currently not shared/hoisted as it is not
clear when this is beneficial.
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1313783003 .
2015-08-28 16:02:16 +02:00
Johnni Winther
c10a813f16
Move common URIs to common/names.dart
...
BUG=
R=sigurdm@google.com
Review URL: https://codereview.chromium.org//1309743006 .
2015-08-28 14:01:57 +02:00
Johnni Winther
d8e5194c3b
Add support for analyzing individual URIs.
...
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//1314973003 .
2015-08-28 13:50:40 +02:00
Kevin Millikin
1e4469c144
dart2js CPS: Do not transform unreachable branches.
...
After type propagation, avoid transforming unreachable branches by
explicitly replacing them with Unreachable. Also use the abstract boolean
value rather than the concrete constant value for branches, just as was
already done for type tests and casts.
R=asgerf@google.com
BUG=
Review URL: https://codereview.chromium.org//1309813009 .
2015-08-28 13:10:22 +02:00
Johnni Winther
876bad5b80
Add visitor methods specific to ??= to SemanticSendVisitor.
...
BUG=
R=karlklose@google.com , sigmund@google.com
Review URL: https://codereview.chromium.org//1313323002 .
2015-08-28 10:17:24 +02:00
Asger Feldthaus
7624ec59da
Revert "dart2js cps: Use dummy constant in dummy receiver optimization."
...
This reverts commit 4d20c86fd0 .
BUG=
Review URL: https://codereview.chromium.org//1314373003 .
2015-08-27 17:08:59 +02:00
Asger Feldthaus
4d20c86fd0
dart2js cps: Use dummy constant in dummy receiver optimization.
...
Also addresses some other post-commit comments from
https://codereview.chromium.org/1312393002
BUG=
R=sra@google.com
Review URL: https://codereview.chromium.org//1317903002 .
2015-08-27 11:34:00 +02:00
Asger Feldthaus
ca9c113313
dart2js cps: Let effective constant expressions propagate further.
...
Constants would typically fail to propagate into an argument of a method
call in cases where the receiver of the call might be null. Constants
can safely propagate across the unsafe method lookup.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1315333002 .
2015-08-27 11:22:49 +02:00
Asger Feldthaus
82e95e3053
dart2js cps: Use a global counter to generate hash codes.
...
This gives almost 30x compile-time speedup on ImagingGaussianBlurOnce.
Based on profiling with Observatory, it seems to be a performance bug
in how hash codes are stored on objects. The majority of time is spent
in Object_GetHash, which does not compute a hash, but looks it up in a
weak hash table in the VM.
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1311673009 .
2015-08-26 16:47:13 +02:00
Asger Feldthaus
0216e21efc
dart2js cps: Use 'this' instead of receiver-arg when possible.
...
This fixes a bug in how intercepted super calls were handled,
and enables the redundant receiver optimization.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1312393002 .
2015-08-26 16:06:41 +02:00
Kevin Millikin
e99fb4fc26
dart2js: Use the NoInline annotation on getInterceptor in the JS runtime.
...
This also requires fixing NoInline to work for the JS runtime.
Previously it was ignored.
R=karlklose@google.com
BUG=
Review URL: https://codereview.chromium.org//1315083002 .
2015-08-26 10:56:14 +02:00
Harry Terkelsen
bc0deb66d7
dart2js: fetch http Resources
...
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org//1308143002 .
2015-08-25 10:46:27 -07:00
Kevin Millikin
90039f64ae
dart2js CPS: simple inlining of static invocations.
...
Inline static functions whose bodies are a single Dart expression that
just calls a foreign (native) function. This eliminates a lot of
overhead from the code in the JavaScript runtime library.
R=asgerf@google.com
BUG=
Review URL: https://codereview.chromium.org//1318453003 .
2015-08-25 13:31:46 +02:00
Johnni Winther
6b156993db
Use Name instead of Selector in SemanticSendVisitor
...
BUG=
R=floitsch@google.com , sigmund@google.com
Review URL: https://codereview.chromium.org//1314573002 .
2015-08-25 10:03:32 +02:00
Johnni Winther
4ed23aff42
Remove SendResolver.computeSendStructure.
...
BUG=
R=floitsch@google.com
Committed: https://github.com/dart-lang/sdk/commit/4013a9aae54ee60d344247d295b750f370ce2417
Reverted: https://github.com/dart-lang/sdk/commit/73a49a5ddbf7bc989adfd07668db1d29c98f91f2
Review URL: https://codereview.chromium.org//1306143002 .
2015-08-25 09:32:26 +02:00
Johnni Winther
73a49a5ddb
Revert "Remove SendResolver.computeSendStructure."
...
This reverts commit 4013a9aae5 .
BUG=
Review URL: https://codereview.chromium.org//1311123002 .
2015-08-24 13:46:28 +02:00
Johnni Winther
4013a9aae5
Remove SendResolver.computeSendStructure.
...
BUG=
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1306143002 .
2015-08-24 11:31:23 +02:00
Karl Klose
999ec11985
dart2js cps: Handle native functions, getters, and setters.
...
R=asgerf@google.com
Review URL: https://codereview.chromium.org//1288013002 .
2015-08-24 11:01:54 +02:00
Stephen Adams
5d575f307c
dart2js cps: Generate fast checks for 'is String' and 'is bool'.
...
R=sigmund@google.com
Review URL: https://codereview.chromium.org//1301363002 .
2015-08-21 17:41:21 -07:00
Johnni Winther
4b85e5b393
Handle erroneous constant constructor call.
...
BUG=
Review URL: https://codereview.chromium.org//1309743002 .
2015-08-21 15:05:58 +02:00
Johnni Winther
087155dcde
Remove code accidentally committed.
...
BUG=
Review URL: https://codereview.chromium.org//1306113002 .
2015-08-21 14:22:01 +02:00
Johnni Winther
bda8db4785
Make InferrerVisitor implement SemanticSendVisitor directly and delete ResolvedVisitor.
...
BUG=
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1308803002 .
2015-08-21 14:11:33 +02:00
Johnni Winther
9a64a00ab9
Deprecate visitStaticSend in ResolvedVisitor.
...
BUG=
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1302313002 .
2015-08-21 14:04:48 +02:00
Stan Manilov
96a76a9bb1
Add documentation for StringToken.stringValue
...
It simply points to the documentation for Token.stringValue. Also: fix
minor typo.
R=ahe@google.com
Review URL: https://codereview.chromium.org//1283373005 .
2015-08-21 09:50:57 +02:00
Johnni Winther
9ce4da5e1a
Refactor qualified send sets.
...
Closes #23795
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1293953006 .
2015-08-21 09:34:45 +02:00
Sigmund Cherem
6e0b2418c7
[dart2js] fix inference of ??= and []??=
...
Fixes #24134
Fixes #24135
R=floitsch@google.com , johnniwinther@google.com
Review URL: https://codereview.chromium.org//1305663002 .
2015-08-20 07:32:34 -07:00
Johnni Winther
34db6ed4cb
Handle static assignment to final/const fields in SSA.
...
BUG=
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1305443004 .
2015-08-20 14:25:34 +02:00
Johnni Winther
99bc71afe6
Move common identifiers, names and selectors to a separate library.
...
BUG=
R=sigurdm@google.com
Review URL: https://codereview.chromium.org//1299413002 .
2015-08-20 13:08:10 +02:00
Johnni Winther
256092eee3
Refactor handling of unqualified static updates.
...
BUG=
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1292673005 .
2015-08-20 12:43:28 +02:00
Johnni Winther
b731e6230b
Refactor updates of locals.
...
BUG=
R=floitsch@google.com
Review URL: https://codereview.chromium.org//1303503002 .
2015-08-20 12:32:09 +02:00
Kevin Millikin
aa9e569ecf
dart2js: Use 'new Array' instead of 'Array' in the JS output.
...
Though the spec says that they are equivalent when called, they are not
optimized equivalently by V8. This might be considered a performance bug in
V8 (https://code.google.com/p/v8/issues/detail?id=4380 ) but we should use
the much faster one unless that issue is fixed.
BUG=
R=asgerf@google.com , floitsch@google.com
Review URL: https://codereview.chromium.org//1291323004 .
2015-08-20 11:03:40 +02:00
Kevin Millikin
1ed82e83c8
dart2js: Just because it's slow doesn't mean it has to be dumb.
...
Change LinkEntry.slowLength to be iterative instead of recursive. The
Guassian blur benchmark, ported from the Kraken JS benchmark suite, has a
427,200 element list literal. Computing the length of a linked list of
427,200 entries will be a stack overflow.
R=asgerf@google.com
BUG=
Review URL: https://codereview.chromium.org//1299393002 .
2015-08-20 11:01:51 +02:00
Stephen Adams
24588d9fec
Recognize corelib.identical.
...
Convert to BuiltinOperator.Identical to enable type based
simplifications. Remaining unsimplified BuiltinOperator.Identical
applications are still codegen-ed as calls to corelib.identical.
About half of the calls to identical() in swarm are improved.
R=asgerf@google.com
Review URL: https://codereview.chromium.org//1294283005 .
2015-08-19 16:31:50 -07:00
Harry Terkelsen
98e67aa065
dart2js: fail gracefully with invalid package config
...
Fixes #24118
Fixes #24120
Fixes #24121
Fixes #24122
BUG=
R=sigmund@google.com
Review URL: https://codereview.chromium.org//1291283006 .
2015-08-19 16:00:37 -07:00
Sigmund Cherem
27b55b60bb
Revert use of ?? to unbreak the build
...
TBR=sra@google.com
Review URL: https://codereview.chromium.org//1293533006 .
2015-08-19 14:16:16 -07:00
Sigmund Cherem
aae02054d2
Record information about constants in dump info
...
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org//1301903002 .
2015-08-19 13:52:49 -07:00
Stephen Adams
bd4b9690a2
cps: Use BuiltinOperator.IsNumber for 'is num'
...
Use double quotes for JavaScript string in expansion of 'is num' for consistency with other strings.
R=asgerf@google.com
Review URL: https://codereview.chromium.org//1294423002 .
2015-08-19 08:21:35 -07:00
Asger Feldthaus
73a6229d7c
dart2js cps: Replace interceptor calls with interceptor constants.
...
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1298373002 .
2015-08-19 13:16:28 +02:00
Asger Feldthaus
6c6ac77475
dart2js cps: Do not treat final field reads as effectively constant.
...
This is a workaround until assignment propagation is able to propagate
constants more effectively.
BUG=
R=kmillikin@google.com
Review URL: https://codereview.chromium.org//1296403004 .
2015-08-19 10:53:14 +02:00
Sigmund Cherem
8896ccd385
dart2js: switch to use dart2js_info/info.dart
...
R=het@google.com
Review URL: https://codereview.chromium.org//1298553002 .
2015-08-18 15:44:38 -07:00