Commit Graph

15405 Commits

Author SHA1 Message Date
Ryan Macnak d9c40462c2 [vm] Rename kImplicitStaticFinalGetter to kImplicitStaticGetter.
This function kind is used for any static field with an initializer. It has nothing to do with whether the field is final.

Change-Id: I3faa2d2d77fd4bbd801624bc0bba88476b8f3cb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99622
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-17 00:47:15 +00:00
Ben Konyi 698800a902 [ VM / Service ] Initialize ThreadInterrupter state even if profiler isn't enabled.
Fixes issue #36586.

Change-Id: I2e3807d00d10e262201295744b6da8249a337e19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99344
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Jacob Richman <jacobr@google.com>
2019-04-16 20:56:39 +00:00
Aart Bik 9070d6ae61 [dart/vm] Inspect shift constant in absence of range analysis
Rationale:
Queries the constant of a shift operation to determine if it
is in range when range analysis has not run. This seems in general
a good idea, since some optimizations occur *after* range analysis,
and we were missing those cases. In this particular case, it also
avoids an assert fail on a shift by one without env() that was
introduced by a pass that has no subsequent range analysis. In
this case, it is unclear whether not having an env() was an
accident, or on purpose since the shift factor is known to
be well-behaved. Please have a careful look!

https://github.com/dart-lang/sdk/issues/36587

Change-Id: I12b4cb773f31899e17bfce8506bce599ccbef8ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99382
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-16 19:07:15 +00:00
Ryan Macnak 1642934663 [vm, interpreter] Emit only one copy of exception processing.
Change-Id: Icfa4039e7a097b9290dd8bbd875791c05ad89162
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99420
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-16 18:29:35 +00:00
Alexander Markov 6e28c24a01 [vm/compiler/bytecode] Ensure CheckStackOverflow is in the join block
Fixes https://github.com/dart-lang/sdk/issues/36590

Change-Id: Ie18f0f61a437c58b452bbcde8f4bafe58125328f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99377
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-16 16:37:25 +00:00
Alexander Markov a8e8b2c426 [vm/compiler] Elide DebugStepCheck instructions in PRODUCT mode
This improves https://dart-review.googlesource.com/c/sdk/+/99287
by removing DebugStepCheck instructions from unoptimized IL
entirely in PRODUCT mode.

Crash mentioned in https://dart-review.googlesource.com/c/sdk/+/99287/1/runtime/vm/compiler/backend/il_arm.cc#7045
is fixed. Also, this CL adds checks which helped me to debug the crash.

Change-Id: I5452877355876b21d2ce21890626db9e5a59f170
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99421
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-16 15:43:55 +00:00
Ryan Macnak a63bf3c846 [vm] Don't call the debug step check stub or bytecode in PRODUCT mode.
Change-Id: I2c91c69f4271bb3eed11d7ba81bd453bdb31bf38
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99287
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-15 23:40:56 +00:00
Ryan Macnak 144bfdfce6 [vm] Use a separate kind tag for static field initializers.
This is preparation for handling implicit static getters as a bytecode.

Change-Id: Ic9fd186161d900c3b4c0bb773726b0cd0f35451e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99105
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-15 22:54:36 +00:00
Drew Fisher 92c14cb7ef [fuchsia] Mark subprocess images as executable
Currently, the VMO returned by `fdio_get_vmo_clone` is executable,
despite being documented as being read-only.  We wish to correct
the implementation, but doing so would break anything that relies
on the implicit executability of that VMO.

To enable Fuchsia to make this transition, we should explicitly call
zx_vmo_replace_as_executable on the VMO holding the binary image we
wish to launch as a subprocess.

Change-Id: I040ed2409120a58a30e88ef34a01fe73434a7ea0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99369
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
Auto-Submit: Drew Fisher <zarvox@google.com>
2019-04-15 22:32:46 +00:00
Ben Konyi f0ae4de9a7 [ VM / Service ] Fixed GetCpuProfileTimeline which was attempting to parse 64-bit values as if they were 32 bits.
Change-Id: Ie4aa0727d28a977f00b8e6470fdf1d8811a13a62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99365
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-04-15 22:10:56 +00:00
Régis Crelier 76e62d83e3 [vm/precompiler,const eval] Properly handle constant closures with delayed type args.
The precompiler fails to traverse the delayed type arguments of a constant
closure for addition to the snapshot. The canonical bit of these type arguments
is therefore cleared in Precompiler::DropTypeArguments before the snapshot is
written.

