Commit graph

42144 commits

Author SHA1 Message Date
Bob Nystrom
8daf4cfb73 Get the basics of deferred libraries working.
References to loadLibrary on a library prefix are compiled to a
helper function that returns a Future that always completes
successfully.

The deferred libraries aren't actually deferred, but code that uses
loadLibrary() now doesn't barf.

BUG=#27343
R=vsm@google.com

Review URL: https://codereview.chromium.org/2477673006 .
2016-11-07 10:41:23 -08:00
Brian Wilkerson
f61a3eacc4 Add the @immutable annotation
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/2476673004 .
2016-11-07 09:49:45 -08:00
Konstantin Shcheglov
ed172ddf70 When DefaultFormalParameter, don't use ParameterKind.REQUIRED.
It's a compilation error, but we still want to be consisten.

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2477183002 .
2016-11-07 09:31:48 -08:00
Konstantin Shcheglov
9723a28457 Support for hover with the new analysis driver.
R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2477193002 .
2016-11-07 09:09:14 -08:00
Zachary Anderson
02cb4a0003 GN: Take asan default from an environment variable
If DART_USE_ASAN is defined, then the GN build will have ASAN
enabled after a 'gclient runhooks'

R=whesse@google.com

Review URL: https://codereview.chromium.org/2480333002 .
2016-11-07 09:01:14 -08:00
Lasse Reichstein Holst Nielsen
88ef4e98fa Make Stream.take(0) still listen and close the stream.
It shouldn't matter, but for some streams (e.g., a `ReceivePort`)
it does make a big difference whether it's closed or not.
We can't make a port not keep the isolate alive unless it has been listened to.
If we could, this wouldn't be necessary.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2481083003 .
2016-11-07 17:01:19 +01:00
Florian Schneider
153b24ad59 Fix bug in test expectation for uri_platform test.
This fixes this test when run from the root directory (/) like we
do when running precompiled tests on Android.

BUG=#26376
R=zra@google.com

Review URL: https://codereview.chromium.org/2439053005 .
2016-11-07 07:58:38 -08:00
Kevin Moore
35c09238d6 smaller observatory pngs
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2473293003 .
2016-11-07 07:08:53 -08:00
Lasse Reichstein Holst Nielsen
4cb61407a8 Remove generalized tear-offs from the specification.
Fixes issue #27519
BUG= http://dartbug.com/27519
R=eernst@google.com

Review URL: https://codereview.chromium.org/2476613002 .
2016-11-07 14:53:27 +01:00
Lasse R.H. Nielsen
7bb7f5e6bb Handle the case of Stream.take(0) better.
The current implementation listens to the stream and waits for it to complete.
The change makes it listen and then immediately cancel, and then return a
subscription that only sends done.

R=floitsch@google.com

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

Committed: 8cead4090c
Committed: 9ebef9af7c
2016-11-07 11:48:48 +01:00
Paul Berry
4ee32a9950 Fix driver_test.dart for Windows.
TBR=scheglov@google.com

Review URL: https://codereview.chromium.org/2476143002 .
2016-11-06 11:16:55 -08:00
Konstantin Shcheglov
fc30904a39 Completion with the new analysis driver.
It works for top-levels, fields, locals, prefixed expressions.

Integration is not the most efficient - we resolve the full unit.
It works fine for files with about 1000 lines, about 50-70 ms.

We could slightly improve timing if we prioritize completion over
navigation and highlight notifications, which are currently prepared
and sent before completion.

In giant files like src/dart/element/element.dart, about 8500 lines,
it takes about 400 ms from typing to receiving completion. The theoretical
bottom bound for such files is about 70 ms - time that it required to
parse, create unlinked bundle, ensure that the API signature is the
same, load linked bundles and prepare to resynthesize. On top of this
goes any time required to resolve a single method and completion itself.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2478963002 .
2016-11-06 10:45:46 -08:00
Konstantin Shcheglov
fa6cfb3515 Support for Quick Fixes with the new analysis driver.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2481643002 .
2016-11-06 10:09:30 -08:00
Adam Barth
3581dd209e Update hardcoded file system path on Fuchsia 2016-11-05 11:10:41 -07:00
Jennifer Messerly
43bcc5945e fix #27766, allow implicit casts from dynamic to composite types
R=leafp@google.com

Review URL: https://codereview.chromium.org/2477093002 .
2016-11-04 17:37:13 -07:00
Jennifer Messerly
68f290c9d8 fix #27764, split STATIC_TYPE_ERROR into more detailed ones
R=leafp@google.com

Review URL: https://codereview.chromium.org/2482573002 .
2016-11-04 17:04:00 -07:00
Konstantin Shcheglov
0ff1d20bfd Implement FileState.hashCode/==.
Object.hashCode is still expensive, so this change makes recovering
after a change about 7% faster.

