Commit Graph

61 Commits

Author SHA1 Message Date
Ryan Macnak f9a6a5bdd2 [vm] Update NULL to nullptr in runtime/vm.
TEST=build
Change-Id: I2834ef7cf7cb7c8770f8167a2438cbedcee5c623
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292063
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2023-04-10 18:15:12 +00:00
Ryan Macnak 81143e16c4 [vm, gc] Don't perform blocking compactions in response to Dart_NotifyLowMemory.
These GCs usually did not free very much memory but did consume a lot of CPU. They would on low-powered, low-memory devices often take ~1s, during which time the OS might decide the OOM signal wasn't working and kill us before the compaction can complete and free pages. Instead, only release pooled memory.

Also use more appropriate GCReasons in calls of CollectMost/AllGarbage.

TEST=ci
Bug: b/216333343
Change-Id: Ia56b9ca409410f17d40508c69fb1bc9df0ce4028
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235300
Reviewed-by: Slava Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2022-03-08 22:42:46 +00:00
asiva 120616eefd [VM/Runtime] Check return value from message handler 'run' method.
TEST=cq

Change-Id: I770e1c606c6622e5cb63bca72b74c63ce776ef53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210428
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2021-08-18 18:22:53 +00:00
asiva 1f405bf163 [VM/Runtime] Added a Dart VM initialization state to prevent racy access
to VM state from Dart API calls.