The vm constant evaluator fails to canonicalize the delayed type arguments of a
constant closure.

This fixes issue 36500.

Change-Id: I3e336e5c8233e5b5233828a913ee66f7b1d4daef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99364
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-15 19:54:50 +00:00
Zach Anderson c18c1f4bfb [fuchsia] Use Unmap() instead of zx_vmar_unmap()
Cleanup from last CL.

Change-Id: I08547b78641867de301d6657c7bc096e7480ad55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99243
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-04-13 21:05:53 +00:00
Zach Anderson 381f94522c [fuchsia] Fix vmo leak
Change-Id: I0e3f1a869ba974a8c665d0741a2597e0bbd2a860
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99288
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-04-12 23:29:22 +00:00
Zichang Guo 61bb30822b Revert "[VM-debugger] resolve column breakpoint tokenposition into a single value"
This reverts commit 2d1440b848.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [VM-debugger] resolve column breakpoint tokenposition into a single value
> 
> The token positions of column breakpointlocation was the token position range of requested line.
> With column number given, the token position should be resolved into a single value. Therefore,
> FindInnermostClosure() can identify the closure precisely.
> 
> BUG= https://github.com/dart-lang/sdk/issues/35137
> 
> Change-Id: Ibbd273fcd85d49b441f2de7f3720e7889a6c1c22
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97341
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Zichang Guo <zichangguo@google.com>

TBR=rmacnak@google.com,asiva@google.com,zichangguo@google.com

Change-Id: I4ea9bcfb82f1cac49312766d420c57959e500270
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/35137
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99272
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-04-12 22:00:42 +00:00
Alexander Markov 9cc008e49c [vm/bytecode] Add bytecode instructions for double operations
Change-Id: Ib1e8ca3b9bbf62f8282524fc5599eee5cae38389
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99089
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-04-12 20:17:01 +00:00
Vyacheslav Egorov 3714658d0f [vm] Fix Win32 build broken by 2a237327b2
Add missing <functional> include for std::function

Change-Id: I2010c7c3952b619d27bb881be38732e85993f50c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99171
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-12 20:09:01 +00:00
Zichang Guo 2d1440b848 [VM-debugger] resolve column breakpoint tokenposition into a single value
The token positions of column breakpointlocation was the token position range of requested line.
With column number given, the token position should be resolved into a single value. Therefore,
FindInnermostClosure() can identify the closure precisely.

BUG= https://github.com/dart-lang/sdk/issues/35137

Change-Id: Ibbd273fcd85d49b441f2de7f3720e7889a6c1c22
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97341
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-04-12 19:41:45 +00:00
asiva 0d65bb9ab3 [VM] Adjust the expected results for get_source_report_test.dart
Since evaluation of constant expressions now happens in the front end
the test coverage results are consistent irrespective of whether 'Force
compilation' is specified for coverage data or not in this test.
Adjusted the expectations accordingly.

This should fix https://github.com/dart-lang/sdk/issues/36600

Change-Id: I5392b255c6102d90b431f62e5fd92408fd706ace
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99268
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-04-12 19:40:15 +00:00
Vyacheslav Egorov 2a237327b2 [vm/compiler] Take into account all redefinitions when computing aliasing.
LoadOptimizer has a builtin alias-analysis which recognized only
Redefinition and AssertAssignable as instructions which must
be followed through when traversing use lists for a given
definition. However after recent changes CheckNull should be
treated the same way as these other two instructions.

This lead to incorrect computation of aliasing identity and
consequently incorrect load forwarding.

This change fixes this bug and also changes implementation of
OriginalDefinition in a way that makes aliasing analysis code
more future-proof.

We introduce virtual method Definition::RedefinedValue and
reimplement Definition::OriginalDefinition through RedefinedValue.

Aliasing analysis is changed to use RedefinedValue to detect
if an instruction is a redefinition.

Fixes https://github.com/flutter/flutter/issues/30619

Bug: https://github.com/flutter/flutter/issues/30619
Change-Id: I8019c93779491a4e6f127119d1d56eb037a3bb56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99170
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-12 19:07:21 +00:00
Martin Kustermann 125ee3b719 [vm/compiler/aot] Avoid using EnterCallRuntimeFrame/LeaveCallRuntimeFrame due to code size of register spilling
It caused significant size increase due to having register spilling code
for every class allocation stub.

