Commit Graph

3601 Commits

Author SHA1 Message Date
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
William Hesse 169b132a63 Add unique serial numbers to sample X509 certificates. Remove the "sendClientCertificate" parameter from SecureSocket.connect.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1420923006 .
2015-10-29 13:17:22 +01:00
Chinmay Garde 2bf488f9e7 Disable integer division when generating precompiled snapshots for older ARMv7 devices
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1410683009 .
2015-10-27 14:38:35 -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 d1c5898ce0 Fix build
BUG=

Review URL: https://codereview.chromium.org/1426713004 .
2015-10-27 08:01:56 -07:00
John McCutchan f82058002c Fix dart_bootstrap build
BUG=

Review URL: https://codereview.chromium.org/1413443007 .
2015-10-27 07:54:18 -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 533a6ecce7 Add new observatory resources cc file to libvmservice_io rule
BUG=

Review URL: https://codereview.chromium.org/1427503002 .
2015-10-26 10:52:43 -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
Chinmay Garde 87ce99fd00 Enable generation of instruction buffer on precompilation
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1411383004 .
2015-10-22 12:26:41 -07:00
Ryan Macnak 371a5dc932 Get tools/test.py --noopt green.
More specifically ./tools/test.py --noopt -mall -ax64,simarm,simarm64,simmips --exclude-suite=pkg

 - Add missing dart:io entry point.
 - Add checks that Dart_FinalizeLoading, Dart_Precompile, Dart_CreatePrecompiledSnapshot are called in order.
 - Add checks for --precompilation flag.
 - Add checks for dropped class in Dart_New/Allocate/AllocateWithNativeFields.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1407393005 .
2015-10-21 10:35:01 -07:00
Ryan Macnak b5979b6a22 Drop uncompiled implicit closure functions. Only seems to happen in a few co19 tests, so this is more to make asserts in BindStaticCalls/DedupStackmaps happy than to save space.
Fix changed standalone entry. Add missing VM entry.

R=srdjan@google.com

Review URL: https://codereview.chromium.org/1397713007 .
2015-10-20 15:19:59 -07:00
William Hesse b519e4c000 Add support for client certificates to Secure[Server]Socket
BUG=https://github.com/dart-lang/sdk/issues/24069
BUG=https://github.com/dart-lang/sdk/issues/24070
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1416843003 .
2015-10-20 17:18:57 +02:00
Siva Annamalai 040637a0e0 Added option --snapshot-after-run to enable an application snapshot to be taken after running the application.
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1413753002 .
2015-10-16 17:10:30 -07:00
John McCutchan 9c4a0364de Add missing dependency from gen_snapshot to generate_resources_cc_file
BUG=

Review URL: https://codereview.chromium.org/1408113002 .
2015-10-16 07:42:28 -07:00
John McCutchan 8a231f797f Temporary fix for precompile_test
BUG=

Review URL: https://codereview.chromium.org/1408783003 .
2015-10-16 07:25:09 -07:00
John McCutchan 9013047425 Bring up the service isolate and use it for package resolution in gen_snapshot
- Link dart:io implementation into gen_snapshot.
- Start event handler in gen_snapshot.
- Build system updates for gypi and gn.

R=asiva@google.com

Review URL: https://codereview.chromium.org/1405183002 .
2015-10-16 06:49:53 -07:00
Siva Annamalai b4d0ca282d Cleanup the extensions code to avoid the duplication that was introduced in the quick fix to turn the bots green.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1401253004 .
2015-10-14 15:27:58 -07:00
Siva Annamalai 830edcee93 Fix build bot error.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1403613005 .
2015-10-14 12:59:32 -07:00
Siva Annamalai e1ff27e761 Fix for issue 23908 - error message reports the exact error when a native extension fails to load.
BUG=23908
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1403683007 .
2015-10-14 11:16:22 -07:00
Ivan Posva 60eab65aa0 - Implement package map parameter when spawning isolate.
BUG=
R=lrn@google.com

Review URL: https://codereview.chromium.org/1403693002 .
2015-10-12 09:05:37 -07:00
William Hesse 2fe4005dc3 Pass BoringSSL error messages from C++ IO threads back into to Dart.
BUG=https://github.com/dart-lang/sdk/issues/24185
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1397343002 .
2015-10-12 15:06:29 +02:00
William Hesse e6b85bb28c Use #if TARGET_OS_IOS instead of #ifdef TARGET_OS_IOS.
New versions of the OS X SDK always define TARGET_OS_IOS, as 0 or 1.

