Commit graph

426 commits

Author SHA1 Message Date
Srdjan Mitrovic 4465fc3492 Address Siva's comments from https://codereview.chromium.org/1877973002/
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1880233002 .
2016-04-12 15:44:50 -07:00
Srdjan Mitrovic cb63ed46fe Invalidate background compilation only if relevant fields were invalidated.
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1877973002 .
2016-04-11 15:34:59 -07:00
Ivan Posva c434931517 - Remove --coverage_dir flag and old-style coverage service requests.
BUG=

Review URL: https://codereview.chromium.org/1846443002 .
2016-04-07 16:24:49 -07:00
John McCutchan 1c4f63df6c Print the isolate's sticky error if it has one.
- Bump protocol version to 3.4 to match service.md.
- Added note in changelog about 'none' pause event.
- Print the isolate's sticky error if it has one.

Fixes #26203

Review URL: https://codereview.chromium.org/1862903003 .
2016-04-07 15:31:50 -07: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
Srdjan Mitrovic 1a9fc8b2fa Move CompilerStats from isolate to thread. Aggregate stats.
The mutator thread holds the aggregate values, the background compiler adds its value to it.

BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1841213003 .
2016-03-30 13:38:32 -07:00
Ryan Macnak b2f3e8efe1 Precompilation: don't include an object header for instructions in the text section.
Reference Instructions only through Code::entry_point_ (or Function::entry_point_). Store the instructions size in its corresponding Code object.

precompiled dart2js x64 22163470 -> 21621102 (-2.45%)

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1808553002 .
2016-03-29 11:04:04 -07:00
Ivan Posva 528baf2173 - Limit 32-bit platforms to 1.5GB of memory for old gen by default.
- Fixed documentation for Dart_NewWeakPersistentHandle.
- Add clarifying comment.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1837803003 .
2016-03-28 17:37:52 -07:00
Srdjan Mitrovic f60e86fd83 Track loading happening in parallel with background compilation and abort compilation if necessary.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1834763004 .
2016-03-28 16:02:32 -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
Srdjan Mitrovic dda658f48a Restructure/fix thread pointer visiting; added some asserts.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1814853005 .
2016-03-17 13:25:46 -07:00
Siva Annamalai 56e888d4cd - Move
stack_limit_,
   stack_overflow_flags_,
   saved_stack_limit_,
   stack_overflow_count_ and
   other interrupts mask fields from Isolate structure to Thread structure

- Change the stack overflow check in the prolog to load the stack limit
  from the THR register, this removes the back to back dependent loads to
  load the stack limit from the Isolate structure

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

Review URL: https://codereview.chromium.org/1812753002 .
2016-03-17 12:57:36 -07:00
John McCutchan c65114b6b4 Timeline API fixes for Flutter
API changes:

- Remove isolate specific Timeline APIs.
- Remove Dart_EmbedderTimelineGetTimeline callback.
- Add Dart_TimelineEvent so that arbitrary trace events can be added.

Internal changes:

- Remove isolate specific streams which were never used or controllable from outside the VM.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1811613002 .
2016-03-16 12:18:46 -07:00
Srdjan Mitrovic 60ce67d91f Fix sticky error propagation from thread to isolate
BUG=
R=asiva@google.com, iposva@google.com

Review URL: https://codereview.chromium.org/1769183003 .
2016-03-09 12:40:43 -08:00
Srdjan Mitrovic 1cc5dab2f2 Clear fields sticky_error and pending_functions when unscheduling thread; enable background compilation
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1754703008 .
2016-03-03 12:32:54 -08:00
John McCutchan 49dc7e557b Fix some service protocol isolate life cycle races that were discovered by the Flutter testing tool.
Fixes #25902

Issue #1

Assuming --pause-isolates-on-start, there is a window of time after an isolate is made runnable and before it pauses at the first message that we say the isolate is "resumed".

- Fix issue #1 by claiming the isolate is paused on start if it will eventually pause on start.
- Also, handle the resume command for this state by clearing the 'should pause on start' bit.

Issue #2

Before an isolate is made runnable we say the isolate is "resumed".

