Commit graph

35 commits

Author SHA1 Message Date
Ryan Macnak 58c6d78712 [vm] Check Zones are only [un]chained on the correct side of a safepoint transition.
Fix order in Dart_CreateIsolate and some tests.

Change-Id: Iceb748be3f7aa6b68ce7abb7f65a3c54ad63c1d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100795
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-05-01 00:36:14 +00:00
Ryan Macnak 347b72c260 [vm] Bypass malloc for large Zone allocations to avoid jemalloc leaks.
Revert 9a07ad88f4.

Bug: https://github.com/flutter/flutter/issues/29007
Change-Id: I6a5f51f0c3a54d354ec5f8495677d46f94d8a1d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100568
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-30 16:17:18 +00:00
Martin Kustermann 832668ff6c Reland "[Infra] Let run_vm_tests --list output a test expectation marker"
Due to not having support for __VA_OPT__ yet the CL introduces a new
wet of macros ..._WITH_EXPECTATIONS() which can be given an expectation
marker.

Change-Id: I33812937f1b226fa89b3ab17a8a3483914abf2e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100643
Reviewed-by: Stevie Strickland <sstrickl@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-04-26 12:15:19 +00:00
Martin Kustermann 76c6b86915 Revert "[Infra] Let run_vm_tests --list output a test expectation marker"
This reverts commit 7cb73d97d2.

Reason for revert: It caused windows build to fail (reason unknown):

c:\b\s\w\ir\cache\builder\sdk\runtime\vm\compiler\assembler\assembler_x64_test.cc(1097): error C3861: 'AssemblerTestGenerate_BitScanReverse': identifier not found
c:\b\s\w\ir\cache\builder\sdk\runtime\vm\compiler\assembler\assembler_x64_test.cc(5499): error C3861: 'AssemblerTestGenerate_bittest': identifier not found

Original change's description:
> [Infra] Let run_vm_tests --list output a test expectation marker
> 
> Due to not having support for __VA_OPT__ yet the CL introduces a new
> wet of macros ..._WITH_EXPECTATIONS() which can be given an expectation
> marker.
> 
> Change-Id: Icaac4672f04340fe4644d13a14c32704ba36daec
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96940
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

TBR=sortie@google.com,kustermann@google.com,regis@google.com

Change-Id: Ica07ef5e7302e3d8e4b131427ff5ab20be8c6a63
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100581
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-04-25 14:35:45 +00:00
Martin Kustermann 7cb73d97d2 [Infra] Let run_vm_tests --list output a test expectation marker
Due to not having support for __VA_OPT__ yet the CL introduces a new
wet of macros ..._WITH_EXPECTATIONS() which can be given an expectation
marker.

Change-Id: Icaac4672f04340fe4644d13a14c32704ba36daec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/96940
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-04-25 12:07:01 +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
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
Ben Konyi c0511ad2ef Reimplemented zone memory tracking to avoid race conditions that were causing crashes in the previous implementation and made some minor name changes.
BUG=
R=asiva@google.com, johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2762323002 .
2017-03-23 09:03:08 -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
Ben Konyi 1e0bf05aaf Added tracking of memory usage within ApiNativeScopes. Usage to be displayed within Observatory.
BUG=
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2650583014 .
2017-01-26 15:24:03 -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
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
Ben Konyi a3ec04eb99 Fixed bad calculations for determining total allocated size of a zone.
BUG=
R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2570763002 .
2016-12-12 17:48:59 -08:00
Ben Konyi fa25fdd72d Fixed tests breaking build.
Merge branch 'master' of github.com:dart-lang/sdk into fix

Updated format string to reflect actual type.

BUG=

Review-Url: https://codereview.chromium.org/2562243003 .
2016-12-12 11:36:55 -08:00
Ben Konyi 35a49bc1ff Created methods to surface zone memory information for each isolate and thread in JSON.
BUG=
R=asiva@google.com, johnmccutchan@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2554983002 .
2016-12-12 09:56:49 -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
Ivan Posva 9c0c6cb5c2 Add product mode:
- Add PRODUCT define and build mode to gyp configurations.
- Add product mode to test harness.
- Start to unify list of flags.
- Allow flags to be constant for particular build configurations.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1663863002 .
2016-02-03 21:10:30 -08:00
Ivan Posva 0a0b101fbd - Remove deprecated StackZone constructor with Isolate parameter.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1312813006 .
2015-09-02 16:07:48 -07:00
Daniel Andersson bc149bf2f5 Migrate most uses of StackZone(Isolate*) to Thread*.
Also migrate some HANDLESCOPE uses.
This prepares for concurrent compilation.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1285293004 .
2015-08-13 13:11:30 -07:00
Florian Schneider ef7a55281f VM: Load allocation-top and -end via Thread.
Cache a pointer to the isolate's Heap in the Thread object
and use it in generated code for allocation.

Change generated allocation code to load allocation-top and
end via THR (THR->heap.top). This is slightly slower than
embedding the address, but faster than loading it
via the Isolate (THR->isolate->heap.top)

BUG=
R=koda@google.com

