Commit Graph

595 Commits

Author SHA1 Message Date
fschneider@google.com ac89119791 Fix dead phis elimination.
When initially marking live phis, only mark those
with real (i.e. non-phi) uses as live so that cycles
are properly eliminated.

Add a pass after allocation sinking since it may
create additional dead phis.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42245 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-10 14:28:38 +00:00
fschneider@google.com e8f27c722a Better constant folding of length-loads in checked mode.
Handle redefinitions (Redefinition/AssertAssignable) when
checking for known constant length.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42132 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-05 14:02:40 +00:00
fschneider@google.com 9fad07f46e Enable inlining inside try-blocks in the VM's optimizing compiler.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42103 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-04 12:29:28 +00:00
srdjan@google.com bad6a61899 Cleanups.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42069 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-02 18:48:12 +00:00
fschneider@google.com abde3a9699 Merge chains of straight-line blocks.
R=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42038 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-01 12:40:55 +00:00
fschneider@google.com d80f05540c Avoid checking for uses in try-blocks, when optimizing a function without try-catch.
R=zerny@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42037 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-01 10:36:24 +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
srdjan@google.com eddeb860eb Restructure inlining of Bigint accessors, use consistent approach, fixes a potential crash.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41840 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-19 22:28:49 +00:00
vegorov@google.com e1387daa67 Teach LoadOptimizer to handle intrablock multi-indirection redundancies in one pass.
Do this by renumbering loads as we move forward.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41779 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-17 15:34:03 +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
vegorov@google.com 8f7f26c0a4 Reland "Suppress canonicalization of Unbox() instruction that can deoptimize."
This relands commit r41693 with additional fixes in canonicalization pass.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41736 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-14 11:19:42 +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 97c3268f51 Revert "Suppress canonicalization of Unbox() instruction that can deoptimize."
This reverts commit r41693 due to checked mode test failures.

TBR=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41695 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-12 18:57:31 +00:00
vegorov@google.com 94e896d963 Suppress canonicalization of Unbox() instruction that can deoptimize.
Suppress canonicalization of instructions that have unsatisfied input representations.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41693 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-12 17:23:55 +00:00
vegorov@google.com 29f021439a Infer range for BIT_XOR.
When selecting representations unbox integer phis that have Int32 range and have only constants or boxing operations flowing into them.

BUG=http://dartbug.com/13869
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41667 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-11 14:51:10 +00:00
vegorov@google.com 0a8e45ae35 Improve precision of range analysis by allowing it to track ranges across all int typed phis.
Even when range of the integer definition is unknown we can optimistically assign full int64-range to it even though tagged integer definition can contain instance of the Bigint. This is based on the following observation: we only use ranges when working with unboxed arithmetic in the optimized code, but the widest possible unboxed arithmetic is 64-bit (mint) one and corresponding unboxing operations will deoptimize if they get Bigint as an input. This makes it safe to assume that any integer definition fits into 64-bit range *once unboxed*.

Additional small fixes:

- Fix ranges assigned to loads from Int32/Uint32 arrays on 64-bit platform - it was overly conservative;

- Add UnboxUint32 range inference to ensure that range is not lost when it passes through box-unbox pair;

- When canonicalizing Binary/Unary Integer operations ensure that we unwrap UnboxUint32(Constant(C)) -> C.

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41640 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-10 17:16:14 +00:00
fschneider@google.com 26c2929073 VM: Load-forwarding of non-final field values at allocations.
Instead of ignoring escaping allocations, we now forward values
for all non-final fields and type arguments even if the object
 escapes. For non-escaping objects we forward all fields.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41522 260f80e4-7a28-3924-810f-c04153c831b5
2014-11-05 15:23:01 +00:00
vegorov@google.com e6847ac17c IR refactoring: consolidate all boxing and unboxing instructions.
BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41437 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-31 12:17:12 +00:00
fschneider@google.com 876193b31a Make CTX allocatable by the register allocator.
This change makes CTX available by not caching the current
context while in Dart code. Instead the current context
is held in a local variable (:saved_current_context_var) and
is passed as argument in CTX at calls.

This also simplifies a lot of code in the debugger: As a result,
Isolate::top_context is not needed anymore since the current context
can always be extracted from a Dart frame.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41422 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-30 15:42:38 +00:00
vegorov@google.com fb915fe887 IR cleanup: pass deopt id as constructor argument instead of doing deopt_id_ assignment.
This also kills a list of Instruction friends that was growing without bounds.

R=srdjan@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41278 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-24 11:27:17 +00:00
johnmccutchan@google.com fb7f8551b4 Add unboxed Mint for X64
BUG=
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41233 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-21 18:11:43 +00:00
fschneider@google.com c6e2650073 VM: Avoid repeated deoptimizations from hoisted array bounds checks.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41223 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-21 10:36:52 +00:00
fschneider@google.com 9087108b5f VM: Avoid repeated deoptimization on speculatively hoisted smi-checks.
This adds the same check as we already have for CheckClass for
CheckSmi and CheckEitherNonSmi instructions to avoid repeated
deoptimization after LICM.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41133 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-15 15:46:49 +00:00
johnmccutchan@google.com 7bbdfc2e16 - Use UnboxedInt32 and UnboxedUint32 representation for LoadIndexedInstr
- Avoid inserting an check class instruction for Uint32 and Int32 arrays on StoreIndexedInstr
- Implement Int32ToDouble on all architectures
- Add Int32 to double instruction to ARM64 and simulator.
- Add Int32 to double instruction to X64.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41025 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 20:49:15 +00:00
vegorov@google.com 1ea5f34f56 Fix incorrect handling of refined aliases during load forwarding.
If intrablock load forwarding refines some store instruction in a way that introduces previously unseen alias fallback to unrefined place with a more generic alias instead.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@41009 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-09 11:47:13 +00:00
vegorov@google.com e6113cc0f5 If bounds check 0 <= index < length is not redundant we attempt to
replace it with a sequence of checks that guarantee

          0 <= LowerBound(index) < UpperBound(index) < length

