inlined frames.
------------
Most remaining deoptimization code from the code generator moves to
DeoptContext. This allows the code to be reused by the debugger.
There is some rework of the code along the way. The remaining code in
the code generator is simpler.
Implement the ability to deopt a frame to an Array. Each inlined
frame accesses its locals from this array at some fixed offset.
Refactor the Debugger::CollectStackTrace code. New code is int
Debugger::CollectStackTraceNew. There is a flag --use_new_stacktrace
which can be used to revert back to the old version. I intend to
remove this flag shortly, after any dust clears.
Added a unit test which makes sure that we can inspect locals from
optimized and inlined frames. Tested this code in the dart editor
debugger as well.
R=iposva@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org//26255004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28468 260f80e4-7a28-3924-810f-c04153c831b5
Primarily this change moves deoptimization state/code out of Isolate
and into DeoptContext (formerly DeoptimizationContext). The lifetime
of DeoptizationContext changes to survive through the entire
deoptimization process.
Some minor renaming. DeoptizationContext -> DeoptContext to make it
consistent with DeoptInstr and to save my wrists.
New files deferred_object.{cc,h} contain a bunch of the stuff lifted
from isolate.{cc,h}.
R=fschneider@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org//24834002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@28112 260f80e4-7a28-3924-810f-c04153c831b5
Add test.
Update status files.
Explanation of change: A malbounded type argument should not be mapped to
dynamic, as is a malformed type argument.
This change also adds a bunch of TODOs related to the encounter of malbounded
types in unexpected places.
A follow-up change will address these TODOs, add more tests, and may simplify
code that is still handling malformed types where they cannot occur anymore
after the spec simplified their handling.
R=hausner@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org//23190035
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26665 260f80e4-7a28-3924-810f-c04153c831b5
The names of actual arguments are checked at resolving time
for a mismatch instead of deferring this check to the function
prologue (emitted as part of the CopyParameters() prologue).
For example:
class A {
foo({a:42}) => null;
}
main() {
var a = new A();
a.foo(b:123); // noSuchMethod: no named parameter named "b".
}
This enables e.g. fast noSuchMethod invocation in the case
of a named argument mismatch.
It also makes the function prologue for instance functions that
use optional parameters shorter by omitting the check for a
name mismatch there.
R=regis@google.com
Review URL: https://codereview.chromium.org//19200002
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25041 260f80e4-7a28-3924-810f-c04153c831b5
Until now there was a large discrepancy between
x.f() and
(x.f)()
This CL makes x.f() as fast as (x.f)() by automatically
generating a intermediate dispatcher function that loads
the field and invokes the result as a closure.
The approach resembles the one taken for fast noSuchMethod
invocation and reuses the same per-class cache
of dispatcher functions.
It also fixes a bug in the debugger so that VM-generated
implicit dispatcher functions (like for noSuchMethod, or
field-as-method invocation) don't show up the debuggers
stack trace.
BUG=https://code.google.com/p/dart/issues/detail?id=11041R=srdjan@google.com
Review URL: https://codereview.chromium.org//18750004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25001 260f80e4-7a28-3924-810f-c04153c831b5
On each call that triggers a noSuchMethod invocation we
attach a custom dispatch function that allocates the
invocation object and invokes noSuchMethod. This dispatcher
is compiled and optimized like a normal Dart function.
Similar to method-extractors, these implicit dispatchers
do not show up as normal functions.
As a first step this CL only handles invocations of getters
and methods with no like o.foo or o.foo(). This CL gives
a >25x speedup of such noSuchMethod invocations. Calls with
multiple arguments still go through the slow path.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//17315008
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24266 260f80e4-7a28-3924-810f-c04153c831b5
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
- Exposes double precision rather than single precision floating point registers
to architecture generic code. This entails a mechanical change in the assembler
to floating point instructions.
- Adds slti, sltiu instructions for comparison with small immediates, and uses
them in the Branch(Un)Signed* macros.
- Fixes a bug in the intermediate language comparison/branching instructions
caused by using subu for comparison. Now it uses two slt instructions.
- Fixes register use bugs in intermediate language.
- More uses of NULLREG instead of loading Object::null()
R=regis@google.com
Review URL: https://codereview.chromium.org//16022011
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23190 260f80e4-7a28-3924-810f-c04153c831b5
Introduce a new PcDescriptor kind to distinguish closure calls from other runtime calls. The debugger can patch these calls to set a breakpoint. When stepping into a closure call, the debugger must fish out the closure object from the stack, find the function and set breakpoints in it.
Arm and Mips breakpoint stubs are not implemented yet. ia32 and x64 stubs tested by hand. Automated test to follow.
R=srdjan@google.com
Review URL: https://codereview.chromium.org//14858033
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22596 260f80e4-7a28-3924-810f-c04153c831b5
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