- Fix issue #2 by introducing a new pause event "None".

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1756393002 .
2016-03-03 11:30:41 -08:00
Srdjan Mitrovic 4128c31916 Add thread safe constant canonicalization.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1754813004 .
2016-03-02 12:12:48 -08:00
Siva Annamalai e83151cc77 - Add assertions in MutexLocker/MonitorLocker to ensure that the code enclosed
in these blocks will not have a safepoint operation
- changed boxed_field_list_monitor_ to boxed_field_list_mutex_ as we only
  need a mutex for guarding access to boxed_field_list_ as changed the
  lock to use SafepointMutexLocker as the list addition code could potentially
  allocate and result in GC (safepoint operation)
- Added a SafepointMonitorLocker as we have a function Isolate::VisitIsolates
  which could potentially have safepoints in the enclosed block.
- Make the lock around MegamorphicCacheTable::Lookup a SafepointMutexLocker
  as the look up code seems to be allocating memory while the lock is held.
- Changed the ThreadPool and MessageHandler code to account for the new
  MonitorLocker usage standard
- Fixed PortMap::PrintPortsForMessageHandler to use SafepointMutexLocker as
  the code it encloses calls into Dart
- Removed profiler_ field in class Profiler as it doesn't seem to be used.

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

Review URL: https://codereview.chromium.org/1748953003 .
2016-03-01 12:33:50 -08:00
Srdjan Mitrovic 88acc8ab01 Make type canonicalization thread safe
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1747073002 .
2016-03-01 12:12:16 -08:00
Srdjan Mitrovic 5a69e3661b In background compilation make a copy of Field in order to freeze its state. Add flag --force_clone_compiler_objects for debugging purpose.
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1722733002 .
2016-02-26 09:07:49 -08:00
Ivan Posva 8d18298fed - Remove Isolate::Flags structure and store flags directly in isolate.
- Make enable_asserts, enable_type_checks, error_on_bad_override and
  error_on_bad_type release mode flags only.

BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1737693003 .
2016-02-25 18:06:56 -08:00
John McCutchan b482480b65 Improve behaviour when we hit a stack overflow / OOM error
Fixes #25815

VM changes:

- Don't crash in SignalExceptionThrown when we have no stack frames.

- Notify the debugger about an unhandled stack overflow / OOM *after* setting the sticky error. This allows Observatory to display it.

- When pausing without a debugger attached, print the sticky error if one is set.

- Improve stack trace frame numbers when printing for a stack overflow.

Observatory changes:

- Report the sticky error for pause at unhandled exception as well as exit.

- Let the user know that we cannot pause for unhandled stack overflow / OOM exceptions.

- Don't show the "at <func> (<script location>)" string in the isolate summary, if we don't have a top frame.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1709383002 .
2016-02-25 07:33:01 -08:00
John McCutchan fda3a9bc2b Remove more things
(stripped) dart_product before: 5307888
(stripped) dart_product after: 5275088

Reduction in size: 32800 bytes.

Removed entirely:

- debuginfo*
- elfgen*
- gdbjit*
- TraceBuffer
- vtune support

Removed in product:

- Compiler stats
- Code observers

R=asiva@google.com

Review URL: https://codereview.chromium.org/1711163002 .
2016-02-22 08:53:11 -08:00
Siva Annamalai 5322692506 Add a SafepointMutexLocker class so that it is possible to have scopes inside the MutexLocker which could potentially trigger safepoints.
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1717803002 .
2016-02-19 16:03:52 -08:00
Ryan Macnak 0c86f0d58b VM service fixes for noopt/precompiled.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1701383002 .
2016-02-17 14:06:24 -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
Todd Turnidge 2ef7f6f140 Improve --trace-service to help track down problems in full_coverage_test.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1690263003 .
2016-02-12 13:26:16 -08:00
John McCutchan cda760915c Add fine grained command line and service protocol control over timeline streams recording
- Add --timeline-streams= flag which takes a comma separated list of streams to record.
- Send "availableStreams" and "recordedStreams" in the _getVMTimelineFlags RPC. Also include the type of recorder we are using.
- Enable setting of "recordedStreams" in the _setVMTimelineFlags RPC.

R=zra@google.com

