Commit Graph

84 Commits

Author SHA1 Message Date
regis@google.com 912194a756 Fix vm code base so that it can be built for --arch=simarm (no snapshot yet).
Review URL: https://codereview.chromium.org//11956004

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17246 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 00:34:20 +00:00
vegorov@google.com 5402bf689d Heuristically predict interference on the back edge and use it to minimize number of register reshuffling which is especially expensive when cycles of XMM registers arise.
When allocating free register check if hint can potentially interfere on the back edge try ignoring hint and search for a better candidate.

Additionally fix handling of constants in the liveness analysis to accommodate constants used as immediates.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15291 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-23 16:04:34 +00:00
vegorov@google.com 78c5832342 Use structural loop info computed by register allocator to mark loop phis.
Currently it disagrees with loop information computed in other parts of optimization pipeline that do not require loops to be properly nested.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14705 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 19:13:57 +00:00
vegorov@google.com 7c8923b829 Try allocating loop phi into a register even if phi has only unconstrained uses but there are cheap eviction candidates: values that come into the loop and have only unconstrained uses in it.
When spilling a value inside the loop that has only unconstrained uses in this loop move spilling point outside of the loop.

This tweaks allow to minimize amount of memory moves on loop back edges.

R=fschneider@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14673 260f80e4-7a28-3924-810f-c04153c831b5
2012-11-08 02:23:41 +00:00
iposva@google.com 15114867c7 - GrowableArray::RemoveLast returns the value being removed
to avoid having to call Last() followed by RemoveLast().
Review URL: https://codereview.chromium.org//11348026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@14237 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-30 00:52:21 +00:00
vegorov@google.com 0df78cb708 Allow splitting at lifetime holes.
If the allocation finger is moved past lifetime hole unwind pending interval to the start of the range before attempting to split.

R=fschneider@google.com
BUG=dart:6094

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13874 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-22 13:36:35 +00:00
fschneider@google.com cb719805d8 Add fast 64-bit integer ADD and SUB to the optimizing compiler.
They operate on unboxed 64-bit integers stored in xmm registers.

I also fixed an issue with some SSE 4 specific assembler
tests where we hit an assert with an empty assembler buffer
when running with --no-use-sse41.
Review URL: https://codereview.chromium.org//11016028

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13211 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-04 08:50:28 +00:00
zerny@google.com 3ae0b96762 Set previous instruction pointers when building the graph.
R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13174 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-03 15:05:27 +00:00
fschneider@google.com 6632f191c4 Support for unboxed 64-bit integer bitwise operations and equality on ia32.
This CL adds AND, OR, XOR and == operations on unboxed 64-bit integers
(aka. mints).

Unboxed mints are stored in xmm registers. Each xmm register location
has an additional bit to keep track of its value representation.

Unboxed mints are materialized on the heap on deoptmization in the same way as
unboxed doubles.

The SSE instructions used are available on all CPUs that support SSE 4.1.
Review URL: https://codereview.chromium.org//10968059

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13112 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-02 11:25:53 +00:00
vegorov@google.com 7e949446ca Disregard constants with no SSA temp index in register allocator.
R=fschneider@google.com
BUG=dart:5416

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12848 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-25 16:36:56 +00:00
kmillikin@google.com 63fa392807 Reapply "A simpler scheme for garbage collection of ureachable phi inputs."
Fix two issues:

* Unreachable code elimination did not correctly identify all unreachable
  blocks.

* Loop detection in the register allocator relied on the block IDs.

R=vegorov@google.com
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12756 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-24 07:27:36 +00:00
fschneider@google.com d2e7dba0b5 Fix bug in assigning the positions of safepoints.
Safepoints are associated with the end of instructions so that
splitting a live range at a safe point position makes the safepoint
at that position belong to the correct live range.
Review URL: https://codereview.chromium.org//10963029

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12708 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-21 14:07:46 +00:00
zerny@google.com 8ca2c4e6e9 Replace start_env with initial_definitions in GraphEntryInstr.
The initial definitions do not have any deoptimization information and can be
represented as just a list of definitions. For easy access, the constant_null
getter remains but assumes that index 0 contains the constant.

R=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12555 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-19 12:37:57 +00:00
zerny@google.com aa5281c88a Reapply "Deoptimization support in inlined code."
This reapplies r12488 with a fix.

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

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12499 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 13:41:20 +00:00
zerny@google.com e174be3f27 Revert "Deoptimization support in inlined code."
This reverts commit a78e33f178aae74a97f4231ca98183adf97fda71.

TBR=fschneider@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12492 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 12:18:04 +00:00
zerny@google.com 64a9ca2b81 Deoptimization support in inlined code.
Review URL: https://codereview.chromium.org//10928232

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12488 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-18 11:53:59 +00:00
vegorov@google.com 5f9ff89e0a Add support for WritableRegister policy in the register allocator.
Use it to eliminate push/pop on the fast path of the write barrier.

