Commit Graph

95 Commits

Author SHA1 Message Date
Lasse R.H. Nielsen adcb6a7399 Make main invocation not fail strong-mode type checking.
Bug: http://dartbug.com/31270
Change-Id: Id6ad2a429d5dc44b437a0fdd8fb4889d3dccf194
Reviewed-on: https://dart-review.googlesource.com/18480
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-03 16:06:00 +00:00
Peter von der Ahé e8aef37eac Clean up patches so they can be compiled by Fasta.
Change-Id: Ie436375c78496366accf0ba82938e54cbe30b143
Reviewed-on: https://dart-review.googlesource.com/3001
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-10-05 14:05:50 +00:00
Jacob Richman 4360e99d18 Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Committed: https://github.com/dart-lang/sdk/commit/62be0eacfbb36bdc92a05c7c35bb4506621b6a3a
Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-21 10:07:26 -07:00
Jacob Richman 62be0eacfb Revert "Fix observatory tests broken by running dartfmt."
This reverts commit b1f7e6d94673b098c93c187fe3efc45c15f27edc.

BUG=

Review-Url: https://codereview.chromium.org/2767533002 .
2017-03-20 22:19:22 -07:00
Jacob Richman 88f8aacd5f Re-apply rolled back CL to apply dartfmt to runtime.
Fix observatory tests broken by running dartfmt due to line and column changes.
Temporarily reverted formatting for evaluate_activation_test.dart as dartfmt doesn't yet handle multitests.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2759973004 .
2017-03-20 21:44:59 -07:00
Ryan Macnak ea4744a06f Revert "Run dartfmt on all files under runtime."
This reverts commit 15f393f189.

The change caused many service test failures due to changed line numbers.

TBR=jacobr@google.com

Review-Url: https://codereview.chromium.org/2762583003 .
2017-03-20 13:42:55 -07:00
Jacob Richman 15f393f189 Run dartfmt on all files under runtime.
I've omitted files where the formatter output is significantly uglier
than the original code and I'll send those files in a separate CL
with options for how to make the code look reasonable while still
taking advantage of the formatter.

BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2751423005 .
2017-03-20 13:13:50 -07:00
Peter von der Ahé 00bed94e0c Fix various nits in VM patch files.
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2705593002 .
2017-02-17 16:28:57 +01:00
Kevin Millikin 9ab1f22b41 Make some VM libraries patch cleanly using the analyzer.
Modify the following VM dart: library patches: collection, convert,
developer, _internal, isolate, math, mirrors, profiler, vmservice_io,
_vmservice, _builtin, nativewrappers, and io.

The modifications are mostly because:

    - Patches should not be able to introduce new public members to a
      library's API.  In cases where the VM's patches introduce public
      members, the patches are rewritten to introduce private members
      instead.

    - Patches should not be able to replace arbitrary members, only
      ones declared external.  In cases where the VM's patches replace
      arbitrary members, those members are declared external in the
      SDK sources and dart2js's patch files are rewritten to use the
      original SDK implementation.

BUG=
R=sigmund@google.com

Review-Url: https://codereview.chromium.org/2564383002 .
2016-12-15 11:30:20 +01:00
Florian Loitsch 136e476c87 Check for the type of the the spawned function.
In general we avoid explicit type-checks, but in this case the error would be only detected in the new isolate making error handling much harder.

Fixes #27185
BUG= http://dartbug.com/27185.
R=lrn@google.com

Review URL: https://codereview.chromium.org/2414173003 .
2016-10-14 13:27:11 +02:00
Matthias Hausner 1a6d1eca32 Implement @patch annotation for patch class members
Allow members of patch classes to be annotated with @patch. The VM
ignores the annotation. I simply replaces the original method
if the name matches, or reports an error if field names match.

Adding a bit is_patched to members to do more checking remains a
TODO. There are currently no unused bits available, and I don’t want
to increase the size of Function objects for this.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/2230383003 .
2016-08-10 12:54:57 -07:00
Matthias Hausner e11ca24053 Use metadata annotation @patch for patch classes
Annotate patch classes and top-level patch functions with @patch
instead of the pseudo-keyword patch. This allows the analyzer
to read patch files, and matches the syntax that dart2js uses.

The deprecated syntax is still supported, but a warning is printed when detected.

BUG=

Review URL: https://codereview.chromium.org/2220883004 .
2016-08-09 09:48:03 -07:00
Siva Annamalai da1a5534b4 Fix for issue 26555, do not inherit package root and package config from the parent isolate when doing Isolate.spawn
BUG=26555
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2072873002 .
2016-06-17 09:59:15 -07:00
Ivan Posva 04debc9c82 - Do not even attempt to spawn an isolate if the local script
URI cannot be determined.

