Commit Graph

12 Commits

Author SHA1 Message Date
Ryan Macnak 147f0e3d94 [vm] Delay allocating the ObjectIdRing until the first service request or response.
Avoids GC overhead when the VM service is not in use.

Change-Id: Ic2e752c17fdd01045e30dd62e16f20896a9fc64e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146440
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-05-06 19:19:52 +00:00
Ryan Macnak 6fe15f6df9 [vm] Represent tagged pointers as C++ value types instead of C++ pointer types.
This works around bugs in UndefinedBehaviorSanitizer and Clang.

Bug: b/28638298
Change-Id: I6be595f9664516019d28017d24559583a1ae3a21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144354
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-04-25 05:21:27 +00:00
Martin Kustermann dae308461c [vm/concurrency] Share [Heap] and [SharedClassTable] between all isolates within one isolate group
This CL:

  * Moves [Heap]/[SharedClassTable] from [Isolate] to [IsolateGroup], which
    will make all isolates in the group use the same heap. The GC will use
    the shared class table for object size information.

  * Adds support for entering/leaving an isolate group as a helper thread
    (e.g. via [Thread::EnterIsolateGroupAsHelper]). The current active
    isolate group can be accessed via TLS `IsolateGroup::Current()` or
    `Thread::isolate_group_`. When entering as a helper thread there will be
    no current isolate.

  * Changes the GC to use the above mechanism and ensures GC works without
    a currently active isolate. The GC will use information purely available via
    [IsolateGroup]. The GC will iterate all isolates within an isolate
    group e.g. for scanning roots.

  * Makes spawning of new isolates start in their own isolate group.
    Once the isolate is fully functional it's heap will be merged into
    the original isolate group

  * Moves ApiState, containing persistent and weak persistent handles,
    from [Isolate] to [IsolateGroup], plus adds appropriate locking.

Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: Ia8e1d8aa78750e8400864200f4825395a182c004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126646
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-02-20 21:08:35 +00: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
John McCutchan d295b9c311 Remove many features when building product mode
Move all JSON printing code from object.cc to object_service.cc.

Not compiled in:

- Service protocol
- Debugger
- Debugger API
- JSONStream
- ObjectIdRing
- Profiler service
- Object JSON printing

Size of dart_bootstrap before: 5670365 bytes
Size of dart_bootstrap after: 5287631 bytes

Reduction in size: 382734 bytes.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1660063002 .
2016-02-05 09:55:51 -08:00
johnmccutchan@google.com f4c3119a2e Add Service ID zones to service protocol
- Add ServiceIdZone interface for getting temporary ids.
- Add RingServiceIdZone which uses the isolate's object id ring.
- Add GrowableServiceIdZone which uses a growable array.
- Unit tests for ServiceIdZones.
- JSONStream has a service id zone.
- Default service id zone is ring with eager id allocation.
- All service RPCs can include a _serviceIdZone parameter.
- Value of _serviceIdZone can be Ring.NewId or Ring.ExistingId.
- All ObjectIdRing usage in object.cc has been replaced with `jsobj.AddServiceId("id", *this);`
- Add a policy for id reuse to ObjectIdRing::GetIdForObject
- ObjectIdRing can dump its contents to JSON.
- Add _dumpRingRequests RPC which dumps the isolate's ring.
- _getCrashDump includes complete object id ring.

R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45754 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-12 23:48:01 +00:00
rmacnak@google.com 2396c11a3c Treat null like the object it is in the Observatory and Service.
BUG=http://dartbug.com/20649
R=turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39616 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 19:36:29 +00:00
turnidge@google.com 058510ebd0 Handle collected objects and expired handles more gracefully.
Prints <collected> or <expired>.

Added tooltips to explain these to users.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@33386 260f80e4-7a28-3924-810f-c04153c831b5
2014-03-06 17:38:16 +00:00
turnidge@google.com b891e78325 Post-meetup feature extravaganza.
Remodel the top-level isolate summary page.

Add variables to stack frames in the stack trace.

Stop putting small integers and bools in the object id ring.

Rework how we pass down null references (and null-like references like
uninitialized values).

Collect all isolate timers by default.

Change the lifetime of IsolateSpawnState so that we can refer to it
later to know how an isolate started up.  Stop pretending that
IsolateSpawnState is a void*.  Clean up vestigial IsolateStartData.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@32128 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-29 18:40:12 +00:00
turnidge@google.com b354d77a3b Add field and function view for libraries. Rough cut.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30596 260f80e4-7a28-3924-810f-c04153c831b5
2013-11-22 23:02:11 +00:00
johnmccutchan@google.com f91c0967ef Expose classes, codes, functions, and libraries collections.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25900 260f80e4-7a28-3924-810f-c04153c831b5
2013-08-07 20:35:37 +00:00
johnmccutchan@google.com 7f993f87ee Object ID Ring with tests
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25063 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-16 18:31:25 +00:00