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
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
srdjan@google.com
29e06db609
In unoptimized code use call for instanceof instead of inlined checks. This allows us to collect type feedback and to reduce the code size of unoptimized code. Next will be work on type tests as well.
...
Review URL: https://codereview.chromium.org//11694003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16589 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 22:22:39 +00:00
regis@google.com
cb27634842
Remove NoSuchMethodErrorImplementation class and use NoSuchMethodError from core
...
lib instead.
Review URL: https://codereview.chromium.org//11712002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16583 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 18:52:28 +00:00
tball@google.com
18e748d0b3
Implemented class literals in the VM.
...
Review URL: https://codereview.chromium.org//11633054
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16530 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-27 23:45:40 +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
hausner@google.com
feff694279
More fixes for super[]
...
Extend the LoadIndexedNode to also handle super[] and super[]=
Make sure super []= returns the value.
Handle side effects in index expression correctly.
Defer operator function resolution to the flow graph build phase.
Review URL: https://codereview.chromium.org//11267027
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14157 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-26 22:31:49 +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
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
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
vegorov@google.com
a528a1a3ea
Refactor building of StoreStaticField and StoreLocal to manually preserve value.
...
This is first step towards eliminating manual value preservation in the write barrier's fast-path.
R=fschneider@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10905182
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12124 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-10 16:02:40 +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
vegorov@google.com
28e3a61d5b
Allow test context to have multiple true and false branch slots.
...
Implement special handling for && and || in the test context to eliminate materialization of intermediate boolean values.
R=kmillikin@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10916119
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11932 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 10:13:54 +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
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
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
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
fschneider@google.com
df23e58a2f
Change indexed load and store IL instructions to fit with SSA backend.
...
Generic indexed operations are implemented as normal instance calls. Specialized
operations are inserted by the flow-graph optimizer. This also avoid a lot of duplicated code
in the code generator.
Review URL: https://chromiumcodereview.appspot.com//10836239
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10727 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 13:54:38 +00:00
vegorov@google.com
3a121cc677
Align AllocateObjectComp and AllocateObjectWithBoundsCheckComp with ssa allocator.
...
AllocateObjectComp becomes a call computation with all arguments pushed via PushArgument.
AllocateObjectWithBoundsCheckComp pushes inputs internally.
R=fschneider@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10855053
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10453 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-09 19:34:41 +00:00
vegorov@google.com
b9aa74f3a2
Eliminate phis that do not reach any non-environment uses.
...
This takes care of phis for temporary variables like :expr_temp, lia, lix, igr, casc, alloc, sca that currently create unnecessary pressure on the back-edge of loops.
R=srdjan@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10832180
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10377 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 12:38:21 +00:00
kmillikin@google.com
9ffbf2ffce
Store variable counts in the flow graph builder.
...
Store the constant counts of copied parameters, non-copied parameters, and
(non-parameter) stack locals in the flow graph builder. This saves passing
them around to flow graph member functions.
Change usage of "fixed parameter" to "non-copied parameter" because it is
different than what fixed parameter means in other parts of the system.
R=fschneider@google.com ,zerny@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10855007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10289 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 14:33:23 +00:00
zerny@google.com
c1262fbd49
Reapply "Added support for copied parameters to the SSA compiler."
...
This reapplies svn revision 10172 with a bug fix.
Original Review URL: https://chromiumcodereview.appspot.com//10837076
R=fschneider@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10824177
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10280 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 10:07:26 +00:00
fschneider@google.com
04fa2e3547
Refactor our IL instruction for static setters.
...
We do not need a separate IL instruction anymore. Instead I generate
a normal static call and save the result in a temporary local if it
is needed.
Review URL: https://chromiumcodereview.appspot.com//10825176
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10222 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 11:14:07 +00:00
kmillikin@google.com
0d699e6c15
Revert "Added support for copied parameters to the SSA compiler."
...
This reverts svn revision 10172.
TBR=zerny@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10837076
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10173 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 15:10:13 +00:00
zerny@google.com
41f9e67324
Added support for copied parameters to the SSA compiler.
...
R=fschneider@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10824147
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10172 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 14:53:18 +00:00
fschneider@google.com
362c202998
Use explicit push-argument for InstanceSetter instruction.
...
This allows optimizing functions with InstanceSetter.
Review URL: https://chromiumcodereview.appspot.com//10826097
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10157 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 10:23:29 +00:00
fschneider@google.com
c87efe45fa
Add explicit PushArgument IL instructions to static calls.
...
This enables compiling static calls with the SSA-based code generator.
Add a helper to the graph builder for adding argument expressions to the graph.
Review URL: https://chromiumcodereview.appspot.com//10824078
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10008 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 11:19:42 +00:00
fschneider@google.com
e7853aab37
Add an explicit push-argument instruction to the IL.
...
It is used in ClosureCall and CreateClosure. Refactoring the other call-instruction
will be done in a separate CL.
These instructions do not have their arguments as input operands anymore since they
are really call-arguments passed on the stack.
This allows us to optimize a function with closure calls with SSA. For example:
foo() {
bar() { return 42; }
return bar();
}
Review URL: https://chromiumcodereview.appspot.com//10825035
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9935 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-26 14:10:29 +00:00
vegorov@google.com
c9e8d9594e
Add support for fixed parameters in the register allocator.
...
This remove bailout for functions with non-zero number of non-fixed parameters and increases our coverage.
SpillSlot location was renamed into StackSlot location and now allows to address spill slots (positive stack index) and incoming parameters (negative stack index).
Environment was reordered to match order of values on the stack (previously it was inversed).
Correctly reserve spill slots in the prologue of the code. Previously register allocator was allocating spill slots, but generated code did not reserve any space for them on the stack so they might have been overwritten by calls.
Fix off by one in DeoptimizationStub::GenerateCode - we were reserving one slot too many.
Change --optimization-filter flag to use substring search instead of prefix comparison, this is much more useful when VM prefixes function name with a path to the file.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10828018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9934 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-26 13:21:39 +00:00
srdjan@google.com
26e3afe496
Apply Kevin's suggestions, make branch-compare generation more robust
...
- remove setting previous link during graph building
- do not replace already inserted nodes
Review URL: https://chromiumcodereview.appspot.com//10808035
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9778 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-20 15:20:11 +00:00
kmillikin@google.com
e440d86cb5
Revert "Revert "Introduce Goto instructions to the flow graph.""
...
Reapply svn revision 9731 with a bug fix. The original review is at
http://chromiumcodereview.appspot.com/10735071/
R=vegorov@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10805008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9738 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 13:44:12 +00:00
kmillikin@google.com
a368233743
Revert "Introduce Goto instructions to the flow graph."
...
This reverts svn revision 9731 due to test failures.
TBR=vegorov@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10808008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9733 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 10:44:54 +00:00
kmillikin@google.com
87d743a3c5
Introduce Goto instructions to the flow graph.
...
Goto is a control instruction with a single successor.
Before: basic blocks ended with an exit (return, throw, or rethrow), a
branch to a pair of target entries, or else they fell through to the
next block entry.
Now: basic blocks end with an exit, a branch, or an explicit goto to a
join entry.
R=vegorov@google.com ,srdjan@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10735071
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9731 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-18 10:28:37 +00:00
srdjan@google.com
f680c68a55
Cleanup usage of GrowableArrays in class Environment.
...
Review URL: https://chromiumcodereview.appspot.com//10692140
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9525 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-10 21:06:52 +00:00
srdjan@google.com
e801021a27
Cleanups.
...
Review URL: https://chromiumcodereview.appspot.com//10765007
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9482 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 20:31:25 +00:00
regis@google.com
32c8564b0a
Add --trace_type_check_elimination flag for debugging purposes.
...
Review URL: https://chromiumcodereview.appspot.com//10689099
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9471 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 16:59:15 +00:00
kmillikin@google.com
ca7e5a9972
Fix broken build.
...
TBR=fschneider@google.com
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10703088
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9408 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:48:26 +00:00
kmillikin@google.com
595aafa18e
Simplify adding of computations to the flow graph.
...
In preparation for collapsing BindInstr/DoInstr and flattening
Computations into the Instruction hierarchy.
Add a pair of functions EffectGraphVisitor::Bind and
EffectGraphVisitor::Do for adding computations to the flow graph that
have respectively one and zero uses. This creates a single site where
we construct new BindInstr and a single site where we construct new
DoInstr (also, a single site where we construct new UseVal during flow
graph construction).
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10702092
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9407 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:43:28 +00:00
fschneider@google.com
7de785eaf4
Remove unused code for StringConcatNode from the AST and the graph builder.
...
Review URL: https://chromiumcodereview.appspot.com//10693092
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9405 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-04 13:07:22 +00:00