The helper method is called always in "tail" position and it is
therefore ok to clobber registers.

Change-Id: Ic2f19d740230282df1e399ea5009171f7713c837
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99168
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-12 13:06:57 +00:00
Martin Kustermann ce9a1e2b54 [vm/compiler] Fix write-barrier elimination issue
The slow patch code of allocation stubs goes to runtime to allocate
objects/contexts/arrays.  Those native calls seemingly guaranteed that
an object is new-or-remembered.

Though the runtime can actually allocate a new object and it can get
moved to old space right before returning to the continuation of slow
path allocation.

This causes us to have a newly allocated object which is not in the
remembered set.

This CL moves the code for "new-or-remembered guarantee" from
runtime_entry.cc to the call-sites in allocation stubs.

Issue https://github.com/dart-lang/sdk/issues/36369

Change-Id: Ieef9232b4c50fdd84ad81dd8f77697bf0c4775ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99143
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-04-12 09:22:17 +00:00
asiva a8f3a5dae6 [VM] Ensure a class is type finalized before finalizing it.
Fix for https://github.com/dart-lang/sdk/issues/36486

Change-Id: Ic04bb71c3bebfa2cf02c02d419b82d2a0e5ed6fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99206
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-04-12 00:16:17 +00:00
Ben Konyi 98fc8ac7ff [ VM / Service ] Temporarily disable VM service auth codes by default
Change-Id: Ia14e7d4eeb680a02482f700ce06f76bc0edab594
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99187
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-04-11 21:27:12 +00:00
Nate Bosch 561dc79a7b Bring in the latest test and stream_channel
The test repo was split into 3 sub-packages

Change-Id: I2b24a998d590c4a3edeb4a6b18d511f361cb82be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98262
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2019-04-11 19:07:58 +00:00
Vyacheslav Egorov d5bbf25197 [vm/compiler] Eliminate Redefinitions based on the reaching type.
Given a graph like this:

  v1 <- ... T{Foo?}
  v2 <- v1.foo()
  v3 <- v1.get:field()

We would constrain v1 after invocation - because call guarantees that v1 is
not null.

  v1 <- ... T{Foo?}
  v2 <- v1.foo()
  v4 <- Redefinition(v1) T{Foo}
  v3 <- v4.get:field()

Which past inlining can turn into something like

  v1 <- ... T{Foo?}
  CheckClass(v1, Foo)  // Inserted by inlining
  ...
  v4 <- Redefinition(v1 T{Foo}) T{Foo}
  v3 <- v4.field

At this point v4 is redundant - because CheckClass above gives the same
guarantee and is movable. Which means we can lift LICM inhibition for v4.field.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try
Change-Id: I4b392ede071c41410a27288cae9bbc813a48cc99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99144
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-11 18:51:39 +00:00
Samir Jindel a437160328 [vm/ffi] Fix bug in AllocateArgument caused by relying on order of argument evaluation.
Change-Id: I5aad361f885bd23436261399b8c31b66aa2a9455
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99164
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-04-11 15:52:56 +00:00
Samir Jindel 3dc29819c8 [vm] Don't emit graph body when intrinsification is complete.
Flutter Gallery:
Instructions(CodeSize): -1.36%
Total(CodeSize): -0.87%

Change-Id: I40b8e0a5a73373993961e357b4cab9a78936332a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99162
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-04-11 13:59:44 +00:00
Jens Johansen 1555594ddb Include a per-library index of owned sources in kernel
This for instance allows the VM to include all patches
(e.g. the previously missing `runtime/lib/date_patch.dart`)
in what's returned from `LoadedScripts()`.

Over time this also allows for `LoadedScripts()` to be simplified and
become faster (it's currently something like O(m + m*n) where m is the
number of results in DictionaryIterator(*this) and n is the number of
returned scripts).

Change-Id: I4b5a6a0fe666b774fc0987d099ed02e81ac97b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-11 12:40:49 +00:00
Samir Jindel a7a87df513 [vm/ffi] Replicate transition to/from native code around FFI calls.
Change-Id: I49be874b47b63a0863ed58d26f417cb957b89380
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98463
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-04-11 11:59:54 +00:00
Jens Johansen fe535ac27c Add missing offset to yield produced by await for
Fixes #36069.
Fixes #28916.

