Commit graph

33 commits

Author SHA1 Message Date
Ryan Macnak 36985859e4 [vm] Don't copy when reading typed data in messages sent to native ports.
Bug: https://github.com/dart-lang/sdk/issues/37833
Change-Id: Iac906e58320e003365c4c0624b4587579f352db1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114970
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-30 17:49:28 +00:00
Liam Appelbe a6eb2cd309 [vm] Support for simarm_x64
Third sub-CL of https://dart-review.googlesource.com/c/sdk/+/100644
The first was here https://dart-review.googlesource.com/c/sdk/+/103487
The second was here https://dart-review.googlesource.com/c/sdk/+/104286

This is the last major CL to support simarm_x64. Now that the other two
CLs have put the required infrastructure in place, this CL actually
adds the new mode..

Bug: https://github.com/dart-lang/sdk/issues/36839
Change-Id: Ie2f850bf33544f2462f37854e762191c78b1bde6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105500
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-21 04:00:35 +00:00
Ryan Macnak 8da53e3120 [vm] Add Dart_SaveTypeFeedback and Dart_LoadTypeFeedback.
Change-Id: I8c20271b20638972b28299f0488e7f3dd37f8797
Reviewed-on: https://dart-review.googlesource.com/c/88604
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-01-10 01:04:11 +00:00
Alexander Markov a4dc8cd22e [vm/kernel/bytecode] Make sure bytecode instructions are aligned in kernel
Change-Id: I109123e88b8352b198d5ef9aad9eedc1df7141c8
Reviewed-on: https://dart-review.googlesource.com/c/83543
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-11-09 17:08:46 +00:00
Ryan Macnak 22ccad1aa6 [vm] Stream writing snapshots as assembly to reduce peak memory usage.
Bug: US-449
Change-Id: Ic1ce6881b54c8c0eb7c93cbbda8057d7268bb3fd
Reviewed-on: https://dart-review.googlesource.com/45580
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-03-08 19:26:17 +00:00
Ryan Macnak 558a931409 [vm] Move some string utils from runtime/vm to runtime/platform.
Change-Id: I552086445a7e07792f9da85afa5edf23b6c450d5
Reviewed-on: https://dart-review.googlesource.com/44402
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-03-01 02:07:46 +00:00
Ryan Macnak d366f9619a [vm] Toward deterministic builds.
- Remove random build-id.
 - Replace build time in embedded version string with commit time.
 - Remove timestamps from Observatory tarball.
 - Zero-initialize skipped bytes in snapshot streams.
 - Fix uninitialized fields in PatchClass, Script and Library.
 - Disable (under flag) random identity hashes and concurrent GC.

Bug: https://github.com/dart-lang/sdk/issues/31427
Change-Id: I3e95de679c8372841cd27ca60df78d9b00ffbfe1
Reviewed-on: https://dart-review.googlesource.com/22901
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-23 00:07:56 +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
Ryan Macnak b09552cd62 Reapply "DWARF and unwind support for AOT assembly output."
This reverts commit 8fcdbb4a7f.

R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2761593002 .
2017-03-20 13:02:41 -07:00
Erik Ernst 8fcdbb4a7f Revert "DWARF and unwind support for AOT assembly output."
Gardening.

This reverts commit ca20aab384.

That commit causes generation of incorrect register names on
vm-noopt-simarm64-mac-be, and it seems to cause a disk full
error later on (making the bot purple).

Review-Url: https://codereview.chromium.org/2754233002 .
2017-03-17 12:57:45 +01:00
Ryan Macnak ca20aab384 DWARF and unwind support for AOT assembly output.
Emit CFI information to teach gdb how to unwind Dart frames. Fixes unwinding for Mac x64 and Linux x64/ARM/ARM64. Unwinding already worked for iOS ARM64. Fixes unwinding on Android 6+ ARM.

Emit DWARF information about function inlining and line number mappings. Works with gdb, addr2line and llvm-symbolizer.

With --dwarf-stack-traces, also remove CodeSourceMaps from snapshots and change stack traces to a non-compliant form resembling Android's debuggerd output, which can be passed to ndk-stack.

Issue #28785

R=fschneider@google.com, johnmccutchan@google.com, vegorov@google.com

