Commit Graph

4835 Commits

Author SHA1 Message Date
ahe@google.com af5c0df7b4 Resolve libraries against their canonical URI.
This is fixes a regression from r10895.

BUG=https://code.google.com/p/dart/issues/detail?id=21864
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42359 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 11:46:38 +00:00
floitsch@google.com 147f810e6f dart2js: accept const map literals as expression statements.
Dart2js was broken for:

    <String, int> {};

The reason was that we tried to find an identifier after an initial type (looking for something like `Set<int> foo`) to parse a declaration. We assumed that the first token would be a type name and skipped the `<` when we did this search, thus believing that there was a declaration.

BUG= http://dartbug.com/12793
BUG= http://dartbug.com/12794
BUG= http://dartbug.com/21155
R=ahe@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42356 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-13 17:12:59 +00:00
sigurdm@google.com b2b4663ec9 dart2js: fix mixin support in deferred libraries.
This is the continuation of https://codereview.chromium.org/794813002

BUG= http://dartbug.com/21837
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42320 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 14:30:32 +00:00
floitsch@google.com 37470f410a dart2js: Simplify type test emitter.
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42318 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 13:37:37 +00:00
ahe@google.com 27ca1d58c6 Customize which libraries darttags index.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42316 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 12:48:32 +00:00
karlklose@google.com 13e2845dcf First version of type propagation in the new IR.
This CL introduces typed constants and values to the IR.  As a demonstration, the types are used to eagerly statically evaluate identical(a, b) to false, if a and b have different types.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42315 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-12 12:14:15 +00:00
sra@google.com 4e523d8a8f Remove trivial dead stores during dead code elimination
Occasionally this optimizes a StringBuffer into a local string variable.  If we had targeted inlining to inline more methods on StringBuffer we would see more examples.

  padRight: function(source, $length) {
    var result, str, t1;
    result = new P.StringBuffer("");
    str = typeof source === "string" ? source : H.S(source);
    result._contents = str;
    for (t1 = str; t1.length < $length;) {
      t1 += " ";
      result._contents = t1;
    }
    return t1.charCodeAt(0) == 0 ? t1 : t1;
  },

-->

  padRight: function(source, $length) {
    var str, t1;
    str = typeof source === "string" ? source : H.S(source);
    for (t1 = str; t1.length < $length;)
      t1 += " ";
    return t1.charCodeAt(0) == 0 ? t1 : t1;
  },

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42302 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-11 21:44:40 +00:00
sigurdm@google.com 480e12f0d7 Dart2js, move deferred global variables to the right output unit.
BUG=dartbug.com/21840
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42287 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-11 13:56:12 +00:00
sigurdm@google.com 531eecac65 Allow dart2js to compile calls to type literals when prefixed.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42286 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-11 13:36:27 +00:00
johnniwinther@google.com 2fb02ef12c Display exports that lead to dart:mirrors.
BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42285 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-11 13:26:30 +00:00
ahe@google.com c3bfe34ce7 Follow up to CL 764533002.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42284 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-11 13:23:51 +00:00
ahe@google.com 45b6278167 Incremental compilation of constants.
R=floitsch@google.com, johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42283 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-11 13:21:48 +00:00
ahe@google.com aaa9d916ef Track emitted classes in incremental compiler.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42282 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-11 13:12:49 +00:00
floitsch@google.com 79ae635658 dart2js: don't pass the supername to visitFields.
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42247 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 16:09:15 +00:00
ahe@google.com 29356bf94a Incremental compilation of new lazy statics.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42243 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 14:15:56 +00:00
johnniwinther@google.com a4eaf84c1d Generate typedef node from the element.
BUG=
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42238 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 09:17:40 +00:00
johnniwinther@google.com 82e12821d0 Fix crash in typechecker
BUG=http://dartbug.com/21793
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42236 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 08:29:32 +00:00
ahe@google.com 5a35c6fd0e Incremental compiler: support optional arguments.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42235 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 08:08:12 +00:00
floitsch@google.com a5f3c39b21 Isolates: allow sending of arbitrary objects in dart2js.
BUG= http://dartbug.com/12628
BUG= http://dartbug.com/9245
R=lrn@google.com, sigurdm@google.com, sra@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42209 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 16:41:58 +00:00
floitsch@google.com 67dff7ca30 Revert "Isolates: allow sending of arbitrary objects in dart2js."
This reverts commit r42161.

Revert "Update status file."

This reverts commit r42163.

Revert "Update test."

This reverts commit r42165.

Revert "Update status file."

This reverts commit r42166.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42206 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-09 13:25:23 +00:00
herhut@google.com 75d0e5f3db Revert "Improve receiver narrowing in type propagation."
This reverts revision 42162.

BUG=
TBR=sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42177 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 20:03:16 +00:00
asgerf@google.com cc4d2af55d Refactored treatment of closure variables in dart2js CPS.
Closure variables are now represented by a ClosureVariable object.
Previously they were identified by a LocalElement.

Parameters to a FunctionDefinition are now a mix of Parameter and
ClosureVariable. FunctionDefinitions also have a list of all the closure
variables they declare.

This change is a step toward supporting field initializers that modify or
capture function parameters.

BUG=
R=johnniwinther@google.com, sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42164 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 14:06:23 +00:00
herhut@google.com 714da403d5 Improve receiver narrowing in type propagation.
BUG=
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42162 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 13:41:05 +00:00
floitsch@google.com c115b77640 Isolates: allow sending of arbitrary objects in dart2js.
BUG= http://dartbug.com/12628
BUG= http://dartbug.com/9245
R=lrn@google.com, sigurdm@google.com, sra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42161 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 13:28:29 +00:00
zarah@google.com 2114b3f3e5 Move isolateStaticClosureAccess and isolateLazyInitializerAccess from namer to emitter.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42159 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 11:38:06 +00:00
zarah@google.com c4044560cf Move elementAccess from namer to emitter.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42130 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 08:30:16 +00:00
sra@google.com 01b3346d7c Always generate the checkBigInt (Math.floor(x) == x) test for int receiver type checks and argument type checks, since the int32 tests don't make sense in the absence of bailouts.
Also remove dead code for checks that are no longer generated.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42088 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-03 18:34:43 +00:00
floitsch@google.com 3618c48d1c dart2js: Always generate functions for rti substitutions.
R=karlklose@google.com, zarah@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42062 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-02 12:17:59 +00:00
sigurdm@google.com d943cfb9e0 Remove js.ArrayElement.
Instead introduce js.ArrayHole to mark empty spots in Arrays.

BUG=
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42060 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-02 09:28:26 +00:00
johnniwinther@google.com 4ff78cf3c6 Support top-level field declaration and assignment in analyzer2dart.
BUG=
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42043 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-01 14:23:19 +00:00
ahe@google.com 590e8b06a2 Incremental compiler: Use addStubs for adding methods.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42042 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-01 14:11:34 +00:00
herhut@google.com a69a6d49f1 Filter out calls to local functions whose signature does not apply.
BUG= http://dartbug.com/21724
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42040 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-01 14:01:18 +00:00
ahe@google.com dd9e8ee3a4 Disable super-aliases during incremental compilation.
R=herhut@google.com, johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42035 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-01 10:06:10 +00:00
johnniwinther@google.com eab478e8ac Extract BuilderContext from ASTEmitter
BUG=
R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42034 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-01 10:04:11 +00:00
sigurdm@google.com e8f775b2e5 Support for map literals in cps js emitter
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42029 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-28 12:07:38 +00:00
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