Commit Graph

366 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
johnmccutchan@google.com 57a245c01d Replace guarded list length field loads with constants
R=fschneider@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27280 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-09 05:48:01 +00:00
srdjan@google.com aa8b03e7d7 For trigonometric functions call to C-libraries: they are faster than x87 operations (3% on Box2D). This also enables quicker trigonometrics on ARM and MIPS. TODO: Make InvokeMathCFunction more flexible so that it can handle both static and instance calls
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27256 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-06 18:14:53 +00:00
fschneider@google.com dff262d761 Remove inlining restriction of calls to the == operator.
This CL is the first step in enabling full inlining of == calls.
Previously, calls to any function with the name "==" were not considered
for inlining because super-calls were not handled correctly. Instead
  of implementing == semantics for super calls in the back-end, the parser
now expands super calls to == into 

let t1 = left, t2 = right {
  (t1 === null  || t2 === null) ? t1 === t2
                                : static_call(super.==, t1, t2)
}

This change removes a bit of platform-specific assembly. Normal instance calls
to == are still translated as before. Expanding those at the AST level would
incur a too high cost in terms of (unoptimized) code size, and also would be
an obstruction for optimizations of equality. The plan is to expand those
only at optimization time if there is an inlineable instance call to ==.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27248 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-06 13:55:24 +00:00
fschneider@google.com e174a4c18e Fix a compiler bug caused by Utils::IsPowerOfTwo treating zero as a power of two.
The IsPowerOfTwo function is used together with ShiftForPowerOfTwo.  Both function
do not work with zero. This caused the optimizing compiler to generate invalid code
for the expression

x ? 0 : 0

where it assumed that if one of the constants is a power-of-two, it can
be computed by (1 << n). We check for 0 in a number of places, but instead
I decided to fix Utils::IsPowerOfTwo itself and remove unnecessary checks
for the zero case.

TEST=tests/language/vm/if_conversion_vm_test.dart, runtime/vm/utils_test.cc
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27033 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 09:28:34 +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
johnmccutchan@google.com 794936d02e Remove LoadFieldInstr with no uses
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26705 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-27 11:22:17 +00:00
kmillikin@google.com 7f81e17d6f Cleanup of deoptimization environment copying functions.
Change the deoptimization environment copying functions so that they
crash rather than safely copying NULL environments.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26634 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 10:56:24 +00:00
johnmccutchan@google.com 6d59f5d25a Fold Box(Unbox(v)) and Unbox(Box(v)) for Float32x4 and Uint32x4
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26480 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 22:22:53 +00:00
srdjan@google.com 03111ecbeb Fix performance regression on Tracer: recognize _doublePow in Math.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26470 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 20:36:08 +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
srdjan@google.com 70983cf599 Add a performance assert that we do not emit a null check for smi class-ids. Instead we should use CheckSmiInstr which does a bit test.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25928 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 16:19:23 +00:00
fschneider@google.com 2793f7ad63 Fix bug with optimized try-catch on ARM/MIPS.
The constant pool pointer must be restored before any parallel
moves at the catch-entry block.

In addition, this CL removes CatchEntryInstr and folds its
functionality into CatchBlockEntryInstr. Until now every catch-block
started with CatchBlockEntryInstr followed by a CatchEntryInstr.

This simplifies a lot of code in the compiler and avoids issues
with allocator-move code inserted between the two instructions.

BUG=https://code.google.com/p/dart/issues/detail?id=12291
TEST=tests/language/try_catch4_test.dart
R=regis@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25918 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-08 08:20:10 +00:00
srdjan@google.com 1b12859a7e Implement IsNullCheck for CheckClassInstr. If input is nullable expected type, then check for null only.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25907 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-07 23:01:43 +00:00
zra@google.com 40394904bb Enables unboxed mints in ia32 javascript int compatability mode.
Also checks range information before emitting checks on x64.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25740 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-02 18:37:20 +00:00
srdjan@google.com 7e313fa96a Recognize Math's min and max function for doubles and inline the operation.
R=regis@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25287 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-22 17:27:45 +00:00
fschneider@google.com aba90e3763 Always try to inline certain core library functions.
Inlining moveNext and get:iterator enables the iterator
object for allocation sinking.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25057 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 16:45:27 +00:00
srdjan@google.com 74c379d01b Equality can be converted to a strict equality with checks. If the number of checks exceeds the threshold (--max_equality_polymorphic_checks=32) use megamorphic dispatch instead.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24592 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-28 16:15:50 +00:00
vegorov@google.com 370a99eda4 Refactor load forwarding pass to use a Place abstraction.
Place describes a location that code can load from or store to.

