Commit Graph

233 Commits

Author SHA1 Message Date
kmillikin@google.com 94ca56a774 Fix a bug in block reordering/block compaction.
The compiler assumes (a) the graph entry is followed in the block order by
its normal entry, and (b) the normal entry block is non-empty.  There is not
necessarily true, so stop assuming it.

BUG=https://code.google.com/p/dart/issues/detail?id=13101
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27377 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-11 12:32:58 +00:00
kmillikin@google.com 1d0cde6f24 Fix the flag --reorder-basic-blocks so it works to disable reordering.
Temporarily set the flag to false by default to avoid a bad interaction
between block reordering and empty block compaction (dartbug.com/13101).

BUG=https://code.google.com/p/dart/issues/detail?id=13101
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27292 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 14:54:45 +00:00
regis@google.com c0036588b9 Move the assertion checking the number of arguments passed to a runtime entry
from the entry to the macro.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26829 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-29 00:08:02 +00:00
kmillikin@google.com 00f20f3ffc Collect edge count profiling data and reorder basic blocks.
In unoptimized code, collect edge counts for all edges.  Use the counts
to reorder basic blocks in optimized code.  Basic blocks are reordered
by using Pettis and Hansen's "Profile Guided Code Positioning" bottom-up
algorithm.

R=fschneider@google.com, regis@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26773 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-28 09:17:07 +00:00
fschneider@google.com ba0f59d1bc Polymorphic inlining for some recognized methods in the optimizing compiler.
The optimizing compiler currently recognizes a certain frequent native methods
like array length or string length and provides an inlined implementation.
Inlining does currently not work for polymorphic call sites of these methods.  
This CL enables also polymorphic inlining in the case of .length getters for
arrays and strings.

1. The method is recognized at flow graph build time. The builder creates
 the body of the method for both compilers (non-optimizing and optimizing).
 Native methods that are not recognized, are translated as before using a NativeCall
 IL instruction.

2. The flow graph inliner handles recognized methods in the same manner as normal methods.
Until now intrinsic and recognized method could not be inlined. This CL enables it.

3. There is no need for an intrinsic assembly implementation because recognized methods
have an IL implementation that does not call into the C++ runtime. I left the intrinsics
in for now, but they can be removed if there is not noticable performance benefit anymore.

4. The inlining heuristics are tweaked in a way that enables more aggressive inlining
of recognized methods: +1 level of inlining depths, call sites of recognized methods are
not counted in the inlining heuristic.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26429 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 12:58:08 +00:00
jacobr@google.com 605b33c1bc fix cpp11 compile errors
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26387 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 20:24:11 +00:00
zra@google.com 5c3c549300 Allows compiler bailout to handle errors of any type.
R=asiva@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25974 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-09 19:51:11 +00:00
zra@google.com 46dd77407f Changes the flag for using far branches from static to volatile.
R=fschneider@google.com, iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25967 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-09 17:23:30 +00:00
zra@google.com fa2ad38a31 Enables per-function far-branches for ARM and MIPS.
R=regis@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25723 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-01 20:51:46 +00:00
fschneider@google.com e6b8a47f6d Disable allocation sinking in the presence of try-catch.
Allocation sinking does not handle the case of optimized try-catch yet.

I added a TODO to support it at a later point.

BUG=https://code.google.com/p/dart/issues/detail?id=11873
TEST=tests/language/try_catch_optimized2_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25146 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-18 14:13:38 +00:00
regis@google.com 191d2673c8 Use proper internal name for implicit static final getters.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25053 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 16:29:59 +00:00
srdjan@google.com f415b31685 Add --deoptimization_counter_inlining_threshold=10 that stops inlining in a method that has reached it.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24519 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 15:26:16 +00:00
srdjan@google.com 47de186e76 Store arguments descriptor in ICData. Remove loading of arguments descriptor at unoptimized call site (the ones using ICData).
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24239 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 16:29:39 +00:00
kmillikin@google.com 665ffe3164 Ensure we perform the same checks for all optimizing compilations.
Ensure that we perform the same checks for on-stack replacement (OSR)
as for normal optimizing compilation.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24132 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-18 11:06:18 +00:00
kmillikin@google.com 3e78b2ad4a Reapply "Initial implementation of on-stack replacement (OSR)."
This reapplies SVN r24024 with a bugfix.

