Commit Graph

4698 Commits

Author SHA1 Message Date
Asger Feldthaus f1bbc3bb2d dart2js cps: 'is' checks on types with type arguments.
R=karlklose@google.com

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

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

Review URL: https://codereview.chromium.org//1161683002
2015-05-27 14:14:07 +02:00
Asger Feldthaus f0c4e31174 Revert "dart2js cps: 'is' checks on types with type arguments."
This reverts commit 00c33fb134.

TBR=karlklose@google.com

BUG=

Review URL: https://codereview.chromium.org//1161793002
2015-05-27 13:54:07 +02:00
Asger Feldthaus 00c33fb134 dart2js cps: 'is' checks on types with type arguments.
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1161683002
2015-05-27 13:45:39 +02:00
Johnni Winther 9e68c2575b Update invariant for unresolved (static) get.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1154353003
2015-05-27 10:31:15 +02:00
Stephan Herhut 0b605a4762 dart2js: Minor cleanup in inlining heuristics.
BUG=
R=sra@google.com

Review URL: https://codereview.chromium.org//1159813002
2015-05-27 10:20:44 +02:00
Karl Klose c0a14a9af2 Fix a bug when narrowing the result type of a field get.
This fixes an assertion failure that occured after the optimizations in 0ef007d00b, when we tried to rewrite a field get for a .length expression, where we already had a more specific type and used that in a truncating divide.

R=floitsch@google.com

Review URL: https://codereview.chromium.org//1148093005
2015-05-27 08:32:44 +02:00
Sigmund Cherem 6dc23373cd add deprecation message for output=dart
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1143183003
2015-05-26 15:14:23 -07:00
Asger Feldthaus f42a0ef25c dart2js cps: Always use interceptors and type tags for 'is' checks.
"x is Foo" will become getInterceptor(x).$isFoo

Testing against a type with type arguments is still a giveup().

This test always works, but is not very fast. For instance, testing
against an int should be "typeof x === 'number' && Math.floor(x) === x".

Following an offline discussion with Karl, the plan is to rewrite
'is'-checks to more fine-grained tests in a CPS optimization pass,
probably the type propagator.

Concretely, we plan to introduce IR nodes like TypeOfTest, FloorTest,
InstanceofTest, etc, which optimization phases can introduce under the
right circumstances. That way, the code generation phase remains simple.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1144163004
2015-05-26 17:50:48 +02:00
Johnni Winther f14fa24a63 Fix invariant in ResolvedVisitor.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1154853004
2015-05-26 15:51:33 +02:00
Johnni Winther a50be4b0c1 Split resolution/members.dart into several parts.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1152963003
2015-05-26 11:45:31 +02:00
Johnni Winther 6399fdc786 Copy files for split of resolution/members.dart
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1156123003
2015-05-26 11:20:39 +02:00
Johnni Winther 45ec43770d Create SendStructure for unary and binary in resolution.
BUG=http://dartbug.com/21137
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1152903003
2015-05-26 11:11:46 +02:00
Karl Klose bef1049767 Refactor StatementRewriter: Extract method for rewriting a list left-to-right.
R=asgerf@google.com

Review URL: https://codereview.chromium.org//1142383005
2015-05-26 08:59:19 +02:00
Johnni Winther 083dce756b Allow return; in async method.
BUG=http://dartbug.com/23200
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1158453002
2015-05-25 13:07:20 +02:00
Sigmund Cherem e095996b0e Fix inference bug of conditional sends
TBR= sra@google.com

Review URL: https://codereview.chromium.org//1157773002
2015-05-22 16:46:24 -07:00
Sigmund Cherem d105d1b63b Some minor fixes caught by the bots, suppress a test that needs more investigation
TBR= sra@google.com

Review URL: https://codereview.chromium.org//1153953002
2015-05-22 16:26:48 -07:00
Sigmund Cherem a8db3278e2 Implementation of null-aware operators.
This CL adds the implementation of all null-aware operators to dart2js. In
particular:

* a?.b: represented as 'isConditional' in the Send ast, and dispatched
  separately by the semantic visitor using visitIfNotNull* methods.

* a ?? b: represented as an operator, and dispatched separately by the semantic
  visitor using the `visitIfNull` method.

* a ??= b: represented as a compound operator.

