Commit Graph

12719 Commits

Author SHA1 Message Date
Régis Crelier f91f67a5be [VM] Emit type checks for incoming function arguments in strong mode.
Change-Id: Icd64913f0fc6ba54a0b8517bf05ae4babfae3bdc
Reviewed-on: https://dart-review.googlesource.com/19287
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-11-18 00:31:35 +00:00
Siva Annamalai 1c282f6482 Fix a set of tests that exercised the library Dart API functions in kernel mode.
Change-Id: Id7ac9166615d2b7de3604da555d9fc61563586af
Reviewed-on: https://dart-review.googlesource.com/20340
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Chandra <sivachandra@google.com>
2017-11-17 18:09:03 +00:00
Alexander Markov 58ffdbf5fc [VM] Move kernel service to pkg/vm, populate pkg/vm with necessary files
* kernel-service.dart is moved to pkg/vm/bin and renamed to
  kernel_service.dart

* LICENSE, pubspec.yaml and analysis_options.yaml added to pkg/vm.

* Kernel isolate name is corrected to be independent of URI passed
  in --dfe VM option.

Change-Id: I5b7b860297314e240e557af80913e7ac3e6324ad
Reviewed-on: https://dart-review.googlesource.com/21260
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-17 17:45:03 +00:00
Alexander Markov 328aa2e1ea [VM] Fix identical() for mint arguments on arm64
Closes https://github.com/dart-lang/sdk/issues/31395

Change-Id: I275a391392245e16ca40b98c3327e39b19106e89
Reviewed-on: https://dart-review.googlesource.com/21567
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-11-17 16:00:43 +00:00
Lasse R.H. Nielsen 84c8f27e51 Revert constant-name changes to observatory code.
Change-Id: I7622658c61d1f3c7ebd2d3fbed7c57ef252d97bb
Reviewed-on: https://dart-review.googlesource.com/21620
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-17 12:49:53 +00:00
Paul Berry 7a778cf47c Strong mode fix for vmservice_io.dart.
Change-Id: I3cb1b44969779018cccff91e45eba11d60afcd58
Reviewed-on: https://dart-review.googlesource.com/21568
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-17 08:31:56 +00:00
Martin Kustermann 38518a98de [VM] Remove recently introduced assertion which doesn't always hold
The "main" method can also be a getter, which this assertion doesn't
take into account.  The assertion was just recently introduced in a
large CL and is not really necessary.

Revert "[gardening] Mark Language/Libraries_and_Scripts/Scripts/top_level_main_t05 crashing on debug dartk[p]"

Fixes https://github.com/dart-lang/sdk/issues/31389

Change-Id: I0fd45cfa5b885bb1942dcafe33afb922b7a75d40
Reviewed-on: https://dart-review.googlesource.com/21442
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-16 16:05:41 +00:00
Erik Corry 1109ffcb6a [VM] Add ARM64 bitfield instructions
R=rmacnak@google.com

Also some minor cleanup in the way we encode ARM instructions.
I'll be needing these for 32 bit Smis on ARM64.
Bug:
Change-Id: I5f515590375a2c6ad11bc6f1a80a4f8e27cd82b4
Reviewed-on: https://dart-review.googlesource.com/20668
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-11-16 15:34:11 +00:00
Erik Corry 54c54a87db [VM] Fix compilation of assembly tests on Mac
R=vegorov@google.com

Bug:
Change-Id: I65128750e1eb37d8664916ff4e94aee45211b1e0
Reviewed-on: https://dart-review.googlesource.com/21440
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-16 14:36:03 +00:00
Erik Corry f3be82bb34 [VM] Make x86 and x64 assemblers less repetitive
This also means that an orthogonal selection of the core ALU instructions
are available so future programmers don't have to add instructions
to the assembler as needed, which tends to slow down progress.

R=vegorov@google.com

Bug:
Change-Id: I5fea72c70ea7ffbae8efad85aef4ecc96c235cb6
Reviewed-on: https://dart-review.googlesource.com/21140
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-16 14:18:41 +00:00
Martin Kustermann d354a28cb2 [kernel] Add kernel2kernel constant evaluation, binary format as well as vm support
The introduced "constants" transformation can evaluate constant expressions.  The
original use-sites of constant expressions are replaced by a new [ConstantExpression]
node, which points to a subclass of a new [Constant] class hierarchy.  Constant
[Field]s and [VariableDeclarations]s will be removed, since all use-sites are
re-written.

