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 .
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 .
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 .
- 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 .
- 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 .
- 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 .
- 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 .
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 .
- 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 .
- 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/24975R=fschneider@google.com, srdjan@google.com
Review URL: https://codereview.chromium.org/1507943002 .
- 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/24651R=johnmccutchan@google.com
Review URL: https://codereview.chromium.org/1418833004 .
- 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 .