Commit Graph

55 Commits

Author SHA1 Message Date
kmillikin@google.com ab3cbf5796 Change CSE, LICM, and range analysis to preserve use lists.
Change the common subexpression elimination, loop-invariant code
motion, and range analysis passes to maintain use lists.

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18209 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-07 09:42:36 +00:00
kmillikin@google.com 361300cb71 Move recording of definition uses from the value to the definition.
It was weird that this method mutated an object that wasn't even
mentioned in the call.  Also, change Definition::ReplaceUsesWith so that
it appends all at once instead of consing each individual use.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18048 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-04 14:01:35 +00:00
kmillikin@google.com a2436038da Make use lists into doubly-linked lists.
At the cost of a word per use, we gain constant time removal from use
lists.

BUG=
Review URL: https://codereview.chromium.org//12079096

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17924 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-31 16:10:15 +00:00
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
srdjan@google.com 76dffe600c Removed loop depth info tracking at graph build time.
60% compilation speed improvement on pathological case. Improvements for dart2js

The loop depth signal was made unnecessary by the call frequency signal.
Review URL: https://codereview.chromium.org//11975061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17408 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-22 16:15:54 +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
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 5aac823c39 Revert "Remove push arguments and replace constants in FlowGraph::InlineCall."
This reverts r14468 due to test failures.

TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14471 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 14:02:53 +00:00
zerny@google.com 8522885d32 Remove push arguments and replace constants in FlowGraph::InlineCall.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14468 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 13:29:35 +00:00
zerny@google.com 8f5aa24ec9 More inlining flags and tuned heuristics.
The heuristics should be examined further, but these maintain about the same
runtime for the benchmarks while decreasing compile time for dart2js.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14463 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-02 12:26:07 +00:00
iposva@google.com 15114867c7 - GrowableArray::RemoveLast returns the value being removed
to avoid having to call Last() followed by RemoveLast().
Review URL: https://codereview.chromium.org//11348026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14237 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 00:52:21 +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
fschneider@google.com 9797d9caa2 Avoid creating unnecessary environments during SSA renaming.
Only instructions that can deoptimize and Goto-instructions
ever need an environment.
Review URL: https://codereview.chromium.org//11225028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13871 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 13:31:31 +00:00
zerny@google.com 5200dfb8b1 Remove slow assert from VM.
Replaced slow-asserts with verify-compiler and removed vm/assert.h

R=srdjan@google.com
BUG=5720

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13456 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-10 08:03:28 +00:00
zerny@google.com 3ae0b96762 Set previous instruction pointers when building the graph.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13174 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-03 15:05:27 +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
zerny@google.com 792a5cbcee Added slow_assert macro and flag for slow development assertions in the VM.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13069 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-01 14:27:45 +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 ddd377b294 Disable slow debug assertions in use-list verification code.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12995 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 08:34:35 +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 63fa392807 Reapply "A simpler scheme for garbage collection of ureachable phi inputs."
Fix two issues:

* Unreachable code elimination did not correctly identify all unreachable
  blocks.

* Loop detection in the register allocator relied on the block IDs.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12756 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 07:27:36 +00:00
kmillikin@google.com 52af2225e9 Revert "A simpler scheme for garbage collection of ureachable phi inputs."
This reverts svn revision 12621.  It causes unexpected test timouts.

TBR=sgjesse@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12624 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 09:11:44 +00:00
kmillikin@google.com 13ef2a994e A simpler scheme for garbage collection of ureachable phi inputs.
Simplify the garbage collection of unreachable phi inputs.  Assign immutable
block ids to basic blocks and ensure that both predecessor blocks and phi
inputs are kept sorted by block id.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12621 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-20 08:47:57 +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
zerny@google.com 8ca2c4e6e9 Replace start_env with initial_definitions in GraphEntryInstr.
The initial definitions do not have any deoptimization information and can be
represented as just a list of definitions. For easy access, the constant_null
getter remains but assumes that index 0 contains the constant.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12555 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 12:37:57 +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
zerny@google.com aa5281c88a Reapply "Deoptimization support in inlined code."
This reapplies r12488 with a fix.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12499 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 13:41:20 +00:00
zerny@google.com e174be3f27 Revert "Deoptimization support in inlined code."
This reverts commit a78e33f178aae74a97f4231ca98183adf97fda71.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12492 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 12:18:04 +00:00
zerny@google.com 64a9ca2b81 Deoptimization support in inlined code.
Review URL: https://codereview.chromium.org//10928232

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12488 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 11:53:59 +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
kmillikin@google.com 8201f0db6b Introduce nested deoptimization environments.
Add an optional outer deoptimization environment to support inlining.
Introduce a pair of environment iterators.

Original codereview: https://chromiumcodereview.appspot.com/10928048/

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12190 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 12:30:21 +00:00
kmillikin@google.com 1d4790280a Repair flow graph printing after graph refactoring.
Recent refactoring broke flow graph printing (including code comments).
Clean it up.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12014 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 11:05:02 +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 d0f3b89aca Clear use lists for globals and definitions in start environment in release mode.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11613 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 13:28:11 +00:00
kmillikin@google.com ea925449f6 Eliminate class UseVal.
This was the only subclass of Value.  All functionality is moved to the base
class, and all functions are made non-virtual.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11590 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 09:08:27 +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
kmillikin@google.com 58d842d6d7 Make constants computations instead of values.
This change requires a pool of global constants that don't have an easy
place to go in the instruction stream.  Currently, that is only the constant
null used to mark eliminated phis in deoptimization environments.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11518 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 12:56:57 +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
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 855e718f5b Make Value not a subclass of Computation.
Instead I introduce one new computation to materialize constants.

sizeof(UseVal) drops from 64 to 32.
sizeof(ConstantVal) drops from 48 to 16.
Review URL: https://chromiumcodereview.appspot.com//10829451

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11041 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 13:36:36 +00:00