Review URL: https://codereview.chromium.org/1690333002 .
2016-02-12 13:18:25 -08:00
Srdjan Mitrovic d26980f6fc Pass field to mutator thread so that it can be marked as boxed and all dependent code deoptimized (background compilation only).
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1685963002 .
2016-02-10 12:33:47 -08:00
Todd Turnidge 2b74ea304d Don't allow oob message interrupts while executing constant expressions in the parser.
When this happens we can get complaints about circular dependencies
that don't really exist.  We were seeing this occasionally on
developer_extension_test.dart.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1666323002 .
2016-02-09 10:04:46 -08:00
John McCutchan e2e7af1229 Remove more feature in product mode
- Remove Timeline.
- Remove more vmservice code.
- Remove AST printing.
- Remove IL printing.
- Remove profiler.
- Remove thread interrupter.
- Remove disassembler.
- Remove Library::CheckFunctionFingerprints.

- Update test status files for product mode.

Size of dart_bootstrap before: 5287631
Size of dart_bootstrap after: 5112783

Reduction in size: 174848 bytes.

Total reduction in size (382734 + 174848): 557582 bytes.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1678203002 .
2016-02-09 08:45:32 -08:00
John McCutchan 1e6c5f196b Add 'runnable' to Isolate service response
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1676233003 .
2016-02-08 10:14:17 -08:00
Srdjan Mitrovic 4316d1bd17 Move sticky_error_ from isolate to thread
BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1672853002 .
2016-02-05 15:46:55 -08:00
John McCutchan d295b9c311 Remove many features when building product mode
Move all JSON printing code from object.cc to object_service.cc.

Not compiled in:

- Service protocol
- Debugger
- Debugger API
- JSONStream
- ObjectIdRing
- Profiler service
- Object JSON printing

Size of dart_bootstrap before: 5670365 bytes
Size of dart_bootstrap after: 5287631 bytes

Reduction in size: 382734 bytes.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1660063002 .
2016-02-05 09:55:51 -08:00
John McCutchan 6f76e2af99 Add necessary support functions so that embedders can implemented pause on start and exit
- Add Dart_ShouldPauseOnStart, Dart_SetShouldPauseOnStart, Dart_IsPausedOnStart, Dart_SetPausedOnStart, Dart_ShouldPauseOnExit, Dart_SetShouldPauseOnExit, Dart_IsPausedOnExit, Dart_SetPausedOnExit to query and control pause on start / exit from outside of the default message handler.
- Add Dart_HandleMessages to process all regular messages from outside the default message handler.
- Allow per isolate overriding of pause on start / pause on exit flags.
- Set the resume_request bit when resuming from isolate start / exit.
- Clear the resume_request bit in the default message handler.
- Rename MessageHandler fields and accessors.
- Rename Isolate::Resume to Isolate::SetResumeRequest.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1665773004 .
2016-02-03 15:33:40 -08:00
John McCutchan d77d376124 Replace intptr_t with TokenDescriptor
- Use TokenDescriptor instead of intptr_t for all token positions.
- Use TokenDescriptor in raw_object instead of int32_t.
- TokenDescriptor is a POD with an int32_t (this shrinks the size of AST and IR nodes by 32-bits on 64-bit architectures).

There are some cleanups I plan on doing as a follow up CL:

- Replace TokenDescriptor::value() with TokenDescriptor::TokenPos()

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

Review URL: https://codereview.chromium.org/1644793002 .
2016-02-02 10:15:44 -08:00
Siva Annamalai e72c1fb47d Implement safepointing of threads :
- uses thread execution status transition to track when a thread is in a safepoint or needs to block for a safepoint
 - introduces a monitor per Thread object
 - uses a per thread safepoint handshake between the thread requesting a safepoint and the requested thread.

The ThreadRegistry class now contains only the thread list for an isolate and the functionality of scheduling a thread onto an Isolate and unscheduling it from teh isolate. We could fold this functionality into the Isolate class in a different CL.

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

