Commit Graph

33 Commits

Author SHA1 Message Date
kmillikin@google.com 27af144369 Move code around in preparation for better inlining.
To inlining calls in a test context, the code to plug the inlined
function graph into the caller graph should be dispatched on the type
of the inlining context.

This change moves code around without otherwise changing it.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17569 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-24 14:13:02 +00:00
vegorov@google.com a77fc9701c When requested to extract a method M from class C inject a method extractor (consisting of a single AST node CreateClosure) as a getter get:M into C.
This allows to cache and optimize method extraction requests as normal method invocations and at hot method extraction sites that significantly decreases overhead of method extraction which previously required two trips into runtime system and was not cached at all.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17261 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 11:54:45 +00:00
regis@google.com 912194a756 Fix vm code base so that it can be built for --arch=simarm (no snapshot yet).
Review URL: https://codereview.chromium.org//11956004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17246 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:34:20 +00:00
kmillikin@google.com 0f65888e88 Change the inlining context from an enum to a class.
To support inlining in test contexts, the inlining context needs to have its
dispatched behavior and state.  This change introduces a context class
representing calls inlined for their value or solely for their effects.  The
intermediate array of exits is moved from the graph to the inlining context.
The implementation behavior is otherwise the same as before.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16965 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-11 11:43:48 +00:00
zerny@google.com 79ddbd6638 Set previous pointer to graph entry for initial definitions.
This should be replace with direct pointers to the containing block on all
instructions.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14001 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 09:46:24 +00:00
zerny@google.com 8459bad004 Inlining of calls with optional parameters.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13999 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-24 08:22:11 +00:00
zerny@google.com 500e301a13 Avoid rediscovering blocks on each call to FlowGraph::InlineCall.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13922 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-23 06:11:31 +00:00
srdjan@google.com 62f74c19c9 Revert r13022 (revert inlining of methods with control flow), Review URL: https://codereview.chromium.org//10979078; disable inlining of methods with control-flow so that we do not run out of heap space.
Review URL: https://codereview.chromium.org//11029002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13081 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-01 18:33:13 +00:00
kmillikin@google.com c4e717264d Revert several inlining related changes.
Revert svn revisions r12990, r12991, r12995, and r13000.  Increased inlining
leads to excessive code growth, preventing dart2js to run in checked mode.
The changes will be relanded when we can come up with improved size
thresholds.

R=ngeoffray@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13022 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 13:50:17 +00:00
zerny@google.com 5936a443d6 Instruction size and growth threshold for inlining.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13000 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 10:22:29 +00:00
zerny@google.com 02822c775b Inlining functions with control flow.
Functions containing control flow are now inlined and incrementally extend the graph in SSA form. For the special case of a function with only one exit, we locally update the dominator tree. If multiple exits occur, we currently recompute the dominator tree for the full resulting graph.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12990 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 07:10:06 +00:00
kmillikin@google.com be0492a8a8 Reapply "Initial implementation of sparse conditional constant propagation."
With a fix for compilation on Mac.  GrowableArray is DISALLOW_COPY_AND_ASSIGN,
so we can't create a temporary one to be ignored and have to pass one in to be
ignored.

R=fschneider@google.com,zerny@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12561 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 14:10:14 +00:00
kmillikin@google.com 5e449aea52 Revert "Initial implementation of sparse conditional constant propagation."
Revert due to compilation failures on Mac.

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12552 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 11:04:36 +00:00
kmillikin@google.com ae9efbfab0 Initial implementation of sparse conditional constant propagation.
Use the results of SCC to eliminate unreachable code.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12549 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 10:34:14 +00:00
vegorov@google.com 12bc91b043 Mark phi as producing a smi value if it is dominated by SmiChecks over its operands.
R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12273 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 17:38:23 +00:00
kmillikin@google.com b78bd3584e Inline monomorphic calls.
Also add inlining support for more instructions that can not deoptimize.