BUG=

Review URL: https://codereview.chromium.org/1586003003 .
2016-01-15 00:48:54 -08:00
Ivan Posva 28412d153e - Fix Isolate.spawn when running from snapshot.
- Avoid access to Isolate.resolvePackageUri when not needed. Fixes Dartium based test.

TBR

Review URL: https://codereview.chromium.org/1591573004 .
2016-01-14 23:24:07 -08:00
Ivan Posva 7b75f2dbb7 - Allow specifying of package: URIs for packageConfig and packageRoot when
spawning a new isolate.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1586653003 .
2016-01-14 08:20:59 -08:00
Ivan Posva 6d066c7e53 Add package config support to dart:isolate
- Add "static Future<Uri> get packageRoot;",
  "static Future<Uri> get packageConfig;" and
  "static Future<Uri> resolvePackageUri(Uri packageUri)" to Isolate class.
- Added "Uri packageRoot, Uri packageConfig, bool automaticPackageResolution: false" parameters to spawnUri.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1553233002 .
2016-01-12 18:19:04 -08:00
Todd Turnidge 71b3d5aba8 Start isolates in a separate thread.
R=asiva@google.com

Review URL: https://codereview.chromium.org/1447353002 .
2015-11-18 11:02:32 -08:00
Todd Turnidge 5817a6f187 Remove some prototype code that snuck into one of my commits.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1435943003 .
2015-11-16 15:07:16 -08:00
Ivan Posva 1fa2ef874d - Rollback packageConfig/File/Spec updates for 1.13.
BUG=24691
R=sethladd@google.com

Review URL: https://codereview.chromium.org/1409343007 .
2015-10-22 16:22:17 -07:00
Ivan Posva 60eab65aa0 - Implement package map parameter when spawning isolate.
BUG=
R=lrn@google.com

Review URL: https://codereview.chromium.org/1403693002 .
2015-10-12 09:05:37 -07:00
Lasse R.H. Nielsen 57f4827c76 Rename [packages] to [packageMap] as Isolate.spawnUri parameter.
This matches the static [packageMap] getter on Isolate.

Fixes issue #24545.
BUG= http://dartbug.com/24545
R=floitsch@google.com

Review URL: https://codereview.chromium.org/1401713002.
2015-10-12 16:31:48 +02:00
Zachary Anderson bb7f3a7501 Fixes RawReceivePort.hashCode
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1386253003 .
2015-10-08 13:06:49 -07:00
Ivan Posva ba6c0ace3e - Add getters for the current packageRoot or packageMap to the Isolate class.
- Simplify loading in builtin.dart.

BUG=
R=asiva@google.com, lrn@google.com

Review URL: https://codereview.chromium.org//1334353002 .
2015-10-03 06:53:13 -07:00
Lasse R.H. Nielsen 232a9d687e Add "environment" parameter to spawnUri for String.fromEnvironment support.
This completes the parameters corresponding to official command line parameters
for the VM/dart2js.

R=floitsch@google.com, iposva@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org//1350053002 .
2015-09-22 12:29:40 +02:00
Todd Turnidge b0ca0789be Fix a variety of service protocol bugs.
Add documentation for breakpoint.

Fix Instance.pattern documentation.

Fix Instance.bytes documentation.

Add class field for null instances.

Fix documentation of Context and closureContext.

Make getObject return Collected for deleted breakpoints.

Closes #24247
Closes #24249
Closes #24309
Closes #24325
Closes #24326
Closes #24327

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1341473002 .
2015-09-11 12:29:21 -07:00
Lasse R.H. Nielsen ff65079c47 Add packages parameter to Isolate.spawnUri.
No implementation supplied, marked as "not implemented everywhere".

BUG= http://dartbug.com/23951
R=iposva@google.com, sigmund@google.com

Review URL: https://codereview.chromium.org//1323373002 .
2015-09-11 13:07:54 +02: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
Ivan Posva fe03640e85 - Implement VM parts of https://codereview.chromium.org/1240743003/
- Pass additional state in the IsolateSpawnState to set
  error and exit handlers, as well as fatal errors on isolate start.

BUG=
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1244733002 .
2015-07-20 16:46:54 +02:00
Lasse R.H. Nielsen e4881c55d0 Add errorsAreFatal, onExit and onError parameters to the spawn functions.
R=floitsch@google.com

