Commit Graph

2060 Commits

Author SHA1 Message Date
Zachary Anderson 202e077815 Uses a finalizer to delete zlib filter resources
Also other misc. cleanup.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1777643003 .
2016-03-10 15:42:00 -08:00
Siva Annamalai 7520ecc48b Do not start the service isolate when generating the core library snapshot as it does not load any files or resolve URIs. This ensures that we do not have a race condition of the main isolate shutting down the service isolate before it gets to start.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1782493002 .
2016-03-09 23:24:45 -08: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
Siva Annamalai c45ebeba70 Fix some potential data races based on output from tsan.
R=zra@google.com

Review URL: https://codereview.chromium.org/1765533003 .
2016-03-04 13:35:25 -08:00
Zachary Anderson f6ddb4568f Regularize some errors thrown by SecureContext.
This is done by replacing a call to SSL_CTX_set_client_CA_list() with
calls to SSL_CTX_add_client_CA(), preserving the diagnostic status
return value discarded by the former.

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

Review URL: https://codereview.chromium.org/1761583002 .
2016-03-04 09:02:20 -08:00
William Hesse f425c82985 Add zlib dependency for dart_bootstrap build
The Dartium build does not include io components in the libraries, which
are what pull in zlib for the non-dartium builds of the SDK.  But it does
build dart_bootstrap, which needs zlib.  It actually should not need to
build dart_bootstrap, since it is useless without io capabilities.

BUG=
R=kasperl@google.com

Review URL: https://codereview.chromium.org/1761233003 .
2016-03-04 13:15:40 +01:00
Ivan Posva d61ebd4ed2 - Unify dart_no_snapshot and dart_bootstrap into one binary.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1760063003 .
2016-03-03 14:53:59 -08:00
Zachary Anderson 7c2c02d6a6 Fix x86-64 Android build.
R=iposva@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1761953002 .
2016-03-03 11:11:31 -08:00
Søren Gjesse 9431f0b32c Fix Mac OS check for terminal input
Closes #25862
BUG= https://github.com/dart-lang/sdk/issues/25862

TBR=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1760033003 .
2016-03-03 10:40:12 +01: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
Zachary Anderson a28bfa9879 Fixes error handling, leaks in secure sockets.
- Peer certificate was leaked, cert passed to bad cert callback could
  could become stale.
  - Added finalizer.
- Failing to call Destroy would leak various things.
  - Added finalizer.
- ThrowIfError in initialization would fail to deallocate various
  things on an error.
  - Replaced with explicit checks, and deallocation where needed.

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

Review URL: https://codereview.chromium.org/1746363002 .
2016-03-01 22:12:20 -08:00
Zachary Anderson e2729705ff Rolls back fix of SecurityContext method names.
R=iposva@google.com

Review URL: https://codereview.chromium.org/1757453002 .
2016-03-01 10:34:15 -08:00
John McCutchan b2249f30fd Add persistent handles to service protocol and Observatory UI
VM Changes:

- Add private _getPersistentHandles service RPC.
- Add service_test for _getPersistentHandles.

Observatory Changes:

- Add Persistent Handles page.
- Display persistent handles in a curly-block
- Display weak persistent handles in a sortable table.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1719313002 .
2016-03-01 07:31:29 -08:00
Zachary Anderson e03a9d54c7 Don't compile in root certs when SSL is disabled in GN build.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1739023005 .
2016-02-26 10:37:53 -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
Florian Schneider b870dafa4f VM: Separate precompilation-specific code, make flags const.
Move optimizations for precompilation into separate file.

Remove precompilation-specific code from flow_graph_optimizer.cc.

Add precompilation-flags: They are const in the precompiled runtime. Started moving flags to use the new flag-definition macros.

Add libdart_lib_precompiled target.

Define PRECOMPILED_RUNTIME_MACRO in more places (dart_precompiled_runtime)

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1714743002 .
2016-02-23 08:48: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
Alan Knight 447590c6f9 Remove now-unused 'result' variable from vmservice_dartium.cc, breaks build on Windows
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1703203002 .
2016-02-17 12:29:59 -08:00
Zachary Anderson 38786e9566 More SecurityContext calls accept a password.
Any PKCS12 container, not just those containing a private key, can be
protected by a password. This change adds an optional named `password`
parameter to other SecurityContext calls, and plumbs it through to
the calls reading PKCS12 data.

R=whesse@google.com

Review URL: https://codereview.chromium.org/1699163002 .
2016-02-17 10:58:19 -08:00
Alan Knight 66d4d7665c Remove apparent duplicate call to PrepareForScriptLoading in Dartium
BUG=

Review URL: https://codereview.chromium.org/1698323004 .
2016-02-17 10:26:54 -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
Zachary Anderson 53dec5d35f Fix PEM error checking
While reading PEM data, if we encounter PEM_R_NO_START_LINE, and some
data has been read successfully, we assume that we have reached the
end of the data.

If we encounter PEM_R_NO_START_LINE, and no data has been read
successfully, we assume that the data is not PEM, and we try instead
to read it as PKCS12.

Otherwise, we assume it is malformed PEM, and propagate an error.

