Commit Graph

169 Commits

Author SHA1 Message Date
fschneider@google.com 6abd6e326e Add mutable double boxes for fields.
This allows the optimizing compiler to generate unboxed loads/stores
to fields containing double values. The double value is stored
in a reusable double object.

Unboxed loads/stores are generated for optimized code. Unoptimized code
allocates a new double on loads. To avoid performance regressions
for fields that are only written few times (e.g. only in the constructor)
I put a heuristic in place that
compares the usage count of setters and getters. Unboxed operations
are only generated if the setter is invoked a significant amount of
times (threshold is 10% of getter invocations).

The CL is so big because it changes the way LocationSummmary
is allocated: We now have a bit to generate different summaries
for optimized and unoptimized code.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31164 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-16 15:11:31 +00:00
fschneider@google.com 8b0b3fde4d Generalize if-conversion to arbitrary smi comparisons.
Until now only == and != comparisons were supported.

Further changes are:
 Remove flag FLAG_new_identity_spec: It is not needed anymore.
 Invoke Canonicalize another time before branch optimizations.
 Fixes support for TestSmiInstr with the branch-simplifier pass.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30622 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-25 12:57:21 +00:00
srdjan@google.com 3165e204e3 Merge TRUNCDIV and MOD into one instruction. Icorporated feedback from CL https://codereview.chromium.org/68663003
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30536 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-21 17:56:54 +00:00
srdjan@google.com f981bda8bd Better printing of MathUnaryInstr.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30430 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-19 23:43:40 +00:00
johnmccutchan@google.com 29c01044bc This is the final breaking change in dart:typed_data needed for Dart 1.0. We need this change because the ECMAScript SIMD specification only includes Int32x4 and Int32x4List and our types must match.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29849 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 21:56:59 +00:00
fschneider@google.com 9031c80c88 Change == into an instance call to allow polymorphic inlining of ==.
In unoptimized code equality is now just another instance call.

The optimizer replaces it with a specialized implementation based on static
 type information and type feedback.

Many of the manual optimizations of == in the optimizer are now just handled
 by the generic inliner, plus polymorphic inlining of == calls is now possible.
This also eliminates the need for a lot of duplicated code in the backend.

I adapted the inlining heuristics to compensate for the slightly larger
inital flow graph size.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29800 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-04 11:32:52 +00:00
johnmccutchan@google.com 5f63715d47 SIMD shuffle API changes
R=srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29723 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-01 07:09:54 +00:00
fschneider@google.com 8779bc8d7f Optimize identical-comparisons based on propagated type information.
If the propagated type allows, eliminate the check for numbers at
identical operations in optimized code.

The previous optimizaton was done before full type propagation was run
and was therefore not very effective.

* Made flow-graph printing having no side-effects: calling Type() lazily
initializes the type_ and reaching_type_ fields of Value and Definition.
Access fields directly when printing instead.

Also, fixed two random spelling mistakes.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28851 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-18 11:13:59 +00:00
fschneider@google.com 0b57a04965 Bug fix in load elimination, constant propagation for LoadClassId.
Handle LoadClassId in constant propagation. This helps with eliminating
unreachable code after polymorphic inlining. It exposed a bug which is
also fixed in this CL.

Redefinitions of values have to be considered for load/store forwarding:
Loads/stores to an object defined by a RedefinitionInstr (inserted by
polymorphic inlining) must be treated properly as loads/stores to the
original object.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28159 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 13:27:55 +00:00
fschneider@google.com 40013fe1c0 Simplify compilation of relational operators.
Instead of having a separate IL instructions relational comparisons
are built as normal instance calls initially. When optimized, we replace
the instance call with a smi/double/mint comparison instruction.

This enables generic inlining of relational operator calls and simplifies
code generation, too.

Merging comparisons with branches is done in the optimizing compiler's
branch simplification phase.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27058 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-03 14:02:53 +00:00
johnmccutchan@google.com 6d11a8fa15 Add signMask getter to Float32x4
R=srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26394 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 21:35:53 +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 266b9cb305 Add double unary operation (negate). This is a replica of the destrpyed CL https://chromiumcodereview.appspot.com/23219002/
Review URL: https://codereview.chromium.org//22999011

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26169 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-14 23:45:13 +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
fschneider@google.com 086b60dada Fix a bug in compilation of try-finally.
When nesting try-finally, the outer finally was incorrectly executed
twice under certain conditions (a return in the inner try-block and a outer
finally-block that ends with throw)

This was because finally-code was inlined at return/break/continue statements
and it was associated with the wrong catch-handler when compiling.

This CL tracks indices of try-blocks in the parser so that each inlined
finally block has the correct catch handler index.

BUG=https://code.google.com/p/dart/issues/detail?id=11972
TEST=test/language/throw8_test.dart
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25767 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-05 13:49:48 +00:00
fschneider@google.com ee0aaf0453 Enable allocation sinking for non-implicit closures.
In optimized code we can eliminate the allocation of closures that are not
escaping and where all calls are inlined.