Original changelist: http://codereview.chromium.org/10913010/

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12244 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-12 08:25:24 +00:00
srdjan@google.com 5a2b8258c1 Use CHA to eliminate checks for calls on receiver of caller: check that there can be only one target.
Review URL: https://chromiumcodereview.appspot.com//10918142

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12109 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-10 11:54:43 +00:00
regis@google.com 7cc84c2892 Implement new optional parameters syntax in the vm (issue 4290).
Provide --reject_named_argument_as_positional flag to ease transition to new
syntax (default is false).
Add tests.
Review URL: https://chromiumcodereview.appspot.com//10910119

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12004 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 01:13:27 +00:00
fschneider@google.com 725fe7b2d8 Implement loop invariant code motion for check instructions.
This CL adds a new optimization pass that hoist loop invariant
instructions upwards out of loops.

I'm adding a deoptimzation point at every Goto so that we
can move deoptimizing instructions like checks out of loops.
As a result there may be multiple deoptimization descriptors
with the same PC. The corresponding assert are removed.
Review URL: https://chromiumcodereview.appspot.com//10909094

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11946 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 13:21:20 +00:00
kmillikin@google.com 0750c472dc Reapply "Remove classes Computation and BindInstr."
Reapply svn revision 11868 with a bugfix.

Original code review at http://codereview.chromium.org/10908091/

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11890 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 17:04:49 +00:00
kmillikin@google.com 7e36720fa8 Revert "Remove classes Computation and BindInstr."
This reverts svn revision 11868.

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11869 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 11:20:14 +00:00
kmillikin@google.com bd84c7ee22 Remove classes Computation and BindInstr.
The former Computation classes are folded into the Instruction class
hierarchy.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11868 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 11:15:34 +00:00
zerny@google.com b859298d3f Reapply "Inlining of static calls with trivial function bodies."
Reapply r11579 with a bug fix.
Original review at https://chromiumcodereview.appspot.com/10919004

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11586 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 08:54:56 +00:00
zerny@google.com 9a6da424e6 Revert "Inlining of static calls with trivial function bodies."
This reverts r11579. Reverted due to test failures on dartc builders.

TBR=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11583 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 08:17:54 +00:00
zerny@google.com 15ff4e19c8 Inlining of static calls with trivial function bodies.
R=kmillikin@google.com,srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11579 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 07:35:16 +00:00
zerny@google.com 8e78defe50 Validate well-formedness of the use lists in debug mode.
R=fschneider@google.com,kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11379 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-27 12:17:47 +00:00
vegorov@google.com 264c4f6d1a Add support for XMM registers in SSA code generation pipeline.
Split BinaryDoubleOp into several instructions that manipulate unboxed doubles.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11313 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 14:45:42 +00:00
fschneider@google.com 323e06222e Reland "Add a simple dominator based redundancy elimination" and fix a register allocation bug.
Original CL: http://codereview.chromium.org/10872035/

It enables elimination of redundant expressions across
basic blocks.

Currently used for smi checks and class checks, but will
be extended to other expressions in a separate CL.


Additionally, this fixes a bug in the register allocator where
a blocked register was illegally assigned to an unallocated live range.

It also fixes a Mac compiler issue with the constructor of
DirectChainedHashMap.
Review URL: https://chromiumcodereview.appspot.com//10871060

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11302 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 11:10:36 +00:00
zerny@google.com 50b114c606 Compute the def-use list on-demand by walking the dominator tree.
This replaces the previous implementation that maintained the def-use lists.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11241 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 16:23:05 +00:00
fschneider@google.com 212c5a4994 Revert my last change r11227.
TBR=kmillikin@google.com
Review URL: https://chromiumcodereview.appspot.com//10871040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11229 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 13:39:24 +00:00
fschneider@google.com cd606f44f0 Add a simple dominator based redundancy elimination.
It enables elimination of redundant expressions across
basic blocks.

Currently used for smi checks and class checks, but will
be extended to other expressions in a separate CL.
Review URL: https://chromiumcodereview.appspot.com//10872035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11227 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 13:17:16 +00:00
zerny@google.com 798b5652a8 Replaced Value by Definition in the renaming environment.
Needed so the SSA renaming environment does not contribute uses in the use list.

R=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10894 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-17 13:06:08 +00:00
zerny@google.com 5cc78d2a33 Refactored FlowGraphBuilder into a separate FlowGraph representation.
R=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10807 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 12:06:17 +00:00