Commit Graph

4698 Commits

Author SHA1 Message Date
johnniwinther@google.com 5c208f4880 Fix deferred_not_loaded_check_test.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45451 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-29 12:44:34 +00:00
johnniwinther@google.com 60f79ad841 Refactor SimpleTypeInferrer.visitGetterSend and visitStaticSend.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45450 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-29 11:58:40 +00:00
johnniwinther@google.com d9b0cc7da2 Refactor SsaBuilder.visitStaticSend and visitGetterSend.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45449 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-29 11:44:05 +00:00
rmacnak@google.com a6e42c48b5 Deal with deferred loading in the VM mirrors.
- Invalidate MirrorSystem.libraries when a load completes.
- Recheck if a deferred import's target has been loaded before failing.
- Allow loading libraries from a LibraryDepedencyMirror.
- Propogate compile-time error when attempting to reflect a deferred type.

BUG=http://dartbug.com/22592
R=asiva@google.com, gbracha@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45444 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-28 23:47:45 +00:00
johnniwinther@google.com 121c7f91fc Use Map<FieldElement, ConstantValue> for fields in ConstructedConstantValue.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45441 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-28 10:48:30 +00:00
johnniwinther@google.com 3d8faf261f Refactor SimpleTypeInferrer.visitSuperSend and deprecate ResolvedVisitor.visitSuperSend.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45440 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-28 09:19:40 +00:00
johnniwinther@google.com e464269f96 Refactor SsaBuilder.visitSuperSend.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45439 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-28 08:23:58 +00:00
johnniwinther@google.com 92a21dbe79 Deprecate ResolvedVisitor.visitClosureSend.
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45420 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-27 08:37:48 +00:00
kmillikin@google.com f44f9c78ac Support rethrow in the dart2js JS backend.
The approach is simple: translate rethrow to a throw of the enclosing
catch block's JS exception.  There is already an assert that the JS
backend does not see rethrow at code generation time.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45397 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-24 11:23:09 +00:00
johnniwinther@google.com 1eea9e39d1 Deprecate ResolvedVisitor.visitOperatorSend.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45374 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-23 13:52:50 +00:00
floitsch@google.com 17ecf6b954 dart2js: Fix new emitter.
Review URL: https://codereview.chromium.org//1103523003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45350 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 14:33:41 +00:00
floitsch@google.com eb20073478 dart2js: add compiler builtins to the core-runtime.
WIP.

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

Committed: https://code.google.com/p/dart/source/detail?r=45176
Reverted: https://code.google.com/p/dart/source/detail?r=45177

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45347 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 13:44:39 +00:00
johnniwinther@google.com 3fbdff8783 Add structural equality to ConstantExpression.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45344 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 13:03:57 +00:00
johnniwinther@google.com cfc2e8017c Deprecate ResolvedVisitor.visitTypeLiteralSend.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45341 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 11:57:54 +00:00
johnniwinther@google.com c467b33a6e Refactor SourceMapBuilder to allow for post-processing.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45339 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 11:23:11 +00:00
kmillikin@google.com ed699ec05d Mark a dart2js test that fails in --use-cps-ir mode.
R=karlklose@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45337 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 11:08:39 +00:00
kmillikin@google.com 4f7c1d3d54 Clean up handling of constants in the CPS backend.
Before: constant-valued expressions were usually compiled by the JS constant
compiler task, which surprisingly produces a Dart (not JS) constant.

After: use the already computed constant value of a constant-valued
expression.  This is looked up in one of two ways depending on whether the
expression is an identifier or not.  For primitive constants (Booleans,
doubles, integers, strings, and null) simply construct them as they have not
had a value computed.

Also, fix a variety of small bugs.  In some case the fix is disabling an
incorrect code path and bailing out of the compiler.