The [Constant] class hierarchy is, similarly to the [DartType] class hierarchy, not
part of the AST tree (also has no parent pointer).  The constants form a
DAG (directed acyclic graph).

There is no canonicalization requirement of the [Constant] objects referenced by the
AST (via [ConstantExpression]).  Although it is beneficial to canonicalize them during
construction, since it reduces time spent in operator==/hashCode.

This CL furthermore adds support for a constant table in the binary format.  Similarly
to [String]s, we canonicalize the constants before writing the table to the binary.
The constant table entries in the binary are written in a post-order way, to ensure
easy construction on the backend side.

The text format will be augmented with a "constants { ... }" section at the end,
which lists the constants in the same order as in the binary format.

The transformation can be used by those backends who choose to do so.  It is not
enabled by default atm.  It should therefore not affect analyzer, fasta or other
components.

Change-Id: I57cd9624fedcf537ab6870db76246149647bed21
Reviewed-on: https://dart-review.googlesource.com/14382
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2017-11-16 11:08:02 +00:00
Ryan Macnak 4f612b749a [vm] Only support instruction tracing for DBC in debug mode.
Flutter uses DBC in release mode.

dart-simdbc-checked linux-armv7hf
ParticleSystemUpdate (Odroid-C2) -32.73% (-0.8 noise)
Tracer (Odroid-C2)                17.72% (0.0 noise)
StarryStrings (Odroid-C2)         45.95% (0.1 noise)
Richards (Odroid-C2)              49.89% (0.1 noise)
DeltaBlueClosures (Odroid-C2)     54.56% (0.1 noise)
DeltaBlue (Odroid-C2)             54.27% (3.7 noise)
ParticleSystemPaint (Odroid-C2)   56.29% (4.8 noise)

Change-Id: I42f9697c7a66f2d8bfb665c32aed90e833d48a75
Reviewed-on: https://dart-review.googlesource.com/21283
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-11-15 23:42:01 +00:00
Ryan Macnak 204f7f6ffa [vm] Visit DBC interpreter's pp and argdesc slot.
Enables compaction with DBC.

