Commit Graph

629 Commits

Author SHA1 Message Date
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
Zachary Anderson 218545ba10 Fixes leak of native File objects.
Also employs the same reference counting technique as secure sockets to
avoid the IO Service touching dangling pointers.

R=iposva@google.com

Review URL: https://codereview.chromium.org/1892623002 .
2016-04-20 10:08:37 -07:00
Florian Schneider e905d64058 VM: Remove redundant build target dart_product.
It has been replaced by out/Product<arch>/dart

Building and testing product mode works via the -mproduct flag
with build.py/test.py.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1902073003 .
2016-04-20 12:29:21 +02:00
Srdjan Mitrovic 706ea55404 Fix background compilation issues when creating snapshots.
- Stop background compilation early enough
- Restore symbol table after completing snapshot writing.
- Create symbols instead fo strinfs (error caught with --no-use_lib_cache)

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1852393004 .
2016-04-04 16:40:46 -07:00
John McCutchan ad0878d1a8 Remove redundant timeline API
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1848683002 .
2016-03-31 09:13:54 -07:00
Ryan Macnak f0d4f3151c Precompilation:
- Fix crash sending full class responses.
  - Don't wait for service isolate startup.
  - Add timeline events for deserializing and premarking the VM isolate.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1835633002 .
2016-03-29 12:30:47 -07:00
Zachary Anderson 7308e58c3f Really remove io support when dart:io is unsupported.
Previously we would compile in implementaitions of native calls for
IO functions that would never be used. This CL provides implementations
that throw a Dart exception if they're called by mistake. It also uses
a DART_IO_DISABLED preprocessor define to clean up the build files and
check that we're not including code we shouldn't.

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

Review URL: https://codereview.chromium.org/1839463002 .
2016-03-29 11:22:03 -07:00
Ryan Macnak 8606e22993 Precompilation: don't start the service isolate in product mode. Remove vm service tree shaking roots from product mode.
precompiled dart2js arm 20331349 -> 19685177 (-3.17%)

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1834743003 .
2016-03-24 14:35:03 -07:00
Siva Annamalai f7d2b2e31e - Fix for issue 25950 (add registration of a thread exit callback)
- Moved some of the file and entropy callbacks to class Dart from
  class Isolate as they are not isolate specific.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1807293002 .
2016-03-17 13:40:20 -07:00
Zachary Anderson 45661a7091 Cleanup in //runtime/bin
R=iposva@google.com

Review URL: https://codereview.chromium.org/1800863002 .
2016-03-16 10:01:00 -07:00
Zachary Anderson c75a817ee0 Fixes some memory leaks in //runtime/bin
Also some style cleanups.

Decided to fix these leaks by using Dart_ScopeAllocate
instead of malloc and new. Leaks are noted in the CL.

I haven't finished looking over all the code in
//runtime/bin yet, but this CL was getting big.

Review URL: https://codereview.chromium.org/1781883002 .
2016-03-14 11:08:52 -07:00
Ryan Macnak a0e3bfdd68 Qualify the precompiled shared library name with the snapshot directory instead of using LD_LIBRARY_PATH.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1771423002 .
2016-03-08 12:01:53 -08:00
Ivan Posva 9535aa6426 - Remove loading of observatory assets from dart_bootstrap.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1766833002 .
2016-03-04 16:05:54 -08:00
Florian Schneider 48b0183926 Make precompiler work with product mode.
For now, change compilation-related flags to be regular
command line options. They won't affect the size of the
precompiled runtime anyway since the compiler is not included
there.

Also introduce a separate switch for precompiled runtime. This can be
 used instead of the macro since it is a compile-time constant in the
 precompiled runtime.

BUG=

Review URL: https://codereview.chromium.org/1759913002 .
2016-03-02 13:59:54 -08:00
Florian Schneider d8677964a3 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Committed: https://github.com/dart-lang/sdk/commit/5c9f18c6c87284395564051a052cc4acc9b6f59a

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-25 07:53:39 -08:00
Ryan Macnak bd85deaf4e Revert "Move precompilation-related flags to flags list."
The default value of print_stop_message was architecture specific.

TBR=fschneider@google.com

Review URL: https://codereview.chromium.org/1739593002 .
2016-02-24 18:08:01 -08:00
Florian Schneider 5c9f18c6c8 Move precompilation-related flags to flags list.
They become compile-time constants in the precompiled runtime, and in product mode.

