Commit Graph

33 Commits

Author SHA1 Message Date
floitsch@google.com 1c89511be4 Move types out of the HInstructions.
Review URL: https://chromiumcodereview.appspot.com//10827180

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10823 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 14:25:00 +00:00
kasperl@google.com 3b87631a1c Make selector registration in the resolver and code generator more explicit.
Get rid of registerFieldClosureInvocations() in the enqueuer by explicit
registering the closure call selectors when we may be calling a getter in
the resolver and the code generator.

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

Review URL: https://chromiumcodereview.appspot.com//10854158

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10805 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 11:52:44 +00:00
ahe@google.com 474a7d6d56 Check overrides.
Review URL: https://chromiumcodereview.appspot.com//10836235

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10677 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 20:23:58 +00:00
kasperl@google.com e8268dd78a Add name and library to selectors.
This is the first step towards improving the Selector as an
abstraction used by the resolver, builder, and enqueur. The
intent is to have the resolver construct selectors that can
be used for method lookup, tree shaking, and for simplifying
the logic we use to build the correct SSA instructions for
sends (some of which are quite complex).

Next step is to get rid of more of the adhoc selector building
that's done outside of the resolver and clean up how we resolve
sends. After that, I'll start removing the need for passing
around both a name and a selector in a lot of places.

R=ahe@google.com,sgjesse@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10825337

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10637 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 12:21:51 +00:00
ajohnsen@google.com 404f888f83 Refactor Library/CompilationUnit and how we define local Scope.
This also collapses members and constructors of a class into the same
map.

BUG=

Original URL: https://chromiumcodereview.appspot.com//10832203

Review URL: https://chromiumcodereview.appspot.com//10830303

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10632 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 11:35:17 +00:00
sgjesse@google.com c888b57137 Fix type inference for self-recursive functions
If a self-recursive function calls itself with different argument
types that the ones currently expected the actual recompilation of the
function did not take place. This caused wrong JavaScript code to be
generated.

This change queues the generated JavaScript code to be invalidated to
after compiling the current function so that it itself can be
invalidated correctly.

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

BUG=dart:4492
TEST=tests/compiler/dart2js_extra/regress/4492_test.dart

Review URL: https://chromiumcodereview.appspot.com//10854140

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10622 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 08:54:02 +00:00
ahe@google.com 26f63f029a Ensure supertypes are loaded safely.
Review URL: https://chromiumcodereview.appspot.com//10855125

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10586 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 16:42:41 +00:00
ajohnsen@google.com dd8585d5a2 Revert "Refactor Library/CompilationUnit and how we define local Scope."
This reverts commit 05718e680ca45ac26fcc0d0256fc98419fac1b2e.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10824275

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10550 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 06:45:24 +00:00
ajohnsen@google.com ccc0ce3101 Refactor Library/CompilationUnit and how we define local Scope.
This also collapses members and constructors of a class into the same
map.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10832203

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10549 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 06:22:24 +00:00
floitsch@google.com 63bce914b7 Implement call operator.
Committed: https://code.google.com/p/dart/source/detail?r=10495

Review URL: https://chromiumcodereview.appspot.com//10834270

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10507 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 14:19:31 +00:00
sgjesse@google.com b0a258d309 Reapply "Collect call site information and use that for estimating parameter types"
This reapplies r10386 and r10383 which was reverted in r10394

It also fixes the bug causing the revert. This is the line 1754 added
in codegen.dart.

Also added a regression test.

R=kasperl@google.com

BUG=4434

Review URL: https://chromiumcodereview.appspot.com//10824234

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10443 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-09 14:41:04 +00:00
lrn@google.com 97b4df393f Reduce usage of .enclosingElement to get enclosing class.
Currently code assumes that a member's immediate enclosingElement is
its class element.
If we introduce compilation unit override elements into the enclosing
chain, this will no longer be true.
This CL changes the places that assumes this to use isMember() or
getEnclosingClass(). The assumption is still in place in isMember(),
which will need to be modified when things change.

Review URL: https://chromiumcodereview.appspot.com//10834243

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10438 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-09 12:47:42 +00:00
sgjesse@google.com 8861344f12 Revert "estimating parameter types" optimization due to failure on browser
test "samples/tests/samples/lib/view/view_test.dart"

Revert "Collect call site information and use that for estimating parameter types"

This reverts commit f0c42199df50d3d70a47d7ea7311b63b0e60cab0.

Revert "Fix mistake in previous commit r10383"

This reverts commit 571f6f3cdabecddecbeee9a0d3fca8b8c5ad61b0.

TBR=ahe@google.com

Review URL: https://chromiumcodereview.appspot.com//10826204

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10394 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 15:56:37 +00:00
sgjesse@google.com 74592b0457 Collect call site information and use that for estimating parameter types
The propagated types at call sites for dynamic invocations are
collected. When a functions is compiled it is checked whether
there is type information available from call sites. If so the
function is compiled with the asumption that these types will
always be provided. If these expected types change during the
rest of the compilation process the generated code for the
function will be flushed and the function scheduled for
compilation again.

Note that the scheduling for being compiled again is not using
the re-compilation queue. The Re-compilation queue is used for
re-compilation functions when all functions have been compile
once and type information will not change.

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

BUG=

