Commit graph

24 commits

Author SHA1 Message Date
Vyacheslav Egorov a5e1f89583 VM: Fix an app-jit related shutdown race.
IsolateData contains AppSnapshot which might own some HeapPage-s, so we can't
destroy IsolateData in the Dart_IsolateShutdownCallback, because some thread
running in the isolate (e.g. background compiler) might still touch
thoses pages or objects they host.

We need to delay destruction of AppSnapshot until after the isolate shutdown.

Current API does not allow that, so we introduce a new isolate lifecycle
callback - Dart_IsolateCleanupCallback, which is invoked at the end of the
isolote lifecycle when things like background compiler have been stopped
and no Dart code is supposed to run.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2720723005 .
2017-02-28 21:10:04 +01:00
Ryan Macnak 781fd36086 Add an option to gen_snapshot for creating a Makefile describing a snapshot's dependencies. This option may be used when generating any snapshot kind, or without generating a snapshot.
- Factor out MallocGrowableArray from vm to platform.
 - Add File::Print.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2715463003 .
2017-02-23 12:40:48 -08:00
Ryan Macnak a317b90d63 Cleanup app snapshots on isolate/vm exit.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2694103004 .
2017-02-16 13:54:57 -08:00
Ryan Macnak 4d65db8a95 Don't use IsolateData for the exit hook as multiple embedders share the dart/bin while using different isolate data structures.
Issue flutter/flutter#6506

R=asiva@google.com

Review URL: https://codereview.chromium.org/2463923002 .
2016-10-31 15:56:25 -07:00
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

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

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Ryan Macnak 5ee94eb837 Generate an app snapshot even if the training run does a hard exit.
(As the analyzer and pub do.)

R=asiva@google.com

Review URL: https://codereview.chromium.org/2426843002 .
2016-10-19 09:37:47 -07:00
John McCutchan 6fd8fd7987 Rework standalone to use a synchronous loader that does not invoke Dart code
- [x] The first caller of the tag handler blocks, recursive callers queue work and exit.
- [x] Use a NativeMessageHandler to receive I/O results from the service isolate.
- [x] Preserve load error message format.
- [x] Move packages map into service isolate.
- [x] Wire up Todd's native URI code.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1998963003 .
2016-06-06 14:15:01 -07:00
John McCutchan ad0878d1a8 Remove redundant timeline API
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1848683002 .
2016-03-31 09:13:54 -07:00
Zachary Anderson 45661a7091 Cleanup in //runtime/bin
R=iposva@google.com

Review URL: https://codereview.chromium.org/1800863002 .
2016-03-16 10:01:00 -07:00
Siva Annamalai 1e5eab3a14 - reorganize DartUtils::PrepareForScriptLoading so that it does not have the wait for service load port code in it. This is needed so that it is possible to not wait for the service load port when running with a full application snapshot that requires no loading.
- cache builtin_lib in IsolateData so that the cached value can be used withouit having to call Builtin::LoadAndCheckLibrary which creates new string objects everytime it is called.

Review URL: https://codereview.chromium.org/1663963002 .
2016-02-04 09:18:31 -08:00
Zachary Anderson 6c8a3e0053 Restore IsolateData destructor
Shutdown is turned on, and the race on IsolatData
deletion has been fixed, so this should be safe
to re-enable.

R=iposva@google.com

Review URL: https://codereview.chromium.org/1581443002 .
2016-01-13 10:12:49 -08:00
Florian Schneider 61f190eebe Temporary workaround to make VM bots greener.
The reason are data races at isolate creation/shutdown. Further investigation
to fix the root cause needed.

TBR=johnmccutchan@google.com,

BUG=

Review URL: https://codereview.chromium.org/1531763002 .
2015-12-16 15:30:29 +01:00
Ivan Posva b07a9ddbca - Implement .packages specification.
Limitation: Currently only works for file: based .package files. If a script is loaded from http: then the VM currently assumes a co-located packages/ directory.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1232593003 .
2015-07-29 11:30:33 -07:00
John McCutchan c7187924a9 Initial Timeline Events
- Each isolate has its own TimelineEventBuffer
- Each isolate has TimelineEventStreams for API, Compiler, Embedder, Isolate, and GC
- Compiler, Isolate, Embedder, and GC are being inserted into the stream
- Basic unit tests
- Dart API for injecting timeline events
- Arbitrary number of native and Dart arguments can be attached to each event
- JSON printing
- Output can be loaded by about://tracing
- Add --timeline-trace-dir flag

Short term follow up CLS:
- Service protocol requests to enable / disable tracing and retrieve a trace
- UI for Observatory
- Dart code EventStreams and Events

R=asiva@google.com

Review URL: https://codereview.chromium.org//1170503004.
2015-06-16 10:10:14 -07:00
ajohnsen@google.com 0491f4e887 Per isolate package root.
BUG=
R=iposva@google.com, ricow@google.com, sgjesse@google.com, turnidge@google.com

Committed: https://code.google.com/p/dart/source/detail?r=40534

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40581 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-23 05:46:14 +00:00
ajohnsen@google.com 38619425c2 Revert "Per isolate package root."
Revert "Fix test in checked mode."

The Dartium branch is locked atm, making it impossible to land this and have green Dartium bots.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40540 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 11:13:28 +00:00
ajohnsen@google.com a058d07806 Per isolate package root.
BUG=
R=iposva@google.com, sgjesse@google.com, turnidge@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@40534 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-22 08:07:06 +00:00
sgjesse@google.com 7b70c2c267 Add UDP support to dart:io
Initial implementation of UDP support in dart:io

Added a RawDatagramSocket which gets the same events as a RawSocket
except that READ_CLOSED is never received.

The receive from a RawDatagramSocket returns a Datagram object where
the senders address and port is presten together with the data.

The send on a RawDatagramSocket takes data and the address and port of
the destination.

Extended the number of socket options to support UDP.

Added getting the socket options.

R=ajohnsen@google.com
BUG=http://dartbug.com/1975

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31098 260f80e4-7a28-3924-810f-c04153c831b5
2013-12-12 15:45:25 +00:00
asiva@google.com a294e0a82f Fix for issue 14236:
Retain script path of parent isolate when spawnFunction is called so that
it works when using script snapshots.

The test case issue14236_test.dart is a script snapshot whose original source
file path is issue14236_source.dart

R=iposva@google.com, sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@29178 260f80e4-7a28-3924-810f-c04153c831b5
2013-10-24 16:41:22 +00:00
ajohnsen@google.com 1e2289e275 One event ahndler for all isolates
BUG=
R=whesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25082 260f80e4-7a28-3924-810f-c04153c831b5
2013-07-17 07:26:05 +00:00
iposva@google.com b60d09b1fb - Add different types for persistent and weak persistent handles
in the Dart C API.
- Adapt code in the runtime.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23421 260f80e4-7a28-3924-810f-c04153c831b5
2013-05-30 15:55:59 +00:00
smok@google.com ebbc2020a2 Put everything in runtime/bin into ':🎯:bin' namespace.
Review URL: https://codereview.chromium.org//14341015

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@22032 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-25 14:22:30 +00:00
ager@google.com abee5139e5 Reapply change to hide VM-only List implementation classes.
The performance issue was that I had not updated the method
recognizer.

BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13003 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-28 11:08:38 +00:00
ager@google.com f791a12b38 Terminate event handler thread on isolate shutdown.
R=sgjesse@google.com
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com//10693039

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9251 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-29 14:40:17 +00:00