vegorov@google.com
7a6cdd92c7
Remove support for non-ssa optimizing code generation.
...
This kills FrameRegisterAllocator and related code.
BUG=
Review URL: https://chromiumcodereview.appspot.com//10832411
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11045 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 13:58: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
fschneider@google.com
33efb39372
Fix a bug in Equals for UseVal and ConstantVal.
...
TEST=vm/intermediate_language_test.cc
Review URL: https://chromiumcodereview.appspot.com//10828414
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11037 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 13:07:40 +00:00
zerny@google.com
a6cf1d04ab
Fixed typos: defintion to definition.
...
TBR=srdjan@google.com
Review URL: https://chromiumcodereview.appspot.com//10836353
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11013 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-21 07:33:25 +00:00
srdjan@google.com
04448b17eb
Fix queries for Dart's clas Obbject cid: get object class from object store and get its cid. This is temproary solution, Siva is working on a permanent one.
...
Review URL: https://chromiumcodereview.appspot.com//10824392
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11007 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-20 23:46:21 +00:00
fschneider@google.com
253c3f8499
Implement class id checks as a separate instruction and add a local CSE optimization pass.
...
This CL contains:
A new CheckClassComp instruction. Currently it is used only for instance loads:
(LoadInstanceFieldComp)
A pass LocalCSE that performs block-local common subexpression elimination. To identify
redundant expressions I use a hash map per basic block. Computations that do not have
side effects can participate in CSE. For now, I only enabled it for CheckClass.
Any computation that participates in CSE must implement the AttributesEqual function.
Other smaller fixes:
Places where we can pass the correct initial size for GrowableArrays
that have a known size. We should consider having a FixedLengthArray for this purpose.
Made the accessors ic_data() and set_ic_data() use a const ICData*.
Review URL: https://chromiumcodereview.appspot.com//10824349
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10948 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-20 12:40:14 +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
srdjan@google.com
b6d1804071
Reenable elimination of strict equals when right side is true.
...
Reenable some Smi check eliminations. Soon Florian will factor out class checks into own instruction where the elimination will be moved.
Implement more ResultCid()-s, removed TODO to make it asbtract because almost all computations return kDynamicCid.
Review URL: https://chromiumcodereview.appspot.com//10827387
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10865 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 22:22:57 +00:00
srdjan@google.com
564e747c2b
Propagate class ids using existing type propagation framework.
...
Review URL: https://chromiumcodereview.appspot.com//10830339
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10849 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 17:39:37 +00:00
zerny@google.com
6ed5884c44
RemoveFromGraph on definitions asserts empty use lists.
...
R=fschneider@google.com ,kmillikin@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10855101
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10822 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 14:08:45 +00:00
regis@google.com
4bc16ae3f7
Cleanup handling of NullType in type propagation.
...
Remove AssertAssignable type checks from graph (when possible), rather than just
marking them as eliminated.
Review URL: https://chromiumcodereview.appspot.com//10828319
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10782 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 23:49:12 +00:00
fschneider@google.com
c9e6717757
Split ToDouble into two IL instruction to make it work with SSA.
...
This CL removes the bailout from SSA on smi-to-double conversions.
The smi-to-double conversion is implemented as a call and requires
its operand pushed, the double-to-double conversion has normal input
operands.
Review URL: https://chromiumcodereview.appspot.com//10834311
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10710 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 11:31:51 +00:00
srdjan@google.com
3a723f2663
Disable using CompileType for class check elimination.
...
Review URL: https://chromiumcodereview.appspot.com//10828318
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10694 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 00:16:58 +00:00
srdjan@google.com
820aa24ab6
Added Smi, Mint and Double types to object store.
...
Review URL: https://chromiumcodereview.appspot.com//10823324
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10687 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 22:54:53 +00:00
fschneider@google.com
2b3ea645f3
Fix crash bug when replacing a definition with a definition that has no uses.
...
TEST=vm/intermediate_language_test.cc
Review URL: https://chromiumcodereview.appspot.com//10826299
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10630 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 11:18:48 +00:00
kmillikin@google.com
172ee045f3
Build and use stack maps in the SSA compiler.
...
Add a stack bitmap to the location summaries for calls that are GC
safepoints. The bitmap covers the spill slots. The register
allocator collects these bitmaps into a list and then marks live
pointer values during register allocation. When emitting code for a
call, a heap-allocated stackmap is built.
BUG=
Review URL: https://chromiumcodereview.appspot.com//10831261
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10618 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 06:59:24 +00:00
iposva@google.com
99d563982c
- Support for patching of class methods and fields.
...
Review URL: https://chromiumcodereview.appspot.com//10827288
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10616 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 00:38:01 +00:00
srdjan@google.com
8299db1ff0
Optimize equality for case when all targets are Object.equals.
...
Also fixes a couple of issues with https://chromiumcodereview.appspot.com/10830275/
Review URL: https://chromiumcodereview.appspot.com//10826285
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10615 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 23:44:07 +00:00
regis@google.com
52f08eda1e
Missed file in previous change.
...
Review URL: https://chromiumcodereview.appspot.com//10832279
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10611 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 22:37:22 +00:00
regis@google.com
0027c42749
Cache the first evaluation of the compile time type of a definition as the
...
initial propagated type in order to prevent repeated evaluation.
Review URL: https://chromiumcodereview.appspot.com//10823279
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10587 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 16:56:10 +00:00
fschneider@google.com
94fa6055ab
Optimize expressions of the form (expr === true) when expr has boolean type.
...
This allows us to generate better code for many short-circuit
expressions like a || b, a && b if we can statically determine the type
of the subexpressions.
Also: Avoid disassembling optimized functions twice with --disassemble --disassemble-optimized.
Review URL: https://chromiumcodereview.appspot.com//10830275
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10568 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 13:10:00 +00:00
srdjan@google.com
6456518776
Use type propagation for removing Smi checks in binary operations and comparisons. Regis will adapt type propagation to collect/propagate class ids and merge them into sets (arrays).
...
Added printing for propagated types and parameter instructions.
Review URL: https://chromiumcodereview.appspot.com//10823278
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10545 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-11 00:09:12 +00:00
vegorov@google.com
1cf5cc74aa
Put PushArgument into the environment instead of raw values.
...
This allows to shorten live ranges and avoid spilling when PushArgument is the last real use of the value.
BUG=
Review URL: https://chromiumcodereview.appspot.com//10825282
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10508 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 14:28:02 +00:00
zerny@google.com
24771817a2
Added def-use chain to the intermediate language.
...
R=fschneider@google.com ,kmillikin@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10826230
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10497 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 12:35:59 +00:00
regis@google.com
f1bdaf504a
Retrying r10475 (now with null check):
...
Continue work on type propagation in optimizing compiler (still WIP).
Propagated types are cached in ssa definition nodes.
Type propagation iterates until fix point is reached.
Type checks are marked as eliminated when possible.
Review URL: https://chromiumcodereview.appspot.com//10854084
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10478 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 01:26:13 +00:00
regis@google.com
7e27be6b90
Revert r10475.
...
Review URL: https://chromiumcodereview.appspot.com//10831252
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10476 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 00:39:42 +00:00
regis@google.com
28bd435419
Continue work on type propagation in optimizing compiler (still WIP).
...
Propagated types are cached in ssa definition nodes.
Type propagation iterates until fix point is reached.
Type checks are marked as eliminated when possible.
Review URL: https://chromiumcodereview.appspot.com//10829270
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10475 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 00:07:21 +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
srdjan@google.com
32d5673c05
Move deopt reason into PcDescriptor so the EAX/RAX register is not destroyed. Some cleanups in PC descriptor.
...
Review URL: https://chromiumcodereview.appspot.com//10832214
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10424 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 22:15:38 +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
4a24120c8d
Move all register allocator environment initialization into class Environment.
...
Move the register constraints and initial live ranges of environment values
out of the register allocator and into the environment class.
R=vegorov@google.com ,srdjan@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10826184
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10342 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 15:53:02 +00:00
fschneider@google.com
99e28aacb6
Refactor Instruction classes to use a template base class.
...
This change makes instructions and computations more uniform.
Also make CreateArrayComp take a register input operand. This
is done by changing the convenience DECLARE_COMPUTATION macro accordingly and use
TemplateComputation as base class for call-instructions.
Review URL: https://chromiumcodereview.appspot.com//10831178
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10330 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 10:34:39 +00:00
regis@google.com
6f5281c404
Get rid of ast node ids.
...
Rename cid to deopt_id.
Review URL: https://chromiumcodereview.appspot.com//10832150
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10306 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 20:24:03 +00:00
fschneider@google.com
e2c7f2449d
Make CreateArrayComp a call by using explicit push-argument instructions.
...
This enables SSA compilation of functions containing CreateArray. Currently,
we don't support call-instructions that have pushed arguments and also take
input operands in registers. This will be done in a separate CL.
Review URL: https://chromiumcodereview.appspot.com//10831176
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10284 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 11:38:45 +00:00
fschneider@google.com
f7963998a8
Simplify BlockEntryInstr::DiscoverBlocks a bit.
...
We can remove the case of blocks containing a single instruction because
every basic block is now terminated with a Goto or Branch (except for the graph
entry, which is handled specially).
Review URL: https://chromiumcodereview.appspot.com//10825198
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10281 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 10:43:47 +00:00
fschneider@google.com
442b981575
Replace InstanceSetterComp instruction with a plain instance call.
...
After my last change to InstanceSetterComp we do not need a separate
IL instruction for it anymore.
Review URL: https://chromiumcodereview.appspot.com//10829164
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10278 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 08:55:13 +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
fschneider@google.com
3c5c1dc4bd
Separate double binary operation into a separate instruction class.
...
Double operation are currently implemented as calls, so they need
arguments pushed on the stack. Smi and Mint operations are not calls,
so they are handled with the same instruction as before.
Review URL: https://chromiumcodereview.appspot.com//10850014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10178 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 16:26:46 +00:00
fschneider@google.com
e5bd4af606
Support Throw and ReThrow in SSA-based compiler.
...
This change makes them call-instructions using explicit push-arguments.
Review URL: https://chromiumcodereview.appspot.com//10829141
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10176 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-02 15:54:42 +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
regis@google.com
ba83d02f9e
Add type propagation phase in optimizing compiler (work in progress).
...
Remove unused cid field from Instruction node and add it to nodes subclassing
Instruction that need it: BranchInstr, ReturnInstr, ThrowInstr, ReThrowInstr.
Remove unused icdata field from Instruction node and add it to BranchInstr.
Review URL: https://chromiumcodereview.appspot.com//10830109
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10125 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-01 17:15:55 +00:00
vegorov@google.com
45e3affbb3
Ensure that we never try to split range at its end position.
...
Move parallel moves corresponding to gotos and block entries into this intructions to separate them from normal parallel moves that are used data flow inside basic blocks.
Block fixed locations only from instruction's start to instruction end (not to the start of the next instruction).
R=fschneider@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10821108
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10065 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 16:28:09 +00:00
kmillikin@google.com
25ac913c69
Remove the default contains_call parameter on location summaries.
...
The plan is to use this parameter to make finer distinctions between
calls (e.g., safepoint vs. non-safepoint). It's a bit safer to eliminate
the default.
R=vegorov@google.com
BUG=
Review URL: https://chromiumcodereview.appspot.com//10843006
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10052 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-31 11:51:47 +00:00
fschneider@google.com
8203892ada
Refactor building arguments for InstanceCall and fix deoptimization environment for pushed arguments.
...
This CL enables SSA compilation of functions containing InstanceCallComp computations.
It also contains a bug fix to correctly simulate the deoptimization environment for argument
expressions.
Review URL: https://chromiumcodereview.appspot.com//10833068
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10011 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-30 13:26:31 +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
regis@google.com
8fe3e69e37
Improve static type propagation.
...
Review URL: https://chromiumcodereview.appspot.com//10823022
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9943 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-26 16:04:36 +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
fschneider@google.com
ac0dd6c295
Add a backward instruction iterator and use it in the liveness analysis.
...
This avoids the complication when collecting the initial live_in sets while iterating forward.
Also simplify the ForwardInstructionIterator class because we have Goto instructions now and
the last instruction of each block does not use the next-link to
indicate a fall-through anymore.
Review URL: https://chromiumcodereview.appspot.com//10796108
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9875 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-25 08:31:50 +00:00
vegorov@google.com
925c9d6128
Adjust location summaries to match expectations of new register allocator.
...
Instructions containing calls can only use fixed registers everything else is blocked and unavailable for allocation.
Insert phi-connecting parallel moves after all instructions were numbered otherwise move gets incorrect position.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10818032
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9856 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-24 17:19:20 +00:00