All except 2 tests are passing with the SSA backend (those 2 tests fail for
unrelated reasons). I've marked the CPS ir tests as failing for now.

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

Review URL: https://codereview.chromium.org//1151163004
2015-05-22 15:44:41 -07:00
Kevin Moore 51a8f0751d Fix 56 hints in pkg/compiler
From 258 to 202

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

Review URL: https://codereview.chromium.org//1155633002
2015-05-22 08:45:12 -07:00
Johnni Winther 4013583d3f Test (and fix some) invalid assignments.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1154743004
2015-05-22 15:00:07 +02:00
Johnni Winther 562eefcb55 Start to compute SendStructure in resolution.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1149973004
2015-05-22 14:25:28 +02:00
Stephan Herhut 08e221174d dart2js: First build all ASTs of deferred code then print them.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1142363006
2015-05-22 09:57:44 +02:00
Johnni Winther dee663e582 Fix TraversalSendMixin.visitDynamicPropertySet.
BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//1143373005
2015-05-22 09:40:30 +02:00
Johnni Winther 46ad1c4e9a Remove return in visitInitializers.
BUG=
R=ajohnsen@google.com

Review URL: https://codereview.chromium.org//1154773002
2015-05-22 09:11:36 +02:00
Sigmund Cherem 23e113227c Fix bug when using super and prefixes as a parenthesis expression
BUG= https://code.google.com/p/dart/issues/detail?id=23486
R=johnniwinther@google.com

Review URL: https://codereview.chromium.org//1142873006
2015-05-21 09:35:50 -07:00
Stephan Herhut 3896a6c834 dart2js: Fix emitting in csp mode.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1151813002
2015-05-21 13:57:25 +02:00
Johnni Winther 393272d0df Rename remaining runtime-error methods from errorX to visitX.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1146973002
2015-05-21 09:04:41 +02:00
Stephan Herhut 0d24a53a56 dart2js: Properly construct rti ast templates.
BUG=
R=floitsch@google.com
TBR=floitsch@google.com

Review URL: https://codereview.chromium.org//1146003004
2015-05-20 15:48:49 +02:00
Karl Klose 64edc7a318 Fix type propagation for is-tests.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1144113003
2015-05-20 14:44:05 +02:00
Asger Feldthaus 40fd8a0bcf dart2js cps: Fix default values for forwarding constructors.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1150523003
2015-05-20 14:31:31 +02:00
Asger Feldthaus 341b346f0e dart2js cps: Fix in how type variables are accessed.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1151443002
2015-05-20 14:12:02 +02:00
Johnni Winther 3b599de618 Change Link to List in FunctionSignature.
BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1146943002
2015-05-20 14:08:29 +02:00
Johnni Winther 8b715cc94b Refactor handling of compounds.
BUG=
R=asgerf@google.com, karlklose@google.com

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

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

Review URL: https://codereview.chromium.org//1126173002
2015-05-20 13:52:32 +02:00
Asger Feldthaus 28484b2c6f dart2js cps: Stack trace should be obtained from raw exception value.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1134753007
2015-05-20 13:44:49 +02:00
Stephan Herhut 03917ffe4d dart2js: Construct the entire output as a single AST before printing.
BUG=
R=floitsch@google.com, sra@google.com

Review URL: https://codereview.chromium.org//1140703006
2015-05-20 12:31:31 +02:00
Johnni Winther 6f6521ccb8 Revert "Refactor handling of compounds."
This reverts commit e248820e56.

BUG=

Review URL: https://codereview.chromium.org//1142293004
2015-05-20 11:35:48 +02:00
Asger Feldthaus 5f2726b451 dart2js cps: Fix for try/catch.
BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1128903012
2015-05-20 10:57:06 +02:00
Johnni Winther e248820e56 Refactor handling of compounds.
BUG=
R=asgerf@google.com, karlklose@google.com

Review URL: https://codereview.chromium.org//1126173002
2015-05-20 10:38:16 +02:00
Asger Feldthaus 7d4a8df496 MutableVariable no longer has a host Element.
This fixes a bug when mutable variables occur in constructor elements,
similar to an earlier bug where mutable variables in nested functions
would fail to use the right element.

Hopefully we've seen the last of it now.