and hoist all of those checks out of the enclosing loop.

Upper/Lower bounds are symbolic arithmetic expressions with +, -, *
operations and are computed based on discovered simple induction variables.

Simple induction variable is a variable that follows the pattern v1 <- phi(v0, v1 + 1)

BUG=
R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40969 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 18:50:29 +00:00
zra@google.com f9b269397c Unrolls array initialization loop for small arrays.
This is similar to what is already done for
object field initializaion, and gives a small
performance improvement on ARM.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40961 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-07 16:26:18 +00:00
johnmccutchan@google.com 5b05c23c9f Revert r40848
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40850 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-01 18:27:09 +00:00
johnmccutchan@google.com 0c61e7eff2 Make LoadIndexedInstr for Uint32List use kUnboxedUint32 representation
BUG=
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40848 260f80e4-7a28-3924-810f-c04153c831b5
2014-10-01 17:46:46 +00:00
srdjan@google.com b8891bf412 Pass isolate to BitVector constructor.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40528 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 23:14:34 +00:00
johnmccutchan@google.com fa189495a5 * Fixes ICData collection on Double.fromInteger factory constructor (for both smi and mint).
* Inlines instance calls to toDouble on mint.
* Adds fast path mint -> double for IA32.

R=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40501 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-19 16:23:38 +00:00
vegorov@google.com 73f4cc059d Fix ConstantPropagator::VisitBinaryDoubleOp to work with all integer types.
R=fschneider@google.com
BUG=http://dartbug.com/20984

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40433 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-18 12:47:20 +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
srdjan@google.com a0b0554faa Recognize Bigint setters and getters. This code will be removed when/if we change the fields to be Dart instead fo native fields.
R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40206 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-12 15:45:40 +00:00
rmacnak@google.com cefb21b6a3 Narrow String::CharAt from int32_t to uint16_t.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40178 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 20:55:36 +00:00
vegorov@google.com 183abe7207 Fix StoreIndexedInstr input representation requirements for Int32/Uint32 arrays.
Previous implementation changed input representation depending on the propagated type of the value which violated assumptions made by SelectRepresentations phase.

Instead of using tagged/mint input require unboxed Int32/Uint32 input and insert explicit truncating unboxing when building StoreIndexed operation in the optimizer. This also leads to strictly better code and opens possibilities for further optimizations.

Implement Int32/Uint32 representation support on all platforms. This includes boxing, unboxing and unboxed converter operations.

Merge BoxInt32/BoxUint32 and UnboxInt32/UnboxUint32 instruction sequences to minimize duplication.

Improve instruction sequences by utilizing CARRY flag set by smi untagging where possible (ARM, ia32, x86).

Enable all tests that were disabled by r40078, r40079.

BUG=http://dartbug.com/20875
R=fschneider@google.com, johnmccutchan@google.com, srdjan@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40143 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-11 12:32:54 +00:00
regis@google.com 0220e41d72 New bigint implementation in the vm.
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40061 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-09 21:47:44 +00:00
fschneider@google.com 0b31ede896 VM: Add constant propagation for binary double operations.
R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39956 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-08 12:08:19 +00:00
vegorov@google.com f0f60262cd Improve LoadOptimizer::ReplacePhiWith.
Previously we were only looking for congruent phis. But we can also include all operations that allow CSE and have no dependencies (e.g. arithmetic) into the congruency check.

This allows in the code like

var idx = 0;
for (var el in src) dst[idx++] = el;

see the congruency between Phi introduced for idx and Phi that LoadOptimizer emits for iterator's _index field. As the result we are able to optimize this code to use a single iteration variable instead of two.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39864 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-04 12:56:15 +00:00
vegorov@google.com df15ce178b Restore behavior of ICDataHasReceiverArgumentClassIds changed by r39471.
ICDataHasReceiverArgumentClassIds checks if a pair is contained in ICData so it can't be expressed through ICDataHasOnlyReceiverArgumentClassIds which checks if *all* pairs within ICData have class ids from the given list.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39727 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-01 12:21:33 +00:00
vegorov@google.com c8e5382693 Address review comments for r39595.
R=srdjan@google.com, srdjan@googe.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39697 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 11:36:11 +00:00
srdjan@google.com 2a3c2ad058 Add loop printing to block comments.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39673 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 19:52:47 +00:00
vegorov@google.com a5becfa5a7 Fix printf modifiers from %d to % Pd to fix compilation on Mac.
TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39597 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 15:01:41 +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
rmacnak@google.com 08cbcf480e Did you mean const?
R=srdjan@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39569 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 21:43:55 +00:00
fschneider@google.com 97dc2bd55a Implement native _List. constructor in the flow-graph builder.
Replace assembly intrinsic and the C++ native function with a CreateArray
instruction.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39554 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 13:57:15 +00:00
fschneider@google.com cdd87138d4 Small improvements in array code.
Avoid emitting x - 0 in byte array view code.

Always inline Lists.copy since it is freqently polymorphic.

Fix printing of CreateArrayInstr.

R=vegorov@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39522 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-25 15:45:07 +00:00
srdjan@google.com 8745b71d4a Fix performance degradation in Havlak: prevent conflicting method recognizer kinds to be stored in the function.
Review URL: https://codereview.chromium.org//497623003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39477 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-21 22:37:47 +00:00