Commit Graph

4698 Commits

Author SHA1 Message Date
floitsch@google.com cfa33f9c4c dart2js: Move TypeTestRegistry into its own file.
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42028 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-28 10:44:01 +00:00
floitsch@google.com 2c92e0d83c dart2js: Split TypeTestEmitter into a registry and an emitter.
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42027 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-28 10:42:56 +00:00
floitsch@google.com c7d49af199 dart2js: Remove dead code in type test emitter.
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42026 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-28 10:41:21 +00:00
floitsch@google.com 18ded35fa2 dart2js: Make usage of names more consistent between compiler and runtime.
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42025 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-28 10:40:28 +00:00
sigurdm@google.com 2e1567ff24 Add support for fields to the new dart backend.
Field initializers are represented similarly to a function with no
parameters.
When they are emitted in backend_ast_emitter.dart `ensureExpression`
wraps the code in an immediately invoked closure if it is not on the
simple form `return e;`.
Ideally this should never happen, but currently happens for cases like eg.
class A {
  static var b = 1;
  var a = b++;
}

main() {
  var a = new A();
  print(a.a);
}

Gets converted to:

class A {
  static var b = 1;
  var a = (() /* new backend */
    {
      var v0;
      v0 = A.b;
      A.b = v0 + 1;
      return v0;
    }
  )();
}

main() /* new backend */
  {
    print(new A().a);
  }

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42024 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-28 08:48:46 +00:00
sigurdm@google.com 8f44815438 Add support for (unintercepted) method calls to the cps js emitter.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42022 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-27 14:53:59 +00:00
floitsch@google.com 3177875959 dart2js: Remove dead code.
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42020 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-27 14:27:59 +00:00
floitsch@google.com 8e8fdb6eee dart2js: use named holes in boilerplate of new emitter.
Review URL: https://codereview.chromium.org//760293002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42019 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-27 13:43:40 +00:00
karlklose@google.com ba86151355 Add an optional decorator to SExprStringifier to augment the output of nodes.
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42018 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-27 13:24:16 +00:00
floitsch@google.com c4fa949b91 dart2js: Support mixins in the new emitter.
R=kasperl@google.com, sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42017 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-27 12:57:42 +00:00
karlklose@google.com 941508b32c Remove the hashCode function from CPS nodes.
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42016 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-27 12:41:11 +00:00
karlklose@google.com 3d2514c304 Refactor the CPS SExprStringifier.
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42015 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-27 12:27:00 +00:00
sigurdm@google.com bd32bef1d5 Invoking constructors in js cps
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42014 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-27 07:57:59 +00:00
herhut@google.com f8eff6c6a0 Delete unused readFunction.
BUG=
TBR=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41990 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 12:10:52 +00:00
herhut@google.com fc75d45d76 Encode super calls via extra properties on prototypes.
BUG= http://dartbug.com/21666
R=ahe@google.com, floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41989 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 11:48:29 +00:00
herhut@google.com ec8fe00d23 Fix declaration of _MixinFieldNamingScope.names.
BUG=
TBR=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41988 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 11:26:27 +00:00
herhut@google.com 40242d131f Use field names that are unique only wrt. the inheritance chain in minified mode.
R=floitsch@google.com, sra@google.com
BUG= http://dartbug.com/21510

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41986 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 10:27:55 +00:00
karlklose@google.com 8071da7ef8 cps-ir: Optimize identical used with constants.
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41982 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 09:24:17 +00:00
karlklose@google.com 4b9dd6daf4 Add CPS IR transformation to make the JavaScript backend specific semantics explicit in the tree.
Also implement transformation to insert boolean conversion.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41979 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 07:26:49 +00:00
floitsch@google.com 0d7b1111f0 dart2js: add comments.
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41958 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 15:39:31 +00:00
floitsch@google.com e728bda036 dart2js: Add "onlyForRti" to Classes in model of the new emitter.
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41956 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 14:49:44 +00:00
ahe@google.com f01fe227e0 Checked mode fixes.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41951 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 13:52:58 +00:00
sigurdm@google.com 0e519dbdcf Add support for if, while, break, continue to js-cps
Also avoid returning values via fields in CodeGenerator.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41946 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 08:30:08 +00:00
ahe@google.com 3e8b1cc1f4 Incremental compilation of added instance fields.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41905 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 15:52:40 +00:00
johnniwinther@google.com c167972a80 Support native extensions for analysis and docgen.
BUG=http://dartbug.com/10616
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41903 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 14:09:14 +00:00
sigurdm@google.com 5ba3c0b361 Fix the new dart2dart backend.
Revert some code accidentially introduced by https://codereview.chromium.org//726543002

BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41902 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 14:00:44 +00:00
johnniwinther@google.com ba110b93ff Avoid patching in dart2dart.
BUG=http://dartbug.com/21441
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41901 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 13:42:56 +00:00
ahe@google.com 50b50dd273 Restore tmp function
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41899 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 12:05:41 +00:00
ahe@google.com 97c56c3c44 Update pkg/compiler/lib/src/use_unused_api.dart.
Review URL: https://codereview.chromium.org//728173003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41894 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 10:32:10 +00:00
ahe@google.com 5f5d4132b5 Refactor superclass change.
This prepares for changes to fields.

R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41892 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 10:14:12 +00:00
sigurdm@google.com c6034d8143 Handle named and optional arguments in cps-ir.
Refactor addArgumentsToList to makeArgumentsList.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41890 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 10:09:28 +00:00
ahe@google.com e3128327a4 Incremental compilation of added class.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41887 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 09:57:35 +00:00
ahe@google.com f70185d648 Implement adding methods.
This makes it possible to implement signature changes as remove followed by add.

R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41886 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 09:54:00 +00:00
ahe@google.com 2e81a536e5 Add Link.copyWithout.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41885 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 09:46:01 +00:00
karlklose@google.com 602126576a cps-ir: Implement boolean conversion in and use it to implement '&&', '||', and '?:'.
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41884 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 09:07:20 +00:00
sra@google.com 0ba7657077 Redo "Revert "Encode super calls via extra properties on prototypes.""
Second attempt to revert r41550 + r41831

TBR=herhut@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41876 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-21 00:07:50 +00:00
sra@google.com d17473e7d0 Revert "Revert "Encode super calls via extra properties on prototypes.""
My revert of r41550 + r41831 was bad, so reverting the revert to go back to the broken state reported in issue 21666, and will attempt a cleaner revert.

TBR=herhut@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41875 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 23:38:30 +00:00
sra@google.com b1cda8191d Revert "Encode super calls via extra properties on prototypes."
Revert "Only emit support for aliasing methods if super calls are present."

TBR=herhut@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41871 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 22:59:43 +00:00
sigurdm@google.com cf7ff395cf Add list literals in js cps codegen.
Also split the test cases out of the test file.

R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41849 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 13:19:57 +00:00
sigurdm@google.com f93a87c77b Remove unused code
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41848 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-20 13:00:16 +00:00
karlklose@google.com 73aa370a85 Fix codegeneration for 'return'.
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41836 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 14:39:41 +00:00
herhut@google.com 4b85c73ba6 Consistently use Array as tag for fixed length arrays.
BUG= http://dartbug.com/21653
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41832 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 13:46:32 +00:00
herhut@google.com 72c2d355a2 Only emit support for aliasing methods if super calls are present.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41831 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 13:44:49 +00:00
sigurdm@google.com e399f27a19 Fix declaration of locals in the cps js codegen.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41830 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 13:23:18 +00:00
sigurdm@google.com ac215fd8df this in js-cps.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41829 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 12:47:49 +00:00
sigurdm@google.com c0c038926a Add support for local variables(including parameters) to cps->js.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41827 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 11:58:53 +00:00
ahe@google.com c5078a0b2f Incremental compilation of new classes with fields.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41825 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 09:52:17 +00:00
ahe@google.com 67e8c8c715 Use Object.create instead of a tmp-function.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41823 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 09:20:40 +00:00
johnniwinther@google.com 798f0417e5 Emit warning on import of dart:mirrors.
BUG=
R=floitsch@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41822 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 09:20:14 +00:00
karlklose@google.com 91a337fe75 Move shared optimizations to the tree_ir directory.
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41806 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-18 14:50:54 +00:00