Commit Graph

629 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Ryan Macnak 83585cfbf1 Emit assembly instead of a blob for the instructions snapshot, and provide labels for the entry point of each Instructions.
R=asiva@google.com

Review URL: https://codereview.chromium.org//1309563006 .
2015-09-04 15:15:50 -07:00
Ryan Macnak 0ed4d44a99 Toward precompiled snapshots.
Gets as far as encountering null Instructions in the first Dart_Invoke after loading the snapshot.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1318803002 .
2015-09-02 16:15:02 -07:00
Zachary Anderson 98384272a5 Don't stop the event handler.
The EventHandler can't be stopped until Dart_Cleanup shuts down all isolates and cleans up all VM thread pool threads.

TBR

BUG=

Review URL: https://codereview.chromium.org//1325963002 .
2015-09-01 20:33:38 -07:00
Zachary Anderson 9395a5b86f Join embedder threads on Windows.
BUG=
R=sgjesse@google.com

Review URL: https://codereview.chromium.org//1291163002 .
2015-09-01 17:53:03 -07:00
Ryan Macnak c3abcd8f93 Add argument to Dart_Initialize for precompiled instructions.
R=asiva@google.com

Review URL: https://codereview.chromium.org//1311963002 .
2015-08-26 11:04:27 -07:00
John McCutchan 1ff7144c31 Switch to a VM wide timeline recorder
- Initialize and shutdown timeline recorder with VM.
- Allocate global blocks for timeline events without an isolate.
- Stop storing the Stream pointer inside a TimelineEvent.
- Store category name in TimelineEvent.
- Store isolate pointer in TimelineEvent.
- TimelineEventRecorder::WriteTo is full VM dump.
- Allow JSONStream to be used without an isolate.
- When a ThreadRegistry is deleted, Finish all open timeline blocks.
- PrintJSON takes a filter.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1294023009 .
2015-08-18 15:18:02 -07:00
Zachary Anderson d4d89d6f12 Reverts VM thread cleanup
BUG=

Review URL: https://codereview.chromium.org//1275853008 .
2015-08-07 19:10:31 -07:00
Zachary Anderson 55bfb3d54b Clean VM thread shutdown:
Second attempt at: https://codereview.chromium.org/1177153005/

This time with fixed error propagation in the embedder.

R=turnidge@google.com

Review URL: https://codereview.chromium.org//1279733003 .
2015-08-07 18:42:00 -07:00
Zachary Anderson 4ca87e6d88 Revert VM thread cleanup
TBR

BUG=

Review URL: https://codereview.chromium.org//1270323002 .
2015-08-05 01:27:01 -07:00
Zachary Anderson 174d552574 Enables clean VM shutdown.
. Disables isolate spawning during Dart_Cleanup.
. Adds a static call Isolate::KillAllIsolates, which sends the
  OOB Kill message to all isolates when called from
  Dart_Cleanup.
. Modifies thread pool shutdown to block until all threads have
  exited.
. Fixes tests.

BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org//1177153005 .
2015-08-04 23:29:25 -07:00
Ryan Macnak ba88435b7d Add --observe to standalone embedder's help message.
BUG=http://dartbug.com/23743
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1256263010 .
2015-08-04 15:14:48 -07:00
Ryan Macnak 8a3e134502 Non-tree-shaking --precompile.
R=srdjan@google.com

Review URL: https://codereview.chromium.org//1261673004 .
2015-07-30 15:29:19 -07:00
Ivan Posva b07a9ddbca - Implement .packages specification.
Limitation: Currently only works for file: based .package files. If a script is loaded from http: then the VM currently assumes a co-located packages/ directory.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1232593003 .
2015-07-29 11:30:33 -07:00
Todd Turnidge e4684c7627 Provide stdout and stderr output in the Observatory debugger.
Implement two new streams, 'Stdout' and 'Stderr' in the service protocol.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1232193003 .
2015-07-14 12:54:07 -07:00
Soren Gjesse 0415d9271d Improve the encoding/decoding to/from system encoding on Windows
On Windows the dart:io SYSTEM_ENCODING is now also working with strings
which have null characters in them. Previously the string would be
terminated at the null character.

