Commit Graph

4835 Commits

Author SHA1 Message Date
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
kevmoo@google.com 2aabb54b66 add library canonicalUri to dart2js dump info
R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45825 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-15 20:32:23 +00:00
johnmccutchan@google.com f01c1490f7 Revert 45783
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45784 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 00:32:32 +00:00
johnmccutchan@google.com 95515238cc Move 'dart:profiler' contents into 'dart:developer' and remove 'dart:profiler'
BUG=
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45783 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 23:48:04 +00:00
karlklose@google.com 9b32c9e673 Implement raw list checks.
R=asgerf@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45762 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 11:58:45 +00:00
karlklose@google.com 898138ad0a Remove return that was reported as a dead-code when running build.py.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45759 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-13 08:09:53 +00:00
sra@google.com afbb537add Better toString and Error.toSafeString output for closures for dart2js.
Closures that appear in error messages, especially NoSuchMethodError, need to identify the function so that captured error messages and stack traces are useful.

Old:
  1. Instance of 'Object'
  2. Instance of 'Object'
  3. Instance of 'anonymous'
  4. Instance of 'anonymous'
  5. Instance of 'main_localFunction'

New:
  1. Closure 'print'
  2. Closure 'Widget_staticMethod'
  3. Closure 'foo' of Instance of 'Widget'
  4. Closure 'remainder' of 1234
  5. Closure 'main_localFunction'

In minified code the names are (usually) minified. Being able to unminify them later is separate issue.
This CL makes NoSuchMethodError variants more uniform in quoting of method to assist unminifying the message.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45753 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 23:47:23 +00:00
floitsch@google.com d22c29b57b dart2js: keep track of non-final static fields.
Dart2js used to just emit static non-final fields, even if they were not referenced.
This is bad, because in some cases it referenced a constant that didn't exist (was tree-shaken away). In the old emitter this just became a reference to a non-existing property, but in the new emitter it crashed.

This CL also fixes (partially) static non-final fields for the lazy emitter.

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45752 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 23:34:42 +00:00
asgerf@google.com f5f1eb643d dart2js cps: Introduce GetStatic/SetStatic.
The GetStatic is used for reading static fields and tearing off
static methods.

Invoking a static getter/setter (not from a field) is still an
InvokeStatic, which IMO is the way it should remain.

BUG=
R=karlklose@google.com

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

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45738 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 14:19:40 +00:00
asgerf@google.com 961c805398 Revert "dart2js cps: Introduce GetStatic/SetStatic."
This reverts commit 28e4518df87c72cb8e23fe6d73b7750ad0f2183a.

TBR=karlklose@google.com

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45737 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 13:53:15 +00:00
asgerf@google.com 2c90643171 dart2js cps: Introduce GetStatic/SetStatic.
The GetStatic is used for reading static fields and tearing off
static methods.

Invoking a static getter/setter (not from a field) is still an
InvokeStatic, which IMO is the way it should remain.

BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45735 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 13:35:49 +00:00
floitsch@google.com ac5e4d906c dart2js: compile metadata lazily in the lazy emitter.
In the lazy emitter evaluates the metadata lazily at first access.
Does this by keeping two arrays. The first one containing the unparsed expressions. The second one containing the evaluated expressions.

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45726 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 03:13:02 +00:00
floitsch@google.com a66524586f dart2js: build metadata-types lazily in the new emitter.
Instead of building all types in the TYPES table eagerly, evaluate them lazily at first access.

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45723 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 00:39:00 +00:00
johnniwinther@google.com 95e30b7b3c Fix test for TypeImpl.==
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45694 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 15:52:51 +00:00
johnniwinther@google.com 0f75f9272d Forward instantiation type to LocalsHandler.
BUG=
R=zarah@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45693 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 15:45:22 +00:00
johnniwinther@google.com 4103f9d13e Add Accessor, Getter, and Setter elements.
+ a bit of model polishing

BUG=
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45689 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 15:09:49 +00:00
johnniwinther@google.com 0d4ab12dcf Add ConstantExpression.evaluate.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45687 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 14:34:01 +00:00
johnniwinther@google.com 6e42a3aab3 Refactor index operator in SimpleTypeInferrer.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45683 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 13:14:53 +00:00
karlklose@google.com a295eb38fe Add import missing from r45680.
TBR=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45682 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 13:14:15 +00:00