Commit Graph

6740 Commits

Author SHA1 Message Date
Regis Crelier ea7929d2fb Ignore bounds in compile time type tests, since they will have been checked at
run time (fixes issue 25935).
Add regression test.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1780333002 .
2016-03-10 14:22:44 -08:00
John McCutchan 53cae0aed9 Add ability for embedder to provide private timeline trace data
- Add three new embedder hooks registered with Dart_SetEmbedderTimelineCallbacks
  - Dart_EmbedderTimelineStartRecording
  - Dart_EmbedderTimelineStopRecording
  - Dart_EmbedderTimelineGetTimeline

- Add unit test for record start / stop notification.
- Add unit test for get timeline.

This should allow Flutter to remove their hacked up timeline service RPCs.

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

Review URL: https://codereview.chromium.org/1783953002 .
2016-03-10 13:32:48 -08:00
Florian Schneider 631ac120bb VM: Fix --noopt build by using ZoneHandle.
BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1777093003 .
2016-03-10 13:47:07 +01:00
Florian Schneider dd0564d9b0 Fix non-x64 builds.
BUG=

Review URL: https://codereview.chromium.org/1783753002 .
2016-03-10 09:50:45 +01:00
Florian Schneider bec43a3b8f Simplify the VM's typed_data constructors.
Remove _new native functions to have one indirection less
when constructing typed data lists.

BUG=
R=asiva@google.com

Review URL: https://codereview.chromium.org/1782003002 .
2016-03-10 09:38:08 +01:00
Regis Crelier ba69c8a898 Enumerate URIs of all types in type errors in order to help the user diagnose
the error (it was previously only printed for types with identical names).
Cleanup and simplify construction of type errors.

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

Review URL: https://codereview.chromium.org/1778133002 .
2016-03-09 15:16:47 -08: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
Ryan Macnak ed52614322 Fix incorrect assertion failures in noopt regarding removing classes that still have constants.
R=asiva@google.com

Review URL: https://codereview.chromium.org/1776243002 .
2016-03-09 12:11:23 -08:00
Matthias Hausner 5db2c56b5b Fix crash when setting breakpoint in Observatory
Fix bug in code that determines end token pos of classes, handle
typedef classes correctly.

BUG=25880
R=floitsch@google.com, johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1767113007 .
2016-03-09 08:55:54 -08:00
Regis Crelier cb0f9e98ea Fix typo in newly introduced mips assembly tests.
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1767133002 .
2016-03-07 11:34:46 -08:00
Ryan Macnak e880063e88 Include the canonical static closure when serializing ClosureData.
BUG=http://dartbug.com/25892
R=asiva@google.com

Review URL: https://codereview.chromium.org/1771483002 .
2016-03-07 09:06:26 -08:00
Florian Schneider 2148815673 Add fast path smi comparison operators.
Only rudimentary support for now, gives around 15% speedup on richards, precompiled.

Branch-merging is not yet supported in this CL.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1773633002 .
2016-03-07 08:55:43 -08:00
Matthias Hausner 3107a41bb7 Fix context level info in for-loops
The stack overflow check on the back-branch of the loop must
be at the same context level as the (outer) loop block of
the for-loop.

Before this change, the stack check was recorded to be at a
token position that is outside of the loop block, which caused
a context mismatch on some stack traces when the debugger
or the observatory interrupted the isolate on that back
branch.

It is not practical to write a test for this, unfortunately.

BUG=25684
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1768763002 .
2016-03-04 16:37:03 -08:00
Siva Annamalai 0bd9c54792 Ensure that calls to EnableGrowthControl/DisableGrowthControl does not reset the last_usage_ value as this can result in the heuristic constantly growing the heap instead of GCing. This was observed with the background compilation being turned on as we disable growth control during installation of code in the background compiler thread.
R=iposva@google.com

Review URL: https://codereview.chromium.org/1771503002 .
2016-03-04 16:17:32 -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
Florian Schneider 5c38712ce9 Clean up more flags using flag list.
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1766573003 .
2016-03-04 15:15:40 -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
Ryan Macnak 10f5ae69e8 ObjectPool is also used on IA32 for deopt.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1764283002 .
2016-03-04 12:33:33 -08:00
John McCutchan 32abe2ce55 Stream blocks of timeline events over the service protocol. Can be used to monitor long running programs without buffering all events inside the VM.
- Rename TimelineEventStreamingRecorder to TimelineEventCallbackRecorder. Note that this should only be used for tests.

- Add 'Timeline' service event stream.
- Send a 'TimelineEvents' event on the 'Timeline' stream whenever a TimelineEventBlock is finished and the 'Timeline' stream is subscribed to.

- Simple service protocol test.

R=turnidge@google.com

Review URL: https://codereview.chromium.org/1765563002 .
2016-03-04 12:30:50 -08:00
Ryan Macnak a78ed1c47a Tree-shake consts.
BUG=http://dartbug.com/25892
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1758153002 .
2016-03-04 09:42:53 -08:00
Florian Schneider 72a815c39f VM: Add smi fast path operations for precompiled code
The non-smi case is handled in a slow-path deferred code path.

BUG=
R=vegorov@google.com