BUG=https://github.com/dart-lang/sdk/issues/24501
BUG=https://github.com/dart-lang/sdk/issues/24453
R=iposva@google.com

Review URL: https://codereview.chromium.org/1388973002 .
2015-10-12 12:38:10 +02:00
Søren Gjesse 7c0688a5c6 Ensure ZILB encoder handles all typed data lists correctly
R=ajohnsen@google.com, lrn@google.com
BUG= https://github.com/dart-lang/sdk/issues/24521

Review URL: https://codereview.chromium.org/1393013002 .
2015-10-08 18:19:02 +02:00
Todd Turnidge 0d501ad53d VM restart + shutdown fixes
This change add the ability to restart the vm through the service
protocol.  All isolates are killed, and then the main isolate is
restarted cooperatively by the embedder.

This change also fixes the message handler to prevent it from
accidentally ignoring vm shutdown messages.

Previously, we would stop handling messages whenever we hit an error
(such as a compile error or an unhandled exception).  This would leave
shutdown requests sitting the oob queue, neglected.

We now process *all* oob requests, up to the first shutdown request.
When we hit a shutdown request, we clear the oob queue and process no
more messages.

To make all of this work, we had to change the return value of
HandleMessage from bool to a new enum type, allowing the message
handler to distinguish *normal* error cases from the more rarified
shutdown and restart cases.

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

Review URL: https://codereview.chromium.org/1371193005 .
2015-10-06 11:27:26 -07:00
John McCutchan af0ab36f7c Make dart:_vmservice a proper builtin library
- Drops custom resource table for sources.
- Stops loading dart:vmservice library by sources.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1387043002 .
2015-10-06 07:58:14 -07:00
William Hesse 0b5fcedaaa Use strlen rather than strnlen, which is missing on Mac OS.
BUG=

Review URL: https://codereview.chromium.org/1390793002 .
2015-10-06 16:48:47 +02:00
William Hesse da574129a8 Add full BoringSSL error information to Dart exceptions it throws.
Fix error in http_proxy_advanced_test.

BUG=https://github.com/dart-lang/sdk/issues/24183
BUG=https://github.com/dart-lang/sdk/issues/24068
BUG=https://github.com/dart-lang/sdk/issues/24074
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1386023003 .
2015-10-06 16:30:10 +02:00
Soren Gjesse 33e2d9cd7e Increase the datagram receive buffer on Windows to 64k
A datagram can can be up to 64k, and if the buffer is too small the received data is truncated.

This change also correctly handles errors when receiving datagrams on Windows.

BUG= #24426
R=kustermann@google.com, iposva@google.com

Review URL: https://codereview.chromium.org/1381233003.
2015-10-06 08:42:51 +02:00
William Hesse 0c2bea237f Add check for password length in SecurityContext. Check return values from BoringSSL functions, throw exceptions.
BUG=https://github.com/dart-lang/sdk/issues/24182
R=sgjesse@google.com

Review URL: https://codereview.chromium.org/1384533002 .
2015-10-05 13:51:01 +02:00
Søren Gjesse 65872873d2 Remove server socket references
The use of server socket references was deprecated in 1.9 and marked
for removal in 1.10.

R=kustermann@google.com

BUG=http://dartbug.com/22187

Review URL: https://codereview.chromium.org/1072783003 .
2015-10-05 12:25:20 +02:00
Ivan Posva ba6c0ace3e - Add getters for the current packageRoot or packageMap to the Isolate class.
- Simplify loading in builtin.dart.

BUG=
R=asiva@google.com, lrn@google.com

Review URL: https://codereview.chromium.org//1334353002 .
2015-10-03 06:53:13 -07:00
William Hesse e5ebc9c630 Free copy of hostname in SecureSocket implementation.
BUG=https://github.com/dart-lang/sdk/issues/24186
BUG=https://github.com/dart-lang/sdk/issues/24225
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1383713002 .
2015-10-01 17:28:32 +02:00
William Hesse 1b5e4cc506 Enable SNI hostname extension in SecureSocket.
BUG=https://github.com/dart-lang/sdk/issues/24330
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1384463003 .
2015-10-01 17:28:06 +02:00
John McCutchan 4b4e836960 Fix build breakage encountered by Flutter
BUG=

