Commit Graph

4698 Commits

Author SHA1 Message Date
karlklose@google.com 09b61d8c7c Use CURRENT_ELEMENT_SPANNABLE in invariant.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42430 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-17 14:25:44 +00:00
karlklose@google.com a9ca8885bb Create a Tree IR builder for JavaScript specific nodes.
R=johnniwinther@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42429 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-17 14:14:52 +00:00
sigurdm@google.com b0e9fbedce Generative constructors in the new dart backend.
With super and field initializers.

Field initializers and the arguments to a super-initializer
are treated as zero-arg nested functions, and if they assign
to a parameter, that parameter is set to be a closure
variable.

Still no 'this' initializer redirections.

initializing formals (such as `C(this.x)` ) are translated
to field initializers. We might want to revisit this choice.

R=asgerf@google.com, kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42427 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-17 10:34:21 +00:00
sra@google.com e9d2c4fb06 Do less inlining in lazy initializer expressions.
Lazy initializer expressions are executed at most once, so should be optimized for size rather than speed.
This currently means only inlining when the call is the only use of the function, sunce we don't really have the right information to do a good job in other cases.

Also use this heuristic to inline in throw expressions - this eliminates the constructor function for several exception classes that have a single throw site.

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42420 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-17 01:49:31 +00:00
floitsch@google.com 348b557b79 Revert "dart2js: put all type-test related properties on the prototype and not on the constructor."
This reverts commit r42392.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42408 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 20:02:24 +00:00
kmillikin@google.com 09ae999a45 Clean up FunctionDefinition in the IR S-expression representation.
Separate value parameters from the continuation for symmetry with
function invocations.  Do not make closure variables optional.  Do not
use '{' or '}', since it makes parsing more difficult and probably
screws up other tools that work with S-expressions.

Move closure variables after the parameters and just before the body,
since they are not part of the signature, do not appear at call sites,
and the implicit box creation happens at the beginning of the body
anyway.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42395 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 14:30:43 +00:00
johnniwinther@google.com e1b1d6e824 Add DartTypes to abstract Types.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42394 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 14:20:26 +00:00
floitsch@google.com e2c1631928 dart2js: put all type-test related properties on the prototype and not on the constructor.
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42392 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 13:48:53 +00:00
karlklose@google.com 8a877247de cps-ir: Add support for intercepted calls.
Add an Interceptor IR node that encapsulates the receiver of a method call that (possibly) must be intercepted and replace the receiver of the call by the new node.

Currently we do no optimizations of the interceptor's intercepted class field based on type inference.

R=sigurdm@google.com

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42391 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 13:48:24 +00:00
sigurdm@google.com cf906beba3 dart2js: Fix of deferred static functions.
When deferred static functions go to a different output hunk than the
class they are defined in the emitter got problems with outputting them.

We could say that static functions always go to the same output-unit as
their class, and this is needed to support reflection. But we already
handle it that way when reflection is needed. In deferred_load.dart:

      void addLiveInstanceMember(Element element) {
        if (!compiler.enqueuer.resolution.hasBeenResolved(element)) return;
        if (!isMirrorUsage && !element.isInstanceMember) return;
        collectDependencies(element.implementation);
      }

R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42389 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 13:14:35 +00:00
karlklose@google.com 0a0f71fb09 Revert "cps-ir: Add support for intercepted calls."
This reverts commit r42385.

R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42386 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 12:57:11 +00:00
karlklose@google.com ea6a8fa140 cps-ir: Add support for intercepted calls.
Add an Interceptor IR node that encapsulates the receiver of a method call that (possibly) must be intercepted and replace the receiver of the call by the new node.

Currently we do no optimizations of the interceptor's intercepted class field based on type inference.

R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42385 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 12:29:05 +00:00
karlklose@google.com dda0e456e2 cps-ir: Give up on code generation of static getters and setters.
They are currently encoded as [InvokeStatic]s, but we cannot generate code for them.  We should create separate nodes for them and add type assertions for the elements.

R=sigurdm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42383 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 10:29:31 +00:00
johnniwinther@google.com 7a05c2e412 Add CoreTypes interface.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42382 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-16 10:26:50 +00:00
karlklose@google.com adddd8c1c6 Disable type propagation for the dart backend.
R=johnniwinther@google.com

BUG= http://dartbug.com/21880

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42361 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 14:13:17 +00:00
johnniwinther@google.com 7b8ed43d70 Remove computeMask from ConstantValue.
BUG=
R=karlklose@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42360 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-15 13:53:45 +00:00
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
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