Commit Graph

37 Commits

Author SHA1 Message Date
Vyacheslav Egorov c910738825 [vm/embedder] Introduce dart_standalone_embedder_api.h
This enables other emdedders to reuse parts of the standalone embedder
implementation without depending too much on the implementations details.

As part of the change we also remove a dependency from DartUtils on
IsolateData - by removing dart:_builtin library caching. Lookup
of this library does not seem to be on hot path anymore in Kernel world.

Change-Id: Ia35b28886121828fad7a96f00bcbceff75e00ae8
Reviewed-on: https://dart-review.googlesource.com/64848
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-07-17 09:04:05 +00:00
asiva 02e47a9731 [VM] Fix for issue 32188 (cannot use pub with --preview-dart-2)
- Fix for 'unable to read .packages file' error when generating
  kernel file (script snapshot).
- Make sync-async an isolate specific flag and turn it off for
  the kernel isolate as it runs in Dart 1 mode
- Include 'reify-generic-functions' and 'sync-async' flags to the
  list of flags to check an app JIT snapshot against.

Change-Id: I2b16270f65705213660487f9c15fe0348fc84c8b
Reviewed-on: https://dart-review.googlesource.com/55589
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-05-18 18:12:08 +00:00
Ryan Macnak a5c11d7d03 [vm] Remove Dart_ReadKernelBinary, take 2.
Update status for simulators, which the test harness invokes with DIL files instead of source files.

Change-Id: I8444ad7e17a0a71a1ce3c0021487397baa1c3e65
Reviewed-on: https://dart-review.googlesource.com/54622
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-05-14 20:58:08 +00:00
Ryan Macnak 407872b9e5 Revert "[vm] Remove Dart_ReadKernelBinary."
This reverts commit 2998c32951.

Reason for revert: Failures with kernel + simulators

Original change's description:
> [vm] Remove Dart_ReadKernelBinary.
> 
>  - Fix const-ness of Dart_FileReadCallback and callers.
>  - Fix leak on read error in DartUtils::FileRead.
> 
> This is progress towards sharing kernel memory on Fuchsia.
> 
> Bug: https://github.com/dart-lang/sdk/issues/32618
> Change-Id: I47f8b224905d6a105a5ca0ab2ee4ab6a42b5e342
> Reviewed-on: https://dart-review.googlesource.com/47102
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=aam@google.com,rmacnak@google.com,asiva@google.com

Change-Id: Ibb636b817de1629a062fe0a6ef9462a2fef669ef
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/32618
Reviewed-on: https://dart-review.googlesource.com/54560
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-05-10 01:36:39 +00:00
Ryan Macnak 2998c32951 [vm] Remove Dart_ReadKernelBinary.
- Fix const-ness of Dart_FileReadCallback and callers.
 - Fix leak on read error in DartUtils::FileRead.

This is progress towards sharing kernel memory on Fuchsia.

Bug: https://github.com/dart-lang/sdk/issues/32618
Change-Id: I47f8b224905d6a105a5ca0ab2ee4ab6a42b5e342
Reviewed-on: https://dart-review.googlesource.com/47102
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-05-10 00:35:37 +00:00
Siva Chandra 6a6103b9c1 Do not compile script to kernel if the isolate was not created from kernel.
This change, and the code introduced, is probably not going to be required
once the platform kernel file is linked into the executable.

Change-Id: I24a837c3a633a625145cf90ff83d3e51b3d23eb6
Reviewed-on: https://dart-review.googlesource.com/36720
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Chandra <sivachandra@google.com>
2018-01-25 18:18:25 +00:00
Siva Annamalai 1e15e6f2d7 Fix for flutter issue 11260 (flutter/flutter#11260)
Do not rely on the udp_receive_buffer field from IsolateData as a buffer for
reading data in the recvfrom call.

Bug:
Change-Id: I43d19f624fd2a406429cc5387bd536524472b4f7
Reviewed-on: https://dart-review.googlesource.com/10212
Reviewed-by: Zach Anderson <zra@google.com>
2017-10-03 15:09:31 +00:00
Siva Annamalai b4ddc97fd5 Revert "Fix for Flutter issue 11260 (https://github.com/flutter/flutter/issues/11260)"
This reverts commit 8817846da6.

BUG=

Review-Url: https://codereview.chromium.org/3005663002 .
2017-08-25 16:15:05 -07:00
Siva Annamalai 8817846da6 Fix for Flutter issue 11260 (https://github.com/flutter/flutter/issues/11260)
Do not rely on the udp_receive_buffer field from IsolateData as a buffer for
reading data in the recvfrom call.

BUG=
R=zra@google.com

Review-Url: https://codereview.chromium.org/3009643002 .
2017-08-25 15:26:55 -07:00
Siva Annamalai 6656404ad6 1. Restructure code to enable reloading when a kernel dill file is specified on the command line instead of sources.
2. Read the platform dill file at startup not for every isolate creation

3. Store the memory representation of kernel program in isolate data so that it is deleted when the isolate is shutdown

R=aam@google.com

Review-Url: https://codereview.chromium.org/2927493002 .
2017-06-07 13:42:20 -07:00
John McCutchan 99c6a18a1b Attempt 2 -- Fix updating packages map on reload and add a regression test
- [x] Update the isolate's .packages path when requested.
- [x] Always refresh package map when loader is initialized.
- [x] Add regression test.

Review-Url: https://codereview.chromium.org/2810223003 .
2017-04-12 14:02:19 -07:00
John McCutchan 94df115e4b Revert "Fix updating packages map on reload and add a regression test"
This reverts commit 7a2d67f3ba.

BUG=

Review-Url: https://codereview.chromium.org/2808953003 .
2017-04-10 12:30:38 -07:00
John McCutchan 7a2d67f3ba Fix updating packages map on reload and add a regression test
- [x] Update the isolate's .packages path when requested.
- [x] Always refresh package map when loader is initialized.
- [x] Add regression test.

BUG=
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2797923008 .
2017-04-10 08:59:10 -07:00
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 '::dart::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