Review-Url: https://codereview.chromium.org/2723213002 .
2017-03-16 13:08:54 -07:00
Ryan Macnak 909ce02b12 Encode inlining information in CodeSourceMap and remove inlining interval arrays.
CodeSourceMap now contains a small bytecode that describes changes to the token position and inlining stack as one moves through a function. This information is used by the disassembler to display inlining comments and by the profiler to properly blame ticks against source code.

Slightly shrinks the total size of code metadata; on dart2js compiling hello world, the final heap is

 before 59.6MB total, 12.8MB List, 1.1MB CodeSourceMap
  after 59.4MB total, 12.1MB List, 1.5MB CodeSourceMap

To be filtered and included in AOT code to expand inline frames in stack traces.

R=johnmccutchan@google.com

Review-Url: https://codereview.chromium.org/2670843006 .
2017-02-07 12:52:21 -08:00
Martin Kustermann 89de0c9267 Reland "VM: Fix memory leaks during isolate spawning"
R=vegorov@google.com

Review-Url: https://codereview.chromium.org/2649283003 .
2017-01-24 12:04:41 +01:00
Martin Kustermann 50150deaf6 Revert "VM: Fix memory leaks during isolate spawning"
This reverts commit d7e884b05f.

Review-Url: https://codereview.chromium.org/2654443003 .
2017-01-24 10:32:59 +01:00
Martin Kustermann d7e884b05f VM: Fix memory leaks during isolate spawning
Fixes #28351

R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2650693004 .
2017-01-24 09:59:13 +01: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 2ec03cba70 Fix leak of message snapshot buffer when attempting to send an illegal object.
Fix leak with FLAG_enable_debug_break.

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

Review-Url: https://codereview.chromium.org/2629533002 .
2017-01-11 16:50:04 -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
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 f262fad639 Option to output precompiled instructions as a blob for use with mmap instead of assembly for use in a shared library.
BUG=http://dartbug.com/26199
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1915853004 .
2016-04-25 16:19:34 -07:00
Ryan Macnak 83585cfbf1 Emit assembly instead of a blob for the instructions snapshot, and provide labels for the entry point of each Instructions.
R=asiva@google.com

Review URL: https://codereview.chromium.org//1309563006 .
2015-09-04 15:15:50 -07:00
asiva@google.com 6a41d797cb Change snapshot versioning code to use plain strings instead of Dart strings
- This ensures that the versioning itself is not dependent on the Dart object
  layout
- It should also fix the strange performance regression we noticed in tracer
  because of the allocation of an initial version string in the old space.

R=srdjan@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@39708 260f80e4-7a28-3924-810f-c04153c831b5
2014-08-29 20:39:21 +00:00
zra@google.com 0ef376e2bd Changes to improve the performance of reading a snapshot.
There are two changes:
1. The decoding loop in ReadStream is unrolled.
2. Small reorganizaiton of PageSpace::TryAllocate to avoid
   copying SpaceUsuage structs around.

These changes improve performance of CorelibIsolateStartup
~10-12% on ia32.

R=iposva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@37141 260f80e4-7a28-3924-810f-c04153c831b5
2014-06-09 22:16:06 +00:00
iposva@google.com 781f737c6a First round of http://dartbug.com/15922:
- Address warnings about 64-bit to 32-bit conversions.
- Remove heap profiler.

