Commit Graph

161 Commits

Author SHA1 Message Date
Ryan Macnak 09e1766e6c [vm] Omnibus memory leaks.
- Fix leak of IsolateReloadContext.
 - Fix leak kernel compilation request arguments.
 - Fix leak kernel compilation result errors in reload harness.
 - Fix leak of class table when a schema changes but there are no instances.
 - Fix leak of kernel::Reader during inlining bailout.

Bug: https://github.com/dart-lang/sdk/issues/32187
Bug: https://github.com/dart-lang/sdk/issues/28349
Change-Id: I9ccc65e018c30a3254e928a43b9727ae8d9314d6
Reviewed-on: https://dart-review.googlesource.com/49547
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-05 18:12:11 +00:00
Ben Konyi b3056d8083 Reland "[VM / Hot Reload] Fixed IsolateReload tests which were importing""
This reverts commit 2538adf41a.

Change-Id: I8904241911a7308dd00f6eb3034b05162be44f38
Reviewed-on: https://dart-review.googlesource.com/43494
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-02-23 23:22:18 +00:00
Ben Konyi 418d867250 [ VM ] Updated IsolateReload tests to not directly use TestCase::GetReloadErrorOrRootLibrary as it accesses zone allocated memory.
Change-Id: Id6fb04e549dc3c0ed9db470a4e49b750b5a51124
Reviewed-on: https://dart-review.googlesource.com/43488
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-02-23 22:15:17 +00:00
Ben Konyi 2538adf41a Revert "[VM / Hot Reload] Fixed IsolateReload tests which were importing"
This reverts commit fdce9a8266835fba252150fae8f88f4dee06b698.

Change-Id: Ifca4a1254c9045cb5c5e8b5c1dfcd606b858b8aa
Reviewed-on: https://dart-review.googlesource.com/43262
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-02-22 23:45:25 +00:00
Ben Konyi 8eab1cf6f4 [VM / Hot Reload] Fixed IsolateReload tests which were importing 'test:isolate_reload_helper'
Change-Id: I0c78c41b43a9976bc8c3811314c1efff09ee90cc
Reviewed-on: https://dart-review.googlesource.com/43240
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-22 23:14:29 +00:00
Ben Konyi 889a277536 [VM / Hot Reload] Fixed various hot reload tests that were failing on the CFE.
Change-Id: I4562cdaecc86802e4e7a5407ca06d7a2234102b3
Reviewed-on: https://dart-review.googlesource.com/42520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-20 23:45:09 +00:00
Siva Chandra 6214cedaf5 Create isolate from the platform kernel when running VM tests under dartk.
This is take 2 with appropriate status files updates or fixes to the
tests.

This reverts commit 4925ed38ac.

Change-Id: I133b9ae307f0feed1b72ec5a0131facdc51ad4e9
Reviewed-on: https://dart-review.googlesource.com/41600
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-02-20 22:08:25 +00:00
Ben Konyi 5716109abd [VM / Hot-Reload] Fixed tests that were failing due to different failure messages generated by the VM parser and CFE.
Change-Id: I6840c993300b3ba36c44bfc8f5c0ce6b8043d6f7
Reviewed-on: https://dart-review.googlesource.com/41571
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-02-15 01:03:04 +00:00
Siva Annamalai 4925ed38ac Revert "Create isolate from the platform kernel when running VM tests under dartk."
This reverts commit 3e967d3d76.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Create isolate from the platform kernel when running VM tests under dartk.
> 
> Status of tests which now start failing has been updated.
> 
> Ability to run the vm tests in strong mode has also been added. The
> status of tests which fail in strong mode will be updated when the vm
> tests are moved under the strong mode tests on the bots.
> 
> Change-Id: I95f94c09dd0ebbf1fe661ee1f6e0c3e7b07509bd
> Reviewed-on: https://dart-review.googlesource.com/40642
> Commit-Queue: Siva Chandra <sivachandra@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>

TBR=sivachandra@google.com,asiva@google.com

Change-Id: I6144bbe882cdf56ee6be3132c6f9dec2cbafcb47
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/41026
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-02-13 23:33:12 +00:00
Siva Chandra 3e967d3d76 Create isolate from the platform kernel when running VM tests under dartk.
Status of tests which now start failing has been updated.

Ability to run the vm tests in strong mode has also been added. The
status of tests which fail in strong mode will be updated when the vm
tests are moved under the strong mode tests on the bots.