In precompiled product mode, the precompiled value has precedence.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1731743003 .
2016-02-24 17:31:08 -08:00
Siva Annamalai 809c205cae - Fix --run-fullsnapshot flag processing issue in non product mode.
- Adjust status files for product mode issues (Process.run, SpawnUri,
  test expecting line numbers)

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1720193002 .
2016-02-22 15:33:34 -08:00
Florian Schneider 1f7458ddf8 VM: Precompiled rodata snapshot.
For now only contains PC descriptors and stack maps and one-byte strings.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1584443002 .
2016-02-15 09:15:26 +01:00
John McCutchan 7b7f2b05c6 Add dart_product binary
- Add dart_product binary that doesn't include the service isolate, Observatory, or the snapshot. It can only be used for running full snapshots.
- Use this binary when running tests.

R=asiva@google.com

Review URL: https://codereview.chromium.org/1690303002 .
2016-02-12 11:04:56 -08:00
Siva Annamalai 4f24d17fef Fixes for running a full application snapshot:
- Eagerly load deferred libraries when running with full application snapshot.
- Do not call ErrorExit when reading of the snapshot fails as it assumes an
  Isolate has been created
- Generate a full application snapshot even when there are runtime errors
  (only compilation errors or VM restarts do not trigger generation of the
   snapshot)

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1689953003 .
2016-02-12 10:48:43 -08:00
Siva Annamalai 62b12f27d6 Add command line options
- full-snapshot-after-run  (This option generates a full snapshot of an application after it is run with some sample input scenarios, this snapshot includes all the core libraries and other framework libraries and could be potentially tree-shaken to reduce the size)

- run-full-snapshot  (This option reads a full snapshot that was generated using the option above and runs it)

Example:
First generate the full application snapshot:

dart_no_snapshot --full-snapshot-after-run=script --package-root=..../packages/ ..../lib/_internal/compiler/implementation/dart2js.dart --categories=all ..../dummy_compiler_test.dart

Then run the full application snapshot generated above:
dart --run-full-snapshot=script ..../lib/_internal/compiler/implementation/dart2js.dart --categories=all ..../dummy_compiler_test.dart

R=srdjan@google.com

Review URL: https://codereview.chromium.org/1670243002 .
2016-02-05 15:28:59 -08:00
Florian Schneider 23dd0b9715 VM: Small clean up in main.cc after introducing dart_noopt.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1667263002 .
2016-02-04 16:33:37 -08:00
Ryan Macnak dbc538412e Precompilation: Make missing entry points an error.
Narrow lookup of classes and top-level fields and functions to a
library's local namespace.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1663893002 .
2016-02-04 14:27:19 -08: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
Florian Schneider 0f48690061 VM: Replace dart --noopt with new binary target dart_noopt.
This allows us to exclude precompiler related code from the standalone
JIT VM, and only have the precompiler included in dart_noopt and dart_no_snapshot
(which is used to generate precompiled snapshots)

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1661703002 .
2016-02-02 17:51:15 -08:00
Todd Turnidge 0f1d73fd07 Add --warn-on-pause-with-no-debugger flag. Add this to --observe behavior.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1649843002 .
2016-01-29 12:19:33 -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
Vyacheslav Egorov 8ea0f17289 Add more dart:io related precompilation roots.
File, Directory, Link and FileSystemException are allocated by the runtime code.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1579643005 .
2016-01-12 14:14:50 +01:00
Ryan Macnak 9328d724f8 Precompilation:
- When using --compile_all + --noopt, run Dart_CompileAll before Dart_Precompile to avoid skipping functions dropped by Precompile / asserting out on functions retained but uncompiled by Precompile.
 - Fail gracefully when attempting to use more than one of --noopt, --gen_precompiled_snapshot, or --run_precompiled_snapshot.
 - Fix tree shaking roots to include the right VM entry point for creating assertion failures.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1567953002 .
2016-01-08 10:19:14 -08:00
Zachary Anderson 810a9fca13 Turn on shutdown
R=asiva@google.com

Review URL: https://codereview.chromium.org/1556373002 .
2016-01-05 10:17:28 -08:00
Florian Schneider b042cd9a9a VM: Remove non-existent/unused functions from precompiled entry points.
These are not present / or not used currently.

Also remove associated native functions from vm-service.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1536003002 .
2016-01-04 12:41:16 +01:00
Ryan Macnak 22683803ed Initialize standalone embedder's copy of the monotonic clock on Windows.
BUG=http://dartbug.com/25055
BUG=http://dartbug.com/25278
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1537063002 .
2015-12-18 13:20:57 -08:00
Ryan Macnak 6b964b83ac Add ./tools/test.py -c precompiler -r dart_precompiled.
- Make --gen/run-precompiled-snapshot take a directory to use for the snapshot pieces.
 - Throw on Platform.executeable to prevent tests from becoming fork-bombs.
 - Update status files so 'dart_precompiled' is generally expected to behave the same as 'vm'.