Closures are currently allocated with a special IL instruction (CreateClosure).
This CL changes this for non-implicit closures and allocates them
like normal objects. The fields for the function and the context are
initialized like instance fields. This way object allocation sinking can
handle closures like any other objects.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25706 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-01 12:03:21 +00:00
johnmccutchan@google.com 10969ab342 Inline two argument shuffle operations on IA32 and X64.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25580 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-29 18:57:35 +00:00
regis@google.com e8a722870b Support type parameters and classes as expression in the vm.
Turn many compile-time errors into runtime errors per latest spec.
Triage affected tests.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24861 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-09 19:35:56 +00:00
iposva@google.com 50fc824be9 - Remove arguments definition test from the VM.
- Update tests still referring to it.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24539 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-27 18:37:53 +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
kmillikin@google.com 1a9f9f691c Scale the OSR optimization threshold by loop nesting depth.
For on-stack replacement (OSR), code quality is better if we optimize at
the outermost hot loop.  Track loop nesting depth and scale the
threshold based on the loop depth to prefer outer loops over inner ones.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24175 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-19 09:21:25 +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
johnmccutchan@google.com cd7c5236a2 Inline Uint32x4 operations
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22649 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-13 20:22:06 +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
johnmccutchan@google.com aa1d4b4062 Inline remaining Float32x4 operations.
BUG=
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22277 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 20:40:24 +00:00
johnmccutchan@google.com 10c4dcba45 Inline Float32x4 min,max,sqrt,reciprocal,reciprocalSqrt, and scale
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22185 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 17:26:42 +00:00
johnmccutchan@google.com 26c86b504e Inline Float32x4 comparison.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22144 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-29 19:17:38 +00:00
johnmccutchan@google.com df712e164e Inline Float32x4 constructors
Review URL: https://codereview.chromium.org//13936009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22055 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 22:03:05 +00:00
johnmccutchan@google.com 08c99e80e6 Inline Float32x4 Getters
Review URL: https://codereview.chromium.org//13872020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21897 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-23 17:52:10 +00:00
johnmccutchan@google.com 252d27c293 Binary Float32x4 ops.
Review URL: https://codereview.chromium.org//13867006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21541 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-16 10:04: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
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
fschneider@google.com 86da5111ad Replace scalarlist optimizations and split external array loads into two IL instructions.
This CL removes optimized access for scalarlist, and only the new TypedData classes
are optimized. I changed the runtime libraries core and math to use typedData
instead of scalarlist (Uint16List is used in StringBuffer, Uint32List by Math.random).

Instead of using LoadIndexed for internal and external arrays,
split external loads into a load of the backing store and a load
of the element.

v3 <- LoadIndexed(v1, index)

becomes

v2 <- LoadUntagged(v1, ExternalTypedData::data_offset)
v3 <- LoadIndexed(v2, index);

For this I introduce two new representations in the IL:

 kUntagged (for values that hold a untagged pointer) and
 
 kNoRepresentation (for instructions accept any input
 representation)

Deoptimization does not need to know about kUntagged
since these values can never occur in the environment.

Also with this change:
* fix COMPILE_ASSERT and use it in one place.
* Cleanup IL printer output of deopt ids.
Review URL: https://codereview.chromium.org//12871010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20198 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-19 12:06:23 +00:00
fschneider@google.com ef6251908c Add a new, separate block entry instruction for catch-blocks.
This is a preparation CL for supporting try-catch in optimized code. Until
now, we used normal TargetEntryInstr for catch blocks.

This meant carrying around handler_types_ and catch_try_index_ for blocks
that are not catch blocks which is not needed.

For now, CatchBlockEntry behaves the same as TargetBlockEntry except for
the additional members needed for catch blocks.
Review URL: https://codereview.chromium.org//12600012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19864 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-12 13:51:32 +00:00
fschneider@google.com c94a722177 Remove unused context-level from LoadLocal/StoreLocal IL instructions.
This is left-over code that is not used anymore.
Review URL: https://codereview.chromium.org//12440015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19789 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-11 13:03:46 +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
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
vegorov@google.com 339c914f2c Ensure that compile time types for comparisons are recomputed once comparison are specialized.
Turn CompileType into a value object instead of zone object. Provide a transparent zone allocated wrapper for CompileType. This simplifies code paths that recompute and update type and reduces number of allocated zone objects.

Split ComputeInitialType into ComputeInitialType and ComputeType.

ComputeType returns values type as a value object. ComputeInitialType returns a pointer and by default it delegates to ComputeType.

This split reflects differences between instructions: majority of them have their own type, but some can return the type of an input which should not be unwrapped and rewrapped again because this will destroy the connection between types.

R=kmillikin@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18895 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-22 16:33:37 +00:00
srdjan@google.com 19995faa3a Recognize pattern (a << b) & c with c being a positive Smi and allow left shift to truncate the result.
Review URL: https://codereview.chromium.org//12218181

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18859 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-21 22:24:42 +00:00
kmillikin@google.com 622efda5fb Convert some compiler passes to preserve valid def-use chains.
Change the ApplyICData, ApplyClassIds, Canonicalize, and
SelectRepresentations passes to preserve valid use lists.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18676 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-19 12:09:01 +00:00
vegorov@google.com baa0347253 Reapply r18377 it was reverted due to the unrelated bug it surfaced.
Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.

Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other

Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18456 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-13 17:16:35 +00:00
vegorov@google.com 487c73e01f Revert "Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields."
This reverts commit r12365.

Reason: failure on vm-mac-debug (debug_ia32 standalone/io/file_fuzz_test).

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18378 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:36:21 +00:00
vegorov@google.com f8d9a90b2c Remove SminessPropagator and FlowGraphTypePropagator and all associated infrastructure and fields.
Replace multiple fields (result_cid_, propagated_cid_, propagated_type_, reaching_cid_) with a single field of type CompileType which represents an element of type analysis lattice and incorporates information about: value's nullability, concrete class id and abstract super type. This ensures that propagated cid and type are always in sync and complement each other

Implement a new FlowGraphPropagator that propagates types over the CompileType-lattice.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18377 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-12 12:06:47 +00:00