floitsch@google.com
fabe7580cc
dart2js: remove unused function in native emitter.
...
Review URL: https://codereview.chromium.org//881803002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43186 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 14:13:46 +00:00
floitsch@google.com
10f80000e5
dart2js: move mapTypeToInterceptor generation to interceptor_stub_generator. and rename to typeToInterceptorMap.
...
R=herhut@google.com
Review URL: https://codereview.chromium.org//876653002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43183 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 13:04:51 +00:00
floitsch@google.com
8285fa7ddf
dart2js: extract a native-blob handler and make it emitter-independent.
...
R=herhut@google.com
Review URL: https://codereview.chromium.org//873223002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43182 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 13:03:41 +00:00
floitsch@google.com
f5a02dcbca
dart2js: remove additionalProperties and store it directly as nativeBlob.
...
R=herhut@google.com
Review URL: https://codereview.chromium.org//868483006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43181 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 12:59:15 +00:00
floitsch@google.com
d5377710ba
dart2js: native classes go through the normal code path.
...
R=herhut@google.com
Review URL: https://codereview.chromium.org//878553002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43178 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 12:14:55 +00:00
floitsch@google.com
b4678cab8b
dart2js: Run prepareNativeClasses in the program builder.
...
R=herhut@google.com
Review URL: https://codereview.chromium.org//868473003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43177 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 12:10:38 +00:00
sigurdm@google.com
c95d6162a8
Let the dart2dart compiler stop in case of failure (errors).
...
This is a stop-gap measure to avoid crashes
BUG= dartbug.com/22085
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org//868273003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43172 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 09:03:08 +00:00
hausner@google.com
14a76e2389
Unfix the fix
...
TBR
Review URL: https://codereview.chromium.org//867653004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43166 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 00:39:37 +00:00
hausner@google.com
6265a49bc9
Fix build, work around broken --enable-async flag
...
TBR
Review URL: https://codereview.chromium.org//876963002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43165 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 00:18:36 +00:00
kmillikin@google.com
5f57d08cb8
Reapply "Add a shrinking reduction for dead continuation parameters."
...
This reapplies SVN revision r43093 with bug fixes. A failing assert
was fixed, and continuation eta-reduction was restricted to not change
non-call continuations into call continuations. If these were to
occur, they risk duplicating code and so are not always on
optimization.
BUG=
R=asgerf@google.com
Review URL: https://codereview.chromium.org//872373003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43135 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 13:51:37 +00:00
floitsch@google.com
b60b8dbd4d
dart2js: Fix small typo in warnings comments.
...
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org//844723004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43134 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 13:45:43 +00:00
floitsch@google.com
e317d42708
dart2js: move emitClass to emitter.
...
R=herhut@google.com
Review URL: https://codereview.chromium.org//880473002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43133 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 13:44:16 +00:00
floitsch@google.com
65fa8ebc3a
Don't create builders to determine if a native class is trivial or not.
...
Also use `emitClass` to emit the native classes (instead of duplicating the code).
R=herhut@google.com
Review URL: https://codereview.chromium.org//872403002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43132 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 13:43:35 +00:00
floitsch@google.com
bceae09ccc
dart2js: Fix bad is-check in native_emitter.
...
Review URL: https://codereview.chromium.org//867963003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43112 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 16:35:29 +00:00
floitsch@google.com
7a3a84f249
dart2js: add work-around hack for try.
...
Review URL: https://codereview.chromium.org//871073002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43109 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 15:40:00 +00:00
floitsch@google.com
039742118f
dart2js: Make emitInstanceMember take a Class and not a classElement.
...
R=zarah@google.com
Review URL: https://codereview.chromium.org//866213005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43108 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 14:50:20 +00:00
floitsch@google.com
f60bdb707e
dart2js: determine if a needed class is needed without having side-effects.
...
R=zarah@google.com
Review URL: https://codereview.chromium.org//866843002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43107 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 14:44:12 +00:00
kmillikin@google.com
c74e16c5d5
Revert "Add a shrinking reduction for dead continuation parameters."
...
This reverts svn revision r43093, due to failures in dart2dart. It
clashes with the commit just before it which has changed the type of
FunctionDefinition parameters.
Also, continuation eta-reduction can destroy a dead parameter
reduction. In this case, it's not obvious which reduction we actually
want. So though the fixes are simple, I will back this change out and
reevaluate it.
R=asgerf@google.com
BUG=
Review URL: https://codereview.chromium.org//869223003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43105 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 13:44:41 +00:00
floitsch@google.com
113c5baba9
dart2js: fix csp mode.
...
Review URL: https://codereview.chromium.org//871003002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43104 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 13:42:23 +00:00
floitsch@google.com
a3d4dbc04c
dart2js: store call stubs in the model.
...
R=zarah@google.com
Review URL: https://codereview.chromium.org//865223002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43099 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 12:29:12 +00:00
floitsch@google.com
ae592134c6
dart2js: store fields in the model and make the emitters use it.
...
R=zarah@google.com
Review URL: https://codereview.chromium.org//869543004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43098 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 12:27:40 +00:00
floitsch@google.com
d60700d96e
dart2js: Don't add properties to native classes that are not needed.
...
This has no impact on the output, and almost no impact on the compilation time.
However, it makes it clearer, that unneeded native classes really are not needed, and don't need their nativeSpecProperty either.
I want to refactor this code in another CL, but I think it's cleaner if this if-check is already in place now, and not merged into a bigger change.
R=sra@google.com
Review URL: https://codereview.chromium.org//863353002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43096 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 10:35:48 +00:00
floitsch@google.com
da94cbcbe3
dart2js: Fix getter/setter flags in the model.
...
It was inverting cases 10 and 11.
Here is the relevant part from model.dart:
/// 00: Does not need any getter.
/// 01: function() { return this.field; }
/// 10: function(receiver) { return receiver.field; }
/// 11: function(receiver) { return this.field; }
final int getterFlags;
/// 00: Does not need any setter.
/// 01: function(value) { this.field = value; }
/// 10: function(receiver, value) { receiver.field = value; }
/// 11: function(receiver, value) { this.field = value; }
final int setterFlags;
R=zarah@google.com
Review URL: https://codereview.chromium.org//862783002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43095 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 10:33:50 +00:00
kmillikin@google.com
bdba8f356b
Add a shrinking reduction for dead continuation parameters.
...
Continuation parameters that have no uses can be eliminated. This is
similar to the reduction for dead values except that that continuation
invocations need to be adjusted.
Performing a dead parameter reduction can create other dead parameter
redexes, dead value redexes, or continuation eta-redexes. Detection
of these redexes does not fit the existing model, where an entire
deleted subterm is visited after being eliminated from the whole term.
Instead, they are detected explicit as part of the reduction
implementation.
R=asgerf@google.com
BUG=
Review URL: https://codereview.chromium.org//864293004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43093 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 10:27:46 +00:00
asgerf@google.com
b78959f1d7
Implement constructor bodies and initializers in CPS->JS backend.
...
As in the SSA backend, a constructor consists of three parts:
1. Instantiator: creates an object and sets its fields
2. Factory: evaluates field initializers, calls instantiator, then
calls bodies.
3. Body: executes the body of a constructor.
The CreateClosureClass instruction has been replaced by CreateInstance
for invoking the instantiator for an arbitrary class.
The IrBuilderVisitor has been split into two subclasses to better
isolate the JS-specific code.
BUG=
R=floitsch@google.com
Review URL: https://codereview.chromium.org//862703002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43092 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-23 10:19:28 +00:00
kmillikin@google.com
b79e6f5905
Incorporate some code review comments.
...
Change the CPS IR's LetCont constructor to have single and multiple
continuation versions. Update a pair of comments.
R=asgerf@google.com
BUG=
Review URL: https://codereview.chromium.org//819143007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43071 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 13:09:27 +00:00
herhut@google.com
10899ca02c
Revert "Change signature of lookupConstructor to only require a name."
...
This reverts revision 43067.
BUG=
TBR=floitsch@google.com
Review URL: https://codereview.chromium.org//868643002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43068 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 10:46:18 +00:00
herhut@google.com
e37fcb6489
Change signature of lookupConstructor to only require a name.
...
BUG=
R=johnniwinther@google.com
Review URL: https://codereview.chromium.org//812523002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43067 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 10:32:43 +00:00
floitsch@google.com
ff659c8b61
dart2js: Use is-checks from the model in the old emitter.
...
R=zarah@google.com
Review URL: https://codereview.chromium.org//840563005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43065 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 10:25:54 +00:00
floitsch@google.com
0c562d82b9
dart2js: use model in native emitter.
...
R=sra@google.com , zarah@google.com
Review URL: https://codereview.chromium.org//859843002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43064 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 10:23:41 +00:00
herhut@google.com
2260e65e5c
Consider updates of locals in type promotion.
...
BUG= http://dartbug.com/21271
R=floitsch@google.com , karlklose@google.com
Review URL: https://codereview.chromium.org//843613004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43062 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 09:52:31 +00:00
ahe@google.com
34512168d9
Rename $dart_unsafe_eval to $dart_unsafe_incremental_support.
...
R=kasperl@google.com
Review URL: https://codereview.chromium.org//856333003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43061 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 09:50:07 +00:00
sra@google.com
37e2caf317
Optimize is-check to instanceof when it eliminates an interceptor
...
See http://dartbug.com/22016 for discussion
R=floitsch@google.com
Review URL: https://codereview.chromium.org//829913006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43058 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-22 02:24:00 +00:00
floitsch@google.com
7951e1675a
dart2js: set needsTearOff when creating the getter/setter stubs in the new emitter.
...
The Method constructor requires the booleans to be set:
Method(this.element, this.name, this.code, {this.needsTearOff}) {
assert(needsTearOff != null);
R=zarah@google.com
Review URL: https://codereview.chromium.org//830193003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43037 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 14:01:13 +00:00
floitsch@google.com
d792de5b4b
dart2js: Let the emitter generate the program.
...
This gives the emitter the option to pass options to the builder.
R=zarah@google.com
Review URL: https://codereview.chromium.org//822593004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43035 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 12:04:52 +00:00
floitsch@google.com
094846ec40
dart2js: Don't assume fields are needed, if they are static.
...
R=herhut@google.com
Review URL: https://codereview.chromium.org//828083003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43034 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-21 11:58:03 +00:00
floitsch@google.com
d98d38a5a8
dart2js: Remove obsolete comment and code.
...
R=sra@google.com
Review URL: https://codereview.chromium.org//855963002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43025 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 20:17:35 +00:00
floitsch@google.com
3f8c3b91b4
dart2js: Change mirror flag message.
...
R=sethladd@google.com
Review URL: https://codereview.chromium.org//859463002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43024 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 20:16:42 +00:00
asgerf@google.com
b29366b9e6
Handle super-method invocations in CPS->JS backend.
...
InvokeSuperMethod has been replaced by InvokeMethodDirectly. This
instruction works like InvokeMethod, except it has an explicit target
element that it always invokes, regardless of overriding.
The new instruction is easier to handle in the JS backend, it is more
amenable to inlining, and it should also be useful for calling
backend-specific methods, such as constructor bodies.
When targeting Dart, we translate it back to a 'super' at the end,
because the instruction is never used for any other purpose with
that backend.
R=karlklose@google.com , sigurdm@google.com
Review URL: https://codereview.chromium.org//861713002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43011 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 14:33:17 +00:00
herhut@google.com
d7ccdf94a7
Fix computation of single type variables.
...
BUG=
TBR=karlklose@google.com
Review URL: https://codereview.chromium.org//859983002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43007 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 12:52:26 +00:00
herhut@google.com
814868cbc2
Do not use full substitution when only computing single type variables.
...
BUG=
R=karlklose@google.com
Review URL: https://codereview.chromium.org//861733002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43006 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 12:01:26 +00:00
floitsch@google.com
db97e89c86
dart2js: Rename functions with getter name.
...
R=karlklose@google.com
Review URL: https://codereview.chromium.org//859833002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43003 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 10:33:55 +00:00
herhut@google.com
3f4e9e7918
Fix minified output for FunctionThatReturnsNull.
...
BUG=
TBR=sigurdm@google.com
Review URL: https://codereview.chromium.org//861723003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43002 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 10:17:18 +00:00
zarah@google.com
b0e80e8374
dart2js: Only emit constructors of the native class interceptors that are used.
...
This change only affects CSP mode: when compiling in CSP mode we were emitting constructors and getters/setters of native classes that were potentially not needed.
R=floitsch@google.com
Committed: https://code.google.com/p/dart/source/detail?r=42944
Reverted: https://code.google.com/p/dart/source/detail?r=42950
Review URL: https://codereview.chromium.org//841993003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43001 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 09:45:26 +00:00
herhut@google.com
f2a40e8c0a
Use a shared function to represent type substitutions with dynamic.
...
BUG=
R=floitsch@google.com
Review URL: https://codereview.chromium.org//826413003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43000 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 09:42:02 +00:00
sigurdm@google.com
ef57c8bdac
Implement await and async for the js-ast.
...
Implementing a new expression 'await e' in the js mini-parser and printer.
Implementing async, async*, sync* function body modifiers.
Also implementing while, do, switch, case, labelled statement in the js mini parser.
This is in preparation for an await-desugaring transformation on the js ast.
BUG=
R=asgerf@google.com , floitsch@google.com
Review URL: https://codereview.chromium.org//858573002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42999 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-20 08:10:47 +00:00
floitsch@google.com
0b03d223bd
dart2js: more uses of the model in the old emitter.
...
Some renamings.
R=ahe@google.com
Committed: https://code.google.com/p/dart/source/detail?r=42917
Reverted: https://code.google.com/p/dart/source/detail?r=42922
Committed: https://code.google.com/p/dart/source/detail?r=42934
Reverted: https://code.google.com/p/dart/source/detail?r=42939
Review URL: https://codereview.chromium.org//787233006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42995 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-19 15:07:33 +00:00
floitsch@google.com
72267dd453
dart2js: Don't reference mixins when they are only used for RTI.
...
BUG= http://dartbug.com/21896
R=sigurdm@google.com , zarah@google.com
Review URL: https://codereview.chromium.org//858433005
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42990 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-19 13:34:10 +00:00
floitsch@google.com
a44d1c44e1
dart2js: capture type variables in closures, if they are only used in literals.
...
BUG= http://dartbug.com/22060
R=asgerf@google.com
Review URL: https://codereview.chromium.org//851303002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42989 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-19 13:32:00 +00:00
kmillikin@google.com
41897d3517
Reapply "Allow LetCont to bind multiple continuations."
...
This reapplies svn revision r42945 with bugfixes. There was an
invalid assertion in the shrinking reduction pass and a stray left
parenthesis in one of the input IR expressions.
Some of the logic in the shrinking reduction pass has been cleaned up.
R=asgerf@google.com
BUG=
Review URL: https://codereview.chromium.org//827763003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42988 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-19 12:49:52 +00:00