BUG=
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45335 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 10:59:03 +00:00
johnniwinther@google.com bd10ba7f11 Refactor visitOperatorSend to used SemanticSendVisitor methods.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45329 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 09:23:17 +00:00
karlklose@google.com 9e154bc62a Allow access to type variables as expressions in factory constructors.
BUG= http://dartbug.com/22700
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45328 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-22 09:11:14 +00:00
sigmund@google.com 667173800b Visit arguments of invalid TypeLiteralSends during inference
BUG= http://dartbug.com/23264
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45315 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-21 15:36:22 +00:00
johnniwinther@google.com 1ef811ab2b Refactor DartTypeVisitor and ElementVisitor.
This enables more patterns of use.

BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45314 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-21 13:46:58 +00:00
johnniwinther@google.com af8a0dcdca Add SourceInformationFactory.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45312 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-21 12:07:51 +00:00
sra@google.com f1ab388015 Rewrite for-in loop on JavaScript indexable arrays as indexing loop
for (E variable in a) <body>

is generated as:

  _end = a.length;
  for (_i = 0; _i < a.length; a.length == _end || (0, H.throwConcurrentModificatiionError)(a), ++_i) {
    variable = a[_i];
    <body>;
  }

or, when the list is known to be fixed length:

  for (_i = 0; _i < a.length; ++_i) {
    variable = a[_i];
    <body>;
  }

R=floitsch@google.com

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

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45309 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-21 03:13:36 +00:00
zarah@google.com 3210ee4967 Revert "dart2js: add type arguments to constructor in case the class needs rti."
This reverts commit r45277.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45281 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 12:32:49 +00:00
herhut@google.com 0297c82c7a dart2js: allow empty main fragment in emitter.
BUG=
TBR=zarah@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45280 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 11:51:43 +00:00
kmillikin@google.com edaccdaa86 Make the mutable variables local to an IR builder instead of global.
When translating a try block, variables become mutable on entry and stop
being mutable on exit.  Make the set of set of mutable variables local to an
IR builder instead of global for a whole function, so that the translation
does not depend so heavily on the order of visiting subparts of the input.

Since JS code can have mutable variables (i.e., not boxed in the heap), move
them to the backend-independent IR builder state.  This fixes a bug in the
JS translation of try-catch where the environment would contain duplicated
bindings for mutable variables.  The right binding happened to 'win' so it
was not observable other than an assertion failure.

BUG=
R=asgerf@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45279 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 11:44:25 +00:00
zarah@google.com b204a67fa9 dart2js: add type arguments to constructor in case the class needs rti.
R=herhut@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45277 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 11:00:47 +00:00
herhut@google.com a0172bc7b5 dart2js: fully assemble program before emitting it.
BUG=
R=karlklose@google.com

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

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45276 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 10:43:55 +00:00
kmillikin@google.com c6b5cae96f Revert "Make the mutable variables local to an IR builder instead of global."
This reverts SVN revsion 45272.  It breaks dart2dart and the S-expression
parsing tests.

R=asgerf@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45273 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 09:28:19 +00:00
kmillikin@google.com 640331c516 Make the mutable variables local to an IR builder instead of global.
When translating a try block, variables become mutable on entry and stop
being mutable on exit.  Make the set of set of mutable variables local to an
IR builder instead of global for a whole function, so that the translation
does not depend so heavily on the order of visiting subparts of the input.

Since JS code can have mutable variables (i.e., not boxed in the heap), move
them to the backend-independent IR builder state.  This fixes a bug in the
JS translation of try-catch where the environment would contain duplicated
bindings for mutable variables.  The right binding happened to 'win' so it
was not observable other than an assertion failure.

BUG=
R=asgerf@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45272 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 09:00:14 +00:00
sra@google.com 541fbcd32e Rewrite for-in loop on JavaScript indexable arrays as indexing loop
for (E variable in a) <body>

is generated as:

  _end = a.length;
  for (_i = 0; _i < a.length; a.length == _end || (0, H.throwConcurrentModificatiionError)(a), ++_i) {
    variable = a[_i];
    <body>;
  }

or, when the list is known to be fixed length:

  for (_i = 0; _i < a.length; ++_i) {
    variable = a[_i];
    <body>;
  }

R=floitsch@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45271 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 02:44:07 +00:00
sra@google.com 24478da6bc Rewrite for-in loop on JavaScript indexable arrays as indexing loop
for (E variable in a) <body>

