Commit Graph

2105 Commits

Author SHA1 Message Date
Zachary Anderson 57fea4f10b Adds a gn argument for boringssl path
Fixes Flutter build. There should be no need for Flutter to set the
flag. Mojo will need to set the flag.

R=jsimmons@google.com

Review URL: https://codereview.chromium.org/1955163002 .
2016-05-06 15:05:10 -07:00
Jason Simmons 7eb43c2134 Return a null Platform.executable and resolvedExecutable on Android
See https://github.com/flutter/flutter/issues/3648

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1953333002 .
2016-05-06 14:29:53 -07:00
Ryan Macnak 7546ef1709 Simplify command line options for creating snapshots.
Also makes codeless app snapshots work in debug and release modes.

dart --snapshot=file.snap [--snapshot-kind=script] script.dart
dart file.snap

dart_bootstrap --snapshot=dir --snapshot-kind=app-after-run script.dart
dart --run-app-snapshot=dir script.dart

dart_bootstrap --snapshot=dir --snapshot-kind=app-jit-after-run script.dart
dart --run-app-snapshot=dir script.dart

dart_bootstrap --snapshot=dir --snapshot-kind=app-aot script.dart
dart_precompiled_runtime --run-app-snapshot=dir script.dart

R=asiva@google.com

Review URL: https://codereview.chromium.org/1947783003 .
2016-05-06 12:40:04 -07:00
Zachary Anderson d55b87d622 Fixes GN boringssl deps path
The Mojo tree already DEPSes in boringssl into its //third_party. To
avoid DEPSing in two boringssl's, we need to look for the one there.
(The GN 'check' routine requires the sources to be found even if
noone depends on them.) Flutter will need to move its boringssl
DEPS from //dart/third_party/boringssl to //third_party/boringssl
to match.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1952383002 .
2016-05-05 16:07:11 -07:00
Ryan Macnak 257b3a82b8 JIT precompilated snapshots.
(Precompiled snapshots with unoptimized code.)

+ ./out/ReleaseX64/dart --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m3.299s
user	0m3.197s
sys	0m0.831s

+ ./out/ProductX64/dart_bootstrap --full-snapshot-after-run=/usr/local/google/home/rmacnak/dart3/sdk/app --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js
+ ./out/ProductX64/dart --run-full-snapshot=/usr/local/google/home/rmacnak/dart3/sdk/app --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
vm-service: Isolate creation error: (null)
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m1.979s
user	0m1.806s
sys	0m0.581s

+ ./out/ReleaseX64/dart_bootstrap --use_blobs --gen-precompiled-jit-snapshot=/usr/local/google/home/rmacnak/dart3/sdk --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js
VMIsolate(CodeSize): 2699304
Isolate(CodeSize): 5930097
Instructions(CodeSize): 9440176
Total(CodeSize): 18069577
+ ./out/ReleaseX64/dart --use_blobs --run-precompiled-jit-snapshot=/usr/local/google/home/rmacnak/dart3/sdk --package-root=./out/ReleaseX64/packages ./pkg/compiler/lib/src/dart2js.dart /usr/local/google/home/rmacnak/hello.dart
Dart file (/usr/local/google/home/rmacnak/hello.dart) compiled to JavaScript: out.js

real	0m0.994s
user	0m1.259s
sys	0m0.229s

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

Review URL: https://codereview.chromium.org/1938653002 .
2016-05-04 18:47:36 -07:00
Ivan Posva 964f95a020 - Fix loading of dart:html.
- Remove debug print in VM service.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1952903002 .
2016-05-04 17:43:58 -07:00
Ivan Posva 2268bb8530 - Fix build.
BUG=

Review URL: https://codereview.chromium.org/1946953002 .
2016-05-03 20:45:05 -07:00
Ivan Posva 3884fd4e4b - Allow for loading dart:html and friends into the standalone
dart_bootstrap binary to evaluate startup and compilation
  performance.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1916793003 .
2016-05-03 20:33:14 -07:00
Martin Kustermann 620b896e2f Initial support to test.dart for running precompiler tests on android devices
Steps to make this work:

a) Make sure you have an android sdk checkout:

  => See https://github.com/dart-lang/sdk/wiki/Building-Dart-SDK-for-Android

b) Building using android-toolchain crosscompiler:

  $ ./tools/build.py -mrelease -aarm --os=android dart_precompiled_runtime

  => Notice --os=android

c) Testing using attached android phones:

  $ export PATH=$PATH:$PWD/third_party/android_tools/sdk/platform-tools
  $ ./tools/test.py -mrelease -aarm --system=android -cprecompiler -rdart_precompiled --use-blobs

  => Notice --system=android

Failing tests on android can be marked in status files via:

[ $compiler == precompiler && $runtime == dart_precompiled && $system == android ]

R=whesse@google.com

Review URL: https://codereview.chromium.org/1922163002 .
2016-05-02 12:41:22 +02:00
Ryan Macnak 3ae8c18359 Fix gcc 4.9 build errors.
(-Werror=clobbered and -Wconversion-null)

BUG=http://dartbug.com/26309
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1932253002 .
2016-04-29 10:34:03 -07:00
Zachary Anderson b1ece64035 Enable BoringSSL for Android in GN build
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1846343002 .
2016-04-26 09:13:33 -07:00
Zachary Anderson ba550f1c43 Fixes NetworkInterface.list crash on Android
Previously, Socket::ListInterfaces failed to set the os_error out
parameter causing a crash in the caller. This change sets an error here.

I've also added NetworkInterface.listSupported, which returns false on
Android, and true everywhere else. ifaddrs.h continues not to exist in
the NDK, so in order to support NetworkInterface.list, we'd have to
reimplement it, or find a suitable reimplementation somewhere.

related #26329

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1916223003 .
2016-04-26 07:48:58 -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
John McCutchan 0cfd4f5cd5 GN Build fixes for Flutter + gen_snapshot fix
1. Add "dart_runtime_mode" GN argument. This is an enum with three valid values: "release", "profile", and "develop".
   *) "release" builds product precompiled-runtime.
   *) "profile" builds non-product precompiled-runtime.
   *) "develop" builds non-product non-precompiled-runtime.

2. Remove the redundant "dart_product" GN argument.

3. Kill all *precompiled_runtime static library variants and the related config.

4. Always include the precompiler in gen_snapshot.

5. Support multiple --embedder_entry_points_manifest arguments to gen_snapshot.

6. Update our test harness to use gen_snapshot and pass the same kinds of command line arguments the Flutter folks are using.

7. ASSERT that both DART_PRECOMPILED_RUNTIME and DART_PRECOMPILER are not set at the same time.

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

Review URL: https://codereview.chromium.org/1903583002 .
2016-04-22 07:00:03 -07:00
Zachary Anderson ccfd19bfd7 Fixes memory leak of async directory lister
R=iposva@google.com

Review URL: https://codereview.chromium.org/1893033002 .
2016-04-21 07:57:02 -07:00
Zachary Anderson 943c69f408 Fix file fuzz test failure
R=iposva@google.com

Review URL: https://codereview.chromium.org/1903733006 .
2016-04-20 14:05:27 -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
Zachary Anderson 1336e6149f Search for a native extension for the host architecture
R=iposva@google.com

Review URL: https://codereview.chromium.org/1896203002 .
2016-04-20 08:02:16 -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
Zachary Anderson 8caa5a6dcb Allow opening a named pipe on MacOS and Linux.
fixes #26237

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1883293005 .
2016-04-15 11:19:37 -07:00
Zach Anderson 522ce88fe6 Implements remaining SecurityContext calls for iOS
BUG=
R=asiva@google.com, iposva@google.com

Review URL: https://codereview.chromium.org/1852783003 .
2016-04-13 10:27:39 -07:00
William Hesse 3eded1245b Rename libchrome_zip to libzip_dart in build.
A condition was added to the libzip target in Chromium, renaming
the output from libzip to libchrome_zip to avoid collisions
with builtin libzip.  We copied this to our libzip_dart target,
so there was a collision in the Dartium build with two products
called libchrome_zip.  Removing this lets our copy be called
libzip_dart.