Change-Id: I95f94c09dd0ebbf1fe661ee1f6e0c3e7b07509bd
Reviewed-on: https://dart-review.googlesource.com/40642
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-13 20:34:24 +00:00
Ben Konyi 6338914d31 - Removed dead code (pulled from review 36121)
- Enabled incremental compiler in the dart frontend for the command-line VM
- Added method to update in-memory file system with in-memory sources provided by tests

Change-Id: Ica26b7235383185dbb6b4b41064193d432dfcba0
Reviewed-on: https://dart-review.googlesource.com/36126
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-07 19:35:39 +00:00
Erik Corry 619656b9c8 [VM] Fix far branches on ARM64 and add tests
R=rmacnak@google.com

Change-Id: I089d12bced44576a8a19e29bad94b1256f320f5f
Reviewed-on: https://dart-review.googlesource.com/38720
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-02-06 08:21:32 +00:00
Erik Corry d300b08e35 [VM] Use X64 disassembler for IA32 and X64 (reland)
R=vegorov@google.com

This removes the IA32 disassembler and uses the X64 disassembler for
both variants.  Instructions that were in the IA32 assembler, but not
supported by the X64 disassembler have been added.  It also adds some
regression tests for a lot of the disassembler output.
Bug:
Change-Id: I243abbb04c3a77810ce96ca74f7f42a5a1aea0cf
Reviewed-on: https://dart-review.googlesource.com/22982
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2017-11-22 12:04:18 +00:00
Erik Corry 80992a5a09 Revert "[VM] Use X64 disassembler for IA32 and X64"
This reverts commit 9e42f006d9.
due to test failures on non-Linux platforms.

R=karlklose@google.com

Bug:
Change-Id: I5dc40da75d8d89fca8fce98a69a39d767493af1b
Reviewed-on: https://dart-review.googlesource.com/22921
Reviewed-by: Karl Klose <karlklose@google.com>
2017-11-22 09:11:12 +00:00
Erik Corry 9e42f006d9 [VM] Use X64 disassembler for IA32 and X64
R=vegorov@google.com

Bug:
Change-Id: I19b1f58e16ea35dc81b941c54e6e57b97cad3d74
Reviewed-on: https://dart-review.googlesource.com/22020
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-22 08:01:07 +00:00
Siva Annamalai 1c282f6482 Fix a set of tests that exercised the library Dart API functions in kernel mode.
Change-Id: Id7ac9166615d2b7de3604da555d9fc61563586af
Reviewed-on: https://dart-review.googlesource.com/20340
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Chandra <sivachandra@google.com>
2017-11-17 18:09:03 +00:00
Ryan Macnak 0e552547a6 Revert "[vm, arm64] Add assembler support for tbz and use it for BranchIfSmi."
This reverts commit 64271895a9.

Reason for revert: Crashes in unchanged assembler tests

Original change's description:
> [vm, arm64] Add assembler support for tbz and use it for BranchIfSmi.
> 
> (Apparently we already had it implemented in the simulator and disassembler.)
> 
> MegaNeverOverridden (Odroid-C2)   -3.702% (-0.5 noise)
> BinaryTrees (Odroid-C2)           -3.296% (-0.4 noise)
> ...
> MegaEquality (Odroid-C2)           2.256% (0.4 noise)
> Splay (Odroid-C2)                  9.879% (0.6 noise)
> MegaOverriddenEvery2nd (Odroid-C2) 6.317% (0.7 noise)
> StringInterpolation (Odroid-C2)    19.07% (0.8 noise)
> ForInLoop (Odroid-C2)              4.902% (1.0 noise)
> 
> Flutter gallery iOS instructions:
> 12543904 -> 12504224 (-0.32%)
> 
> Change-Id: I23fa58e5589ddf5042a2075431bc53aa21723813
> Reviewed-on: https://dart-review.googlesource.com/17061
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,rmacnak@google.com,regis@google.com

Change-Id: I6d55907972a6f1485e2789a8623a557bcdfa7f22
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/20320
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-10 23:57:09 +00:00
Ryan Macnak 64271895a9 [vm, arm64] Add assembler support for tbz and use it for BranchIfSmi.
(Apparently we already had it implemented in the simulator and disassembler.)

MegaNeverOverridden (Odroid-C2)   -3.702% (-0.5 noise)
BinaryTrees (Odroid-C2)           -3.296% (-0.4 noise)
...
MegaEquality (Odroid-C2)           2.256% (0.4 noise)
Splay (Odroid-C2)                  9.879% (0.6 noise)
MegaOverriddenEvery2nd (Odroid-C2) 6.317% (0.7 noise)
StringInterpolation (Odroid-C2)    19.07% (0.8 noise)
ForInLoop (Odroid-C2)              4.902% (1.0 noise)