BUG=https://github.com/dart-lang/sdk/issues/23295
R=kustermann@google.com, lrn@google.com

Review URL: https://codereview.chromium.org//1194883002.
2015-06-24 10:36:05 +02:00
John McCutchan bcf6eb7099 Remove dart_debugger_api.h
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1190103003.
2015-06-17 14:56:55 -07:00
Ivan Posva f5e3f94019 Fix http://dartbug.com/23578:
- Complete revamp of isolate-specific flags.
- Associate flags with the isolate on creation.
- Dart_CreateIsolate and associate callback do take an
  extra flags argument.
- Make sure to clear IC data array when clearing code.

BUG=23578

Review URL: https://codereview.chromium.org//1162033005
2015-06-07 17:57:34 +02:00
Todd Turnidge 996f012707 2nd attempt at adding streamListen/streamCancel to the service protocol.
This time I am committing the protocol changes first and saving the
Observatory changes for a second cl.

------

We currently support 5 streams: Isolate, Debug, GC, _Echo, and _Graph.

Only generate events when at least one client is listening to the
corresponding event stream.

Only send events to the clients that actually request them.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//1166433008
2015-06-04 09:57:22 -07:00
Srdjan Mitrovic fc3cd69c05 Load deferred classes eagerly when generating script snapshots
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org//1155183003
2015-05-27 17:11:35 -07:00
Todd Turnidge 8d24372339 Revert "Add the streamListen and streamCancel rpcs to the vm service."
This reverts commit 0967b63073.

Conflicts:
	runtime/observatory/tests/service/graph_test.dart
	runtime/vm/service.cc

BUG=

Review URL: https://codereview.chromium.org//1152283005
2015-05-26 15:22:39 -07:00
Todd Turnidge 0967b63073 Add the streamListen and streamCancel rpcs to the vm service.
We currently support 5 streams: Isolate, Debug, GC, _Echo, and _Graph.

    Only generate events when at least one client is listening to the
    corresponding event stream.

    Only send events to the clients that actually request them.

    Implement this all as Dart streams in the service lib.

    Update tests.  Fix a race in async_generator_..._test that was biting me.

Review URL: https://codereview.chromium.org//1143783003
2015-05-26 13:52:35 -07:00
John McCutchan 51d8bae199 Revert "Hide Isolate pointer from embedder"
This reverts commit 014e694ba7.

Revert "Fix fall out from hide isolate pointer change"

This reverts commit 966aafbc81.

Revert "Fix build"

This reverts commit d7b03ba7b0.

BUG=

Review URL: https://codereview.chromium.org//1140263005
2015-05-19 11:41:42 -07:00
John McCutchan 014e694ba7 Hide Isolate pointer from embedder
BUG=
R=iposva@google.com

Review URL: https://codereview.chromium.org//1130753006
2015-05-18 14:06:10 -07:00
asiva@google.com 35cbf31ca1 Instead of aborting in Builtin::LoadAndCheckLibrary let the caller handle the error condition accordingly.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org//1126233009

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45804 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-14 23:27:58 +00:00
iposva@google.com d0763f97f3 - Add --trace-loading to trace resolution and loading.
- Remove unused --print-script option.

R=asiva@google.com

Review URL: https://codereview.chromium.org//1138083003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45720 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-11 22:58:32 +00:00
srdjan@google.com dbeedf6d26 Add --noopt flag that sets all kind of flags to make unoptimzied code as fast as possible (and not running optimized code at all).
Add flag --always_megamorphic_calls, causes instance calls to use megamorphic instead of ICdata calls.

R=fschneider@google.com

Review URL: https://codereview.chromium.org//1119013003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@45475 260f80e4-7a28-3924-810f-c04153c831b5
2015-05-01 20:55:24 +00:00
asiva@google.com 87c8a6ee76 First step towards splitting a full snapshot into a vm isolate snapshot and a
regular isolate snapsot.
- change gen_snapshot to split a full snapshot into a vm isolate snapshot
  and an isolate snapshot