After OSR compilation, restore the pre-OSR code (which might be already
optimized) rather than the unoptimized code (which might have its entry
patched).  When the optimized code entry is patched it is only safe to call
it as a static call, not as an instance call.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24088 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 11:05:15 +00:00
kmillikin@google.com d6f3eccdf2 Revert "Initial implementation of on-stack replacement (OSR)."
This reverts commit 24024.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24025 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:30:53 +00:00
kmillikin@google.com 0b39927d30 Initial implementation of on-stack replacement (OSR).
Add profiling support to select OSR candidates and launch the compiler
for OSR, followed by entry to the function at the OSR entry point.

Implemented only on IA32 and X64.  The initial implementation can be
improved in various ways --- specifically: tuning of profiling
parameters and incorporation of feedback about the actual values seen
at OSR entry.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24024 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 10:10:55 +00:00
fschneider@google.com 3208230580 Revert r23330 and r23136 because of a bug with loop invariant code motion.
This CL temporarily remove deoptimzation history which was put in to prevent
repeated deoptimization caused by loop invariant code motion. It caused
illegal code motion under certain conditions.

BUG=https://code.google.com/p/dart/issues/detail?id=11245
TEST=tests/language/licm3_test.dart

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23989 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 15:52:33 +00:00
fschneider@google.com 732163dfcd Make constant propagation to fold x == x and re-run type propagation for better range analysis.
1. When comparing numbers, or strict-comparing objects, this can be folded into
true/false.  Since this often occurs after inlining and store-to-load forwarding,
constant propagation is repeated after these phases. The pattern looks like:

o.x = o.y;
if (o.x == o.y) { ... }

2. Load elimination may introduce new phis that may have smi-type. In order to
get range information for these phis, I added a second phase of type propagation after
load elimination.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23901 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-12 10:27:13 +00:00
vegorov@google.com 59da9de8c7 Ensure that all phis inserted by load optimizer have consistent representation.
Revert r23619.

R=srdjan@google.com
BUG=dart:11048

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23634 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-05 15:37:23 +00:00
fschneider@google.com 07966b62da Fix two bugs in the Dart VM's super-noSuchMethod invocation.
1. The result value of an expression 
"super.someMissingSetter = val" was incorrect in case of a noSuchMethod call.

To fix this I refactored the BuildStaticNoSuchMethod function. It now no longer
creates AST nodes and visits them, because the last argument may be needed saved
as a result value.

2. The evaluation order of "super[e1] = e2" was wrong in case of a noSuchMethod call.

BUG=dart:8917, dart:10965
TEST=tests/language/super_operator_index7_test.dart, tests/language/super_operator_index8_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23553 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-03 17:09:09 +00:00
fschneider@google.com 9a6657cd4d Eliminate temporary locals for some expressions
This CL affects a subset of expressions that use temporary locals: constructor
calls, array literals and and instance getter postfix-ops.

For expressions that are de-sugared in the parser I added LetNode.
It creates a scoped temporary local bound to an initializing expression.

For expressions where we need a temporary local at graph-building time,
I added a helper class TempLocalScope to easily create a single temporary
local in the graph builder since this is a frequently recurring pattern.

This simplifies code in the parser and the graph builder and also fixes a
bug with indexed-super invocation and NoSuchMethod.