Review URL: https://codereview.chromium.org//1240743003.
2015-07-16 16:52:43 +02:00
Lasse R.H. Nielsen 5a843ebbf3 Add "checked" parameter to Isolate.spawnUri.
R=iposva@google.com

Review URL: https://codereview.chromium.org//1154673004
2015-06-03 12:32:52 +02:00
lrn@google.com e96a973492 Reduce timer stack overhead by getting immediate callback and run it, instead of calling through function.
R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45097 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-13 12:35:40 +00:00
lrn@google.com 1b208bd6e6 Update Isolate API.
Remove AS_EVENT as priority of ping/kill. It wasn't very usable or predictable.
Make priority consistently named and a named parameter.
Add response object to ping/addExitListener so it doesn't have to send null.
This is useful for cases where you want to use the same receive port for
multiple purposes.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45092 260f80e4-7a28-3924-810f-c04153c831b5
2015-04-13 10:29:54 +00:00
iposva@google.com 91e105d8c6 - Implement some more missing pieces of the Isolate API.
Added:
    * addOnExitListener, removeOnExitListener
    * setErrorsFatal
    * addOnErrorListener, removeOnErrorListener

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44307 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-07 01:04:19 +00:00
iposva@google.com b4088d10c9 Adjust handling of timers:
- Every zero timer is enqueued individually in the event queue
  and handled in sequence with other events.
- Non-zero timers and zero timers expire in order. Therefor a
  due zero timer will also fire all preceding non-zero timers
  to ensure this order.

R=sgjesse@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44095 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-27 16:45:23 +00:00
iposva@google.com ad008bf8ba - Move timer implementation closer to the rest of message handling.
R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43225 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-28 00:39:35 +00:00
asiva@google.com ca1c3241c4 Fix for issue 21398.
Accept only 'literal-like' objects when sending messages to isolates
spawned using spawnURI. Allow all objects for isolates spawned using
spawnFunction.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42793 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-12 23:14:30 +00:00
iposva@google.com 2104fd6165 Fix http://dartbug.com/21834
- Ensure that microtasks fire after every timer event, instead
  of being bunched together once all pending timers fired.
- Do not wait for timer message to be delivered. Trigger timers
  as soon as they are ready from within the message handling
  loop.
- Notify timers in the order of wakeup time regardless of
  specified timeout value. (AKA Do not allow Timer.run to
  overtake new Timer() scheduled operations.)

R=zra@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42673 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-07 22:21:59 +00:00
iposva@google.com fd69128004 - Allow an isolate to be started in paused state.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42576 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-30 23:52:37 +00:00
lrn@google.com cf724d70a9 Add Isolate.current getter, returning the current isolate as an Isolate object.
R=floitsch@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42499 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-19 07:04:29 +00:00
iposva@google.com 577242dbd4 - Implement Isolate.kill.
R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42355 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-13 00:39:16 +00:00
iposva@google.com 602aad28a1 - Implement Isolate.ping.
- Allow isolate library messages to be enqueued at the beginning
  of the message queue.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42193 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-08 22:45:10 +00:00
iposva@google.com 320ffa23a1 - Implement hashCode and == for Capability.
R=lrn@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@42102 260f80e4-7a28-3924-810f-c04153c831b5
2014-12-04 12:17:48 +00: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
lrn@google.com 0acdec95ff Specify packageRoot parameter to Isolate.spawnUri.
R=ajohnsen@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39903 260f80e4-7a28-3924-810f-c04153c831b5
2014-09-05 09:11:54 +00:00
ricow@google.com 69bed3d030 Revert revision 39617 "Create isolates in a separate thread."
This is breaking dartium with:
BrowserOutput.stderr:
  ../../dart/runtime/vm/dart_api_impl.cc:1614: error: Dart_EnterScope expects there to be a current isolate. Did you forget to call Dart_CreateIsolate or Dart_EnterIsolate?

R=vsm@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39638 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-28 09:52:59 +00:00
turnidge@google.com 3cd24f8ebf Create isolates in a separate thread.
Previously the parent isolate waited for the child isolate to fully
load, which was not ideal.  This change fixes that.

If you run on mac, you may need to raise your open file limit to make mandel_isolate_test pass:

ulimit -n 1024

Default open file limit on the mac is low.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39617 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-27 19:47:06 +00:00
turnidge@google.com 2d4250d852 Defer execution of the main isolate's entry point until the message loop.
This allows us to know more accurately the stack limit while running main.

R=johnmccutchan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39558 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-26 17:21:20 +00:00