Review URL: https://codereview.chromium.org//1376143004 .
2015-10-01 07:18:27 -07:00
Ryan Macnak 67c15fc982 Make --noopt behave like an in-place precompilation.
Breaks --noopt for IA32.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1373873004 .
2015-09-30 13:11:47 -07:00
William Hesse 322a735424 Allow X509 certificate chains where we trust a certificate in the middle of the chain.
BUG=https://github.com/dart-lang/sdk/issues/24330
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1381673002 .
2015-09-30 15:25:45 +02:00
Siva Annamalai 575fa10d39 Fix for issue 24487951 (heap buffer overflow problem)
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1376973002 .
2015-09-29 15:18:30 -07:00
Ryan Macnak da006acfdf Extend precompilation test to Mac. Attempt to fix for host MIPS.
R=fschneider@google.com

Review URL: https://codereview.chromium.org//1370833003 .
2015-09-28 10:04:45 -07:00
John McCutchan 0b931dbc00 Fix hidden bug with isolate shutdown debugger events
A CL from July (https://codereview.chromium.org/1168933002), papered over (see ASSERT removal in dbg_message.cc) a bug where we would send isolate shutdown event for the service isolate even though no isolate create event was sent.

This CL:

- Restores the ASSERT in dbg_message.cc
- Fixes the service isolate shutdown path so that the shutdown event is no longer sent.

Review URL: https://codereview.chromium.org//1361213005 .
2015-09-24 07:01:16 -07:00
Florian Schneider 3a75f0d67a Add simple VM test for precompiled code.
The test creates a precompiled snapshot in a temporary directory, runs it and
checks the output.

Also:
Minor cleanup and fix segfault on dlopen error and with --trace-isolates

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1362743003 .
2015-09-24 11:36:46 +02:00
Ryan Macnak c6d5e4796e Fail sooner and with better error message when attempting precompilation on IA32.
Allocate megamorphic cache table in old space.

R=srdjan@google.com

Review URL: https://codereview.chromium.org//1357423005 .
2015-09-23 13:47:31 -07:00
Ryan Macnak f6021d0608 Let the embedder provide entry points to Dart_Precompile.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1359963002 .
2015-09-23 13:18:56 -07:00
John McCutchan f6e0a8f30b Catch unexpected http uri error in service isolate
Fixes #24388

R=iposva@google.com

Review URL: https://codereview.chromium.org//1357023004 .
2015-09-21 11:01:34 -07:00
Zachary Anderson a580bafc5d Disable shutdown
BUG=

Review URL: https://codereview.chromium.org//1350713004 .
2015-09-16 15:51:10 -07:00
Ryan Macnak 9764a9f037 -Setup heap page for precompiled instructions to make heap verifier etc happy.
-Pre-mark instructions when writing the snapshot.
-Write the megamorphic miss function to the snapshot.
-Add missing ExceptionHandlers for megamorphic miss code.
-Add missing C++ entry points.
-Relocate Function and Code entry_points_ when reading precompiled snapshot.
-Don't try to load a script again when running from a precompiled snapshot.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1336763002 .
2015-09-16 11:22:57 -07:00
Ryan Macnak 998f19dfbb More precompiled snapshotting.
- Load precompiled stub code from the snapshot.
- Mark isolates reading from precompiled snapshots as not allowed to compile.
- Reset static field values during precompilation.
- Don't run the program after generating a precompiled snapshot.

Fails sooner in loading precompiled snapshots due to null Instructions.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1311403009 .
2015-09-15 16:53:44 -07:00
Zachary Anderson 7093f2996b VM thread shutdown.
BUG=
R=iposva@google.com, turnidge@google.com

Review URL: https://codereview.chromium.org//1275353005 .
2015-09-15 12:49:52 -07:00
John McCutchan ae57de89d1 Force disconnect all service clients when VM is shutting down
BUG=https://github.com/dart-lang/sdk/issues/24352
R=turnidge@google.com

Review URL: https://codereview.chromium.org//1338753004 .
2015-09-15 12:47:28 -07:00
Rico Wind 38b579fa78 Add tracking of open processes to the new io resource tracking.
I plan on refactoring the io_resource_info.dart file a bit in a follow up, but I keept this simple

I also plan on adding some sort of sanity checking when the vm exits, to make sure
all 3 maps are empty (in debug mode)

This fixes issue #24314, before we would hold on to process that failed to start
running in the _processes map.

Closes #24314
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1331033003 .
2015-09-14 12:54:36 +02:00