- change the build process and scripts to account for splitting the full
  snapshot

R=hausner@google.com

Review URL: https://codereview.chromium.org//1023753006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44814 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-31 18:46:19 +00:00
asiva@google.com 354b4f3228 Move definition of trace_debug_protocol to dbg_connection.cc as this file is also linked into libvmservice_io
R=hausner@google.com

Review URL: https://codereview.chromium.org//1040543003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44778 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-30 15:40:51 +00:00
johnmccutchan@google.com 14afbd7fc2 Fix compile all for service isolate
BUG=

Review URL: https://codereview.chromium.org//1046483002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44768 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-28 00:00:42 +00:00
johnmccutchan@google.com bc0b241b0e Enable strict flags for all service tests
BUG=
R=turnidge@google.com

Review URL: https://codereview.chromium.org//1043513002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@44765 260f80e4-7a28-3924-810f-c04153c831b5
2015-03-27 23:32:07 +00:00
johnmccutchan@google.com 9b1f39bf58 Initialize standalone embedder debugger before calling Dart_Initialize
BUG=dartbug.com/22394
R=hausner@google.com

Review URL: https://codereview.chromium.org//914253006

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43741 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-12 21:22:34 +00:00
turnidge@google.com d554f4fbfe Finish moving service protocol to json rpc.
Service

- Remove support for old-style service requests.

- Drop 'arguments' from JsonStream and ServiceRequestHandler.

- Json-rpc inspired renaming: command->method, options->params all over.

- Implement getFlagList, setFlag, getObjectByAddress.

- Add helpers PrintMissingParamError and PrintInvalidParamError
  to make our error messages more regular.

- Update tests.

- Service_SetSource removed for now.  John will resurrect.

Observatory

- Drop all Deprecated 'get' functions.  We now use json rpc for everything.

- Drop 'link' and 'relativeLink' from ServiceObject -- they were
  ui-specific and they are no longer meaningful anyways.  Use 'id' instead.

- New pages: VMPage, FlagsPage, InspectPage, ErrorPage.  All urls
  used by Observatory are now 'new school' and have a proper
  prefix.  ErrorPage is the new catch-all.

- Pages now use a Uri instead of a url String.  This lets them
  grab query parameters more easily.

- SimplePage replaces IsolateSuffixPage.

- We now use gotoLink() or makeLink() to make our navigation
  links.  gotoLink gets some optional parameters to make it
  easier to construct links to ServiceObjects.

- Rework mouse clicks on the heap map to use getObjectByAddress.

- Remove the breakpoint_list.  It wasn't working.  I'll add it back later.

- Silence logging of getIsolateMetric/getVMMetric.

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org//897193002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43514 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 17:45:52 +00:00
iposva@google.com c859d25679 - Return exit code 253 in case of API errors during loading. This
will trigger for example when loading outdated snapshots.

R=ricow@google.com

Review URL: https://codereview.chromium.org//899523005

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43505 260f80e4-7a28-3924-810f-c04153c831b5
2015-02-05 14:30:24 +00:00
johnmccutchan@google.com 409a4527b3 Set LibraryTagHandler before attempting to load builtin libraries
BUG=
R=regis@google.com

Review URL: https://codereview.chromium.org//891533002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43317 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 22:09:55 +00:00
johnmccutchan@google.com 172baa03ff Service isolate rework take 2
Review URL: https://codereview.chromium.org//889443002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43306 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-29 18:31:27 +00:00
johnmccutchan@google.com db271b0477 Revert r43217, r43215, r43208, r43207, and r43202.
Reverting because of some isolate spawn issues (on Windows, and pub bots).

Review URL: https://codereview.chromium.org//867113003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@43219 260f80e4-7a28-3924-810f-c04153c831b5
2015-01-27 22:56:18 +00:00