dart-simdbc-checked linux-armvhf (closest to Flutter's usage):
ParticleSystemPaint (Odroid-C2)  -3.454% (-0.3 noise)
ParticleSystemUpdate (Odroid-C2) -9.009% (-0.2 noise)
DeltaBlue (Odroid-C2)            -1.655% (-0.1 noise)
DeltaBlueClosures (Odroid-C2)    -2.415% (-0.0 noise)
StarryStrings (Odroid-C2)        -2.445% (-0.0 noise)
Richards (Odroid-C2)            -0.9325% (-0.0 noise)
Tracer (Odroid-C2)              -0.6846% (-0.0 noise)

Bug: https://github.com/dart-lang/sdk/issues/30978
Change-Id: Iff7dfad25db0a1e12fd02157c7c4f970ea88779d
Reviewed-on: https://dart-review.googlesource.com/16689
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-15 22:07:14 +00:00
Paul Berry ff898fded5 Strong mode fix for socket_patch.dart.
Change-Id: Icf5bcc7ba370ad9880c1565faf3ace046e47abe0
Reviewed-on: https://dart-review.googlesource.com/21262
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-15 20:45:31 +00:00
Alexander Markov c1212311bf [VM] Fix OOM handling when allocating buffers in dart:io
Reland 1d6c1020c9 with the fix for ASAN
bots.

* Test standalone_2/file_error_test is updated for Dart 2.0 fixed-size
  integers.

* This update revealed that certain dart:io native methods do not handle
  out-of-memory properly when I/O buffers are allocated.
  This CL fixes this bug.

* Updated test point is extracted to a separate test
  standalone_2/file_error2_test as it needs custom ASAN options.

Change-Id: Ifb1fa59828f36dc03d45c18a41d45da6b989d70a
Reviewed-on: https://dart-review.googlesource.com/20908
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-15 18:06:31 +00:00
Ryan Macnak 344a9d546b [vm] Deduplicate catch entry state maps.
Flutter gallery ARM32:
TypedData          74349 ->    22701 (-69.5%)
Total snapshot  10741228 -> 10689108 (-0.49%)

Bug: https://github.com/dart-lang/sdk/issues/31302
Change-Id: I759147e4a9cd532eb338d96558a423e675358790
Reviewed-on: https://dart-review.googlesource.com/20562
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-14 23:06:05 +00:00
Paul Berry 7cec90293e [VM,libs] Add workaround for issue 31305.
The tear-off of _NativeSocket.multiplex needs to have runtime type
`(Object) -> void` in order to be passed to the RawReceivePort
constructor.  Once issue #31305 is fixed, we should be able to fix
this by marking _NativeSocket.multiplex's argument as "covariant".
Until then, we have to type the argument as `Object` and then assign
it.

Change-Id: I1c9b7fb77dd3b0a71037459206f8de30ad77f73e
Reviewed-on: https://dart-review.googlesource.com/20822
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-14 21:46:45 +00:00
Alexander Markov f28005819b Revert "[VM] Fix OOM handling when allocating buffers in dart:io"
This reverts commit 1d6c1020c9.

Reason: failures on ASAN bots as ASAN is not configured to
accept memory allocations with huge size.
Change-Id: Ibb3b27f60017fb42e0f36caea2262125f5bb40d0
Reviewed-on: https://dart-review.googlesource.com/20900
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-14 21:33:25 +00:00
Ryan Macnak 374c21ccb4 [vm] Improve packing of StackMaps.
Flutter gallery ARM32:
StackMaps        1248008 ->   898886 (-28.0%)
Total snapshot  11089876 -> 10741228 (-3.1%)

Bug: https://github.com/dart-lang/sdk/issues/31302
Change-Id: I61c6fbf9024648907238d1d835d13d75b17f224a
Reviewed-on: https://dart-review.googlesource.com/20480
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-14 20:04:14 +00:00
Alexander Markov 1d6c1020c9 [VM] Fix OOM handling when allocating buffers in dart:io
* Test standalone_2/file_error_test is updated for Dart 2.0 fixed-size
  integers.

* This update revealed that certain dart:io native methods do not handle
  out-of-memory properly when I/O buffers are allocated.
  This CL fixes this bug.

Change-Id: I6a9018ab86da7b163d9797d745544835dfb0f15c
Reviewed-on: https://dart-review.googlesource.com/20582
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-14 18:26:34 +00:00
Vyacheslav Egorov f669d19927 [VM] Fix RegExp_ExecuteMatch to return List<int> instead of List<dynamic>.
Fixes https://github.com/dart-lang/sdk/issues/31307

Bug:
Change-Id: Ied39fd616a492d9872fe7676202e4dc497d1ee17
Reviewed-on: https://dart-review.googlesource.com/20780
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-11-14 18:13:04 +00:00
Zachary Anderson 0af5298845 [dart:io] Adds optional withTrustedRoots parameter to SecurityContext()
The parameter defaults to false. This enables creating a
SecurityContext that includes the trusted root certificates that can
be modified per-connection.

fixes #24693

Change-Id: I22e5736838755ce4055f77b1b17aeb5176329240
Reviewed-on: https://dart-review.googlesource.com/20580
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-11-14 18:09:34 +00:00
Siva Chandra 2b80ed8290 Make line starts field of RawScript to be a TypedData of int32_t values.
It was previously an array of Smi values. By converting to TypedData
array of int32_t values, we shave off 70+KB from the kernel based core
snapshots. While 70KB might not seem too high, it is 5% of the excess
size we have wrt to the token stream based core snapshots.

Change-Id: I5b58a1d1ac27391eca1efff179301bb04162e97b
Reviewed-on: https://dart-review.googlesource.com/19800
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-11-14 17:55:06 +00:00
Vyacheslav Egorov ca8f7b58ae [VM] Fix a bug in dart::Monitor::Wait and dart::bin::Monitor::Wait
Code path Monitor::Wait that handles timeout contains a race between removing
waiter from the list and another thread signaling waiter's event:

T1: WaitForSingleObject(wait_data->event_, ...) returns with WAIT_TIMEOUT
        T2:  SetEvent(wait_data->event_)
T1: data_.RemoveWaiter(wait_data->event_)

This race leaves wait_data->event_ signaled, which breaks an important invariant
the method relies on: if WaitForSingleObject returns successfully (neither
timedout nor failed), that implies that wait_data was removed from the
waiters list by the method that signaled the event (SignalAndRemoveAllWaiters
or SignalAndRemoveFirstWaiter). However if wait_data->event_ is left signaled
the next invocation to WaitForSingleObject will return prior to any invocation
of SignalAndRemoveAllWaiters/SignalAndRemoveFirstWaiter, which means that
wait_data->event_ will be left in the list, which can lead to all sorts of
bugs, for example:

T1: // Assuming that wait_data WD1 for thread T1 is left with signaled event.
T1: ml.Wait()                                        | waiters list: WD1
T1: | WaitForSingleObject(...) returns "spuriously"  | waiters list: WD1
T1: // WD1 is still on the waiters list, even though |
T1  // it is not waiting anymore                     | waiters list: WD1
                                                     |
  T2: ml.Wait()                                      | waiters list: WD1 -> WD2
                                                     |
T1: // wait on the same monitor again                |
T1: ml.Wait()                                        | waiters list: WD1 -> WD2
T1: | GetMonitorWaitDataForThread()                  | waiters list: WD1 -> WD2
T1: | | wait_data->next_ = NULL                      | waiters list: WD1

  T3: // Notify all waiters. Only T1 will wake up!
  T3: ml.NotifyAll()

Notice how waiting on the same monitor caused us to corrupt the singled
linked list of waiters, because GetMonitorWaitDataForThread(...) does
wait_data->next_ = NULL - which means that if WD1 was accidentally left
in the list of waiters then all elements on that list after WD1 are lost.

This means that NotifyAll will not wake up all threads.

This was causing deadlocks in GC (#29261) by breaking ThreadBarrier logic.

Fixes https://github.com/dart-lang/sdk/issues/29261

Bug:
Change-Id: Ia61efa065bc7db8fe4bbf549032f35932356a0f4
Reviewed-on: https://dart-review.googlesource.com/20760
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-11-14 17:00:16 +00:00
Lasse R.H. Nielsen ad932a8c7a Fix fingerprints correctly
Change-Id: I5e1f443b1b6907953a9758abe15dcdd2d23289d6
Reviewed-on: https://dart-review.googlesource.com/20701
Reviewed-by: Erik Ernst <eernst@google.com>
2017-11-14 14:02:17 +00:00
Lasse R.H. Nielsen 0b58c4bd10 Change some constant declarations to lowerCase.
Retain the old values.

Reapply of https://dart-review.googlesource.com/c/sdk/+/20680 with fixes
for VM method fingerprints.

Change-Id: Ie14e7ccc3194d5561983348e6b6752728913ff4d
Reviewed-on: https://dart-review.googlesource.com/20664
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 12:59:14 +00:00
Kevin Millikin 7d2c8950bf Set the source position on strong-mode downcasts
Set the appropriate source position so that the line and column number
will appear in stack traces for failed downcasts.

Bug: https://github.com/dart-lang/sdk/issues/31327
Change-Id: Ie0ddd597ddd000a8170746d5ca15336898f04b11
Reviewed-on: https://dart-review.googlesource.com/20663
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2017-11-14 12:06:34 +00:00
Lasse R.H. Nielsen e61fc07b58 Revert "Change some constant declarations to lowerCase."
This reverts commit c048cfb178.

Reason for revert: VM code fingerprints needs update.

Original change's description:
> Change some constant declarations to lowerCase.
> 
> Retain the old values.
> 
> Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
> Reviewed-on: https://dart-review.googlesource.com/11520
> Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Florian Loitsch <floitsch@google.com>

TBR=lrn@google.com,floitsch@google.com

Change-Id: I095e8198304ca4e59b39d30b0fdf0af4945e5231
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/20680
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2017-11-14 11:23:08 +00:00
Lasse R.H. Nielsen c048cfb178 Change some constant declarations to lowerCase.
Retain the old values.

Change-Id: I03bd326f379fe5f96d8f6081a7133de956d745c0
Reviewed-on: https://dart-review.googlesource.com/11520
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Florian Loitsch <floitsch@google.com>
2017-11-14 11:13:04 +00:00
Erik Corry 248d4468f4 [VM] Add csneg instruction on ARM64
R=rmacnak@google.com

I'll be needing this for some read barrier experiments.
Bug:
Change-Id: I18ac62a9a23a2bd285826e4247b8ee2819d5283b
Reviewed-on: https://dart-review.googlesource.com/20065
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-11-12 20:34:14 +00:00
Paul Berry 8f57cf8e45 Strong mode fix for runtime/bin/vmservice/loader.dart
The values in isolateEmbedderData have IsolateLoaderState in practice,
but the static type system only guarantees they have type
IsolateEmbedderData (a supertype).  So we need an implicit downcast.

Change-Id: I9da0c9a34deae233e3bb25d264e4307fd186c3c7
Reviewed-on: https://dart-review.googlesource.com/20160
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-11 15:38:51 +00:00
Ryan Macnak cbb7cb360b [vm] Include the content of image pages into --print-snapshot-sizes-verbose.
E.g.,
             Cluster   Objs     Size Fraction Cumulative
    (RO)Instructions      0 11465312 0.500079 0.500079
        (RO)StackMap  97579  3525312 0.153763 0.653842
   (RO)CodeSourceMap  22358  1752087 0.076420 0.730262
   (RO)OneByteString  30427  1644273 0.071718 0.801980
          ObjectPool  27233  1077927 0.047016 0.848995
               Array  25995  1029434 0.044901 0.893896
            Function  36468   924984 0.040345 0.934241
                Code  35686   782093 0.034112 0.968353
               Class   4026   177417 0.007738 0.976091
           TypedData  33768   125511 0.005474 0.981566
                 ...

Change-Id: I9f1e45ce85df6a4509f6d9fb2c28b41157872941
Reviewed-on: https://dart-review.googlesource.com/20262
Reviewed-by: Siva Chandra <sivachandra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-11 00:19:18 +00:00
Ryan Macnak 0e552547a6 Revert "[vm, arm64] Add assembler support for tbz and use it for BranchIfSmi."
This reverts commit 64271895a9.

Reason for revert: Crashes in unchanged assembler tests

Original change's description:
> [vm, arm64] Add assembler support for tbz and use it for BranchIfSmi.
> 
> (Apparently we already had it implemented in the simulator and disassembler.)
> 
> MegaNeverOverridden (Odroid-C2)   -3.702% (-0.5 noise)
> BinaryTrees (Odroid-C2)           -3.296% (-0.4 noise)
> ...
> MegaEquality (Odroid-C2)           2.256% (0.4 noise)
> Splay (Odroid-C2)                  9.879% (0.6 noise)
> MegaOverriddenEvery2nd (Odroid-C2) 6.317% (0.7 noise)
> StringInterpolation (Odroid-C2)    19.07% (0.8 noise)
> ForInLoop (Odroid-C2)              4.902% (1.0 noise)
> 
> Flutter gallery iOS instructions:
> 12543904 -> 12504224 (-0.32%)
> 
> Change-Id: I23fa58e5589ddf5042a2075431bc53aa21723813
> Reviewed-on: https://dart-review.googlesource.com/17061
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,rmacnak@google.com,regis@google.com

Change-Id: I6d55907972a6f1485e2789a8623a557bcdfa7f22
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/20320
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-10 23:57:09 +00:00
Ryan Macnak 074b43c863 [vm] Don't let the optimizer mislead coverage data.
Coverage uses the value of an execution counter to detect executed functions. However non-positive execution counter does not necessary mean that a function was never executed because we sometimes reset the counter.

Introduce additional bit on a function that is set whenever we reset positive execution counter and use this bit when generating coverage data.

Bug: https://github.com/dart-lang/sdk/issues/31326
Change-Id: I5357109603defad7e7c9415c433203f16bcf88f4
Reviewed-on: https://dart-review.googlesource.com/19760
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-10 22:35:48 +00:00
Ryan Macnak 64271895a9 [vm, arm64] Add assembler support for tbz and use it for BranchIfSmi.
(Apparently we already had it implemented in the simulator and disassembler.)

MegaNeverOverridden (Odroid-C2)   -3.702% (-0.5 noise)
BinaryTrees (Odroid-C2)           -3.296% (-0.4 noise)
...
MegaEquality (Odroid-C2)           2.256% (0.4 noise)
Splay (Odroid-C2)                  9.879% (0.6 noise)
MegaOverriddenEvery2nd (Odroid-C2) 6.317% (0.7 noise)
StringInterpolation (Odroid-C2)    19.07% (0.8 noise)
ForInLoop (Odroid-C2)              4.902% (1.0 noise)

Flutter gallery iOS instructions:
12543904 -> 12504224 (-0.32%)

Change-Id: I23fa58e5589ddf5042a2075431bc53aa21723813
Reviewed-on: https://dart-review.googlesource.com/17061
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-10 21:35:48 +00:00
Régis Crelier f568029b5f [VM] Make flag --strong isolate specific.
Change-Id: I3416e65eeec8b92af7f35dce20188b3934674cb7
Reviewed-on: https://dart-review.googlesource.com/20221
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-11-10 20:47:10 +00:00
Vyacheslav Egorov 8186104db1 [VM] Return zero from Random_nextState intrinsic instead of GC unsafe garbage.
Random.Random contains the following code:

    return new _Random._withState(state)
      .._nextState()
      .._nextState()
      .._nextState()
      .._nextState();

This code gets compiled into a let cascade by Fasta

    return let final dynamic #t300 = new math::_Random::_withState(state) in
           let final dynamic #t301 = #t300._nextState() in
           let final dynamic #t302 = #t300._nextState() in
           let final dynamic #t303 = #t300._nextState() in
           let final dynamic #t304 = #t300._nextState() in #t300;

This means that _nextState should not return GC unsafe garbage because
its return value will be pushed onto the stack by unoptimizing compiler.

Fixes https://github.com/dart-lang/sdk/issues/31309

R=kustermann@google.com

Bug:
Change-Id: Ib44abfc66ec82c350a3899b054e4b095bbc78ea4
Reviewed-on: https://dart-review.googlesource.com/19569
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Erik Corry <erikcorry@google.com>
2017-11-10 11:11:57 +00:00
Jens Johansen da75676729 Crash VM service test
For more information see dartbug.com/31331

Bug:
Change-Id: Ic0dee3fa04403dc7305eaf01ae3c932b334269e8
Reviewed-on: https://dart-review.googlesource.com/19600
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2017-11-10 07:59:14 +00:00
Ryan Macnak b7a509e98a [vm] Add --print-snapshot-sizes-verbose.
E.g.,
             Cluster     Size Fraction Cumulative
               Array  1079963 0.206635 0.206635
          ObjectPool  1063564 0.203497 0.410132
            Function   961383 0.183946 0.594079
                Code   802081 0.153466 0.747545
              ROData   379720 0.072654 0.820199
               Class   185324 0.035459 0.855658

Bug:
Change-Id: I948877963b467263d399fa14ef32eedace02d6a5
Reviewed-on: https://dart-review.googlesource.com/19840
Reviewed-by: Siva Chandra <sivachandra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-10 00:23:42 +00:00
William Hesse baea6eecf8 Update status for vm/cc tests that timeout with dartk.
Bug:
Change-Id: I6379fe50227157a848a15ecd1bcdde8c84e6c6ef
Reviewed-on: https://dart-review.googlesource.com/19681
Reviewed-by: Alexander Thomas <athom@google.com>
2017-11-10 00:09:01 +00:00
Siva Annamalai 847119b3a1 is_final flag was not being set for top level const fields in the kernel loader.
Change-Id: I26f91e7738ae0e763ba59fed9911124ee172fc67
Reviewed-on: https://dart-review.googlesource.com/19861
Reviewed-by: Siva Chandra <sivachandra@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2017-11-09 23:49:02 +00:00
Régis Crelier f734e7ee38 [VM] Treat 'deferred' as a built-in identifier (fixes #31267 and #25732).
Reject built-in identifiers as prefix names (fixes #25733).
Update co19 status file.

Change-Id: I7fe5014d128bfdad442866e78196fb8dd2764dda
Reviewed-on: https://dart-review.googlesource.com/19860
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2017-11-09 23:29:52 +00:00
Ryan Macnak 28399608e3 [vm] Remove some unnecessary OFFSET_OF.
Change-Id: Iaed6cbae7717b7fb5d3c22d8c35a2ba489569e73
Reviewed-on: https://dart-review.googlesource.com/18461
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-09 22:20:02 +00:00
Siva Annamalai 16ffa00ba2 Fix status file to reflect passing tests.
Change-Id: Id6a4a953071b3f68aee1c8b3d11e029c02c0f032
Reviewed-on: https://dart-review.googlesource.com/19780
Reviewed-by: Siva Annamalai <asiva@google.com>
2017-11-09 20:45:29 +00:00
Alexander Markov 9b845bce1b Silence updated vm/dart/truncating_ints_test test for dartkp
Issue: https://github.com/dart-lang/sdk/issues/31339
Change-Id: I10fcbb264331c638084390dfcdd1b4d0ad59d267
Reviewed-on: https://dart-review.googlesource.com/19740
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-09 20:31:47 +00:00
Siva Annamalai c29b19fb34 - Do not generate a separate vmservice kernel file, include it in vm_platform file
- Load vmservice_io library only in the service isolate or when an AOT snapshot is being generated

This should account for the following issues:
- https://github.com/dart-lang/sdk/issues/31203 - there should be a vmservice_io_strong.dill file
- https://github.com/dart-lang/sdk/issues/30158 - Consider extracting flutter vmservice_sky into
                                                  separate .dill from platform.dill
- https://github.com/dart-lang/sdk/issues/30111 - support compiling vmservice with an external
                                                  outline of the sdk

Bug:
Change-Id: If945ec05afe8127e288e8d3b55172c0f7c3d6e7a
Reviewed-on: https://dart-review.googlesource.com/18147
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Chandra <sivachandra@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2017-11-09 19:05:15 +00:00
Alexander Markov 59cdc65dc7 [VM] Relax constraints for integer literals according to int64 spec
Handling of integer literals is corrected according to the informal spec
for the fixed-size integers:

https://github.com/dart-lang/sdk/blob/master/docs/language/informal/int64.md

This change allows unsigned 64-bit hexadecimal literals and MIN_INT64
to be used when running on the VM with --limit-ints-to-64-bits option.

Change-Id: Ied7a7688768bcf4ff40ab5b499dd71622d2c3948
Reviewed-on: https://dart-review.googlesource.com/19400
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-11-09 16:58:38 +00:00
Jens Johansen 66bf1a5fbd [kernel, VM] ReportError on unsupported tag instead of crashing
Closes #31296.

Bug:
Change-Id: I1bcdd60d25fde7d99e71ce0e42efcd78916a3409
Reviewed-on: https://dart-review.googlesource.com/19186
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-09 13:25:07 +00:00
Jens Johansen d07e7c0fb9 [kernel] Fix AOT constant evaluation crashes
This fixes a number of issues caused by constant evalation reporting
an error, but not correctly propergating that error in AOT mode.

Fixes #31298

Bug:
Change-Id: I43d378e96f033a9bd5bc0d90e1c2cf130d2cce2e
Reviewed-on: https://dart-review.googlesource.com/19183
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-09 12:35:16 +00:00
Vyacheslav Egorov c4f5add7c4 [VM,Kernel] Fix IL construction issues in BuildMethodInvocation.
* When building method invocation that requires checking receiver for null
and has type arguments make sure that we duplicate type arguments above the
receiver temporary. Before this fix the stack ended up looking like
`[type_arguments_temp][receiver_temp][receiver]...` and after the fix it
looks like `[type_arguments_temp][receiver_temp][type_arguments][receiver]...`.
* Fix how we generate StaticCall with type arguments: we were adjusting
arguments count by one manually if type arguments were present at each call site
to FlowGraphBuilder::StaticCall. This is very brittle and were leading to
incorrect number of arguments used if caller forgot to adjust. Instead handle
this inside FlowGraphBuilder::StaticCall just like other similar methods do it
(e.g. FlowGraphBuilder::InstanceCall).

Fixes https://github.com/dart-lang/sdk/issues/31297

Bug:
Change-Id: I3713fdde838d159985c68b456f911eab7746824c
Reviewed-on: https://dart-review.googlesource.com/19563
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-11-09 12:13:27 +00:00