Commit Graph

65 Commits

Author SHA1 Message Date
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
srdjan@google.com 2c6d0181e1 Fix performance regression introduced by new equality semantic: we do not collect ICData when comparing with NULL. For now recognize left/right inputs as being null constant and convert the equality tests to strict-equality. There is still a problem if one of the equality arguments is always null but not a constant.
Review URL: https://chromiumcodereview.appspot.com//10861017

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11001 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-20 21:14:37 +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
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
vegorov@google.com 181be0165b Rename is_call to always_calls and contains_call to can_call.
R=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10735 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 14:26:39 +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
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
vegorov@google.com fe291bf0fa Implement basic support for deferred slow path code with calls that save and restore live registers.
Use it to avoid spilling over stack-checks.

R=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10639 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 12:47:42 +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 4000bbad60 Eliminate condition type check when possible.
Review URL: https://chromiumcodereview.appspot.com//10832277

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10610 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 22:31:07 +00:00
regis@google.com fdfcde6046 In checked mode, make sure the ssa compiler propagates the checked types of
incoming arguments.
Propagate the type of the receiver and of the constructor phase argument.
Review URL: https://chromiumcodereview.appspot.com//10855134

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10605 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-13 21:09:28 +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
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
asiva@google.com d4d781d636 - Unify class ids and snapshot object ids list so that we don't have disparate
and sometimes confusing values.
- Remove instance_kind_ field from RawClass.
- Rename all class id names to have a Cid suffix.
- Remove code from object.h and object_store.h which dealt with object ids
  of predefined classes for snapshots.
Review URL: https://chromiumcodereview.appspot.com//10827209

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10418 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 19:46:23 +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 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 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
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
srdjan@google.com efbc8a83f3 Fix issue 4182: When inlining StringBase_get_length, we cannot assume that all receivers where subclasses of StringBase since we are running in production mode.
Review URL: https://chromiumcodereview.appspot.com//10795076

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9829 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-23 21:43:43 +00:00
srdjan@google.com 9df3e4deaa Add higher-level accesses to Environment. Print flow graph after register allocation. Most interesting with --print-flags --print-environments
Review URL: https://chromiumcodereview.appspot.com//10800080

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9826 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-23 20:29:51 +00:00
srdjan@google.com 2016081f87 Fuse compare with branch at graph building time.
Review URL: https://chromiumcodereview.appspot.com//10802025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9762 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-19 15:52:44 +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 00c3067049 Fix problem of excessive attempts to optimize, fix excessive deoptimizations for load/store indexed, performance issue with non-inlineable instance setter (direct call instead of IC call). Add tracing of issues encountered when attepting to optimize a method (--trace_failed_optimization_attempts), rename flag --print_stacktrace_at_throw.
Review URL: https://chromiumcodereview.appspot.com//10704210

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9680 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-16 20:55:09 +00:00
srdjan@google.com f5b544c948 Equality compare should record two arguments in IC data. Inline double equality comparison.
Review URL: https://chromiumcodereview.appspot.com//10702195

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9644 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-13 20:17:42 +00:00
vegorov@google.com 1bd5a9b414 Skeleton of a linear scan register allocator.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9563 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 18:52:17 +00:00
vegorov@google.com 1ae72fbd8b Change comparison-to-branch fusion to actually remove comparison from the graph.
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9556 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 17:41:54 +00:00
kmillikin@google.com ac0025ebd3 Use the instruction iterator rather than an explicit loop in more places.
R=vegorov@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9467 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 12:58:36 +00:00
kmillikin@google.com 6bd463ee85 Rename the successor field of instruction to next.
Renaming only change to use a name parallel to 'previous'.

R=vegorov@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9464 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-09 11:38:29 +00:00
kmillikin@google.com 0b1f1323cd Remove the instruction pointer from computations.
Remove the back pointers from computations to instructions in favor of
passing the instruction explicitly when needed.

R=fschneider@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9435 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-06 11:10:53 +00:00
kmillikin@google.com 5f541253ad Eliminate the type distinction between BindInstr and DoInstr.
Represent the distinction between computations whose value is used and
computations whose value is unused with a data member (instead of a
separate type).

R=fschneider@google.com,srdjan@google.com
BUG=
TEST=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9416 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-05 10:06:28 +00:00
fschneider@google.com eba7136e7b Make IL instructions a doubly-linked list within basic blocks.
In order to be able to efficiently iterate backwards over instructions
and removing or replacing instructions in the graph we want them to
be a double-linked list inside basic blocks. The list has the following

1. Block entry instructions do not have a previous instruction.
2. The last instruction in a block may or may not have a next instruction:
   - Branches have a NULL-successor.
   - Normal block exits have a block entry instructions as successor.

This CL also makes the accessor for previous and next instruction in this
list non-virtual. This avoidis the current code duplication there.
Review URL: https://chromiumcodereview.appspot.com//10665022

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9297 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-02 16:08:58 +00:00
srdjan@google.com a799978f11 Recognize leaf functions: skip stack check and populating the pc slot, store the pc slot lazily in case of deoptimization.
Review URL: https://chromiumcodereview.appspot.com//10668034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9095 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-25 23:50:37 +00:00
srdjan@google.com f7a999dc34 Do not issue Mint/Smi code sequence if we have only Smi/Smi comnbination.
Review URL: https://chromiumcodereview.appspot.com//10642026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9044 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-22 21:07:03 +00:00
srdjan@google.com 8ee92c41d6 Fixed a typo, one more reason to get rid of StrictCompare vs StrictCompareComp distinction.
Review URL: https://chromiumcodereview.appspot.com//10634032

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9039 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-22 18:28:16 +00:00
regis@google.com df25e13d4c Improve inlining of bit_and operation for Mint and Smi in new compilers.
Review URL: https://chromiumcodereview.appspot.com//10592028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8998 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-21 19:37:15 +00:00
srdjan@google.com 5f509dc665 Removing more IC calls in optimized code.
Review URL: https://chromiumcodereview.appspot.com//10572050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8950 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-20 23:19:02 +00:00
srdjan@google.com 3b0fd96a70 Fuse Comparison->BooleanNegate->Branch.
Review URL: https://chromiumcodereview.appspot.com//10559072

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8914 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-20 16:25:11 +00:00
srdjan@google.com 60fa0b27ca More ICData cleanups: try to use ICData instead of converting it to another intermediate representation. This sets the stage for more & simpler optimizations based on collected type feedback.
Review URL: https://chromiumcodereview.appspot.com//10594002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8877 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-19 21:49:11 +00:00
srdjan@google.com 7f8cbb12b7 This is https://chromiumcodereview.appspot.com/10581006/ that I forgot to submit, and messed up the original accidentally. Submitting as TBR
Review URL: https://chromiumcodereview.appspot.com//10580024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8871 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-19 21:19:00 +00:00
regis@google.com 030a798c9f Inline binary And operation for Mint and Smi in new compilers.
Review URL: https://chromiumcodereview.appspot.com//10553040

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8825 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-18 21:55:52 +00:00
regis@google.com 7527d97cf5 Inline Math.sqrt in new compilers.
Review URL: https://chromiumcodereview.appspot.com//10542167

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8702 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-15 00:56:25 +00:00
srdjan@google.com f26f243476 Improve equality operation (inline, direct calls).
Review URL: https://chromiumcodereview.appspot.com//10545186

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8700 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-15 00:40:58 +00:00
srdjan@google.com 70bc9aa213 Add token kind into InstanceCallComp so that we do not need to extract it from name (addresses vego…
Review URL: https://chromiumcodereview.appspot.com//10536162

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@8675 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-14 17:41:54 +00:00