The state is used to protect the following Dart API calls that exhibit
racy behavior
- Dart_Timeline calls (see
  https://github.com/dart-lang/sdk/issues/44814,
  https://github.com/flutter/flutter/issues/74134)
- Dart Native port creation calls
- Dart VM service invocation call

TEST=new C++ api test have been added.

Change-Id: I26f6cff254366e13daff138041037696b3429f69
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/209761
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-08-13 18:25:31 +00:00
Ryan Macnak bbefc05748 [vm] Rewrite isolate message serialization.
TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/25559
Bug: https://github.com/dart-lang/sdk/issues/27285
Bug: https://github.com/flutter/flutter/issues/84691
Change-Id: I04608c5d337144195748d5f3509a29eb3116585d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207865
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2021-07-29 16:55:55 +00:00
Clement Skau 4d5055805f [VM/FFI] Adds FFI leaf calls.
This CL adds FFI leaf calls by adding `lookupFunction(.., isLeaf)`
and `_asFunctionInternal(.., isLeaf)`, which generate FFI leaf calls.
These calls skip a lot of the usual frame building and generated <->
native transition overhead.

`benchmark/FfiCall/` shows a 1.1x - 4.3x speed-up between the regular
FFI calls and their leaf call counterparts (JIT, x64, release).

TEST=Adds `tests/ffi{,_2}/vmspecific_leaf_call_test.dart`. Tested FFI tests.

Closes: https://github.com/dart-lang/sdk/issues/36707
Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-release-arm64-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm64-try,vm-ffi-android-product-arm-try,vm-ffi-android-debug-arm64-try,vm-ffi-android-debug-arm-try,vm-kernel-linux-debug-ia32-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-release-x64-try,vm-kernel-mac-debug-x64-try,vm-kernel-precomp-nnbd-mac-release-simarm64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-asan-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-precomp-ubsan-linux-release-x64-try,vm-kernel-precomp-tsan-linux-release-x64-try,vm-kernel-precomp-win-release-x64-try,vm-precomp-ffi-qemu-linux-release-arm-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try
Bug: https://github.com/dart-lang/sdk/issues/36707
Change-Id: Id8824f36b0006bf09951207bd004356fe6e9f46e
Cq-Do-Not-Cancel-Tryjobs: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179768
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-21 11:12:02 +00:00
Clement Skau cb2a625d7c [vm] Removes FLAG_enable_testing_pragmas from native_api_impl
This removes the need for passing the flag to use
Dart_ExecuteInternalCommand, which is done in several tests
that otherwise have nothing to do with testing pragmas.

Also adds status file skips for precomp-win targets that currently
crash due to https://github.com/dart-lang/sdk/issues/40579.

TEST=CQ

Bug: https://github.com/dart-lang/sdk/issues/46059, https://github.com/dart-lang/sdk/issues/46061
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-win-release-x64-try,vm-kernel-precomp-nnbd-win-release-x64-try,vm-kernel-win-debug-x64-try
Change-Id: I3024ad9bedb7a74abaaaa1020b7525e5d8b1bd47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200461
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2021-05-21 07:04:37 +00:00
Martin Kustermann 3c81d992ef [vm/concurrency] Distinguish "gc safepoint operations" from "deopt safepoint operations"
This extends the existing safepoint operation mechanism by allowing to
perform two different operations:

  * "gc safepoint operations": All mutators are stopped at places where
    it's safe to GC. It therefore requires stackmaps to be available for
    all optimized mutator frames.

  * "deopt safepoint operations": All mutators are stopped at places
    where it's safe to GC, but also safe to lazy-deopt mutator frames.
    It therefore requires deopt-id/deopt-info to be available for all
    optimized mutator frames.

Mutators can be asked to block for any of those two safepoint operations.
If a mutator is at a place where its safe to GC it will respond to "gc
safepoint operations" requests, if a mutator is additionally at a place
where it's also safe to lazy-deopt it will respond to "deopt safepoint
operation" requests.

Depending on how the runtime was entered (which is tracked via the
[Thread::runtime_call_deopt_ability_] value) - the mutator might
participate in both or only in gc safepoint operations.

During the start of a "deopt safepoint operation", the safepoint handler
will request all threads to stop at a "deopt safepoint". Some threads
might first want to initiate their own "gc safepoint operation"
(e.g. due to allocation failure) before they reach a "deopt safepoint".

We do allow this by letting the safepoint handler own a "deopt safepoint
operation" but still participate in other thread's "gc safepoint
operation" requests until all mutators are checked into places where
it's safe to lazy-deopt at which point the "deopt safepoint operation"
also owns a "gc safepoint operation".

In order to facilitate this, the Thread's safepoint_state will be
extended to consist of the following bits:

  * AtSafepoint
  * SafepointRequested
  * AtDeoptSafepoint
  * DeoptSafepointRequested
  * BlockedForSafepoint

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

TEST=vm/cc/SafepointOperation_*

Change-Id: Icdc2827718f6780818f99b829a5e806d6bb5b130
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196927
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-05-10 09:13:09 +00:00
Ryan Macnak b1c09ecd8f [vm] Make naming more consistent when converting between handles, tagged and untagged pointers.
Currently we have things called XPtr which are not what you get from ptr().

Old world:
handle->raw() returns RawObject* (tagged)
raw_obj->ptr() returns RawObject* (untagged)

After 6fe15f6df9:
handle->raw() returns ObjectPtr
obj_ptr->ptr() returns ObjectLayout*

New world:
handle->ptr() returns ObjectPtr
obj_ptr->untag() returns UntaggedObject*

TEST=ci
Change-Id: I6c7f34014cf20737607caaf84979838300d12df2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149367
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-15 23:32:02 +00:00
Martin Kustermann 0f76981bb1 [vm/concurrency] Change references to class_table/object_store/heap from Isolate to IsolateGroup
As part of making the compiler and other subsystems independent
of `Isolate` we have to move various state from `Isolate` to
`IsolateGroup`.

The class_table and object_store were already moved to `IsolateGroup`.

This CL only replaces usages of `Isolate::{object_store,class_table}`
with the equivalent in `IsolateGroup`.

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

TEST=Pure refactoring - relying on existing test coverage.

Change-Id: I34a0682d715b054d6c5faff077a513980f59a348
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177126
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2021-01-06 15:22:11 +00:00
Alexander Markov 7588ed86de Remove bytecode mode from the VM
Change-Id: Ief167b7ffc128105a03cc225ab750234c9a6a7a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169147
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-10-28 17:42:35 +00:00
Alexander Aprelev d33e51df3c [build] Support --clang when building dart sdk on Windows.
It relies on flutter copy of clang distribution, same one that is used to build flutter/engine.

It addressed several deprecated warnings from clang compiler for functions like strdup, unlink, etc.

It allows few warnings still since they are triggered in third_party sources.

Change-Id: Ieb13792c011438d46dbbc0fa030e1b5e4ea14315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/142704
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-06-25 03:36:41 +00:00
Ryan Macnak 13ec6ef5ff [vm] Address TSAN errors in FFI tests.
Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: I34556155d1d20ab48af952ddc4fdb6959db960d5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140250
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2020-03-23 21:19:36 +00:00
asiva b52d264f5b [VM/runtime] Address code review comments.
Change-Id: I6d33b5d522e32f29ffefc7282b2fbe09b1db6a7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129811
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-12-27 21:27:35 +00:00
asiva 8e4421a95e [VM/runtime] Conditionally include kernel/service isolate code
- Do not include the kernel isolate code in the precompiled runtime
- Do not include the service isolate code in PRODUCT mode

Change-Id: I6c49a9d4b3523205d1d70d1c6e5743b809ef3212
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129807
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-12-27 19:46:15 +00:00
Martin Kustermann 1f2316adc5 [vm] Add clang-tidy PRESUBMIT.py check on linux, flag implicit-to-bool conversions
Fixes also some implicit to bool conversions in native_api_impl.cc

Change-Id: I31aecaa1e442f7f934de46ee019765f9f0746658
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115248
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-09-04 08:53:12 +00:00
Martin Kustermann 28f692165e [vm] Improve error message from Dart_InvokeVMServiceMethod()
Change-Id: Ib7dad8a4e7fcc7ebb224bee848728e235f04459e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114508
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2019-08-28 13:18:52 +00:00
Daco Harkes 670d40d808 [vm/ffi] regression test for 37511
I tested this test manually by reverting 48d92b3176 to confirm that it makes the test segfault.

Closes: https://github.com/dart-lang/sdk/issues/37511

Change-Id: I62cb2b83775780a2fccfd9ee4ebff793de82090a
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try, app-kernel-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109703
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-08-21 08:10:34 +00:00
Samir Jindel e59a4a2b42 [vm/ffi] Call natives through stubs if write-protection is enabled without dual-mapping.
Addresses the Dart -> Native half of dartbug.com/37629

Change-Id: I242b7f3a14dd105334a8b6e5c089b173c398491e
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111280
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-07 11:37:20 +00:00
Clement Skau 8cce940579 [API] Makes Dart_InvokeVMServiceMethod errors more specific.
Specifies that the 'isolate' mentioned in the error message is always the
service isolate.
Also adds a specific error message for when the service isolate port isn't
found, which can indicate the service isn't there (yet?).

Change-Id: I1f29b7c4ccf4df2c3dbefafe05f410e4725488e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111426
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-07-31 12:21:24 +00:00
Samir Jindel dd306dd36f [vm/ffi] Remove hacks and instability from FFI GC tests.
This is based on https://dart-review.googlesource.com/c/sdk/+/100583/2,
but instead of relying on private symbols, we expose an API function which
is a no-op outside specific tests.

Fixes https://github.com/dart-lang/sdk/issues/36723

Change-Id: Ieb78caa2d14956a2b5f985533b9b73e941d2d9c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103801
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-06-06 15:52:12 +00:00
Alexander Markov e3edfd36b2 [vm/snapshots] Finalize and sort all classes in snapshots with compilation trace
This ensures that core-jit snapshots used in Fuchsia (built according
to the compilation trace) would have properly sorted cids without any
gaps with non-finalized classes. This enables merging of cid ranges in
more cases and more efficient cid checks.

Issue: https://github.com/dart-lang/sdk/issues/36428
Change-Id: I7b696ccb7d5ffa80f190bcfc9e1b7229937f16b6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103403
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-22 16:01:07 +00:00
Matthew Dempsky a53c12d07a [vm] Use std::unique_ptr with Message
Message is a C++ type with a simple ownership model appropriate for
std::unique_ptr. This CL applies the following changes:

1. All uses of "new Message(...)" are replaced with
"Message::New(...)", which is effectively
"std::make_unique<Message>(...)". (The latter was only added in C++14,
but Dart still compiles in C++11 mode.)

2. All owning Message* are replaced with std::unique_ptr<Message>. The
notable exception is MessageQueue, which still uses raw Message*
internally to simplify the linked list handling.

3. All "delete message;" statements are removed.

4. Uses of "NULL" replaced with "nullptr" as necessary.

Change-Id: I05b5804289f2a225bfa05d3c1631129358fed373
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101222
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
2019-05-06 21:01:39 +00:00
Vyacheslav Egorov 1dd4559271 [vm] Add Native->VM transitions when dereferencing API handles.
For example setting return value unwraps handles and stores
raw pointer values to the stack which might race with GC
in another thread.

This CL adds assertions in helper methods from Api class which
unwrap API handles and fixes all places that were revealed by
those assertions.

Caveat: we still permit to check whether handle contains
Smi or not without entering VM state - because GC does not
change this property.

Bug: b/127482366
Change-Id: I59f08c2a91935995514fb70607c2777aa2844d94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95654
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-03-08 00:06:37 +00:00
Martin Kustermann f205292227 [VM] Bare instructions - Part 4: Add --use-bare-instructions flag to AOT compiler & runtime
This is the final CL which adds a new --use-bare-instructions flag to
the VM.

If this flag is set during AOT compilation, we will:

  * Build one global object pool (abbr: GOP) which all code objects
    share. This gop will be stored in the object store.  The PP register
    is populated in the enter dart stub and it is restored when
    returning from native calls.

  * Gets rid of the CODE_REG/PP slots from the dart frames. Instead the
    compiled code uses the global object pool, which is always in PP.

  * Starts emitting pc-relative calls for calls between two dart
    functions or when invoking a stub.
    Limitation: We only emit pc-relative calls between two code objects
    in the same isolate (this is because the image writer is writing
    instruction objects for vm-isolate/main-isolate seperately)

  * We do compile-time relocation of those static calls after the
    precompiler has finished its work, but before writing the snapshot.
    This patches all the instruction objects with pc-relative calls to
    have the right .text distance.

  * We emit a sorted list of code objects in ObjectStore::reverse_code_table,
    which will be used by the AOT runtime to go back from PC to Code
    objects (where all metadata, e.g. stack maps, catch entry moves, pc
    descriptors are available).

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

Change-Id: I6c5dd2b1571e3a889b27e804a24c2986c71e03b6
Reviewed-on: https://dart-review.googlesource.com/c/85769
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-12-14 16:03:04 +00:00
Ryan Macnak 235a918233 [vm] Remove Dart_LoadScript, Dart_LoadLibrary, Dart_LoadSource, etc.
Change-Id: I9c19625702f1df48c03de2eb3a0f7bb581d2e0b3
Reviewed-on: https://dart-review.googlesource.com/c/79140
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-10-11 00:38:37 +00:00
Zach Anderson dba8b37d38 [vm] Benchmark for reading kernel bytecode
Change-Id: I07617a553193495fcc4fc0ce4a6382996ee7dc51
Reviewed-on: https://dart-review.googlesource.com/75821
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-09-24 15:54:49 +00:00
Martin Kustermann 4becf1aec3 [VM] Fix windows build after landing new navie embedder API
Change-Id: Ie726abe8038b873761e2f9f25de67a51c7c933fa
Reviewed-on: https://dart-review.googlesource.com/66564
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-07-25 12:34:59 +00:00
Martin Kustermann 33914226f2 [VM] Add Dart_InvokeVMServiceMethod() to dart_tools_api.h
This will allow any embedder to use a C++ API to talk to the vm-service.
Usecase is e.g. trigger a hot-reload without speaking websocket.

Change-Id: Ia54e5a73a0f0a4899e3e6d60694af0b394efb993
Reviewed-on: https://dart-review.googlesource.com/66384
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-07-25 12:06:55 +00:00
Ryan Macnak ebdc8abaae [vm, service] Avoid double TLS creating timeline events for API functions.
Add timeline events for Dart_CompileAll and Dart_ParseAll.

Change-Id: I184319aadfe18a6e51cb44c2ab77fb95f452f6de
Reviewed-on: https://dart-review.googlesource.com/43242
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-02-23 01:31:38 +00:00
Ryan Macnak 3f40488ec4 [vm, isolate] Refactor isolate message snapshotting to centralize construction of the Message.
Remove unused special case in ApiMessageWriter for lists of int.

This is in preparation for ensuring we always free any external data that ends up in an isolate message.

Bug: https://github.com/dart-lang/sdk/issues/31959
Change-Id: I999656fc11d2aee9aebe70852be5bb075f234b4d
Reviewed-on: https://dart-review.googlesource.com/41020
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-02-14 00:28:01 +00:00
Ryan Macnak 958a4ebdc8 Misc missing API errors for AOT runtime.
Change-Id: I5742bd1600fcb6b22351fdfc6bb38139dc007352
Reviewed-on: https://dart-review.googlesource.com/26421
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-12-07 17:49:39 +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
Vyacheslav Egorov 9bae50bf47 VM: [Kernel] Revert changes to the native ports that introduced peers.
The problem with these changes was that closed ports still continue to receive
messages and as a result we start using dead peer objects.

Fixing that would require more intrusive changes into message handler implementation - so instead we are reverting the changes and restoring manual PORT -> PEER mapping.

BUG=
R=erikcorry@google.com

Review-Url: https://codereview.chromium.org/2666063002 .
2017-01-31 10:30:15 +01:00
Vyacheslav Egorov 43a0500e37 VM: [Kernel] Fix bootstraping when Kernel isolate is used.
We must bootstrap from Kernel instead of Source when running with --dfe

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

Review-Url: https://codereview.chromium.org/2651633002 .
2017-01-30 20:52:59 +01:00
Ryan Macnak cbf3eaeb90 Fix various memory leaks in unit tests detected by a new version of ASAN.
R=zra@google.com

Review-Url: https://codereview.chromium.org/2620413002 .
2017-01-11 11:12:40 -08:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Siva Annamalai 12f86594ec Add --parse-all option in order to benchmark and measure the scanner/parser performance.
R=hausner@google.com

Review URL: https://codereview.chromium.org/2327693002 .
2016-09-23 15:20:39 -07:00
Todd Turnidge f8ff7bd5c4 Delete NativeMessageHandler once a native port closes.
Closes #27002

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2217693002 .
2016-08-04 15:34:24 -07:00
John McCutchan 757b7d094c Revert "Fix NativeMessageHandler leak"
This reverts commit 425efb9808.

BUG=

Review URL: https://codereview.chromium.org/2207663002 .
2016-08-02 11:33:12 -07:00
John McCutchan 425efb9808 Fix NativeMessageHandler leak
Fixes #27002

R=zra@google.com

Review URL: https://codereview.chromium.org/2200903002 .
2016-08-02 11:08:18 -07:00
Siva Annamalai e72c1fb47d Implement safepointing of threads :
- uses thread execution status transition to track when a thread is in a safepoint or needs to block for a safepoint
 - introduces a monitor per Thread object
 - uses a per thread safepoint handshake between the thread requesting a safepoint and the requested thread.

The ThreadRegistry class now contains only the thread list for an isolate and the functionality of scheduling a thread onto an Isolate and unscheduling it from teh isolate. We could fold this functionality into the Isolate class in a different CL.

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

Review URL: https://codereview.chromium.org/1541073002 .
2016-02-01 10:57:34 -08:00
Zachary Anderson ad0e9622e9 Fix build
TBR

Review URL: https://codereview.chromium.org/1519333002 .
2015-12-11 19:45:17 -08:00
Zachary Anderson a0970835f0 Adds a special case for sending an int over a port with the native API.
This improves dart <=> C++ IPC round-trip-times for Mojo by 10-20%.

BUG=

Review URL: https://codereview.chromium.org/1499853004 .
2015-12-11 16:07:16 -08:00
Siva Annamalai 01b69ebabc Move ApiLocalScope out of class ApiState into class Thread so that the API local handles and zone etc. are thread specific instead of being Isolate specific.
R=zra@google.com

Review URL: https://codereview.chromium.org/1473403003 .
2015-11-25 11:07:22 -08:00
Siva Annamalai 9e19d236ca - Add an OSThread structure which is the generic TLS structure for all C++
fields in a thread (i.e fields that are not Dart VM related)
- Split the Thread structure to be a pure Dart per thread structure and add
  a pointer to os_thread which points to the OSThread structure
- Change Schedule/UnSchedule to set the Dart Thread structure as the TLS of
  the thread when it is inside the Dart world and reset the TLS back to the
  OSThread strcuture when is exits the Dart World.
- Moved the stack_base and few stack size related functions to OSThread from Isolate

R=johnmccutchan@google.com, zra@google.com

Review URL: https://codereview.chromium.org/1439483003 .
2015-11-19 13:45:10 -08:00
Srdjan Mitrovic 465cf10a7c Remove some Isolate::current_zone() calls, as it gets the zone from mutator thread not the current thread
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1414493003 .
2015-10-19 10:27:36 -07:00
Srdjan Mitrovic ab20fa00da Move no_callback_scope_depth_ and cha_ from isolate -> thread
Add checks for background compilation:
- Dart code may not be invoked
- Object allocation must happen in old space

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1401413002 .
2015-10-13 14:29:43 -07:00
Srdjan Mitrovic 8d618766a8 Remove isolate argument from handle allocation: Part II
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org/1389353004 .
2015-10-12 14:06:50 -07:00
Ryan Macnak 0ed4d44a99 Toward precompiled snapshots.
Gets as far as encountering null Instructions in the first Dart_Invoke after loading the snapshot.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1318803002 .
2015-09-02 16:15:02 -07:00