BUG=
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1129693005
2015-05-20 10:29:07 +02:00
Asger Feldthaus 036f50d6aa Fix evaluation field initialization order for forwarding constructors.
Intestingly, the VM, dart2js/SSA and dart2js/CPS all fail the new test
in three different ways.

This CL fixed the SSA and CPS backends, and leaves a status line for
the VM.

When a constructor A redirects to B, it is B that should evaluate
declaration-site initializers (unless B also redirects).
Thus, this should happen after the arguments to B have been computed.

In SSA: Fields were initialized at A instead of B
(i.e. before redirect).

In CPS: Fields were initialized at both places, just horrible.

In VM: There seems to be a problem with redirecting constructors
called using super().

VM bug report: https://code.google.com/p/dart/issues/detail?id=23488

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1129693006
2015-05-20 10:05:53 +02:00
Johnni Winther c4d65452e0 Ensure ErroneousElement for static getter with no setter.
BUG=
R=herhut@google.com

Review URL: https://codereview.chromium.org//1142933003
2015-05-20 09:54:45 +02:00
Florian Loitsch ec51cdcca3 dart2js: Cleanups and renames in runtime code that thouches types.
As a convention we use "rti" in variable names that represent internal type encodings.

R=sra@google.com

Review URL: https://codereview.chromium.org//1135653005
2015-05-19 17:43:01 +02:00
Florian Loitsch de495c6b20 dart2js: remove JS_OBJECT_CLASS_NAME and JS_NULL_CLASS_NAME from foreign
Instead of comparing the constructor's class name to the one of the Dart object class (or Null class), provide a builtin that returns whether a type is _the_ object or null type.

This CL also starts the convention that internal types should have "rti" in their name.

R=sra@google.com

Review URL: https://codereview.chromium.org//1136913006
2015-05-19 17:40:02 +02:00
Johnni Winther e4d3c4339d Compute better names for source maps.
BUG=http://dartbug.com/23336
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1139693002
2015-05-19 15:00:18 +02:00
Asger Feldthaus ccee558a5b dart2js cps: Access to lazily initialized fields.
R=kmillikin@google.com

Review URL: https://codereview.chromium.org//1136843006
2015-05-19 10:05:09 +02:00
Johnni Winther 0afef600d4 Handle constant constructors with parse errors.
co19/Language/07_Classes/07_Classes_A02_t13 exercises this.

BUG=
R=karlklose@google.com

Review URL: https://codereview.chromium.org//1140903002
2015-05-19 09:44:13 +02:00
Kenneth Endfinger 0a55500c61 Fix typo in compiler.
BUG=
R=msimprovertechnologies@gmail.com, sra@google.com

Committed: https://github.com/dart-lang/sdk/commit/7ad29a2fa33af1cd8e545f06458c90638d73b30c
Reverted: https://github.com/dart-lang/sdk/commit/7917485d890db47ca7fed9c157655eddf4d5b58b

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

Patch from Kenneth Endfinger <kaendfinger@gmail.com>.
2015-05-18 19:12:08 +02:00
Florian Loitsch 7917485d89 Revert "Fix typo in compiler."
This reverts commit 7ad29a2fa3.

I didn't commit it the correct way. Relanding soon.

BUG=

Review URL: https://codereview.chromium.org//1141263003
2015-05-18 19:09:04 +02:00
Florian Loitsch 7ad29a2fa3 Fix typo in compiler.
BUG=
R=msimprovertechnologies@gmail.com, sra@google.com

Review URL: https://codereview.chromium.org//1142433004
2015-05-18 18:53:04 +02:00
Rico Wind 5edbaf3136 Fix path for dart2js native tests.
This seems a bit fragile, I can easily imagine people checkout out into directories not named dart (well, now sdk)

TBR=floitsch@google.com
BUG=

Review URL: https://codereview.chromium.org//1133343007
2015-05-17 08:45:51 +02:00
sra@google.com 0ef007d00b Optimize DateTime properties
Several small pieces fit together to improve calendar arithmetic code in a customer's app.

1. Mark DateTime primitives that return small integers as returning uint31.

2. uint31 + uint31 -> uint32 in type inference.

3. uint32 / N can be generated as (uint32 / N) | 0 when N >= 2.

R=floitsch@google.com

Committed: https://code.google.com/p/dart/source/detail?r=45621

Reverted: https://code.google.com/p/dart/source/detail?r=45625

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45829 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 22:36:15 +00:00