When we call a closure, the caller saves the context before the call.
So when walking the stack, we used to check the callee activation to
see if it was a closure call, and then recover our caller-saved
context.
This breaks down in the following case:
1. Caller calls function F.
2. Function F is compiled.
3. The compiler needs to run code to evaluate a constant (e.g. a
static final getter).
4. We hit a breakpoint *while* evaluating the constant.
In this case, there is no callee frame for the closure call yet.
I fix this by using the the pc descriptors to see if the current pc in
the caller is a closure call. This avoids needing to have a callee
frame available.
---
ALSO:
New flags:
--verify-incoming-contexts: in development - verify assumptions about
contexts in stub code. (currently ia32 only)
--trace-debugger-stacktrace: this helps debug these kinds of
stacktrace issues.
Miscellaneous improvements to frame and context printing.
BUG=
R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org//240213004
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35130 260f80e4-7a28-3924-810f-c04153c831b5
The stack frame iteration during GC was missing one slot in stub frames that
did not save the pool pointer.
- This change makes all stub frames uniform, i.e they always save/restore the pool pointer. This ensures that we will traverse all slots on the stack.
- A new constant called kFirstObjectSlotFromFp has been added which is used as the slot to start stack traversal.
(The ARM and MIPs changes will be in a different CL)
R=iposva@google.com, regis@google.com, zra@google.com
Review URL: https://codereview.chromium.org//63093003
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30088 260f80e4-7a28-3924-810f-c04153c831b5
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
- Read the saved context from the entry frame when straddling across C++ frames while iterating over a stack trace in the debugger. This ensures that the correct context is setup in the ActivationFrame structure in these scenarios (instead of the empty context).
- Read the saved context from the caller's frame when iterating over a stack trace in the debugger. The compiler saves the context in the caller frame before invoking closures, we read this saved context when iterating the stack trace.
Review URL: https://codereview.chromium.org//12179020
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18235 260f80e4-7a28-3924-810f-c04153c831b5
In some cases of NoSuchMethodError creating a stack trace with optimized
code did result in an assertion failure.
We don't have deoptimization info at all potentially throwing calls
in optimized code: Namely in the prologue that copies parameters.
BUG=dart:8200
TEST=tests run with --optimization-threshold=5
Review URL: https://codereview.chromium.org//12079071
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17843 260f80e4-7a28-3924-810f-c04153c831b5
Fix decoding of the deoptimization info when constructing a stack trace.
Fix stack trace for checked mode exceptions from optimized code.
BUG=dart:8058
TEST=runtime/tests/vm/dart/optimized_stacktrace_test.dart,
tests/language/stack_overflow_stacktrace_test.dart
Review URL: https://codereview.chromium.org//12049039
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17755 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
Change 6302 description:
- Wire the stack frame iterator to use stack maps for traversing objects if
there are stack maps in the code object. If there are no stack maps it still
does the old style stack frame traversal between fp and sp looking for tagged
pointers.
- Added a mechanism to be able to iterate over the code space and look for a
particular object.
Review URL: https://chromiumcodereview.appspot.com//10030001
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6331 260f80e4-7a28-3924-810f-c04153c831b5
This function can be used in native functions to properly pass all
errors up the stack.
Set the long jump base in the Compiler instead of outside of the
compiler. A bunch of errors that used to be propagated through the
sticky_error are now propagated through return values. This includes
all of the DartEntry and DartLibraryCall functions.
In particular, we no longer use the long jump to cross dart frames.
Instead errors are propagated across dart frames using the same
mechanism that we use for unhandled exceptions. I've added assertions
to make sure that we only use the long jump when it is "safe".
Review URL: https://chromiumcodereview.appspot.com//9169102
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3815 260f80e4-7a28-3924-810f-c04153c831b5