On the slow path for a stack overflow check we manually spill the live
registers before our call to the runtime function. We were updating
all uses of these spilled registers in the Environment object but this
was not enough - we also need to update any uses of these spilled
registers in MaterializeObjectInstrs which are hanging off of the
Environment.
This would fail when a deoptimization was triggered during a stack
overflow check and a materialized object happened to refer to
registers.
I've been chasing this for a while and I was able to get it to
reliably reproduce by using the --stacktrace_every=N and the
--stacktrace_filter flags, which were added for this purpose.
ALSO:
Set the top context to null on exceptions/errors. This is needed for
the --verify-incoming-context flag.
Minor printing improvements.
R=fschneider@google.com
Review URL: https://codereview.chromium.org//246303004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35443 260f80e4-7a28-3924-810f-c04153c831b5
- 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
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
Instead of emitting a large smi constant directly as an immediate, xor the
smi with a random 32-bit cookie at compile time, emit code to move that into
a register and then to xor the register with the cookie.
1. In unoptimized code constants are always loaded into a register in
ConstantInstr::EmitNativeCode. Change it to load safely.
2. In optimized code constants loaded into a register for use by an
instruction are loaded by ParallelMoveResolver::EmitMove. Change it to
load safely.
3. In optimized code some instructions allow constants as inputs. These are
reflected with an input location of Location::RegisterOrConstant (or
similar) or else Location::Constant. For the former allocate a register
if the constant is unsafe, and for the latter check for safety before
allowing the constant input.
BUG=https://code.google.com/p/dart/issues/detail?id=1742R=iposva@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org//48743002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29439 260f80e4-7a28-3924-810f-c04153c831b5
Remove representation from location. Presence of representation in location encoding was violating the invariant that unequal locations must be disjoint (where equality for locations is defined in terms of bitwise equality of their encoding). This could lead ParallelMoveResolver to treat XMM1 containing unboxed double as unequal location to XMM1 containing unboxed mint, which is obviously incorrect.
For similar reason eliminate kFloat32x4StackSlot and kUint32x4StackSlot distinction is eliminated and both are replaced with kQuadStackSlot. Register allocator now guarantees that no kQuadStackSlot occupies the same space as any other kDoubleStackSlot. This also shrinks optimized stack when only doubles are used (but might lead to a higher stack utilization when a mixture of doubles and quads is used).
Implement allocation of scratch Cpu and Xmm registers for ParallelMoveResolver. This also allows to remove push(eax)/pop(eax) pairs when resolving memory-memory cycles on ia32.
BUG=dart:9710
Review URL: https://codereview.chromium.org//13801014
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21148 260f80e4-7a28-3924-810f-c04153c831b5
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
This remove bailout for functions with non-zero number of non-fixed parameters and increases our coverage.
SpillSlot location was renamed into StackSlot location and now allows to address spill slots (positive stack index) and incoming parameters (negative stack index).
Environment was reordered to match order of values on the stack (previously it was inversed).
Correctly reserve spill slots in the prologue of the code. Previously register allocator was allocating spill slots, but generated code did not reserve any space for them on the stack so they might have been overwritten by calls.
Fix off by one in DeoptimizationStub::GenerateCode - we were reserving one slot too many.
Change --optimization-filter flag to use substring search instead of prefix comparison, this is much more useful when VM prefixes function name with a path to the file.
BUG=
TEST=
Review URL: https://chromiumcodereview.appspot.com//10828018
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9934 260f80e4-7a28-3924-810f-c04153c831b5
Instructions and computations switched to the new code generation scheme should implement two virtual functions:
- locs() should return pointer to a LocationSummary object, that specifies location constraints for the instruction/computation.
- EmitNativeCode() should emit instructions/computations native code using locations provided through LocationSummary object attached to the instruction.
For converted functions instruction pattern should be removed from the FlowGraphCompiler visitor. It will not be used as long as instruction/computation returns non-NULL from locs().
Review URL: https://chromiumcodereview.appspot.com//10382234
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@7818 260f80e4-7a28-3924-810f-c04153c831b5