Tighten assertions in StoreIntoObject to ensure that value register is not equal to object register. Current code can't cope with that.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10909169

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12193 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 12:50:52 +00:00
kmillikin@google.com 8201f0db6b Introduce nested deoptimization environments.
Add an optional outer deoptimization environment to support inlining.
Introduce a pair of environment iterators.

Original codereview: https://chromiumcodereview.appspot.com/10928048/

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

Review URL: https://chromiumcodereview.appspot.com//10909168

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12190 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 12:30:21 +00:00
regis@google.com 7cc84c2892 Implement new optional parameters syntax in the vm (issue 4290).
Provide --reject_named_argument_as_positional flag to ease transition to new
syntax (default is false).
Add tests.
Review URL: https://chromiumcodereview.appspot.com//10910119

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12004 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-07 01:13:27 +00:00
vegorov@google.com a192ac3d9e Allow smi comparisons to have constant operands.
Remove unnecessary temps reserved for them.

Load constants directly in phi moves.

Generate xor(reg, reg) for loading of 0 instead of mov.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10918097

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11947 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 13:27:30 +00:00
cshapiro@google.com da14bf70a7 Add attributions so printf like functions can have their arguments checked.
This change also corrects some misuses of format strings and format
arguments that discovered by the compiler checks.

Review URL: https://chromiumcodereview.appspot.com//10869063

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11912 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 00:58:25 +00:00
kmillikin@google.com 0750c472dc Reapply "Remove classes Computation and BindInstr."
Reapply svn revision 11868 with a bugfix.

Original code review at http://codereview.chromium.org/10908091/

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10912094

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11890 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 17:04:49 +00:00
kmillikin@google.com 7e36720fa8 Revert "Remove classes Computation and BindInstr."
This reverts svn revision 11868.

TBR=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10917085

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11869 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 11:20:14 +00:00
kmillikin@google.com bd84c7ee22 Remove classes Computation and BindInstr.
The former Computation classes are folded into the Instruction class
hierarchy.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10908091

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11868 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-05 11:15:34 +00:00
vegorov@google.com 1911b2bc81 Make register allocator to disregard constant computation with no uses.
Inline constant values into environments, instead of creating a use of the constant definition.

Change BinarySmiOpComp code template to allow inline constant uses for the right hand side.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10916082

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11798 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-04 09:58:57 +00:00
vegorov@google.com a573d2dec8 Unbox phis that were proven to be of type Double.
Eliminate Boxing/Unboxing pairs.

Allow boxing, unboxing and double binary operations to participate in CSE.

Allow double comparisons to operate on unboxed inputs.

Support XMM registers and double spill slots in deoptimization.

Save XMM registers when calling to runtime from WriteBarrier stub.

R=srdjan@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10919008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11652 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 20:39:48 +00:00
vegorov@google.com 978ec58a5e Rematerialize constants instead of spilling them.
This also fixes the crash that occurs when we try to spill constant null at the graph entry.

R=srdjan@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10918006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11634 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 17:49:23 +00:00
kmillikin@google.com 8122966c80 Put live register bits in stackmaps.
Add a count of live registers to each stackmap and add bits describing the
registers.  This allows untagged values in general purpose registers at
safepoints.

R=vegorov@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10882055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11595 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 10:20:26 +00:00
kmillikin@google.com ea925449f6 Eliminate class UseVal.
This was the only subclass of Value.  All functionality is moved to the base
class, and all functions are made non-virtual.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10891025

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11590 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-30 09:08:27 +00:00
kmillikin@google.com 58d842d6d7 Make constants computations instead of values.
This change requires a pool of global constants that don't have an easy
place to go in the instruction stream.  Currently, that is only the constant
null used to mark eliminated phis in deoptimization environments.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10894034

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11518 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-29 12:56:57 +00:00
vegorov@google.com 264c4f6d1a Add support for XMM registers in SSA code generation pipeline.
Split BinaryDoubleOp into several instructions that manipulate unboxed doubles.

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10875030

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11313 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 14:45:42 +00:00
fschneider@google.com 323e06222e Reland "Add a simple dominator based redundancy elimination" and fix a register allocation bug.
Original CL: http://codereview.chromium.org/10872035/

It enables elimination of redundant expressions across
basic blocks.

Currently used for smi checks and class checks, but will
be extended to other expressions in a separate CL.


Additionally, this fixes a bug in the register allocator where
a blocked register was illegally assigned to an unallocated live range.

It also fixes a Mac compiler issue with the constructor of
DirectChainedHashMap.
Review URL: https://chromiumcodereview.appspot.com//10871060

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11302 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-24 11:10:36 +00:00
zerny@google.com 50b114c606 Compute the def-use list on-demand by walking the dominator tree.
This replaces the previous implementation that maintained the def-use lists.

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