Flutter gallery iOS instructions:
12543904 -> 12504224 (-0.32%)

Change-Id: I23fa58e5589ddf5042a2075431bc53aa21723813
Reviewed-on: https://dart-review.googlesource.com/17061
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-10 21:35:48 +00:00
Alexander Aprelev a9afb54d6d Revert "Revert "Introduce IKG into kernel-service to support incremental compilation.""
This reverts commit c35510d835
with fix for the build - remove implicit temporary array in TestCase::LoadTestScript.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2998963002 .
2017-08-15 09:03:48 -07:00
Alexander Aprelev c35510d835 Revert "Introduce IKG into kernel-service to support incremental compilation."
This reverts commit f596d440f5.

BUG=

Review-Url: https://codereview.chromium.org/3002553003 .
2017-08-14 14:15:41 -07:00
Alexander Aprelev f596d440f5 Introduce IKG into kernel-service to support incremental compilation.
This CL also adds few hot-reload incremental kernel files tests(some pass, one is failing), which are useful to track progress of hot reload functionality in Flutter setting.

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

Review-Url: https://codereview.chromium.org/2993013002 .
2017-08-14 14:06:15 -07:00
Beeravolu Siva Chandra Reddy 2ea5140093 Fix couple of vm/cc/DartAPI_* tests for the dartk configuration.
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2994883002 .
2017-08-14 17:54:50 +02:00
Siva Annamalai 33c50e9374 1. Correctly set root_library based on the application script URI instead of looking for the library that has the 'main' method.
2. Adjust the Dart front end to not require a 'main' method when the in memory filesystem is used, this allows execution of VM unit tests which all do not necessarily have a 'main' method (integrated CL from siggi)

3. Change kernel reader to not look for a 'main' methos when Dart_LoadKernel is called.

4. Change Dart_LoadScript to also support loading of dart programs when Dart front end is used

R=aam@google.com, sigmund@google.com

Review-Url: https://codereview.chromium.org/2948273002 .
2017-07-19 18:09:19 -07: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
Zachary Anderson ac16656161 Remove MIPS support
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2858623002 .
2017-06-22 08:49:22 -07:00
Régis Crelier 9aafded095 Pass type argument vector to generic functions (if --reify-generic-functions is
true, still false per default).
Work in progress, not functional yet (passed vector is still ignored in callee).

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

Review-Url: https://codereview.chromium.org/2859673002 .
2017-05-18 14:03:47 -07:00
Ben Konyi f2fd150ea0 Added new type of unit test, RAW_UNIT_TEST_CASE, which is used for tests that can be flaky if run while the VM is alive. Tests created using the RAW_UNIT_TEST_CASE macro will run after the VM has shutdown to avoid having any worker threads contaminating the test results.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2666133002 .
2017-01-31 15:16:38 -08:00
Ryan Macnak b46af1e75f Refactor snapshots pieces to include a section for loading instructions into the heap of a regular isolate.
Progress toward allowing each isolate to load a different snapshot.

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2622053002 .
2017-01-23 10:25:02 -08:00
Ben Konyi 259c7ac2be Resolution for issue #5092: Unit test handle checks consider dangling handles to be valid.
Updated the IS_VALID(handle) macro to also check if the handle is still in
scope or is a read-only handle.

BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2640573003 .
2017-01-20 15:50:15 -08:00
Ryan Macnak 26a364f998 Support spawnUri in app snapshots.
- Don't mark core_isolate_snapshot_buffer as a const pointer.
 - Update app snapshots without code to not rewrite the VM isolate snapshot, as already done by app snapshots with code.

Fixes #28368

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2637193002 .
2017-01-17 15:59:41 -08:00
Ryan Macnak 12a3699301 Revert "Support spawnUri in app snapshots."
Failures on IA32.

This reverts commit c6ecfe1746.

Review-Url: https://codereview.chromium.org/2631893002 .
2017-01-13 15:52:36 -08:00
Ryan Macnak c6ecfe1746 Support spawnUri in app snapshots.
Don't mark core_isolate_snapshot_buffer as a const pointer.

Fixes #28368

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2623423007 .
2017-01-13 15:18:27 -08:00
Ryan Macnak f89056f6cd Revert "Support spawnUri in app snapshots."
This reverts commit 593d4504b0.
This reverts commit 113aa64b98.
This reverts commit 422afa2ead.