BUG=
R=iposva@google.com, terry@google.com

Review URL: https://codereview.chromium.org/1883593002 .
2016-04-13 00:15:37 +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
Zach Anderson b0475caa7f Allows adding trusted certs on iOS.
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1845273004 .
2016-03-31 15:51:14 -07:00
Zach Anderson 08450dc432 Begin work on ios secure sockets
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org/1839123003 .
2016-03-31 12:55:31 -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
Zachary Anderson a742ea06b3 Try to fix Windows Dartium build again
BUG=

Review URL: https://codereview.chromium.org/1843793004 .
2016-03-30 07:55:40 -07:00
Zachary Anderson 9f43293f27 Fix build
TBR

BUG=

Review URL: https://codereview.chromium.org/1844693002 .
2016-03-29 13:48:24 -07:00
Zachary Anderson c44617fca7 Fix Dartium Windows build
BUG=

Review URL: https://codereview.chromium.org/1844613003 .
2016-03-29 13:32:51 -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
Zach Anderson 5cee7ff634 Fixes handling of short reads/writes for Mac SSL
The SecureTransport API is a bit finicky about the return code
and length from SSL{Read,Write}Callback. I think I've got it
right now, but we'll have to keep an eye on it.

Also a small tweak to avoid an extra trip through the event loop
before putting a write event on the secure socket stream.

related #26104

R=iposva@google.com

Review URL: https://codereview.chromium.org/1842703003 .
2016-03-29 10:30:09 -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
Jacob Richman 5c8de46a7d Fix broken dartium build due to invalid dependencies when dart_io_support=0
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/1831533002 .
2016-03-23 10:40:32 -07:00
Zachary Anderson b10f3e7be9 Some build file cleanup
R=iposva@google.com

Review URL: https://codereview.chromium.org/1824053002 .
2016-03-22 13:29:26 -07:00
Zachary Anderson 27f5c1f81c Don't compile in root certs on Android.
This works by using SSL_CTX_load_verify_locations in
SecurityContext._trustBuiltinRoots() to specify
/system/etc/security/cacerts as the certificate directory.

This saves about 240KB from a stripped ProductAndroidARM build.

This has the drawback that SSL_do_handshake will synchronously
hit the filesystem looking for root certs during its trust evaluation.
We call SSL_do_handshake directly from the Dart thread so that Dart
code can be invoked from the "bad certificate" callback called by
SSL_do_handshake. If there was no need to support this callback,
it would be easier to move the handshake to the IOService thread, and
thus remove the compiled-in certs without the need for blocking IO
on the Dart thread.

R=whesse@google.com

Review URL: https://codereview.chromium.org/1811583003 .
2016-03-22 09:30:04 -07:00
Ivan Posva 3b2a695d71 - Properly return null if an unknown package is resolved.
- Allow short form package:foo imports.

R=asiva@google.com

Review URL: https://codereview.chromium.org/1822863002 .
2016-03-22 09:02:04 -07:00
Zach Anderson ed4589ae9d Use SecItemImport instead of SecKeychainItemImport
BUG=

Review URL: https://codereview.chromium.org/1820183002 .
2016-03-21 19:10:19 -07:00
Zach Anderson e82b3c9092 Try to fix Mac build
BUG=

Review URL: https://codereview.chromium.org/1821693003 .
2016-03-21 15:57:38 -07:00
Zach Anderson e900b1b944 Implements secure sockets on Mac OS with SecureTransport API
R=iposva@google.com

Review URL: https://codereview.chromium.org/1721283002 .
2016-03-21 15:46:29 -07:00
Zachary Anderson 078d89ef5c Fix dangling pointer
The resolved executable path is returned to the static in Platform as
a scope allocated string. This change strdups it when it is cached in
a static for return on subsequent calls. Previously, the memory would
be deallocated on exit from the scope.

fixes #26031

R=asiva@google.com

Review URL: https://codereview.chromium.org/1813943004 .
2016-03-18 08:34:23 -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 88ad41c959 Fix Android build warnings
R=regis@google.com

Review URL: https://codereview.chromium.org/1809743002 .
2016-03-16 11:17:53 -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
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