Commit Graph

3 Commits

Author SHA1 Message Date
Ryan Macnak 1d05591fbb [vm] Produce clearer error messages when operator new fails.
TEST=bots
Bug: https://github.com/dart-lang/sdk/issues/43642
Bug: https://github.com/dart-lang/sdk/issues/43862
Change-Id: I598a26a56762c141a1aef972f7d32f2c9594b244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171802
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-11-13 19:07:20 +00:00
Martin Kustermann 72320b6c9a [vm/concurrency] Avoid quadratic complexity when closing ports on isolate shutdown
When an isolate dies it has to close all it's open ports. Right now this
is done by walking all ports in the system.
  => O(#num-isolates x #num-ports) complexity

Instead we let each isolate remember it's own open ports: When the
isolate dies we iterate over those ports that particular isolate has
open and close them.
  => O(#num-isolates + #num-ports) complexity

On a many-isolate test of the form:

    foo(int n) {
      if (n == 1) return 1;
      return foo(n-1) + 1;
    }

for `foo(50k)` this reduces the runtime from 90 seconds to 30 seconds.

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

Change-Id: I3ac68c5334a1d5e8cac47e89e15cbb50c26b65ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144261
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-04-21 14:05:53 +00:00
Martin Kustermann 4d3ae12d9f [vm/concurrency] Extract the hashset implementation out of PortMap into PortSet
This CL extracts the hashset implementation from PortMap into
it's own (template) class into port_set.h:PortSet.

This splits the functionality (a nice cleanup in itself) and will
make it re-usable (via template) for a follow-up CL which makes
each message handler aware of it's own open ports.

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

Change-Id: I4a56c997414672a4efc9330077110ac5f54d03d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/144260
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-04-21 12:43:12 +00:00