Review URL: https://codereview.chromium.org/1756403002 .
2016-03-04 09:33:09 -08:00
Regis Crelier 6219753e18 Use TRUNC.W instead of CVT.W on mips to convert from double to int as to not
depend on the current rounding mode (fixes issue 25900).
Add support for TRUNC.W in assembler, disassembler, and simulator.
Fix disassembler to understand CVT.S.
Remove unused instructions.
Update co19 status file.

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1765623002 .
2016-03-03 17:05:09 -08:00
Florian Schneider 69f39d0b83 VM: Don't do inline context allocation in precompiled code.
It saves almost 2% (dart2js) in generated snapshot size, and the performance
benefit is negligible in precompiled code.

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1760153003 .
2016-03-03 16:22:13 -08:00
John McCutchan 3d5b6017c1 Adjust offset before querying inline information for samples that begin at exit frames
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1762833002 .
2016-03-03 13:58:10 -08:00
Siva Annamalai c51fcbf2b3 Turn off background compilation by default.
Review URL: https://codereview.chromium.org/1764823002 .
2016-03-03 13:48:48 -08:00
John McCutchan f7aec4b5d2 Set last resume timestamp when isolate is made runnable
Fall out from https://codereview.chromium.org/1756393002/ caused a checked mode test failure: https://build.chromium.org/p/client.dart/builders/vm-linux-release-ia32-be/builds/11330/steps/checked%20vm%20tests/logs/stdio

Review URL: https://codereview.chromium.org/1759303002 .
2016-03-03 13:34:03 -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
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
Todd Turnidge 5d83c5ec9b Print isolate properly in debug output for IsolateRunnable events.
Be a bit more verbose in test_helper to help us track down some test hangs.

BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1760963002 .
2016-03-03 09:53:44 -08:00
Srdjan Mitrovic 27a44122d9 Disable background compilation .. again.
BUG=
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1762543002 .
2016-03-02 18:04:00 -08:00
Srdjan Mitrovic 5d4b7b69bb Turn on background compilation
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1760763002 .
2016-03-02 17:32:27 -08:00
John McCutchan cd6485d380 Fix precompiler
BUG=
R=srdjan@google.com

Review URL: https://codereview.chromium.org/1755353002 .
2016-03-02 14:01:42 -08: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
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
John McCutchan 58e0ef13fa Add source position information to profile
- Fix bug in inlined call token positios.
- Add ProfileFunctionSourcePosition for tracking source positions within functions.
- Keep a list of ProfileFunctionSourcePosition in each function.
- Add unit test helper functions.
- Add unoptimized unit tests that verify source positions in function profiles.
- Add optimized/inlined unit tests that verify source positions in function profiles.

R=srdjan@google.com

Review URL: https://codereview.chromium.org/1758653003 .
2016-03-02 12:02:28 -08:00
Matthias Hausner 5a0a097188 Fix issues in name resolution
Looking up a name x in the library scope or in a prefix can also return
the setter name x=. There were several situations that were not handled
right.

- a getter x and a setter x= should not result in a duplicate name
  error (and thus a resolution error at runtime).

- when looking for an untangled name x but a setter x= is found first,
  keep looking for x.

BUG=25625
R=regis@google.com

Review URL: https://codereview.chromium.org/1752203002 .
2016-03-02 10:44:28 -08:00
Todd Turnidge 45ec466ce5 Make getSourceReport public.
BUG=
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1753903003 .
2016-03-02 10:26:27 -08:00
Siva Annamalai e091d17fd9 Fix windows build break.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1760673002 .
2016-03-02 10:20:55 -08:00
Ryan Macnak 48af897a3e When a catch is unreachable, use the canonical empty array instead of null as its type array.
R=iposva@google.com

Review URL: https://codereview.chromium.org/1753053003 .
2016-03-02 09:46:21 -08:00
Siva Annamalai 3067a27a8c Make the lock/unlock and Enter/Exit methods in Mutex and Monitor private so taht we always use the locker objects for operating on mutexes/monitors.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1758503002 .
2016-03-02 09:20:40 -08:00
Ryan Macnak f12b2edf3d Don't automatically exclude closure functions from potential removal of the stack overflow check.
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1757643002 .
2016-03-01 17:18:23 -08:00
Ryan Macnak 3fd5ffdbd4 Make tools/build.py -cprecompiler -rdart_precompiled green:
- Create a separate compilation output directory for each VMOptions varient so they can run in parallel.
- Run both the snapshotter and assembler from the test harness instead of a wrapper script so crashes in the snapshotter are correctly identified by the test harness.
- Delete the assembly source for the precompiled shared library as we go to limit space required to run the test suite (now 61GB for X64 release).
- Remove the VMOption --optimization-counter-threshold in when running precompilation tests.
- Don't look at a library prefix's import list during load(), it was removed by tree-shaking.
- Trace types of TypeParameters.
- Trace types of a Function's owner and parent.
- Update status file for remaining 4 failures under http://dartbug.com/25892.

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1732323005 .
2016-03-01 15:19:11 -08:00
Srdjan Mitrovic 3deae0d887 Allow regexp functions to be optimized in background
BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/1751173002 .
2016-03-01 14:37:49 -08:00
Siva Annamalai 1ba14b5b1d Check for Thread::Current being non NULL as in some situations (shutdown) it could be NULL.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/1751913003 .
2016-03-01 14:06:26 -08:00
Siva Annamalai b6d01a8947 Fix thread test.
Review URL: https://codereview.chromium.org/1754833002 .
2016-03-01 13:26:30 -08:00
Siva Annamalai 376b60148c Fix windows build.
Review URL: https://codereview.chromium.org/1748883004 .
2016-03-01 12:56:46 -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
Ryan Macnak 7b6463b708 Exception handlers may have null type arrays.
Fixes crash introduced by e1cd55dc8f.

R=regis@google.com

Review URL: https://codereview.chromium.org/1755713002 .
2016-03-01 10:14:03 -08:00