* 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>
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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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/31309R=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>
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>
* 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>