Currently multitests will fail unless run with --jobs=1 because the test harness assigns them the same temporary directory.

Running this also requires a great deal of space. My out directory is 380G.

BUG=http://dartbug.com/24975
R=fschneider@google.com, srdjan@google.com

Review URL: https://codereview.chromium.org/1507943002 .
2015-12-18 12:08:10 -08:00
Ivan Posva e651452759 - Make sure that externals are patched for dart2js.
- Remove unneeded native entry points.

BUG=

Review URL: https://codereview.chromium.org/1535743002 .
2015-12-17 08:26:07 -08:00
John McCutchan e7358d1e51 Fix clang build error
BUG=

Review URL: https://codereview.chromium.org/1531863003 .
2015-12-16 12:42:36 -08:00
John McCutchan cc0f297703 Compress Observatory assets
- Gzip the Observatory assets tar file before encoding into the C++ source file.

Shrinks observatory_assets.cc from ~21MB to ~4MB.

Fixes #25276

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1534523002 .
2015-12-16 12:35:58 -08:00
Ryan Macnak 3c3d3e23af Update standalone help message for removed legacy debugger protocol options.
Cf. 6249c2bcf3

R=hausner@google.com

Review URL: https://codereview.chromium.org/1505253003 .
2015-12-08 14:48:50 -08:00
Ivan Posva 6249c2bcf3 - Remove the legacy debug protocol.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1497033003 .
2015-12-03 17:46:02 -08:00
Todd Turnidge b243fa53cf Redo the interface for capture stdio.
Flutter doesn't care to import tons of our include files.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1460863002 .
2015-11-19 09:24:23 -08:00
Todd Turnidge 1d2d1ce0fc Don't use global variables for capturing stdio.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1458983002 .
2015-11-18 12:47:34 -08:00
Florian Schneider 72bd5adf00 Fix running standalone-precompiled when passing a package-root/-file/-map.
These are missing embedder entry points for standalone VM and
are needed when e.g. passing --package-root to a precompiled snapshot.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1462533002 .
2015-11-18 19:00:47 +01:00
Zachary Anderson ca7c39d8d2 Turn off shutdown
BUG=

Review URL: https://codereview.chromium.org/1403293007 .
2015-11-04 12:56:02 -08:00
Zachary Anderson a0c51df0ce Turn on shutdown
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1419333008 .
2015-11-04 12:19:11 -08:00
Zachary Anderson 2c5044b671 Don't do clean shutdown on Process.exit()
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1428923003 .
2015-11-03 14:10:42 -08:00
Zachary Anderson 3563dc0fb0 Use ExitProcess on Windows.
Even after joining threads, it is still possible for the exit code to be
polluted. NaCL uses ExitProcess to avoid this problem:

https://code.google.com/p/chromium/codesearch#chromium/src/native_client/src/shared/platform/win/nacl_exit.c

This change also cleans up thread local storage for the last Thread.

BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1410293006 .
2015-10-29 23:35:46 -07:00
Ryan Macnak 37dd876bf1 VM: Service isolate under precompilation.
- Include the embedder's portion of the service isolate's Dart code in precompiled snapshots. Swap it in as the root library when running precompiled instead of loading from source.
- Make linter happy with gen_snapshot.
- Fix profiler to consider Instructions in the VM isolate may have their corresponding Code in the regular isolate.
- Make non-functional service RPCs fail cleanly instead of crashing.

BUG=http://dartbug.com/24651
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1418833004 .
2015-10-29 15:15:46 -07:00
John McCutchan 33814bd507 Attempt to fix Windows build
BUG=

Review URL: https://codereview.chromium.org/1419563005 .
2015-10-27 08:56:02 -07:00
John McCutchan 30e77221bc Some cleanups to observatory BUILD.gn
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1416293003 .
2015-10-27 07:42:27 -07:00
John McCutchan 2844eb86ca Service isolate requests Observatory assets from embedder
- Provide a new callback to Dart_Initialize that will be called when the service isolate needs the Observatory assets
- Move asset management code out of embedder and into common dart:_vmservice
- Use the tar format as the archive format
- Add build script to generate .cc file containing the archive
- Add a simple tar parser to service isolate

This makes it possible for embedders to not bake Observatory into their executable but instead load it off disk or over the network. The standalone embedder still links Observatory into the executable.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1411853003 .
2015-10-26 07:21:23 -07:00