Review URL: https://codereview.chromium.org/1541073002 .
2016-02-01 10:57:34 -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
John McCutchan ec020a301b Improve Observatory debugger behaviour when an isolate exits with unhandled exceptions
- When an isolate is paused at exit and has a sticky error, have the debugger display the error.
- Add --pause-isolates-on-unhandled-exceptions flag which sets a default value for break-on-exception.
- Have the debugger display help text about 'set break-on-exception' and '--pause-isolates-on-unhandled-exceptions'
- Signal an unhandled exception even if no client is connected to Observatory.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1636083002 .
2016-01-26 10:12:46 -08:00
Ivan Posva 6d066c7e53 Add package config support to dart:isolate
- Add "static Future<Uri> get packageRoot;",
  "static Future<Uri> get packageConfig;" and
  "static Future<Uri> resolvePackageUri(Uri packageUri)" to Isolate class.
- Added "Uri packageRoot, Uri packageConfig, bool automaticPackageResolution: false" parameters to spawnUri.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1553233002 .
2016-01-12 18:19:04 -08:00
Zachary Anderson 1ce512b69f Fix Shutdown race.
This CL fixes a race during VM shutdown in which the embedder's
isolate creation callback is passed an invalid isolate data pointer.

BUG=http://dartbug.org/25351
R=asiva@google.com

Review URL: https://codereview.chromium.org/1560853002 .
2016-01-08 12:30:57 -08:00
Zachary Anderson 97158fed8c Adds strict compilation flags to Dart_IsolateFlags
Also removes the API call for setting these, which is no longer needed.

R=iposva@google.com

Review URL: https://codereview.chromium.org/1569833003 .
2016-01-08 09:54:58 -08:00
Siva Annamalai b40775549f Fix for issue 25236
- Ensure that no new OSThreads are created once the VM is in shutdown mode
- Do not query thread_list_head_ without a lock (this leads to the race which causes two threads to delete the lock and TLS at the same time)

BUG=25236
R=zra@google.com

Review URL: https://codereview.chromium.org/1537543002 .
2015-12-18 10:16:28 -08:00
John McCutchan f3ee772308 Provide list of service protocol extensions in isolate and emit an event when one is registered.
- Doc improvements.
- Type annotation improvements.
- Isolate includes list of currently registered extensions.
- New event kind on isolate stream emitted whenever an extension is registered (IsolateServiceExtensionRegistered).

Fixes https://dartbug.com/25208
Fixes https://dartbug.com/25257

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1527793004 .
2015-12-16 13:49:37 -08:00
Zachary Anderson a0970835f0 Adds a special case for sending an int over a port with the native API.
This improves dart <=> C++ IPC round-trip-times for Mojo by 10-20%.

BUG=

Review URL: https://codereview.chromium.org/1499853004 .
2015-12-11 16:07:16 -08:00
Ivan Posva 6249c2bcf3 - Remove the legacy debug protocol.
BUG=
R=hausner@google.com

Review URL: https://codereview.chromium.org/1497033003 .
2015-12-03 17:46:02 -08:00
Ivan Posva bc89cfccbf - Remove unused PrintInvokedFunctions method.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1490583002 .
2015-11-30 13:42:29 -08:00
Siva Annamalai 01b69ebabc Move ApiLocalScope out of class ApiState into class Thread so that the API local handles and zone etc. are thread specific instead of being Isolate specific.
R=zra@google.com

Review URL: https://codereview.chromium.org/1473403003 .
2015-11-25 11:07:22 -08:00
Siva Annamalai 4992bc72a0 Remove support for object grouping during Garbage Collection
- remove support for prolog weak persistent handles
- remove support for construction of weak reference sets

R=iposva@google.com

Review URL: https://codereview.chromium.org/1459173004 .
2015-11-20 12:36:16 -08:00
Siva Annamalai 9e19d236ca - Add an OSThread structure which is the generic TLS structure for all C++
fields in a thread (i.e fields that are not Dart VM related)
- Split the Thread structure to be a pure Dart per thread structure and add
  a pointer to os_thread which points to the OSThread structure
- Change Schedule/UnSchedule to set the Dart Thread structure as the TLS of
  the thread when it is inside the Dart world and reset the TLS back to the
  OSThread strcuture when is exits the Dart World.
- Moved the stack_base and few stack size related functions to OSThread from Isolate

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

Review URL: https://codereview.chromium.org/1439483003 .
2015-11-19 13:45:10 -08:00