Commit Graph

585 Commits

Author SHA1 Message Date
asiva@google.com 7fe1c42468 Fix issue 12718 - crash when the trying to access context variables in a frame.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26658 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-26 17:06:17 +00:00
hausner@google.com 8e9139da08 Fix debugger stack traces
This change fixes the lookup of exception handlers that are
contained in activation frames that are not user-visible
(e.g. frames in dart library code).

Fixes issue 12318 (https://code.google.com/p/dart/issues/detail?id=12318)

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26445 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-21 17:22:30 +00:00
jacobr@google.com 605b33c1bc fix cpp11 compile errors
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@26387 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-20 20:24:11 +00:00
hausner@google.com eadbe08e61 Prevent recursive exception notification in debugger
Fixes bug 12329.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25961 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-09 10:19:56 +00:00
iposva@google.com 9fec984d80 - Make sure to not skip frames too early.
Review URL: https://codereview.chromium.org//22451002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25821 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-06 17:51:17 +00:00
regis@google.com 9581071936 Refactor resolution code in the vm to properly handle ambiguity errors.
Add test.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25324 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-23 00:19:39 +00:00
regis@google.com 191d2673c8 Use proper internal name for implicit static final getters.
R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25053 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 16:29:59 +00:00
fschneider@google.com 13b7b7242a Faster invocation of fields as methods.
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=11041
R=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
2013-07-15 11:12:09 +00:00
hausner@google.com c1fe1ba67c Fix a debugger step regression
Fix stepping after hitting a user breakpoint.

R=devoncarew@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24691 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-02 15:21:22 +00:00
hausner@google.com 1e955965df Better single stepping in VM debugger
Single stepping now steps into the next dart code that the
user is interested in, including from one asynchronous task
to the next.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24632 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-01 17:29:18 +00:00
srdjan@google.com 7d945c593a Remove skip_static_calls_ as it uses an obsolete way to check for uncalled static calls. Will be replaced by ICData tracking.
Add two different PCDescriptors to differentiate between optimized and unoptimized static calls (the former loads args. descr, the later loads ICData before calling).
Populate static call's ic_data field when optimizing.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24433 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-25 21:31:37 +00:00
fschneider@google.com 0bf7251d1a Reland: Optimizing noSuchMethod invocation with no arguments.
This is the same CL as https://codereview.chromium.org/17315008/ with
one bug fixed:

If a method is invoked with a mismatching number of arguments, we don't
add a no-such-method-dispatcher function since the dispatcher currently
can only invoke noSuchMethod and would not work if the method
is invoked with correct arguments at a later point.

I extended the test to cover that case.

TEST=tests/language/no_such_method_dispatcher_test.dart
R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24351 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-24 17:18:51 +00:00
srdjan@google.com fa7817bf79 Change static calls in unoptimized code to always call via a stub. Using ICData, the call count of static calls is collected as well.
TODO: Use call frequency to guide inlining.

R=asiva@google.com, hausner@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24307 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 23:35:10 +00:00
fschneider@google.com 48555c83ac Back out r24266 to investigate dartium test failure.
TBR=kmillikin@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24284 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-21 11:56:32 +00:00
fschneider@google.com ab1981b421 Optimizing noSuchMethod invocation with no arguments.
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
2013-06-21 07:31:51 +00:00
srdjan@google.com 47de186e76 Store arguments descriptor in ICData. Remove loading of arguments descriptor at unoptimized call site (the ones using ICData).
R=asiva@google.com, zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24239 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-20 16:29:39 +00:00
devoncarew@google.com 762d86296b Fix for an issue w/ breakpointResolved events not being sent.
Added tests for breakpointResolved events.
Added tests for handling toString() invocations throwing exceptions, and extended debug_lib.dart to supported verifying values of local variables.

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24164 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-18 21:56:00 +00:00
srdjan@google.com 71340907c2 Cosmetic change: s/arg_descriptor/args_descriptor/
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24103 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-17 17:31:00 +00:00
asiva@google.com 925fdb5680 Fix warning in dartium builds:
warning: converting to non-pointer type ‘uword {aka long unsigned int}’ from NULL [-Wconversion-null]

R=hausner@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@24012 260f80e4-7a28-3924-810f-c04153c831b5
2013-06-13 21:21:44 +00:00
hausner@google.com 2ec6f419c3 Allow breakpoints on strict equal
The compiler turns equality checks with null into
strict equal comparisons. Make the compiler backend
create a pc descriptor for the runtime call so that
the debugger can break on x == null and x != null.

R=regis@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23153 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-24 16:26:42 +00:00
hausner@google.com 4b497b0c17 Consolidate debug stubs
The new debug stub BreakpointRuntime gets the original stub address
from the debugger. With this scheme, we don't need a new debug stub
for every runtime stub that the debugger patches.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23094 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-23 18:42:03 +00:00
hausner@google.com b466bceb20 Make VM debugger stop at every safe point
Debugger front-end can decide to ignore some steps and only halt
when the next line is reached.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22972 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-21 23:07:22 +00:00
hausner@google.com 7349a6d611 Make breakpoints on == fire reliably
Add breakpoints in the path taken if one of the operands
in a == b is null.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22857 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-17 17:08:09 +00:00
hausner@google.com 2b7746ae05 Allow breakpoints on one-liner functions
Fixes issue 10234. This is also the first step for setting
reliable breakpoints on a == b expressions.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22799 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-16 15:44:05 +00:00
hausner@google.com 80c7ad1070 Implement breakpoint for closure calls
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
2013-05-10 21:06:04 +00:00
iposva@google.com a6fb0962e2 - Fixed some old-style casts.
- Remove TODO as it is not feasible to ever enable.

R=kustermann@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22313 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-02 11:40:23 +00:00
hausner@google.com 7f1fac8d1d Loosen aggressive assert in debugger stack trace code
A closure may be called from native code. In that case we will not
find a saved context variable in the dart frame 'below' the closure.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22268 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-01 18:34:48 +00:00
hausner@google.com 29f15c6f8b Instrument debugger to track down stack trace problems
- Print caller and callee if an expected saved current context is not found.
- Make removing a non-existing breakpoint a no-op.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22213 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 23:03:30 +00:00
hausner@google.com d852cd37c4 Another fix for debugging stack traces and captured variables.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22196 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-30 19:46:07 +00:00
hausner@google.com d7fdf7f0e8 Fix context-allocated variables in stack traces
The debugger did not properly use saved contexts when collecting a stack trace.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22070 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-26 15:27:00 +00:00
hausner@google.com df5c543b6f Add library id, location info to breakpointResolved event
Review URL: https://codereview.chromium.org//13940008

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21592 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-16 23:24:21 +00:00
hausner@google.com 89949d455b Deprecate old debugger breakpoint handler
- Add new breakpoint handler callback that does not take a
  stack trace
- Remove deprecated handler from debugger core
- Adjust tests
- Old breakpoint handler support remain in code until Dartium
  switches to new handler.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21569 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-16 19:42:39 +00:00
hausner@google.com 226b3f4ce4 Fix issue 9744
Allow for debugger stack frames that have no corresponding pc descriptor
entry, i.e. the PC is not at a known safe point. In that case, we cannot
return a code location nor variables.

Fixes 9744
Review URL: https://codereview.chromium.org//13948009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21175 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-09 23:36:51 +00:00
tball@google.com 7ba1326a91 Disable stack context when its frame is for optimized code.
Review URL: https://codereview.chromium.org//12408015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19894 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-12 20:42:36 +00:00
tball@google.com 15f62a9361 Fixed debugger stacktrace generation that failed a VM assertion.
Added LocalVarDescriptors.ToCString(), which is just used when
debugging debugger issues, and is not referenced by any public APIs.
Review URL: https://codereview.chromium.org//12380031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19255 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-28 20:45:37 +00:00
tball@google.com 309ef2a8b5 Disabled context variables in local variable list in the debugger,
so developers can still use it while issue 8593 is being fixed.
Review URL: https://codereview.chromium.org//12320023

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19020 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 23:36:28 +00:00
regis@google.com 163db76189 Hook up simulator (if needed) when calling Dart code.
Merge identical InvokeDynamic and InvokeStatic to InvokeFunction.
Remove redundant argument from InvokeClosure.
Review URL: https://codereview.chromium.org//12315087

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18994 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-25 19:30:29 +00:00
regis@google.com 8c44be4313 Add support for object pool that will be used on ARM and MIPS architectures.
Modify code patching infrastructure to accept code object, which is necessary to
get to the object pool containing patchable target addresses.
Modify assembler test infrastructure to provide associated code object.
Review URL: https://codereview.chromium.org//12260026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18604 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-15 23:55:31 +00:00
asiva@google.com 80e281a078 Fix for issues 6080 -
- 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
2013-02-07 22:43:16 +00:00
asiva@google.com 109cbae3dd Minor cleanup of activation frame creation code. Get the code object while iterating the frames as that is way faster than doing a code lookup later.
Review URL: https://codereview.chromium.org//12225031

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@18162 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-06 01:45:56 +00:00
asiva@google.com f4fe42c280 Added macros OBJECT_IMPLEMENTATION and FINAL_OBJECT_IMPLEMENTATION
which have different implementations of 'operator=' and 'operator^='.
In the case of FINAL_OBJECT_IMPLEMENTATION we do not do the vtable setting
in these methods (Note the |= operator functionality is now subsumed into
the new implementation of "operator^=")
Review URL: https://codereview.chromium.org//12052033

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17491 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-23 20:01:31 +00:00
hausner@google.com c3a133777d Add function for one-time stop at function entry
Adds function Dart_OneTimeBreakAtEntry()

Used by debugger clients to stop at the beginning of the program without setting a user-visible breakpoint.
Review URL: https://codereview.chromium.org//11926026

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17332 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-19 00:03:30 +00:00
srdjan@google.com d56766f251 More ^= to |=
Review URL: https://codereview.chromium.org//11941021

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17308 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 19:43:19 +00:00
vegorov@google.com a77fc9701c When requested to extract a method M from class C inject a method extractor (consisting of a single AST node CreateClosure) as a getter get:M into C.
This allows to cache and optimize method extraction requests as normal method invocations and at hot method extraction sites that significantly decreases overhead of method extraction which previously required two trips into runtime system and was not cached at all.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17261 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-18 11:54:45 +00:00
hausner@google.com 79f4b5b61b Simplify exception handler table
Sort entries and drop the try_index field. This simplifies lookup
of exception handlers when walking the traces on exceptions.
Review URL: https://codereview.chromium.org//11970024

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17179 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-17 01:10:42 +00:00
hausner@google.com cfb3b53aac Check whether exceptions are caught
The debugger can now determine whether an exemption will be caught or not.
Review URL: https://codereview.chromium.org//11946020

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17167 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-16 22:16:09 +00:00
hausner@google.com e8a293c05a Allow optimized code when debugger is active
The debugger allows the VM to optimize code unless there is a breakpoint inside the
function. Whenever a new breakpoint is set (explicitly or implicitly by stepping)
all optimized code is discarded.
Review URL: https://codereview.chromium.org//11780005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16815 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-08 18:57:19 +00:00
hausner@google.com 016b84310a Handle optimized code blocks in debugger stack trace
Removed an old restriction that debugger activation frames
are expected to be non-optimized code. Fixes bug 5944.
Review URL: https://codereview.chromium.org//11776007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16665 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-05 00:46:23 +00:00
asiva@google.com 7022b39e35 Convert all symbol accessors to return read only handles so that it is not necessary to create a new handle in the code that uses it.
Added a few more strings to the symbols list.
Review URL: https://codereview.chromium.org//11667012

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16584 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-02 19:31:59 +00:00
hausner@google.com a2d682d1d8 Improve line info accuracy in debugging
Review URL: https://codereview.chromium.org//11696005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@16550 260f80e4-7a28-3924-810f-c04153c831b5
2012-12-28 18:51:58 +00:00