Review URL: https://chromiumcodereview.appspot.com//10827181

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10383 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 13:55:09 +00:00
floitsch@google.com 596f69cae0 Use better names for closures and static variables.
This increases the code size, but goes away with a minifier.

Review URL: https://chromiumcodereview.appspot.com//10693123

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9468 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 14:40:13 +00:00
sgjesse@google.com 77cd2824be Make sure that constructor bodies are added to the resolver
R=ahe@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10642017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9030 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-22 11:50:41 +00:00
floitsch@google.com 3d5769cc8b Remove static fields in the namer.
Review URL: https://chromiumcodereview.appspot.com//10574046

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8965 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 09:35:08 +00:00
sgjesse@google.com 0192db763e Refactor the collection of initializer list types
Instead of storing a boolean to indicate whether a field is only
intialized to an integer store the propagated type instead. If
different types are encountered for the same field indicate this with
HType.UNKNOWN.

Also fix a bug in the checking, as potential single type initializers
is not the same as known single type initializers.

This is in preparation for information on other types than integers.

R=floitsch@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10584009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8963 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 08:51:24 +00:00
sgjesse@google.com 1d39bb9c4d Track fields which are known to be always set to integer constants
For each field which is accessed directly in the generated JavaScript
code track whether all the setters are setting the field to an integer
constant. If that is the case the codegen will always generate ===
comparison when comparing to an integer constant.

To know for sure that only integer constants are assigned the
functions having the getters need to be recompiled.

This gives ~10% on Delta Blue.

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

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10539156

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8796 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 14:03:30 +00:00
sgjesse@google.com 7b653cd41e Some cleanup of recompilation
Addressed additional comments to https://chromiumcodereview.appspot.com/10537025.

R=ahe@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10532158

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8766 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 06:59:49 +00:00
ahe@google.com f768722f65 Address review comments from https://chromiumcodereview.appspot.com/10542073/
Review URL: https://chromiumcodereview.appspot.com//10537129

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8656 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-14 13:24:07 +00:00
sgjesse@google.com 30da55a7d1 Prototype re-compiling methods in dart2js
This is a prototype with the ability for dart2js to retry the
compilation of a method after everything has been compiled
once. Information collected during the first compilation can then be
used when retrying the compilation.

During compilation information on whether setters are used on specific
fields is collected. When compilation is retried and there are no
setters for a field it is treated as if it was declared final.

As this is a prototype there are some issues we need to discuss, e.g.

* The two queues should probably be generalized some way - maybe with
  listeners on specific changes to the collected information

* Throwing Pass2BailoutException when retrying compilation is a bit of
  a hack. We should probably not try to retry something we can't.

* Where to store the imformation collected during compilation

This is one way of improving Delta Blue with 25-30%.

R=ahe@google.com, ngeoffray@google.com, kasperl@google.com, ager@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10537025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8647 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-14 11:43:30 +00:00
ahe@google.com 91e2b7794c Resolution based tree-shaking.
Review URL: https://chromiumcodereview.appspot.com//10542073

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8543 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 12:35:34 +00:00
sgjesse@google.com fbae779b58 Reapply "Collect field getters and setters in the universe""
Added additional checks on the receiver instead of asserting that its
type was not null. HFieldSet and HFieldGet are used for other purposes
than instance fields.

R=ngeoffray@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10537118

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8534 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-12 10:29:00 +00:00
sgjesse@google.com 27aa7b21f7 Revert "Collect field getters and setters in the universe"
This reverts r8487 due to assertion failures in dart2js.

TBR=ngeoffray@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10541096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8489 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-11 15:02:12 +00:00
sgjesse@google.com e5abe8d735 Collect field getters and setters in the universe
This is intended to replace the setter information collection used in
http://codereview.chromium.org/10537025/.

R=ngeoffray@google.com

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10535074

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8487 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-11 14:03:03 +00:00
ahe@google.com ab38ce3561 Move registering to the enqueuer.
Review URL: https://chromiumcodereview.appspot.com//10408059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7903 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-23 12:25:36 +00:00
ahe@google.com fd61a77669 Prepare to have more than one universe.
Review URL: https://chromiumcodereview.appspot.com//10377166

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7795 260f80e4-7a28-3924-810f-c04153c831b5
2012-05-21 12:05:23 +00:00
ngeoffray@google.com acffc45787 Introduce typed selectors for getters and setters also for better tree shaking.
FYI: Swarm from 862465 to 848387 (14k saved).
Review URL: https://chromiumcodereview.appspot.com//10191016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6997 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-26 10:14:01 +00:00
ngeoffray@google.com 78b7ced997 Introduce typed selectors to do better tree shaking based on calls on 'this'. Getters and setters will be next.
Review URL: https://chromiumcodereview.appspot.com//10180001

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6847 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-23 15:36:51 +00:00
karlklose@google.com 038964d52c Check number of type arguments.
Review URL: https://chromiumcodereview.appspot.com//10105031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6675 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-18 10:27:32 +00:00
kasperl@google.com da29bdcace Remove frog dependencies from lib/compiler.
Start importing the URI library using dart:uri rather than
dotting our way to the right directory in lib.

R=ahe@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10081004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6511 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-13 12:05:45 +00:00
ahe@google.com dc099c4a00 Move frog/leg to lib/compiler/implementation.
Review URL: https://chromiumcodereview.appspot.com//9873021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5926 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-28 08:54:01 +00:00