Review-Url: https://codereview.chromium.org/2633543003 .
2017-01-13 11:02:44 -08:00
Ryan Macnak 593d4504b0 Support spawnUri in app snapshots.
Fixes #28368

R=asiva@google.com

Review-Url: https://codereview.chromium.org/2628283002 .
2017-01-13 10:37:51 -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
Ryan Macnak 26245de7a5 Support unaligned integer loads on ARM and MIPS.
Fixes SDK build with SIMARM/SIMARM64/SIMMIPS.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2452453002 .
2016-10-31 17:41:53 -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 7ff2dd4117 Optimize AOT's switchable calls for the monomorphic case.
The call sequence is very similar to a classic IC call, except the guarded class and the target are loaded indirectly from the constant pool instead of as immediates. In the monomorphic case, we call directly to the expected target with a class check in the callee. In the unlinked, polymorphic and megamorphic cases, we call a stub; these case are now call-through instead of call-and-return.

Every code, except stubs involved in switchable calls, includes the class check sequence at the beginning. So we now distinguish between a checked and an unchecked entry point. Generated code except the switchable call continues to use the unchecked entry point.

PC offsets are calculated relative to the beginning of the instruction stream, rather than either entry point.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/2226893002 .
2016-08-12 11:18:35 -07:00
Todd Turnidge 248ee5227b Pay attention to exports when determine which libraries to reload.
Refactor unit testing framework functionality around imported test
libraries.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2205513002 .
2016-08-01 13:35:22 -07:00
Todd Turnidge 1166f83bf6 Only reload libraries when they may have been modified.
We now check all of the scripts which make up a library.  If any
script is modified, then we consider that library to be modified.  We
also consider any library which imports a modified library to be
modified.  To propagate this info efficiently, we build and discard
the imported-by graph when beginning a reload.

The embedder must provide a FileModifiedCallback in order to support
the detection of modified scripts.

In order to detect changes to package: libraries, we have modified the
embedder interface to provide the resolved url when possible, so that
we don't need to re-resolve package uris when checking for reload.
This change is incompatible and all embedders will need to be updated.

We now support a "force" flag when reloading sources.  This causes all
libraries to be reloaded regardless of whether the underlying scripts
have been updated.

Closes #26919

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2186423002 .
2016-07-29 11:23:18 -07:00
John McCutchan 48c8ffa7f3 Initial isolate reload support
This is a cut of the work that Todd and I collaborated on in the reload branch.

In this CL, we've dropped the loader port hacks, in other words, on stack reloading in the standalone embedder does not work yet.

- [x] Support for hot reloading of isolate source code
- [x] Unit test harness and many tests
- [x] Service protocol and Observatory support
- [x] Product build does not include support for hot reloading.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1965823002 .
2016-05-17 12:19:06 -07:00
Zachary Anderson fc65d07fdf Adds DBC StoreIntoObject test
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1948803002 .
2016-05-03 14:58:40 -07:00
Zachary Anderson a1d241922f Adds more DBC assembler tests.
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1944503002 .
2016-05-03 09:01:11 -07:00
Zachary Anderson 7c9fe49495 Start to add assembler tests for DBC
R=iposva@google.com

Review URL: https://codereview.chromium.org/1927203002 .
2016-04-29 09:09:42 -07:00
Vyacheslav Egorov 751cf3c40c Fix VM CC tests on non-DBC simulators.
TBR=fschneider@google.com

Review URL: https://codereview.chromium.org/1896013002 .
2016-04-19 01:02:48 +02:00
Vyacheslav Egorov ee0f608ce4 Dart Byte Code interpreter.
This version is Clang/GCC only and does not support Windows because it uses computed goto's.

Only unoptimized mode is supported.

Architecture is described in constants_dbc.h and stack_frame_dbc.h.

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

Review URL: https://codereview.chromium.org/1858283002 .
2016-04-18 23:02:01 +02: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
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
Ryan Macnak 3e7212e194 Reapply "Precompilation/x64: Load float vector constants via Thread."
Fix unbalanced Enter/LeaveTestFrame in TestObjectCompare. Crashed on release + clang with the original change, and was failing on ASAN before that.

BUG=http://dartbug.com/24450
BUG=http://dartbug.com/25002
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1499763002 .
2015-12-04 09:46:21 -08:00
Ryan Macnak 7dfb517618 Revert "Precompilation/x64: Load float vector constants via Thread."
This reverts commit 9cf30c9697.

Review URL: https://codereview.chromium.org/1494323002 .
2015-12-03 14:19:21 -08:00