Change-Id: I1acc6b9f0aaba100827749a1f3653f5cc9e4fd2f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98665
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-04-11 11:16:13 +00:00
Jens Johansen a190a2762b Allow debugger to stop on comparison to null
E.g. trying to set a breakpoint on the if in this code

```
  if (args == null) {
    print("was null");
  }
  // more code below
```

would actually set a breakpoint on the print, and the breakpoint - unless
the argument is null - would never be hit.

Change-Id: I072abb3bf2783e9f36c8d3ac6be4885ca454db94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98663
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-04-11 10:32:05 +00:00
Daco Harkes 462e03d01e Reland "[vm] Refactor Location to use either dart::Register or dart::host::Register"
Refactoring motivation: go/dart-simulated-ffi

* template Location and PairLocation with <dart::Register, dart::FpuRegister> or <dart::host::Register, dart::host::FpuRegister>
* move RegisterName and FpuRegisterName from assembler to constants
* move methods that are only implemented by Location and not HostLocation out of Location

Change-Id: Ie9aa2dae63380da0cbfb15eacc440537fbed48f8
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-precomp-win-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98845
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2019-04-11 10:09:23 +00:00
Martin Kustermann aa9ce0f122 Revert "[vm] Repair the resolver abstraction, take 2."
This reverts commit d79787771e.

Reason for revert:

This caused significant performance regressions on our protobuf_decode* benchmarks (probably on more benchmarks, but we don't yet have results due to some perf infra issue).

To avoid letting the regressions land for downstream users we'll revert it.

We should measure performance impact before landing this again.

Original change's description:
> [vm] Repair the resolver abstraction, take 2.
> 
>  - Move resolution logic that accumulated in the runtime entries into Resolver.
>  - Improve NoSuchMethodError for closures when --no-lazy-dispatchers
>  - Fix concurrent modification of Null class by nullability propagation.
> 
> Change-Id: Ib05b431a289d847785032dda46e1bbcb524b7343
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98428
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

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

Change-Id: I4f0f0a0d7c6018fc5968aafdce30f6d2e7495059
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99140
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-11 09:57:25 +00:00
Martin Kustermann 7cdba2e711 Revert "[vm] Cache method resolution."
This reverts commit 2f0dfd6124.

Reason for revert:
Need to revert this CL in order to revert [0] which had performance regressions.

[0] https://dart-review.googlesource.com/c/sdk/+/98428

Original change's description:
> [vm] Cache method resolution.
> 
> Change-Id: I5b3a9764b6932548ee25823b7dc42011ac292427
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98640
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

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

Change-Id: I2b3367e38103437a74124d129ff0b357058a5a57
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99160
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-04-11 09:53:04 +00:00
Régis Crelier bed1bab2cd [vm/interpreter] remove assumptions about alignment of bytecode instructions.
A pc value of -1 marks an interpreter entry frame.
Preserving the argument count is not necessary.
VisitPointers now skips pc marker and fp in interpreted frames.
This fixes #36542.

Change-Id: Id752f16ecf08d5a882e44dd2b2aa9d86534b7b4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98986
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-11 02:01:03 +00:00
Ryan Macnak 2f0dfd6124 [vm] Cache method resolution.
Change-Id: I5b3a9764b6932548ee25823b7dc42011ac292427
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98640
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-04-11 00:58:43 +00:00
Ryan Macnak 1685ac3683 [vm] Reimplement COMPILE_ASSERT with static_assert for nicer error messages from the C++ compiler.
Since COMPILE_ASSERT was originally authored, we have moved to requiring C++11 support.

Change-Id: I8cd5f720d2350cb28d0363fbd9399c4f864d66d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99104
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-11 00:47:13 +00:00
Ryan Macnak 9e279a5054 [vm] Dart_Cleanup: wait for outstanding vm-service and kernel isolate spawns.
Also make the ServiceIsolate and KernelIsolate implementations more similar.

Bug: https://github.com/dart-lang/sdk/issues/36502
Change-Id: Ief494600e938d9edb9d316bd6708c445694290a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98867
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-04-10 22:55:20 +00:00
Ryan Macnak d79787771e [vm] Repair the resolver abstraction, take 2.
- Move resolution logic that accumulated in the runtime entries into Resolver.
 - Improve NoSuchMethodError for closures when --no-lazy-dispatchers
 - Fix concurrent modification of Null class by nullability propagation.

Change-Id: Ib05b431a289d847785032dda46e1bbcb524b7343
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98428
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-04-10 21:57:43 +00:00
Alexander Markov ebd13e891f [vm/bytecode] Add UncheckedInterfaceCall instruction
dart --use-bytecode-compiler NavierStokes.dart
Before: NavierStokes(RunTime): 8909.053017777778 us.
After: NavierStokes(RunTime): 7221.510314079423 us.

Issue: https://github.com/dart-lang/sdk/issues/36429
Issue: https://github.com/dart-lang/sdk/issues/36428

Change-Id: Ib1be4dd20cdc25e3b979a91a098f67a7bc00df8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98945
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-04-10 21:49:23 +00:00
Alexander Markov 1dd820158b [vm/bytecode] Avoid crashes when trying to collect token positions without AST
This is a temporary workaround for VM crashes when using observatory
in bytecode modes. Crashes heppen when CollectTokenPositionsFor
tries to access kernel AST (via kernel_offset()) but there isn't one.

Change-Id: I4c4dbb84653957c2f276f62216c12b58d2d666c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99084
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-04-10 21:20:43 +00:00
Aart Bik 585debbb2e [dart/fuzzer] Exclude process info from API table
Rationale:
Yields false divergences only.

https://github.com/dart-lang/sdk/issues/36560

Change-Id: I48e32e06b453bab0aeba22ee214ec201ebd34229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99083
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-10 21:05:12 +00:00
asiva 2cde9c05ee [VM] Better error messages when unexpected constant tags are seen in the kernel reader.
This should fix https://github.com/dart-lang/sdk/issues/36490

Change-Id: I07491dfdb9ed55ebb1e09345c2ea4e051298f307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99082
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-04-10 20:49:43 +00:00
Alexander Aprelev 72b7e95c74 [vm/service] Give service isolate name.
This is follow-up to https://dart-review.googlesource.com/c/sdk/+/97845.

Change-Id: I8cfdb047eb68ae24315763ea05252db5f98a654d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99100
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-04-10 19:50:29 +00:00
Ben Konyi 92c9f124c3 [ VM / Service ] Fixed HTTP requests to the VM service not working correctly with authentication codes
Change-Id: Ibbf9edb58b9e1f83b31ff876d2da4ef327ea1dab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99081
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-04-10 19:41:59 +00:00
Aart Bik 9876e92c7d [dart/vm] Support OSR on non-empty expression stack
Rationale:
This enables OSR even in the presence of block expressions,
which are introduced by the new CFE control-flow collections
and spread operations. Faster is better!

https://github.com/dart-lang/sdk/issues/36421
https://github.com/dart-lang/sdk/issues/36218
https://github.com/dart-lang/sdk/issues/36214

Change-Id: I363a0b0a5becbbd5743f8fb47ff24dcebc0e4d64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98744
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-10 19:40:49 +00:00
Aart Bik dc606ef02f [dart/fuzzer] Exclude 'pid' from API table
Rationale:
Yields false divergences only.

https://github.com/dart-lang/sdk/issues/36560

Change-Id: I68133e2b076e1da1b094d79512a281093b093a91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99080
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-04-10 19:04:59 +00:00
Ryan Macnak f819c866e7 [vm, interpreter] Handle method extractors as a bytecode.
Bug: https://github.com/dart-lang/sdk/issues/36410
Change-Id: Ifb803d88456227ce03f43b285b4d950c75ae379e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98947
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-10 18:24:36 +00:00
Samir Jindel f4e63990cb [vm/ffi] Support FFI on ARM32.
Fixes dartbug.com/36311.
Addresses dartbug.com/35760.

Change-Id: Ib6c4db69f31dfb5317e4162b80d3e30a996e3a2e
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97631
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-04-10 13:15:16 +00:00
Samir Jindel 409b68a4ce [vm] Mark type_feedback_test as Slow.
Even when it passes, it often reaches close to the timeout threshold.

Change-Id: Ifab28dc013e628e78c54c0fd65a8feb4079c83a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99024
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-04-10 12:49:56 +00:00