R=whesse@google.com

Review URL: https://codereview.chromium.org/1689873003 .
2016-02-12 19:01:47 -08: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
John McCutchan 0c11088761 Introduce dart_sdk_lib_copy and make all sdk lib gypi files regular
- rename sdk/lib/io/iolib_sources.gypi to sdk/lib/io/io_sources.gypi so that io is regular with respect to the other sdk libraries.
- Lint sdk/lib/*/*_sources.gypi
- Add dart_sdk_lib_copy gn template.

Related https://github.com/flutter/flutter/issues/1712

R=zra@google.com

Review URL: https://codereview.chromium.org/1692603002 .
2016-02-11 14:23:22 -08:00
Zachary Anderson 89f414dc37 Adds support for PKCS12 containers to SecurityContext
Looking forward to using platform specific APIs, this container type is
more common on MacOS and Windows, and is the only container type
supported by the native iOS API.

R=whesse@google.com

Review URL: https://codereview.chromium.org/1687533002 .
2016-02-10 14:20:59 -08:00
John McCutchan b9b0649b9c dart:developer service extension fixes
Fixes #25724
Fixes Florian Loitsch's emailed request (get rid of k prefix on constants).

- Rename ServiceExtensionResponse constants to not have a 'k' prefix.
- Provide more explanation on how to invoke service extensions (they require an 'isolateId' parameter).
- Require extension method names to begin with "ext." and recommend the template: "ext.package.command" to avoid conflicts with other packages.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1680593004 .
2016-02-10 08:54:51 -08:00
Chinmay Garde 63e836ceae Fix the snapshotter to generate valid precompilation snapshots
R=asiva@google.com

Review URL: https://codereview.chromium.org/1673423004 .
2016-02-09 13:46:32 -08:00
Jacob Richman f478562b0a Dartium 45 roll
R=alanknight@google.com

Review URL: https://codereview.chromium.org/1682783002 .
2016-02-09 10:50:43 -08:00
Zachary Anderson 786aafd052 Fix build
TBR

Review URL: https://codereview.chromium.org/1680733002 .
2016-02-08 08:57:43 -08:00
Zachary Anderson 2cf6405ca9 Adds SecurityContext.setTrustedCertificatesBytes
Implements SecurityContext.setTrustedCertificates in terms of the new
function. This requires setTrustedCertificates to return a Future,
and removing the `directory` named argument as it is not possible to
implement with BoringSSL without blocking IO.

R=whesse@google.com

Review URL: https://codereview.chromium.org/1665433002 .
2016-02-08 08:41:49 -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 36be64acc1 Fix dartium build break in vmservice_dartium.cc
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1665703006 .
2016-02-04 09:33:13 -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
Todd Turnidge 4e3643f445 Prefer Dart_SetReturnValue over Dart_PropagateError when it makes sense.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1665993002 .
2016-02-03 15:41:54 -08:00
Ryan Macnak c547c0c183 Remove workarounds for fixed issue 21620.
BUG=http://dartbug.com/21620
R=iposva@google.com

Review URL: https://codereview.chromium.org/1665473002 .
2016-02-03 11:03:03 -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
Zachary Anderson 8f356bf87e Adds SecurityContext.useCertificateChainBytes
Changes SecurityContext.useCertificateChain to call the new method and
return a Future.

R=whesse@google.com

Review URL: https://codereview.chromium.org/1648793005 .
2016-02-02 10:54:07 -08:00
Todd Turnidge f8d48510cf Temporary fix for socket_many_connections_test.
I am working on a more general api change that will make this kind of
programming error harder to make in the future.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1654873004 .
2016-02-01 15:41:58 -08:00
Siva Annamalai cab435bd03 Fix gen snapshot code to use Dart_LoadLibrary instead of Dart_LoadScript so that the root library value is not set when creating the bootstrap snapshot. The root library gets set when the application is loaded in later.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1653143002 .
2016-02-01 12:57:04 -08:00
Todd Turnidge 250773cb65 Improve the error message when an import fails.
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1641383003 .
2016-01-29 16:30:08 -08:00
Adam Barth 94570789c9 Fix gn build
This function name had a typo.

R=zra@google.com, zra

Review URL: https://codereview.chromium.org/1654443002 .
2016-01-29 12:27:00 -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
Zachary Anderson 98771a083f Adds SecurityContext.usePrivateKeyBytes
This is the first step toward removing blocking IO calls from
the implementation of the SecurityContext API.

Using a buffer rather than a file name API will probably be needed
for implementing SecurityContext and SecureSocket with platform
specific built-in APIs on iOS/Mac/Windows rather than BoringSSL.

related #8227

R=whesse@google.com

Review URL: https://codereview.chromium.org/1616073004 .
2016-01-29 08:52:18 -08:00
John McCutchan 87d8d3a719 Make it possible to share the embedder's dart sources for the service isolate.
- Cleanups to the embedder's Dart sources for the service isolate. This lets us stop keeping a local copy in the mojo and flutter trees.
- Let the VM know Observatory's server address.

R=zra@google.com

Review URL: https://codereview.chromium.org/1640773005 .
2016-01-29 07:43:21 -08:00