BUG=dart:8918
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23401 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 12:19:21 +00:00
srdjan@google.com d1adfc37a3 Fix issue 3874: non-deterministic AST generation caused by exceptions being thrown during parsing (StackOverFlow). Mark functions that throw and exception as non-optimizable.
Fix flow graph printing (optimized vs non-optimized).

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23350 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 13:07:46 +00:00
fschneider@google.com fdcae8a772 Add a helper function for allocation of deoptimization history.
This CL addresses DBC comments from my previous CL (https://codereview.chromium.org/15779006/)

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23330 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-29 09:11:23 +00:00
fschneider@google.com c1a33f3ea6 Add deoptimization history to optimized functions.
Each function that is optimized or inlined into an optimized
functions keeps an array of deoptimization ids.

This history is used to avoid repeated deoptimization caused by
speculative hoisting of check instructions.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23136 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 12:03:40 +00:00
asiva@google.com e33c2d4254 Delay Class parsing until the class is actually used.
Prior to this change the initial heap sizes were as follows:
ia32:
Size of isolate snapshot = 1230921
New space (0k of 32768k) Old space (1446k of 1604k)

X64:
Size of isolate snapshot = 1223943
New space (0k of 32768k) Old space (2630k of 2692k)


After this change the initial heap sizes are as follows:
ia32:
Size of isolate snapshot = 686443
New space (0k of 32768k) Old space (677k of 836k)

X64:
Size of isolate snapshot = 684731
New space (0k of 32768k) Old space (1220k of 1412k)

R=hausner@google.com, iposva@google.com, regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23115 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 00:13:10 +00:00
kmillikin@google.com 1248115680 Remove the IC data array from the isolate.
Thread it as an argument rather than storing it in a global variable.  This
means the programmer does not have to implement a shadow stack to save and
restore the data array, and there is no special handling needed for GC.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22982 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-22 06:21:57 +00:00
fschneider@google.com 8ad125f607 Optimize functions containing try-catch.
This is a first step towards fully optimizing try-catch-finally.

At a catch entry, all local variables and parameters are
expected at a fixed stack location. There is a list of
initial definitions at the catch entry block, similar to
the initial definitions at graph entry.

Inside every try-block there is a special prologue code before each
call (instruction that may throw) inside the try-block. This prologue
is similar to a parallel move instruction: It moves all locals+parameters
to the locations expected by the catch-entry block. The stack frame
is extended with the corresponding number of fixed slots right below
the normal spill slots.

Every function containing try-catch has additional compiler-
generated local variables to pass the context, the exception and
the stack trace.

Variable liveness analysis is adapted to treat locals inside try{} blocks
specially: Every call has an implicit LoadLocal of every local variable.
This CL uses a safe approximiation of liveness which can be optimized further.

Current restrictions which are planned for future CLs:
 * No inlining inside try-blocks.
 * No inlining of functions containing try-catch.
 * No try-finally yet.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22615 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-13 10:33:24 +00:00
vegorov@google.com 2565ca222f Implement a variation of scalar replacement for non-escaping allocations.
AllocationSinking pass discovers non-escaping allocations that have no input uses other than uses in the stores into its own fields.

Every environment use of such allocation is replaced by a state snapshot (MaterializeObject instruction) that describes the state of each initialized field in the object. State snapshots are computed through an additional round of load-forwarding.

Once snapshots are computed allocations are removed from the graph.

MaterializeObject instructions are not compiled into native code but produce deoptimization instructions instead that describe how object should be materialized at deoptimization.

Deoptimization instructions now follow the following format:

[mat obj #1]...[mat obj #N][ret addr][... mat arguments ...][... real frames ...]

- the prefix describes each object to materialize on deopt via kMaterializeObject instruction;
- actual values that are needed for materialization are emited as a part of bottom-most stack frame. This is done to simplify implementation: they need to be discoverable by a GC during materialization phase. At the end of deoptimization they will be removed from the stack;
- normal stack slots can refer to materialized objects via kMaterializedObjectRef instruction.

Additionally this change contains fixes in load-forwarding that are needed to guarantee that all artificial LoadField instructions inserted during AllocationSinking are correctly replaced with actual values.

Limitations of the current implementation:

- can't eliminate allocations that flow into phis but otherwise don't actually escape;
- can't sink allocations out of loops;
- allocation with type arguments are not handled.

R=regis@google.com, srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22485 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 23:40:42 +00:00
kmillikin@google.com 7e31a88a0a Initial support for polymorphic inlining.
Consider each polymorphic variant separately for inlining in frequency
order.  Share inlined bodies for shared targets.

Insert an SSA redefinition of the receiver in each inlined variant to
prevent hoisting.  Hoisting code specialized to the receiver (e.g.,
direct access to internal fields of typed data arrays) out of the
inlined body is not safe.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22434 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-06 17:22:18 +00:00
vegorov@google.com f005802733 Improve load forwarding:
- stores/loads that access different fields can't alias each other;
- if result of the AllocateObject does not escape then stores/loads to it does not alias stores/loads to other objects.

Other:
- rename LoadFieldInstr's value to instance to better convey meaning and match StoreInstanceFieldInstr;
- slightly bump inlining_size_threshold;
- canonicalize UnboxDouble(BoxDouble(v)) and BoxDouble(UnboxDouble(v)) patterns;

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22340 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-02 21:20:49 +00:00
hausner@google.com d852cd37c4 Another fix for debugging stack traces and captured variables.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22196 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 19:46:07 +00:00
vegorov@google.com 34d41f9c80 Track side-effect free paths in the graph to allow CSE and LICM for instructions that depend on some side-effects.
Right now only a single side-effect is important for CSE/LICM purposes: externalization.

But abstractions are in place to introduce others if needed.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22180 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 14:25:16 +00:00
srdjan@google.com 155dd046c5 Run constant propagation one more time after canonicalization so that following code can always return true:
foo() {
  var a = new List(0);
  return a.isEmpty();
}

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21489 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 18:06:23 +00:00
vegorov@google.com 11edd87390 Convert diamond shaped control flow into a single conditional instruction.
Adds a IfConverter pass that right now recognizes two simple patterns cond ? 0 : 2^n and cond ? x : x+-1 that can be generated without branches on ia32 and x64 using setcc instruction.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21207 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-10 15:09:46 +00:00
srdjan@google.com cbe8bd9a3a Restore r20998 with a bug fix: add field to guarded_fields_ when it contains relevant cid. Was missing most cases and did not check for unique adds.
Review URL: https://codereview.chromium.org//13726023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21008 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 23:26:53 +00:00
srdjan@google.com e7f1ae5383 Revert r20998.
Review URL: https://codereview.chromium.org//13739002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21001 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 21:44:17 +00:00
srdjan@google.com 44938de19c Fix guarded_cid handling: add field to list of guarded_field at LoadField creation time.
Review URL: https://codereview.chromium.org//13529021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20998 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-05 21:01:30 +00:00
fschneider@google.com 5e0ac1419e Use range analysis to improve constant propagation.
This CL runs a second round of constant propagation after range
analysis to eliminate additional unreachable code. Range analysis
is changed to mark branches as constant if the constraints they
generate are unsatisfiable.

The second pass of constant propagation only visits branches and
removes unreachable code, but does not do full constant propagation.

This proves useful when inlining array view operations where the
following pattern occurs:

for (i = 0; i < length; i++) {
  if (i < 0 || i >= length) {
    throw 123;
  }
  foo();
}

In this example the if-statement will be eliminated completely.

Also, fix a bug in range analyis where constraints of already
constrained values were missing.
Review URL: https://codereview.chromium.org//13469013

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20914 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-04 12:42:17 +00:00
vegorov@google.com 535ed8eb25 Revert "Compute local variable liveness before translation to SSA."
Attaching environments to branches on strict comparisons breaks pattern matching in the optimizer and regresses performance.

This reverts commit r20377.

TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20400 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 18:32:17 +00:00
vegorov@google.com 66ecd504f9 Compute local variable liveness before translation to SSA.
Use it to remove dead values from deoptimization environments.

R=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20377 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 12:33:42 +00:00
vegorov@google.com 1c9d22d75c Collect type feedback for fields.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20235 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 20:15:10 +00:00
vegorov@google.com caf1f9ec74 Run type propagation after LICM to ensure correct reaching types for hoisted values.
R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19954 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-13 18:28:07 +00:00
kmillikin@google.com ef0580c26a Implement a branch optimization pass.
Branch optimization pushes some branches that test the value of a phi
to the predecessor blocks.  This can avoid materializing a boolean
object solely for the purposes of branching on its boolean value.

The optimization is performed after inlinining which creates
opportunities, and before constant propagation, because it exposes
opportunities for unreachable code elimination.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19682 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-08 11:14:08 +00:00
srdjan@google.com ba7597afb4 Fix factory name to result cid mapping, run type propagation once more after constant propagation.
Review URL: https://codereview.chromium.org//12374024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19256 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 20:54:15 +00:00
kmillikin@google.com 9ee9cfb78d Remove dead phis as soon as they are discovered.
Previously we removed dead phis late, in the register allocator.  This
change removes them as soon as they are discovered to be dead and packs the
phi array to squeeze out NULLs.  This speeds iteration but doesn't save
space because the phi array is zone-allocated.

The PhiIterator is used everywhere to iterate phis except a few places that
need to know the phi index (e.g., SSA construction, phi elimination).

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19206 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 08:25:58 +00:00
regis@google.com 3b374ead4b Compile and simulate first dart function on arm generated from ast.
Review URL: https://codereview.chromium.org//12335102

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19152 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 17:13:51 +00:00
kmillikin@google.com 45a6441346 Add functions for setting an environment and rebinding a use.
Add functions for setting or clearing an instruction's environment, which
initialize the environment uses.  Add a function for changing a use's
definition.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19036 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-26 11:50:28 +00:00
regis@google.com 163db76189 Hook up simulator (if needed) when calling Dart code.
Merge identical InvokeDynamic and InvokeStatic to InvokeFunction.
Remove redundant argument from InvokeClosure.
Review URL: https://codereview.chromium.org//12315087

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18994 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 19:30:29 +00:00
vegorov@google.com 51c4652bca null value can be the receiver of methods on Object (e.g. hashCode).
Fix wrong assumption in the type propagator that marked the receiver as never nullable.

R=srdjan@google.com
BUG=dart:8739

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18991 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 18:48:49 +00:00