is generated as:

  _end = a.length;
  for (_i = 0; _i < a.length; a.length == _end || (0, H.throwConcurrentModificatiionError)(a), ++_i) {
    variable = a[_i];
    <body>;
  }

or, when the list is known to be fixed length:

  for (_i = 0; _i < a.length; ++_i) {
    variable = a[_i];
    <body>;
  }

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45270 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-20 02:08:12 +00:00
sigmund@google.com 0189a4b353 Better hints for await in non-async functions
BUG=23234
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45256 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 20:58:59 +00:00
sigmund@google.com 6a98437e2d Fix tests in bots (handle 'is' as an invalid binary operator)
TBR=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45251 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 19:20:52 +00:00
sigmund@google.com ea5c8193c1 Make super.foo= erroneous if they are not assignable.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45250 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 18:34:29 +00:00
johnniwinther@google.com 77be26cdd7 Use UnaryOperator and BinaryOperator in ConstantSystem.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45248 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 17:52:20 +00:00
sigmund@google.com 20d96e83d2 Fix dumpInfo: include information for methods that are not in the generated
output (because of inlining, orelse)

R=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45247 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 17:51:55 +00:00
johnniwinther@google.com 62167b954f Move constant systems into their own libraries.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45241 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 16:29:44 +00:00
kmillikin@google.com 5d95a09836 Repair a CPS integrity violation.
If replacing a use with another one will orphan the original, then it needs
to be unlinked from the CPS term graph.

R=asgerf@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45240 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 13:02:20 +00:00
karlklose@google.com e5f493f841 Revert "dart2js: fully assemble program before emitting it."
This reverts commit r45237.

TBR=herhut@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45239 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 12:58:05 +00:00
herhut@google.com 0ad79339c5 dart2js: fully assemble program before emitting it.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45237 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 11:47:57 +00:00
kmillikin@google.com 00e4ba52ea CPS implementation of throw and rethrow.
Throw and rethrow are implemented as CPS expressions in tail position.

The CPS translation assumes that all expressions translate to a primitive
that is the value of the expression, and throw is an expression in Dart.
For simplicity of the translation, a non-tail throw Primitive is sometimes
used as a placeholder during the translation and removed immediately
afterward.

Both throw and rethrow are represented in the Tree IR.  In the Dart backend,
throw translates to throw and rethrow translates to rethrow.  In the JS
backend, throw translates to JS throw of a wrapped value.  Rethrow is not
currently implemented for the JS backend, it bails out of the compiler.

R=asgerf@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45235 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 11:15:45 +00:00
herhut@google.com b859f5a11d Do not emit stubName for static functions.
BUG=
R=zarah@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45232 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 10:24:25 +00:00
herhut@google.com d8b3272512 dart2js: reify type variables as result of class enqueueing.
BUG=
R=zarah@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45229 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-17 09:51:46 +00:00
asgerf@google.com a68db11570 cps-ir: Replace getter-invocation methods in IR builder.
The IR builder is poorly equipped to decide the order in which to
evaluate things.

ISSUE=https://code.google.com/p/dart/issues/detail?id=23229
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45209 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 14:02:57 +00:00
asgerf@google.com 3f2263aad7 tree-ir bugfix: Count unseen uses instead of seen uses.
Keeping track of the number of "seen uses" of a variable is too fragile
since it needs bookkeeping whenever we merge two variable uses.

I've changed it to track the number of unseen uses instead. The
bookkeeping is simpler because we aren't going to transform an unseen
use.

BUG=
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45207 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 13:03:09 +00:00
zarah@google.com 00f73c4988 dart2js: don't reify type variables for reflectable typedefs.
R=herhut@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45206 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 12:39:48 +00:00
karlklose@google.com 37defc4573 Add a command line option to use the new CPS based backend.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45203 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 11:22:02 +00:00
asgerf@google.com f1f81f6a7e cps-ir: Clean-ups in type propagator.
R=karlklose@google.com, kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45195 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 08:12:04 +00:00
johnniwinther@google.com 26a5f52a81 Use templates for BulkMixin messages.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45194 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-16 08:01:36 +00:00