R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2473233004 .
2016-11-04 16:55:39 -07:00
Konstantin Shcheglov
9f6e57635a Support for Quick Assists with the new analysis driver.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/2480843002 .
2016-11-04 16:50:25 -07:00
Paul Berry
f9c55af608 Avoid writing to the same parts of the element model in two tasks.
Previous to this change, ResolveUnitTypeNamesTask would set types to
`dynamic` if there was no explicit type in the source code, and
InferInstanceMembersInUnitTask would overwrite those types with
inferred types.  This caused a problem if the result of
ResolveUnitTypeNamesTask got flushed due to memory pressure, but the
result of InferInstanceMembersInUnitTask did not.  In that case, the
task model would come back at a later time and re-run
ResolveUnitTypeNamesTask, causing the inferred types to be set back to
`dynamic`.  But it would not re-run InferInstanceMembersInUnitTask.
As a result, the inferred type would be lost.  This manifested as a
sporadic failure to inferred types in analysis server.  Annoyingly,
edits to the file(s) involved would frequently cover up the problem
(temporarily) since they would invalidate the cache entries, forcing
the task model to re-run both tasks.

This CL fixes the problem by adding _declaredType and
_declaredReturnType fields to the element model;
ResolveUnitTypeNamesTask writes to those.
InferInstanceMembersInUnitTask continues to write to _type and
_returnType, as it always has.  When a type or return type is
requested from the element model, the getter consults _type (or
_returnType) first; only if it is null does it fall back to
_declaredType (or _declaredReturnType).

This gives us the behavior we need (inferred types override the
implied "dynamic" type stored by ResolveUnitTypeNamesTask), but since
the two tasks are now writing to different fields in the element
model, it is now safe to re-run ResolveUnitTypeNamesTask--it will no
longer overwrite the inferred types.

Fixes #27482.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/2480783003 .
2016-11-04 16:44:28 -07:00
Ryan Macnak
4d81fee396 Special case the Pixel as not supporting integer division for 32-bit ARM.
R=zra@google.com

Review URL: https://codereview.chromium.org/2477453006 .
2016-11-04 15:43:18 -07:00
Zachary Anderson
479a97b129 clang-format runtime/bin
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2480793002 .
2016-11-04 12:30:56 -07:00
Zachary Anderson
2e4dfd3a2d clang-format runtime/lib
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2468093007 .
2016-11-04 12:14:41 -07:00
Konstantin Shcheglov
e7f4816f9d Optimize ApiSignature.addBytes()
This makes the benchmark below to run in 100 ms, vs. 250 ms.

main() {
  var bytes = new Uint8List(16);
  for (int i = 0; i < 2000; i++) {
    var timer = new Stopwatch()..start();
    ApiSignature signature = new ApiSignature();
    for (int i = 0; i < 1000; i++) {
      for (int i = 0; i < 1500; i++) {
        signature.addBytes(bytes);
      }
    }
    timer.stop();
    print('time: ${timer.elapsedMilliseconds}');
  }
}

R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2474993004 .
2016-11-04 11:24:10 -07:00
Terry Lucas
2f39479e6e Need to skip if runtime is drt.
TBR=johnniwinther@google.com

Review URL: https://codereview.chromium.org/2478603005 .
2016-11-04 10:36:19 -07:00
Ryan Macnak
760e97c88f Fix non-DBC builds.
R=zra@google.com

Review URL: https://codereview.chromium.org/2480523004 .
2016-11-04 10:04:20 -07:00
Ryan Macnak
3658a16e47 DBC: When calling DRT_OptimizeInvokedFunction, patch the stack to have a stub instead of the to-be-optimized function as the caller.
Fixes #27746

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

Review URL: https://codereview.chromium.org/2473213002 .
2016-11-04 09:51:02 -07:00
Zachary Anderson
2113134d4d Fix thread pool tests
fixes #26957

R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2478243004 .
2016-11-04 09:50:34 -07:00
Zachary Anderson
52b94871a7 Fuchsia: Fix run_dart_vm_tests build
Review URL: https://codereview.chromium.org/2474273004 .
2016-11-04 08:43:31 -07:00
Konstantin Shcheglov
64e0247700 Implement 'Sort Members' for the new analysis driver.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2473003003 .
2016-11-04 08:24:02 -07:00
Lasse R.H. Nielsen
9ebef9af7c Handle the case of Stream.take(0) better.
The current implementation listens to the stream and waits for it to complete.
The change makes it listen and then immediately cancel, and then return a
subscription that only sends done.

R=floitsch@google.com

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

Committed: 8cead4090c
2016-11-04 15:55:05 +01:00
William Hesse
3bd04426a8 Revert "Handle the case of Stream.take(0) better." This reverts commit 8cead4090c.
The test co19/LibTest/async/Stream/take_A01_t02 was failing after this
commit, on macos and windows, and perhaps everywhere.

