Commit Graph

16 Commits

Author SHA1 Message Date
Ryan Macnak 466385ceb6 [vm, gc] Require a safepoint for heap iteration.
Assert a safepoint operation can only be started from a thread in the VM state. Fix several unit tests missing a native-to-vm transition.

R=asiva@google.com, danunez@google.com

Review-Url: https://codereview.chromium.org/2995543004 .
2017-08-07 17:51:25 -07:00
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Ben Konyi f2fd150ea0 Added new type of unit test, RAW_UNIT_TEST_CASE, which is used for tests that can be flaky if run while the VM is alive. Tests created using the RAW_UNIT_TEST_CASE macro will run after the VM has shutdown to avoid having any worker threads contaminating the test results.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2666133002 .
2017-01-31 15:16:38 -08:00
Ryan Macnak 11975ab353 ObjectGraph: Establish a HeapIterationScope *before* making the heap writable, least the sweeper interfer.
Fixes #28030

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2566383002 .
2016-12-14 11:27:15 -08:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Siva Annamalai e72c1fb47d Implement safepointing of threads :
- uses thread execution status transition to track when a thread is in a safepoint or needs to block for a safepoint
 - introduces a monitor per Thread object
 - uses a per thread safepoint handshake between the thread requesting a safepoint and the requested thread.

The ThreadRegistry class now contains only the thread list for an isolate and the functionality of scheduling a thread onto an Isolate and unscheduling it from teh isolate. We could fold this functionality into the Isolate class in a different CL.

R=rmacnak@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1541073002 .
2016-02-01 10:57:34 -08:00
Srdjan Mitrovic b9426418d8 Get rid of deprecated methods accessing mutator_thread_ instead of current thread
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1410643008 .
2015-10-20 10:26:08 -07:00
Ivan Posva 4bd7cdc75c - Ensure that HandleScope is initialized with a thread. (Remove
deprecated isolate based API.)
- Update all code impacted by this change. E.g. DARTSCOPE
- TEST_CASE now passes the current thread as a parameter to the   unit test.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1310463005 .
2015-09-01 17:18:55 -07:00
Daniel Andersson 3ce2b95070 Make ObjectGraph wait for concurrent sweeper before using mark bits
Attempt to extend test coverage by triggering a full GC in test. (Manual inspection did show the "Wait" being executed.)

BUG=https://github.com/dart-lang/sdk/issues/21620
R=iposva@google.com

Review URL: https://codereview.chromium.org//1179973005.
2015-06-17 14:22:51 -07:00
koda@google.com e3a345a84b Rename NoGCScope -> NoSafepointScope.
The old name makes less sense in the context of concurrent GC (and multiple threads in general).

Document the intended semantics of this (DEBUG-only) guard scope.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44616 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-20 22:08:25 +00:00
koda@google.com 655b16b2d6 Include parent field/list index in retaining path.
R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37956 260f80e4-7a28-3924-810f-c04153c831b5
2014-07-02 20:37:56 +00:00
koda@google.com 5886e8ec95 Light-weight stats counters for temporary experiments/debugging.
A single statement is enough to add a counter:
  ...
  Isolate::Current()->counters()->Increment("allocated", size_in_bytes);
  ...

I've been using these myself for a while now, but figured others might
find them useful too. They are not intended for production use, just temporary local experiments/investigation.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37367 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-16 17:13:20 +00:00
koda@google.com 61bde80790 Retaining path in Observatory.
Add retaining_path instance command to VM service, exposed in the Observatory
with a [find] eval-link in instance view. By default shows up to 10 elements,
possibly followed by [find more] which doubles the number of elements shown.

Change RetainingPath to include the object itself.

Always include an id in Object::PrintJSONImpl, to avoid instance-ref crashing on
internal objects.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36516 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-22 17:31:47 +00:00
koda@google.com b9c9bb5dfe ObjectGraph::RetainingPath
Adds a utility method to find a retaining path and unit test.
Next step is to expose it via VM service and Observatory.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@36381 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-20 20:38:02 +00:00
koda@google.com 1c3a41ad13 Retained size for instance in Observatory.
Add objects/$id/retained message that uses ObjectGraph to compute retained size for an instance.
In the instance view, the user can request the size to be calculated.

R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35757 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-05 19:41:12 +00:00
koda@google.com f9b6613cf4 Object graph visitor: general depth-first search.
Features:
 * Performs a pre-order, depth-first search.
 * Allows the visitor to direct whether to
   proceed, backtrack, or abort.
 * Provides a complete chain of parents to the root.
   (unlike the GC marking stack).

The plan is to use this in the observatory, e.g.:
 * inspect a path from the isolate roots to a particular object, or
 * determine how much memory is kept alive by some particular object or class of objects.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@35711 260f80e4-7a28-3924-810f-c04153c831b5
2014-05-02 21:38:30 +00:00