Review URL: https://chromiumcodereview.appspot.com//10879036

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11241 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-23 16:23:05 +00:00
zerny@google.com 6ed5884c44 RemoveFromGraph on definitions asserts empty use lists.
R=fschneider@google.com,kmillikin@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10855101

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10822 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 14:08:45 +00:00
zerny@google.com 5cc78d2a33 Refactored FlowGraphBuilder into a separate FlowGraph representation.
R=kmillikin@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10857016

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10807 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 12:06:17 +00:00
fschneider@google.com d571e18ebd Make all variants of RelationalOp work with SSA.
This is the last instruction that causes a bailout in the register
allocator. This bailout is now changed into an ASSERT.
Review URL: https://chromiumcodereview.appspot.com//10830333

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10802 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-16 08:46:45 +00:00
vegorov@google.com 181be0165b Rename is_call to always_calls and contains_call to can_call.
R=kmillikin@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10824308

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10735 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-15 14:26:39 +00:00
vegorov@google.com fe291bf0fa Implement basic support for deferred slow path code with calls that save and restore live registers.
Use it to avoid spilling over stack-checks.

R=kmillikin@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10823308

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10639 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 12:47:42 +00:00
kmillikin@google.com 172ee045f3 Build and use stack maps in the SSA compiler.
Add a stack bitmap to the location summaries for calls that are GC
safepoints.  The bitmap covers the spill slots.  The register
allocator collects these bitmaps into a list and then marks live
pointer values during register allocation.  When emitting code for a
call, a heap-allocated stackmap is built.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10831261

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10618 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-14 06:59:24 +00:00
vegorov@google.com 8aced7aab1 In AllocateAnyRegister allow spliting at blocked_at position inclusive.
R=srdjan@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10825300

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10518 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 17:28:01 +00:00
vegorov@google.com 1cf5cc74aa Put PushArgument into the environment instead of raw values.
This allows to shorten live ranges and avoid spilling when PushArgument is the last real use of the value.

BUG=

Review URL: https://chromiumcodereview.appspot.com//10825282

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10508 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-10 14:28:02 +00:00
vegorov@google.com b9aa74f3a2 Eliminate phis that do not reach any non-environment uses.
This takes care of phis for temporary variables like :expr_temp, lia, lix, igr, casc, alloc, sca that currently create unnecessary pressure on the back-edge of loops.

R=srdjan@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10832180

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10377 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-08 12:38:21 +00:00
kmillikin@google.com 4a24120c8d Move all register allocator environment initialization into class Environment.
Move the register constraints and initial live ranges of environment values
out of the register allocator and into the environment class.

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

Review URL: https://chromiumcodereview.appspot.com//10826184

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10342 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 15:53:02 +00:00
vegorov@google.com 4a24eb7ad8 Add hints when resolving phies and register constraints.
R=fschneider@google.com

Review URL: https://chromiumcodereview.appspot.com//10829218

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10333 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-07 11:55:42 +00:00
vegorov@google.com be323c2d61 Don't mark register constraints resolution moves as prefering registers.
R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10832159

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10293 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 15:43:03 +00:00
kmillikin@google.com 1093cf4fe5 Allocate the environment's location backing store during register allocation.
The code relies on the addresses of elements in this backing store.  It was
correct but difficult to guarantee when it was a growable array's backing
store.

R=vegorov@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10831179

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10290 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 15:13:21 +00:00
kmillikin@google.com 9ffbf2ffce Store variable counts in the flow graph builder.
Store the constant counts of copied parameters, non-copied parameters, and
(non-parameter) stack locals in the flow graph builder.  This saves passing
them around to flow graph member functions.

Change usage of "fixed parameter" to "non-copied parameter" because it is
different than what fixed parameter means in other parts of the system.

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

Review URL: https://chromiumcodereview.appspot.com//10855007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10289 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 14:33:23 +00:00
vegorov@google.com f07819adb2 Ensure that ia32 build passes all tests with --use-ssa on.
Bugs fixed in register allocator:

- incorrect assertions in SplitAt;
- allocation finger should not cache positions that are owned by a sibling after split;
- UpdateFreeUntil should allow evicting live range with vreg 0;
- values expected in fixed locations should not cause an interference at the instruction itself, they can be evicted if need arises;

Bug fixed in deoptimization:

- parallel move resolver uses push/pop to free a scratch register for memory to memory moves, when using it for deoptimization we need to ensure that those push/pops do not interfere with actual moves;

R=srdjan@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10824165

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10287 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 12:24:12 +00:00
zerny@google.com c1262fbd49 Reapply "Added support for copied parameters to the SSA compiler."
This reapplies svn revision 10172 with a bug fix.

Original Review URL: https://chromiumcodereview.appspot.com//10837076

R=fschneider@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10824177

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10280 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-06 10:07:26 +00:00
kmillikin@google.com 5a5c84fa06 Change TRACE_ALLOC to take a statement rather than an argument list.
This allows tracing things that are not arguments to OS::Print.

R=vegorov@google.com
BUG=

Review URL: https://chromiumcodereview.appspot.com//10825173

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10216 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 08:27:42 +00:00