Review URL: https://codereview.chromium.org//1263513002 .
2015-08-03 16:26:23 +02:00
Ivan Posva f5e3f94019 Fix http://dartbug.com/23578:
- Complete revamp of isolate-specific flags.
- Associate flags with the isolate on creation.
- Dart_CreateIsolate and associate callback do take an
  extra flags argument.
- Make sure to clear IC data array when clearing code.

BUG=23578

Review URL: https://codereview.chromium.org//1162033005
2015-06-07 17:57:34 +02:00
fschneider@google.com 699add3afc VM: Make ZoneAllocated-objects that don't need a vtable smaller.
Remove virtual destructor from ZoneAllocated. Instead, subclasses
that need one have it explicitly declared.

This makes ZoneAllocated objects without virtual functions smaller
because there won't be a vtable for them.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37228 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-11 10:54:16 +00:00
asiva@google.com a02f310d91 Added code to trace zone and handles creation/deletion under flags
--trace-zone and trace-handles
Review URL: https://codereview.chromium.org//11879005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@17001 260f80e4-7a28-3924-810f-c04153c831b5
2013-01-12 00:33:16 +00:00
tball@google.com 2cd8436c5a Changed StackZone and ApiZone to be containers for Zone.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13707 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-16 22:05:40 +00:00
tball@google.com 76d7c9b105 Renamed Zone->StackZone, BaseZone->Zone, in preparation for changing isolate->get_zone() to return what was called the BaseZone instead of its wrapper. The GetBaseZone() methods were not renamed, to help the next CL.
BUG=

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@13314 260f80e4-7a28-3924-810f-c04153c831b5
2012-10-05 19:52:55 +00:00
turnidge@google.com 2803d78dfd Change the zone allocation api.
Instead of passing a size in bytes to the allocation function, we now
have a templatized Alloc function:

  zone->Alloc<Type>(len)

This is better for security, as we can check for integer overflow in
the size computation before performing the allocation.  Before, we
often failed to check this.
Review URL: https://chromiumcodereview.appspot.com//10836061

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@10254 260f80e4-7a28-3924-810f-c04153c831b5
2012-08-03 21:51:44 +00:00
turnidge@google.com e61a02c10d Implement spawnFunction from the new isolate api.
Still need to implement spawnUri, which will be the more difficult one.
Review URL: https://chromiumcodereview.appspot.com//9691005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@5441 260f80e4-7a28-3924-810f-c04153c831b5
2012-03-13 22:05:08 +00:00
turnidge@google.com e62f34ce77 Give isolates names to be used during debugging.
Implement --trace_isolates.

-------------

Sample output of --trace_isolates for the CrossIsolateMessageTest:

[+] Starting isolate:
    isolate:    CrossIsolateMessageTest.dart/main-7112
[+] Starting isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
[+] Starting isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 7117
    dest:       CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    dest_port:  7115
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    reply_port: 7118
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7117
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 7119
    dest:       CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    dest_port:  7114
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    reply_port: 7120
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7119
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    dest_port:  7120
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    dest_port:  7118
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7116
[>] Posting message:
    source:     CrossIsolateMessageTest.dart/main-7112
    reply_port: 0
    dest:       CrossIsolateMessageTest.dart/main-7112
    dest_port:  7113
[-] Stopping isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate2.main-7115
[-] Stopping isolate:
    isolate:    CrossIsolateMessageTest.dart/CrossIsolate1.main-7114
[-] Stopping isolate:
    isolate:    CrossIsolateMessageTest.dart/main-7112
Review URL: https://chromiumcodereview.appspot.com//9242035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3416 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-18 21:46:27 +00:00
sgjesse@google.com bf67f24098 Move assert.h/assert.cc from runtime/vm to runtime/platform
The purpose of this change is twofold:

1. Source in the bin directory can now use the same assertions as
   source in the vm directory. The ASSERT macro used by the code
   in runtime/bin was just defined to use assert from the standard
   C library.
2. Moving other implementation parts from runtime/vm to
   runtime/platform (e.g. classes Monitor and Mutex) for sharing
   between runtime/bin and runtime/vm will be easier as these
   implementations rely on these assertion macros.

Created two gypi files for the platform directory. One for the
headers and one for the source. The source one is only included
when building the VM library and will be present in libdart.a
when the dart executable is linked.

All the code for asserts is still in the dart namespace.

Also re-arranged the order of includes to be alphabetically in
the files touched.

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

BUG=
TEST=

Review URL: http://codereview.chromium.org//9189003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3335 260f80e4-7a28-3924-810f-c04153c831b5
2012-01-16 12:28:10 +00:00
asiva@google.com 5cf3ad018a Changes to pass the current isolate to all runtime and native calls.
Review URL: http://codereview.chromium.org//8528010

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@1499 260f80e4-7a28-3924-810f-c04153c831b5
2011-11-12 05:55:22 +00:00
dgrove@google.com 4c0f559d23 Initial checkin.
git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@15 260f80e4-7a28-3924-810f-c04153c831b5
2011-10-05 05:20:07 +00:00