R=asiva@google.com

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@31867 260f80e4-7a28-3924-810f-c04153c831b5
2014-01-16 05:05:35 +00:00
asiva@google.com fbc931e6a6 Report OOM errors instead of asserting on allocation failures when sending
messages to other isolates.

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

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21980 260f80e4-7a28-3924-810f-c04153c831b5
2013-04-24 20:52:22 +00:00
asiva@google.com 01cc7d3cd2 - Canonicalize types, type_arguments only when the object is marked as being from the core libraries.
- adjust the snapshot write buffer growth policy
- turn off the heap growth rate adjustments when reading from a snapshot.
Review URL: https://codereview.chromium.org//12578009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20423 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 22:43:46 +00:00
hausner@google.com d4872a1499 Support initialized mixin fields across scripts
Add capability to set parser to read tokens from different
scripts and token positions. This is used when the initializer
expression of a field resides in a different script.
Review URL: https://codereview.chromium.org//12827007

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@20388 260f80e4-7a28-3924-810f-c04153c831b5
2013-03-22 17:06:42 +00:00
johnmccutchan@google.com 6c4afdd546 Force WriteByte to be inlined
Review URL: https://codereview.chromium.org//12340086

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@19143 260f80e4-7a28-3924-810f-c04153c831b5
2013-02-27 15:21:12 +00:00
asiva@google.com b053301ccf Fix for issue 1204.
Do not allocate a buffer of 64KB by default when writing a message out. Start
with a much smaller buffer. FOr script and full snapshots the buffer
allocated remains 64 KB.
Review URL: https://chromiumcodereview.appspot.com//10908185

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12153 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-11 02:06:59 +00:00
asiva@google.com fdbe32e24d Use external byte arrays for token stream, this moves the token stream out of the isolate heap. For full snapshots the external byte array points to the snapshot buffer thus incurring no extra space in the C heap either.
Heap usage stats before this change is:
New space (0k of 32768k) Old space (1085k of 1280k) Code space (0k of 0k)

Heap Usage stats after this change is:
New space (0k of 32768k) Old space (947k of 1024k) Code space (0k of 0k)

A savings of about 138k.
Review URL: https://chromiumcodereview.appspot.com//10914050

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11977 260f80e4-7a28-3924-810f-c04153c831b5
2012-09-06 18:46:51 +00:00
asiva@google.com 08c662b1c0 Represent tokens as a compressed stream instead of an array.
On x86:

Original sizes:
Size of isolate snapshot = 925655
New space (0k of 32768k) Old space (1700k of 1792k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 80944
CorelibIsolateStartup(RunTime): 5636
UseDartApi(RunTime): 404620
Dart2JSCompileAll(RunTime): 1379683
FrameLookup(RunTime): 45

Size with the new TokenStream implementation:
Size of isolate snapshot = 851352
New space (0k of 32768k) Old space (1368k of 1536k) Code space (0k of 0k)
out/ReleaseIA32/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 76918
CorelibIsolateStartup(RunTime): 4056
UseDartApi(RunTime): 502111
Dart2JSCompileAll(RunTime): 1251646
FrameLookup(RunTime): 45

(saves about 332k out of the original TokenStream size of 410k)

On x64:

Original sizes:
Size of isolate snapshot = 924865
New space (0k of 32768k) Old space (3234k of 3444k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 109660
CorelibIsolateStartup(RunTime): 3985
UseDartApi(RunTime): 463009
Dart2JSCompileAll(RunTime): 2170309
FrameLookup(RunTime): 35

Size with the new TokenStream implementation:
Size of isolate snapshot = 849675
New space (0k of 32768k) Old space (2436k of 2560k) Code space (0k of 0k)
out/ReleaseX64/run_vm_tests --benchmarks
CorelibCompileAll(RunTime): 98716
CorelibIsolateStartup(RunTime): 2938
UseDartApi(RunTime): 509149
Dart2JSCompileAll(RunTime): 2042273
FrameLookup(RunTime): 39

(saves about 798k out of the original TokenStream size of 810k)

Token stats:
Number of tokens:   101470
  Literal tokens:   4550
    Ident tokens:   33020
Review URL: https://chromiumcodereview.appspot.com//10697055

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9539 260f80e4-7a28-3924-810f-c04153c831b5
2012-07-11 00:11:58 +00:00
asiva@google.com 9e6f43e6e3 Prepare for writing token streams directly into a snapshot and reading it directly from the snapshot using memmove.
Review URL: https://chromiumcodereview.appspot.com//10665035

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9098 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-26 00:18:14 +00:00
asiva@google.com 5cbd276939 Make the parser agnostic to the TokenStream implementation. This is the first step towards compacting the token stream.
Pull the data stream writer/reader code out of snapshot into a generic file so that it can be reused into the token stream compaction implementation.
Review URL: https://chromiumcodereview.appspot.com//10632009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@9043 260f80e4-7a28-3924-810f-c04153c831b5
2012-06-22 20:37:01 +00:00