Start forwarding loads through phis.

Previously load forwarding operated directly on load instructions which complicated certain things e.g. implementation of a hash map had to allow looking up a load instruction by store instruction, forwarding through phis might have required introducing synthetic load instructions to be put into the map.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24426 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-25 18:50:26 +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 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
srdjan@google.com b9b689d20a Split LoadStatic into two instructions: load static field, load value from static field. This allows to canonicalize loads, thus reducing the number of inlined constants. Has large benefit on x64 (DeltaBlue). Note different register allocation spec for ia32, otherwise large regression in DeltaBlue is introduced.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24044 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-14 18:15:49 +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
regis@google.com 8f62a87598 Switch code generation on ARM from softfp ABI to hardfp ABI.
Support leaf float runtime calls in ARM simulator.
Enable previously failing tests.

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23868 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-11 16:47:01 +00:00
zra@google.com cfea7c3c9a Implements checks for 53-bit overflow for x64.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23721 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-06 22:48:20 +00:00
fschneider@google.com 9c386a80df Improve array bounds check elimination for growable lists.
Previously we could not eliminate bounds checks for
growable lists, even though the length is not modified.

This CL removes obsolete restrictions and enables elimination
of checks as long as the length does not change.

This restriction were there originally because the CheckArrayBounds
instruction loaded the length from the array itself. Now, the length-load
and the  actual check are split into separate instructions.
Tracking side-effects for normal loads determines can now determine if
the length-load is invariant.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23688 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-06 14:41:58 +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
kmillikin@google.com 873e6d4494 Do not emit duplicate deoptimization entries for GotoInstr.
This is the uncontroversial part of https://codereview.chromium.org/15741002/

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23213 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-27 11:31:27 +00:00
hausner@google.com 2ec6f419c3 Allow breakpoints on strict equal
The compiler turns equality checks with null into
strict equal comparisons. Make the compiler backend
create a pc descriptor for the runtime call so that
the debugger can break on x == null and x != null.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23153 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 16:26:42 +00:00
fschneider@google.com 063027cf7c Support inlining function containing throw in the optimizer.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23142 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 12:52:44 +00:00
srdjan@google.com 816053cb7c Improve constant propagation for Mint and Smi.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23020 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-22 15:20:55 +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
kmillikin@google.com 4ca50f4f39 A few simple cleanups.
* Remove BlockEntryInstr::PrepareEntry and use EmitNativeCode to emit the
  native code.
* Use Array::element_offset in a few places.
* Comment and identifier fixes.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22924 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-21 09:34:50 +00:00
iposva@google.com 2aeb172512 - Correctly handle negative constant indices when
constant propagation has not eliminated range checks.
- Add test to verify the optimizer does not
  allow negative constant indices when eliminating
  array bounds checks.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22705 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 20:33:04 +00:00
iposva@google.com c4cf519a5b - Canonicalize array bounds checks to avoid deopting when comparing
two constants.
- Add named locations for index and length to make using locs less
  confusing.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22698 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-14 18:39:44 +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 5868a6bffa Use the constant pool for all constants, not just null.
Remove constants from the instruction stream in optimized code at SSA
construction time.  Modify the range analysis pass to analyze values in the
constant pool.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22458 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-07 12:50:37 +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
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
johnmccutchan@google.com d41cdc6d61 Mark Float32x4List as fixed length array.
Review URL: https://codereview.chromium.org//13932038

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21841 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-22 21:35:31 +00:00
vegorov@google.com 1162595313 Convert EqualityCompare to StrictCompare if reciever is either null or guaranteed to have default equality operator.
R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21696 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 19:52:26 +00:00
srdjan@google.com 67cdbd0653 Detect leaf optimized methods and skip stack check overflow test in those, unless it is in a loop (to be able to stop it).
Review URL: https://codereview.chromium.org//14308009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21692 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-18 18:37:24 +00:00
vegorov@google.com 81ecaba321 Re-apply r20377.
Compute local variable liveness before translation to SSA.

Use it to remove dead values from deoptimization environments.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21439 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-15 11:53:50 +00:00
vegorov@google.com 9f3783186f Ensure that all goto instructions have deoptimization target.
R=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21351 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-12 11:19:34 +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 d01002343e Fix checked mode crash when clearing reaching type of a value.
When replacing uses we clear type information that is set by a previous type propagation (e.g. by CheckSmi). This led to unexpected behavior: value guarded by a CheckSmi but not Smi. Adding another type propagation pass before code generation.
Review URL: https://codereview.chromium.org//13125002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20921 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-04 16:13:50 +00:00