Commit Graph

173 Commits

Author SHA1 Message Date
koda@google.com 99127744c6 Add Zone-based handle allocation interface and reduce use of Isolate-based interfaces.
Remove deprecated Isolate-based BitVector constructor.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43136 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-26 14:54:02 +00:00
fschneider@google.com c99e78af72 Reland and fix r42951: Tweaks in the VM's typed_data implementations.
Fixed checked mode failure and correct function fingerprints.

R=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42980 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-19 09:59:45 +00:00
vegorov@google.com 6c597dadbf Revert "Tweaks in the VM's typed_data implementations."
This reverts commit r42951.

Reason: checked mode breakage.

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42952 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-16 12:14:47 +00:00
fschneider@google.com 1f5208e648 Tweaks in the VM's typed_data implementations.
Moving the throw of RangeError out of the _throwRangeError helper
may benefit LICM, since that block is now considered a method exit (and
not part of a enclosing loop).

_throwRangeError was not inlined because the call site was considered
cold by invocation counters (most programs don't throw RangeError).

Also, I renamed some misleading names in the optimizer.

R=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42951 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-16 11:30:49 +00:00
fschneider@google.com dfdb8c12db Refactor and simplify manual inlining in the flow graph optimizer.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42908 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-15 13:58:01 +00:00
fschneider@google.com 009eb5d33c Move ConstantPropagator from flow_graph_optimizer.cc/.h into separate files.
flow_graph_optimizer.cc is becoming unnecessarily large, so
I'm  moving self-contained optimization passes into
separate files.

In a separate CL I'll also move load/store optimization into
separate files.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42567 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-29 14:41:27 +00:00
zerny@google.com 8e807c8550 Integrate the Irregexp Regular Expression Engine.
BUG=http://dartbug.com/19090
R=fschneider@google.com

Committed: https://code.google.com/p/dart/source/detail?r=41949

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41983 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-26 09:32:43 +00:00
zerny@google.com 84a4135901 Revert "Integrate the Irregexp Regular Expression Engine."
This reverts commit https://code.google.com/p/dart/source/detail?r=41949

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41950 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 13:36:40 +00:00
zerny@google.com 43ac0c6f33 Integrate the Irregexp Regular Expression Engine.
BUG=http://dartbug.com/19090
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41949 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-25 13:10:21 +00:00
vegorov@google.com ec802d54b2 When constant folding x == y take reachability of blocks into account.
This allows to constant fold phi(x, ...) == x if a single predecessor is reachable.

R=fschneider@google.com, fscheider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41777 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-17 15:10:40 +00:00
fschneider@google.com b26ff22adf Allocation sinking for contexts.
Improved aliasing computation in presence of Redefinition and AssertAssignable.

Added possibility for inlining annotations via --enable-inlining-annotations flag.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41713 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-13 13:53:58 +00:00
vegorov@google.com d61a330d7c Initial steps towards cleaning up integer arithmetic IR.
Introduce base classes for binary and unary integer operations and move all shared logic (e.g. canonicalization) into these classes.

Start removing special cases dispatch from instructions patterns - it goes into Canonicalization pass.

Start removing duplication between instruction patterns where meaningful and possible.

Cleanup the notion of truncation in the operations: is_truncating implies !can_overflow, not the other way around.

BUG=
R=johnmccutchan@google.com, srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40375 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-17 13:31:13 +00:00
vegorov@google.com 9f9e250e92 Support Int32 representation for selected binary operations.
BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39595 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 14:49:19 +00:00
fschneider@google.com 937726a0aa Improve polymorphic inlining of int/int double/double operations.
I added inlining of the native Double methods _add, _sub, _mul and _div and fromInteger
and unified the method recognition of the MethodRecognizer and the Intrinsifier classes.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39446 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 11:13:44 +00:00
fschneider@google.com 6fe6eb46be VM: Small cleanup in optimizer and intrinsics code.
1. Use macro-assembler instructions for allocation in intrinsics.

2. Refactor two helpers in the optimizer that are almost identical.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39287 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-15 12:52:51 +00:00
fschneider@google.com 36c848d1d7 VM: Optimized context allocation on all platforms.
This change generate inline code for context allocation and makes
the stores to initialize the parent pointer and the context variables
explicit in the optimized flow graph. This allows dead store elimination
to eliminate those stores.

Before, we only had inlined context allocation for ia32.

Furthermore:
* Added an assertion that the exit label of slow-path code
is bound when emitting deferred code. This used to cause random crashes
if forgotten.

* Fixed a bug in allocation stats on ARM.

BUG=dartbug.com/17238
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39202 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 15:49:01 +00:00
fschneider@google.com 54a7410866 Fix bug with CHA dependencies by recording a set of classes for registering code.
CHA is not only used with the receiver class, but also with other classes
when doing type propagation. The optimized code has to be registered with
all classes that are affected by CHA so that deoptimization occurs whenever
the set of subclasses changes for these classes.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39194 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-13 12:43:03 +00:00
vegorov@google.com 77c26187f2 Support allocation sinking for compound objects.
- Improve escape/alias analysis:
-- Storing an object into a field of another object does not mean that this object escapes (or has aliases) as long as that object does not have any loads from the same place;
-- Places like X.f and Y.f don't alias if X and Y are two different allocation instructions even if X and Y themselves potentially have aliases;
-- Improve precision of alias analysis for indexed properties;

- Support dematerialization and rematerialization of objects that are referenced by other dematerialized objects.
-- Use fix-point algorithm to collect candidates for allocation sinking;
-- Support aborting unsuccessful allocation sinking.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38404 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-18 18:35:08 +00:00
johnmccutchan@google.com 2ebd74a740 Add Uint32 representation.
- Add new representation: kUnboxedUint32.
- Add BinaryUint32Op, UnaryUint32Op, ShiftUint32Op instructions.
- Add new optimization pass which replaces Mint instructions with Uint32 instructions when possible.
- IA32 completed.
- ARM completed.

R=fschneider@google.com, vegorov@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38198 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-14 17:01:02 +00:00
vegorov@google.com 55840a70d5 Fix branch optimizations based on range analysis.
ConstantPropagator Analyze method was overwriting reachability so VisitBranches that were supposed to compute reachability based on the results of the range analysis became a no-op.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@38060 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-08 14:33:48 +00:00
johnmccutchan@google.com 3eb3bc3fa9 Extend Range analysis to 64-bit range and mint operations
- Convert many private static functions into public static methods on Range or RangeBoundary classes.
- Simplify ConstraintInstr::InferRange to just use RangeBoundary::Min and RangeBoundary::Max calls.
- Extend RangeBoundary to 64-bits.
- Include mints in RangeAnalysis.
- Introduce generic Range::BinaryOp.
- Require ranges passed to Range::BinaryOp are finite.
- Clamp ranges attached to BinarySmiOpInstr and BinaryMintOpInstr.
- InferRange for BinaryMintOp and UnboxInteger instructions.
- Correctly set mint constant ranges.
- Add many tests.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37521 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-19 21:13:26 +00:00
srdjan@google.com 16282635a1 Use isolate when allocation Zone objects and handles: focus on FlowGraphOptimizer, next inliner.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36587 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-23 21:15:29 +00:00
fschneider@google.com c71d29f6b6 VM: Remove unnecessary field use_kind from IL instructions.
We already store a SSA- or temp-index that indicates if a definition
is used or not. There is no need to have a separate field to store
this information.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36432 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-21 14:26:09 +00:00
fschneider@google.com 927d43caf2 More general dead phi elimination.
This CL adds an explicit pass to eliminate dead phis. Until now, we
only removed redundant phis that occurred after load elimination locally.

Also, constant propagation may result in dead / or redundant phis which
are removed by this phase.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36094 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-13 09:48:46 +00:00
fschneider@google.com 16e03db724 Implement simple dead store elimination.
This optimization is the dual to load elimination. It uses
the same infrastructure for handling aliasing. Since dead
store elimination is a backward data-flow analysis it inherits
from LivenessAnalysis.

Instead of eliminating upward exposed loads, it eliminates
downward exposed stores.

First local intra-block analysis is done in ComputeInitialSets.
Afte the fixed point iteration EliminateDeadStores performs the
global optimization on downward exposed stores in each block.

Only fully dead stores are eliminated. No partially dead
stores yet.

Example:

1: o.x = null;
2: if (cond) {
3:   o.x = 1;
4: } else {
5:   o.x = 2;
6: }

The store in line 1 is fully dead and will be removed. Note that
any deoptimization in "cond" will make the store only partially
dead and it won't be removed yet.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35909 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-08 14:26:16 +00:00
fschneider@google.com 07fcee05c8 Optimize conditional branches that have same true/false targets.
Branches that have the same true/false target, or where both
target blocks reach the same common join block via empty blocks
can be replaced by a goto to the common join block.

In code like this

var a = unknown();
var b = null;
if (a == null || b == null) {
    ...
}

it eliminates the test (a == null) if b is known to be null. Until now,
the compiler could only eliminate the test for b, if a was known.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35669 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-01 23:17:24 +00:00
srdjan@google.com 8a76062d50 Add flag —source-lines which emits appropriate source lines as code comments. Added token_pos to some instructions. This is work in progress.
R=fschneider@google.com, johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35599 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-30 21:18:10 +00:00
srdjan@google.com 0c2b0af123 Copy of Issue 231383002 after hard disk crash: First step in improving instance of test for a fixed set of value cids returning different results.
Review URL: https://codereview.chromium.org//258563004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35455 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-25 23:21:12 +00:00
johnmccutchan@google.com 3834c9a869 Support for multiple register values
- Adds a PairLocation type (Location is still a single word but now has two tags one for constants and one for pairs).
- New representations: kPairOfTagged & kPairOfUnboxedDouble.
- Register allocator uses second SSA index for Definitions that use two registers.
- Fix LiveRange shape for kWritableRegister inputs.
- Updated MergedMathInstr that returns a kPairOfTagged or kPairOfUnboxedDouble (depending on the merged math kind).
- A new instruction (ExtractNthOutput) for extracting a single register from an instruction that has a output register pair.

Open issues that need to be addressed in a follow up CL:

- Adjust PhiInstr and handling of PhiInstr in the register allocator to work with output pairs (once unboxed mints are in GPRs).

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@34833 260f80e4-7a28-3924-810f-c04153c831b5
2014-04-08 16:13:43 +00:00
fschneider@google.com b5b1be80fa Add alias disambiguation for VM fields.
This is needed for generalizing allocation sinking to
work with instance fields and plain field offsets.

MaterializeObject now works with  a set of Field/Smi objects
Right now this should be performance-neutral, but it already
simplifies the code be removing the fake fields previously used
for type arguments, closure function/context.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33478 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-10 09:59:49 +00:00
johnmccutchan@google.com 115cad1945 Inline of Float64x2 operations round 1
BUG=
R=srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33459 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-07 21:43:49 +00:00
johnmccutchan@google.com 95dc06ae34 Enable polymorphic inlining of StringBase [] and StringBase codeUnitAt.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32749 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-18 17:41:11 +00:00
johnmccutchan@google.com 45cee25fc3 Inline polymorphic typed array view stores
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32656 260f80e4-7a28-3924-810f-c04153c831b5
2014-02-13 15:54:33 +00:00
fschneider@google.com 15dfa97ab6 Fix bug and refactor optimized try-catch.
When untagged values flow into a exception-throwing instruction
 they need to be converted eagerly. Catch block entries assume all
 values are tagged at the entry.

 I changed the generation of moves at throwing
 instructions in try-catch: Instead of manuallu emitting moves,
 construct a parallel move and use the resolver to emit the native code.
 This eliminates a lot of duplicated code from all platforms.

 It will also allow to re-use stack space that is currently allocated
 separately for each individual try-catch in a function.

 I added a few more unrelated minor changes in various parts of the VM
 * Simpilify guard code generation
 * Resolve refactoring TODO in deoptimization
 * Improve names

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31536 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-07 09:58:45 +00:00
srdjan@google.com cd92319223 Optimize string length one comparisons by comparing char codes only. Implemented for one byte strings only at the moment. Will add other string types/mixed compares later.
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31347 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-20 20:11:38 +00:00
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
srdjan@google.com a8f549dbc3 Merge sin(a), cos(a) into one instruction. On IA32 use x87 fsincos operation, on x64 call runtime routine whihc merges sin/cos intos sincos.
TODO: Implement for ARM and MIPS.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30827 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-03 22:00:27 +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
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
fschneider@google.com be9875fb2b VM: Fix bug in polymorphic inlining of recognized methods.
The inliner has to insert a redefinition of the receiver to
prevent illegal hoisting of instructions that depend on the
receiver class id.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29389 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-28 20:20:11 +00:00
johnmccutchan@google.com 4ebeadba11 This CL enables the polymorphic inliner to inline loads on typed array views.
It also contains a small cleanup so that the signatures of BuildByteArrayViewLoad and BuildByteArrayViewStore match.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29066 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-23 09:18:52 +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
srdjan@google.com b83bda9e0e Add new style of string interpolation optimization: new nodes, working constant folding.
TODO: partial constant fold of incoming arguments.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28741 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-16 18:12:08 +00:00
fschneider@google.com 2cff01970b Polymorphic inlining for []= operators.
This CL allows the inliner to do polymorphic inlining of recognized
[]= operators. Before, only monomorphic calls were handled in the
optimizer.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28202 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-03 09:43:50 +00:00
srdjan@google.com 008229fa11 Optimize string interpolation by running it at compile time if all inputs are constant. This is done during constant propagation, however, the argument construction instructions must be removed manually. It is unclear how safe it is to modify graph during constant propagation.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28175 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-02 17:49:14 +00:00
fschneider@google.com e9f0b93eb1 Revert r28050 due to crashes with --optimization-counter-threshold=5.
TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28052 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-30 14:29:44 +00:00
fschneider@google.com acb389dbf9 Optimize conditional branches that have same true/false targets.
Branches that have the same true/false target, or where both
target blocks reach the same common join block via empty blocks
can be replaced by a goto to the common join block.

In code like this

var a = unknown();
var b = null;
if (a == null || b == null) {
  ...
}

it eliminates the test (a == null) if b is known to be null. Until now,
the compiler could only eliminate the test for b, if a was known.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28050 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-30 12:41:28 +00:00
fschneider@google.com 1072bc1c60 Reland: Fix bug in field type tracking and polymorphic inlining.
Original CL: https://codereview.chromium.org/24096018/

This fixes the bug by changing FlowGraphBuilder to a zone object
because it is needed by the inliner later in the pipeline.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@27695 260f80e4-7a28-3924-810f-c04153c831b5
2013-09-20 10:35:01 +00:00