BUG=
TBR=lrn@google.com

Review URL: https://codereview.chromium.org/2475303002 .
2016-11-04 15:47:46 +01:00
Lasse R.H. Nielsen
8cead4090c Handle the case of Stream.take(0) better.
The current implementation listens to the stream and waits for it to complete.
The change makes it listen and then immediately cancel, and then return a
subscription that only sends done.

R=floitsch@google.com

Review URL: https://codereview.chromium.org/2444363004 .
2016-11-04 14:54:58 +01:00
Florian Schneider
6fa4a54bba DBC: Fix smi shl with large (>word-size) shift counts
Insert check to guard against large shift counts.

Integer shifts with shift counts greater or equal than the number
of bits per word are undefined behavior in C/C++.

Fixes #27474.

R=vegorov@google.com

Review URL: https://codereview.chromium.org/2474103003 .
2016-11-04 12:16:34 +01:00
Florian Loitsch
fb968553ae Add generic argument to Codec.fuse.
Fixes #27722
BUG= http://dartbug.com/27722
R=lrn@google.com

Review URL: https://codereview.chromium.org/2472023004 .
2016-11-04 10:19:03 +01:00
Johnni Winther
bfa476c2b6 Fix kernel/visitor_test
- still need to change encoding of redirecting factories.

R=het@google.com

Review URL: https://codereview.chromium.org/2468273003 .
2016-11-04 08:37:04 +01:00
Konstantin Shcheglov
af23652ad1 Mix file: and package: URIs during analysis.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2469323004 .
2016-11-03 21:14:46 -07:00
Vijay Menon
d062fd7994 Fixes #27752
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2473143003 .
2016-11-03 18:01:05 -07:00
Ryan Macnak
93e55dbe6e Adjust tests/standalone/io/file_test not to resolve relative to Platform.executable.
Fixes #27748

R=asiva@google.com

Review URL: https://codereview.chromium.org/2477903002 .
2016-11-03 16:18:40 -07:00
Emily Fortuna
de2697f41c Code cleanup: moving compiler perf tests to compiler/tool
Task as described in https://docs.google.com/spreadsheets/d/1zebkSp_VjVFC_vd2JufrOkrT5O1XVu6iyoCmusE_UEk/edit#gid=0&vpid=A1

R=sigmund@google.com

Review URL: https://codereview.chromium.org/2473553005 .
2016-11-03 15:28:58 -07:00
Adam Barth
1e4092f5a8 Use the new argument ordering for mx_cprng_draw
BUG=
R=abarth@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2479683002 .
2016-11-03 15:09:53 -07:00
Zachary Anderson
e4e7e28c7f GN: Fix build
DDC needs another argument to make --help work.

R=vsm@google.com

Review URL: https://codereview.chromium.org/2480573002 .
2016-11-03 14:51:00 -07:00
Zachary Anderson
6953586716 Add .clang-format and run clang-format on runtime/platform.
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2470663006 .
2016-11-03 14:25:16 -07:00
Adam Barth
0de5c9a03f Use the new mx_object_get_info parameter ordering
BUG=
R=zra@google.com, abarth@google.com

Review URL: https://codereview.chromium.org/2475083002 .
2016-11-03 14:17:41 -07:00
Adam Barth
913b592a4e Move to the new mx_vmo_syscall argument order
BUG=
R=abarth@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2471343002 .
2016-11-03 14:17:20 -07:00
Adam Barth
7cfd287674 Move to the new mx_handle syscall argument order
BUG=
R=abarth@google.com, zra@google.com

Review URL: https://codereview.chromium.org/2475543004 .
2016-11-03 14:16:53 -07:00
Zachary Anderson
40073c3844 Remove unused handles array missed in previous patch.
BUG=
R=zra@google.com

Review URL: https://codereview.chromium.org/2479453002 .
2016-11-03 13:59:00 -07:00
John McCutchan
ec2767eeb4 During a reload, give const fields their new values.
Fixes #27667

BUG=
R=rmacnak@google.com

Review URL: https://codereview.chromium.org/2474193002 .
2016-11-03 13:01:48 -07:00
Jacob MacDonald
1aff39dd13 replace / with . in sourceUrl to prevent breaking relative source uris in source maps (#27730) 2016-11-03 12:22:55 -07:00
Ryan Macnak
9dfbd3d2fa Suppress error dialogs on Windows.
Issue #27749

R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2470823006 .
2016-11-03 11:00:08 -07:00
Terry Lucas
57b03def16 Skip front_end tests running in Dartium
TBR=paulberry@google.com

Review URL: https://codereview.chromium.org/2475523003 .
2016-11-03 10:58:22 -07:00