Commit Graph

13561 Commits

Author SHA1 Message Date
Alexander Markov 68fd91b5bb [vm] Fix field initialization during isolate reload in kernel mode
Closes https://github.com/dart-lang/sdk/issues/32273

Change-Id: Ief0dfaa735e29619a1541b890069f4618906440d
Reviewed-on: https://dart-review.googlesource.com/43260
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-02-23 17:44:24 +00:00
Jens Johansen ac7f580005 Support Kernel Instantiation node in VMs constant evaluator
Fixes #32268.

Bug: 32268
Change-Id: I7d2ebc28d19aca623460cd1dacc86b64893810ac
Reviewed-on: https://dart-review.googlesource.com/42949
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-23 07:02:45 +00:00
Ryan Macnak 6664e3c02a [vm, dbc] Implement lazily-linked natives for DBC and enable AppJIT.
Because DBC still uses code patching to implement breakpoints, running a program from DBC AppJIT may trigger a crash attempting to set a breakpoint.

Change-Id: I5d761aacec6629be946d7d2510ec3f1e3f03f4a4
Reviewed-on: https://dart-review.googlesource.com/42584
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-02-23 02:20:12 +00:00
Ryan Macnak ebdc8abaae [vm, service] Avoid double TLS creating timeline events for API functions.
Add timeline events for Dart_CompileAll and Dart_ParseAll.

Change-Id: I184319aadfe18a6e51cb44c2ab77fb95f452f6de
Reviewed-on: https://dart-review.googlesource.com/43242
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-02-23 01:31:38 +00:00
Régis Crelier b761571bf3 [VM runtime] Remove reference to old Bigint class from intrinsics (that will be
reused to support new Bigint implementation) by introducing a global constant.
Add asserts and comments in old Bigint implementation.

Change-Id: Id647ffb6ae6557457ccf52fde4f0e6eb3d06c0b5
Reviewed-on: https://dart-review.googlesource.com/43280
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-02-23 01:23:33 +00:00
Ben Konyi 2538adf41a Revert "[VM / Hot Reload] Fixed IsolateReload tests which were importing"
This reverts commit fdce9a8266835fba252150fae8f88f4dee06b698.

Change-Id: Ifca4a1254c9045cb5c5e8b5c1dfcd606b858b8aa
Reviewed-on: https://dart-review.googlesource.com/43262
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-02-22 23:45:25 +00:00
Ben Konyi 8eab1cf6f4 [VM / Hot Reload] Fixed IsolateReload tests which were importing 'test:isolate_reload_helper'
Change-Id: I0c78c41b43a9976bc8c3811314c1efff09ee90cc
Reviewed-on: https://dart-review.googlesource.com/43240
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-22 23:14:29 +00:00
Ryan Macnak 6ae272becf [vm] Make --compile_all retain the compiled code.
Change-Id: I5595c5855d638b5ed144e3591348ddb9080f9e81
Reviewed-on: https://dart-review.googlesource.com/42886
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-02-22 22:56:01 +00:00
Vyacheslav Egorov e9ca5ea55f [vm/kernel] Unbreak debug build broken by 8881ec77ec
Change-Id: I34d30b53f39616c3181bdaee107928c2a93aada2
Reviewed-on: https://dart-review.googlesource.com/43220
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-22 20:49:31 +00:00
Alexander Aprelev ec7029daf6 Workaround deferred library limitation.
Introduce no-op LoadLibrary, CheckLibraryIsLoaded into kernel_binary_flowgraph.cc

Bug: https://github.com/dart-lang/sdk/issues/32245
Change-Id: If93a4d717844dcb8a5d45d0237660ec764a6f738
Reviewed-on: https://dart-review.googlesource.com/42461
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2018-02-22 20:34:39 +00:00
Vyacheslav Egorov 8881ec77ec [vm/kernel] Move work-around for #32087 into the loader.
While working on #32274 I noticed that #32087 also impacted debugging
experience in the external debuggers like VS Code - IDE attempts to
load non-existent local sources for core libraries, instead of
asking Service for their source.

To resolve this I moved work-around we placed in stack trace formatting
futher up the flow into kernel loader, which will now rewrite urls
for all core library scripts as classes are being created.

Bug: 32087
Change-Id: I2175a041e5fdcc9958bfccb2af724c37c2435f94
Reviewed-on: https://dart-review.googlesource.com/43021
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-02-22 13:00:25 +00:00
Kevin Millikin ffc5a96074 Reland "Fix a bug in Kernel's mixin elimination"
Reland
https://github.com/dart-lang/sdk/commit/52d1b4e96d0a384b08aafc184785d1c74cb74efc
with a fix to the test so that it does not use super mixins.

Change-Id: Id1283b1066e853baca4c39402c255ceaa90662f4
Reviewed-on: https://dart-review.googlesource.com/43002
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
2018-02-22 11:52:24 +00:00
William Hesse 7bb941a60c Revert "Fix a bug in Kernel's mixin elimination"
This reverts commit 52d1b4e96d.

Reason for revert: Analyzer and DDC do not support the super-mixin fix and flag, so the new test fails on them.  The test needs to either be marked as failing on them, or support needs to be added and work in the test framework.

Original change's description:
> Fix a bug in Kernel's mixin elimination
> 
> Mixin elimination copied factory constructors from the mixin class to
> the mixin application class.  This could be observed as an unbound
> type parameter which led to a crash in the VM.  Fixes
> https://github.com/dart-lang/sdk/issues/32267.
> 
> Change-Id: I87b70a35d11c364739d01e261adf5329d492d8cf
> Reviewed-on: https://dart-review.googlesource.com/42922
> Reviewed-by: Jens Johansen <jensj@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,jensj@google.com,kmillikin@google.com

Change-Id: I4a0bcf0b323c9adef7e5dc7d9019b6aafe40509d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/42960
Reviewed-by: William Hesse <whesse@google.com>
2018-02-22 10:09:09 +00:00
Kevin Millikin 52d1b4e96d Fix a bug in Kernel's mixin elimination
Mixin elimination copied factory constructors from the mixin class to
the mixin application class.  This could be observed as an unbound
type parameter which led to a crash in the VM.  Fixes
https://github.com/dart-lang/sdk/issues/32267.

Change-Id: I87b70a35d11c364739d01e261adf5329d492d8cf
Reviewed-on: https://dart-review.googlesource.com/42922
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-22 08:51:09 +00:00
Ryan Macnak afdbce7b13 [vm, isolate] Send large TypedData as ExternalTypedData in isolate messages.
Be careful to free external data when reading or writing a message is interrupted, or releasing messaging without reading on shutdown.

Bug: https://github.com/dart-lang/sdk/issues/31959
Change-Id: Ia39acb9ca0e27cf9e8b83961741e5949b5930266
Reviewed-on: https://dart-review.googlesource.com/41561
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-21 18:57:14 +00:00
Erik Ernst 7e40dda728 Adjusted status for 7 vm tests
vm/cc/CorelibIsolateStartup: Pass --> Timeout, Pass
vm/cc/Mixin_PrivateSuperResolutionCrossLibraryShouldFail: Fail --> Fail, Crash
vm/cc/Profiler_BasicSourcePosition: Fail --> Fail, Pass
vm/cc/Profiler_CodeTicks: Fail --> Fail, Pass
vm/cc/Profiler_FunctionTicks: Fail --> Fail, Pass
vm/cc/Profiler_ToggleRecordAllocation: Fail --> Fail, Pass
vm/cc/Profiler_TrivialRecordAllocation: Fail --> Fail, Pass

Change-Id: If70f0f44b9ea492b0a31d727a6db12f89c1ec6e2
Reviewed-on: https://dart-review.googlesource.com/42780
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2018-02-21 17:49:59 +00:00
Jens Johansen 0c8704ef89 Revert "Revert "[kernel] Don't always treat doubles as constants""
This reverts commit ef51b33f22.

Reason for revert: Issue from initial land was fixed in 076db33f03.

Original change's description:
> Revert "[kernel] Don't always treat doubles as constants"
> 
> This reverts commit 12407c3ea0.
> 
> Reason for revert: co19/Language/Expressions/Object_Identity/double_t01 fails in -c dartkp -r dart_precompiled mode.
> 
> Original change's description:
> > [kernel] Don't always treat doubles as constants
> > 
> > Previously, when the VM parsed a doubles from the dill file it passed
> > control over to the constant evaluator which would then case the
> > value and canonicalize it.
> > That doesn't really seem to make sense when its not used in a const
> > context, nor is it done the same way for integers for instance.
> > 
> > This CL changes that and treats doubles the same way as integers.
> > 
> > Below timings are statistics run through "ministat" based on 5 runs
> > of each configuration (now and before). The timings is for running
> > the dill file with the VM, i.e. the dill file was precompiled via
> > fasta.
> > 
> > Program adding 50,000 doubles to a list and prints the last one:
> > 
> >         -56.6 +/- 28.2389
> >         -10.9988% +/- 5.48753%
> >   (~510 ms -> ~460 ms)
> > 
> > Program adding 1,000,000 doubles to a list and prints the last one:
> > 
> >         -3177.2 +/- 263.54
> >         -31.4643% +/- 2.60987%
> >   (~10 seconds -> ~7 seconds)
> > 
> > Hello world program:
> > 
> > No difference proven at 95.0% confidence
> > 
> > Change-Id: I7dd748e759b3e433bc806b2ef2505d29f0b109b6
> > Reviewed-on: https://dart-review.googlesource.com/42000
> > Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> > Commit-Queue: Jens Johansen <jensj@google.com>
> 
> TBR=ahe@google.com,vegorov@google.com,jensj@google.com
> 
> Change-Id: If8efa9917c009f2df68a3ef00331ab45bf8bf67b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://dart-review.googlesource.com/41981
> Reviewed-by: Jens Johansen <jensj@google.com>
> Commit-Queue: Jens Johansen <jensj@google.com>

TBR=ahe@google.com,vegorov@google.com,jensj@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I3c20797f585057e8f77e917918926dcfa921df0a
Reviewed-on: https://dart-review.googlesource.com/42720
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-02-21 14:38:16 +00:00
Paul Berry b119f7a4cd Only allow implicit use of .call if it refers to a method.
Change-Id: I4c332b64eb7338ceaf63544c3dd0317f8c7d4538
Reviewed-on: https://dart-review.googlesource.com/42020
Reviewed-by: Erik Ernst <eernst@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-02-21 14:12:14 +00:00
Erik Ernst 6f50360cd5 Adjusted status of of IsolateReload_LibraryLookup to include Fail
Change-Id: Icb880bdb5e8ca0468a2019ae8a39d608e4ba5133
Reviewed-on: https://dart-review.googlesource.com/42745
Reviewed-by: William Hesse <whesse@google.com>
2018-02-21 13:45:03 +00:00
Erik Ernst d0449c3399 Adjusted vm.status of cc/IsolateReload_LibraryLookup
Change-Id: I7236f3f0ca754dc5c7f8c6d744e1feda24fb233a
Reviewed-on: https://dart-review.googlesource.com/42701
Reviewed-by: Erik Ernst <eernst@google.com>
2018-02-21 12:04:51 +00:00
Jens Johansen 076db33f03 [vm] Fix constant propagators version of identical for integers and doubles
Before this CL the constant propagator relied on two objects being identical
only if a.raw() == b.raw().
This is only the case if they have been canonicalized, which doubles and
ints shouldn't have to be.

This CL fixes it and introduces a few tests (one of which -cdartkp would have
failed prior to this CL).

NOTE: This should only change the behavior of precompiled mode, and only so
that it is more correct.
Change-Id: I4380ce4d3292fa15d728b0572403cb7ed4d0582c
Reviewed-on: https://dart-review.googlesource.com/42620
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-21 11:58:44 +00:00
Ben Konyi 37989ba83e Updated status file for IsolateReload tests that are failing in strong mode.
TBR=asiva@google.com

Change-Id: I2d31dbdf913590b30c86bd3214a558e6b1b50085
Reviewed-on: https://dart-review.googlesource.com/42583
Reviewed-by: Ben Konyi <bkonyi@google.com>
2018-02-21 00:37:58 +00:00
Ben Konyi 279bcc60f7 Removed 'Fail' expectations for passing IsolateReload tests.
TBR=asiva@google.com

Change-Id: I01f6d7a552772056494d4ea3b20d94caa0df7bed
Reviewed-on: https://dart-review.googlesource.com/42581
Reviewed-by: Ben Konyi <bkonyi@google.com>
2018-02-21 00:21:23 +00:00
Ben Konyi 889a277536 [VM / Hot Reload] Fixed various hot reload tests that were failing on the CFE.
Change-Id: I4562cdaecc86802e4e7a5407ca06d7a2234102b3
Reviewed-on: https://dart-review.googlesource.com/42520
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-20 23:45:09 +00:00
Siva Chandra 6214cedaf5 Create isolate from the platform kernel when running VM tests under dartk.
This is take 2 with appropriate status files updates or fixes to the
tests.

This reverts commit 4925ed38ac.

Change-Id: I133b9ae307f0feed1b72ec5a0131facdc51ad4e9
Reviewed-on: https://dart-review.googlesource.com/41600
Commit-Queue: Siva Chandra <sivachandra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-02-20 22:08:25 +00:00
Vyacheslav Egorov ed5b6a3e8e [vm/kernel] Ensure that ScopeBuilder visits parameter types
Parameter types of local functions might refer to type arguments of
the receiver which means that receiver needs to be captured even
if it is not explicitly used inside a local function.

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

Bug: 32204
Change-Id: I448f0c8cbce12e9b58e1c3de9b2630ee22031d92
Reviewed-on: https://dart-review.googlesource.com/42441
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-02-20 19:09:15 +00:00
Vyacheslav Egorov 7dccc7ea99 [vm/kernel] Skip argument type checks in constructors too.
Reduces Flutter Gallery AOT code size by ~600k.

Change-Id: I6f3cac8020db4f667c8f8a86ba7c20385727f3e3
Reviewed-on: https://dart-review.googlesource.com/42242
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-02-20 16:06:45 +00:00
William Hesse 62a2c75af7 Update status for simarch kernel observatory service tests.
Skip runtime/observatory/tests/service/pause_on_start_then_step_test
on dartk on Windows.

Move some status sections from service.status to service_kernel.status
Change some Timeout statuses to Skip, because we don't get any info
from runnning those tests.

Bug: https://github.com/dart-lang/sdk/issues/32225
Change-Id: I85c4567711657188985d52103e87de96086b8222
Reviewed-on: https://dart-review.googlesource.com/42280
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2018-02-19 17:35:31 +00:00
Ryan Macnak bd06ffc2c6 [vm] Check for mis-matched thread type in OSThread TLS destructor.
Change-Id: I1d878d4d31877749cf47ddd3ef973386592fd714
Reviewed-on: https://dart-review.googlesource.com/42104
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-02-16 23:20:37 +00:00
Ryan Macnak 0916763466 [vm, aot] Further debugging aids for null function encountered when writing DWARF inlining data.
Bug: https://github.com/dart-lang/sdk/issues/31952
Change-Id: Ice62439ac2a3a762d7876b8258f00a2489bdce4c
Reviewed-on: https://dart-review.googlesource.com/42121
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-02-16 23:18:11 +00:00
Ryan Macnak 04100796c1 [vm, aot] Further debugging aids for null function encountered when writing DWARF inlining data.
Bug: https://github.com/dart-lang/sdk/issues/31952
Change-Id: Iaf677c2dd15567772d1bb9f2482e749ef1139fe2
Reviewed-on: https://dart-review.googlesource.com/42060
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-02-16 20:48:59 +00:00
Zach Anderson 0d5cf900b0 [infra,flutter] Adds semantically meaningful custom version strings
See https://github.com/flutter/flutter/issues/14751

Change-Id: I3b35c2a32c0dd1301e92abe23b1c6fe2c2e04a6c
Reviewed-on: https://dart-review.googlesource.com/42026
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-02-16 20:44:48 +00:00
Alexander Markov 31b0cc6ac1 [vm,aot] Generate more efficient code for UnboxInt64 if it takes Smi
Change-Id: I7e2b1cabfa749cd781927a32e652f1f59a1c7667
Reviewed-on: https://dart-review.googlesource.com/41925
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-02-16 17:57:57 +00:00
Vyacheslav Egorov eb997b2818 [vm/kernel] Support as{TypeError} as a constant expressions.
Under certain conditions front-end currently generates as{TypeError}
type checks in constant expressions. Support evaluating these type
checks as constant expressions instead of rejecting them.

Change-Id: Id432c4c5062d7bab89c29fef308b42b2cbd64de8
Reviewed-on: https://dart-review.googlesource.com/41761
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-02-16 13:37:37 +00:00
Jens Johansen ef51b33f22 Revert "[kernel] Don't always treat doubles as constants"
This reverts commit 12407c3ea0.

Reason for revert: co19/Language/Expressions/Object_Identity/double_t01 fails in -c dartkp -r dart_precompiled mode.

Original change's description:
> [kernel] Don't always treat doubles as constants
> 
> Previously, when the VM parsed a doubles from the dill file it passed
> control over to the constant evaluator which would then case the
> value and canonicalize it.
> That doesn't really seem to make sense when its not used in a const
> context, nor is it done the same way for integers for instance.
> 
> This CL changes that and treats doubles the same way as integers.
> 
> Below timings are statistics run through "ministat" based on 5 runs
> of each configuration (now and before). The timings is for running
> the dill file with the VM, i.e. the dill file was precompiled via
> fasta.
> 
> Program adding 50,000 doubles to a list and prints the last one:
> 
>         -56.6 +/- 28.2389
>         -10.9988% +/- 5.48753%
>   (~510 ms -> ~460 ms)
> 
> Program adding 1,000,000 doubles to a list and prints the last one:
> 
>         -3177.2 +/- 263.54
>         -31.4643% +/- 2.60987%
>   (~10 seconds -> ~7 seconds)
> 
> Hello world program:
> 
> No difference proven at 95.0% confidence
> 
> Change-Id: I7dd748e759b3e433bc806b2ef2505d29f0b109b6
> Reviewed-on: https://dart-review.googlesource.com/42000
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Commit-Queue: Jens Johansen <jensj@google.com>

TBR=ahe@google.com,vegorov@google.com,jensj@google.com

Change-Id: If8efa9917c009f2df68a3ef00331ab45bf8bf67b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/41981
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-02-16 11:08:18 +00:00
Jens Johansen 12407c3ea0 [kernel] Don't always treat doubles as constants
Previously, when the VM parsed a doubles from the dill file it passed
control over to the constant evaluator which would then case the
value and canonicalize it.
That doesn't really seem to make sense when its not used in a const
context, nor is it done the same way for integers for instance.

This CL changes that and treats doubles the same way as integers.

Below timings are statistics run through "ministat" based on 5 runs
of each configuration (now and before). The timings is for running
the dill file with the VM, i.e. the dill file was precompiled via
fasta.

Program adding 50,000 doubles to a list and prints the last one:

        -56.6 +/- 28.2389
        -10.9988% +/- 5.48753%
  (~510 ms -> ~460 ms)

Program adding 1,000,000 doubles to a list and prints the last one:

        -3177.2 +/- 263.54
        -31.4643% +/- 2.60987%
  (~10 seconds -> ~7 seconds)

Hello world program:

No difference proven at 95.0% confidence

Change-Id: I7dd748e759b3e433bc806b2ef2505d29f0b109b6
Reviewed-on: https://dart-review.googlesource.com/42000
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-02-16 10:21:47 +00:00
Alexander Markov dc1b07af7f [vm,aot] Refine types of uses after specializing a call
After replacing a call with specialized instruction it makes sense
to update types of uses immediately to open more opportunities for
specialization of calls which use result of a replaced call.

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I87d64ff190cebd4fcd1d2ac678859f2bc6612f6d
Reviewed-on: https://dart-review.googlesource.com/41602
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-16 01:25:08 +00:00
Alexander Markov a9586c6147 [vm,aot] Recognize haveSameRuntimeType pattern after devirtualization
This CL teaches AotCallSpecializer to recognize and optimize
haveSameRuntimeType pattern after TFA devirtualizes 'operator=='.

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I172384c8113d2f0954ac141e8f2c1050bc850306
Reviewed-on: https://dart-review.googlesource.com/41572
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-16 00:26:50 +00:00
asiva 0ee460a6b0 Fix memory leak in check snapshot unit test (was reported in the asan build).
Change-Id: I289e189afd5d27fd1ad230270a29d838dd6b77bd
Reviewed-on: https://dart-review.googlesource.com/41905
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-02-15 22:06:19 +00:00
Alexander Markov 32fb103713 [vm/aot] Recognize int operations after devirtualization
TFA devirtualizes calls to int methods and converts them to
static calls to _IntegerImplementation methods.

This CL teaches AotCallSpecializer to recognize int operations
after devirtualization.

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I94be77675fdabef52861869aa4a8ef36946258ae
Reviewed-on: https://dart-review.googlesource.com/41540
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-15 19:14:35 +00:00
Zach Anderson fe96de2858 Revert "Restore console to original state on VM exit. Fixes issue #30318."
This reverts commit c9700040c3.

Revert "[vm] Fix Fuchsia's Platform::Save/RestoreConsoleConfiguration."

This reverts commit 365f7b5a8b.

Reason for revert: newlines not printed correctly on Windows after
spawning a Dart VM process.

fixes #32172

Change-Id: I155752370bed7798fe91defdc61ccfe9f666b725
Reviewed-on: https://dart-review.googlesource.com/41840
Reviewed-by: Zach Anderson <zra@google.com>
2018-02-15 16:33:41 +00:00
asiva b9039cd35b - Fix const ness in signature of new API function
- Access snapshot contents using the getter

Change-Id: I9c264c2bf8ab20ee1d3431e4b802e14fa92616c2
Reviewed-on: https://dart-review.googlesource.com/41642
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-15 09:11:04 +00:00
Vyacheslav Egorov c2899e424f [vm/kernel/aot] Keep type checks in setters for covariant fields
Fixes issue instroduced by 286b123d35

Change-Id: I10444a7ecbb5c03e052df720f3dc1694983e6423
Reviewed-on: https://dart-review.googlesource.com/41263
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-15 07:21:32 +00:00
asiva f1543c38ee Adjust Dart_IsDart2Snapshot API to not expect a size argument as the size
is part of the snapshot header.

Change-Id: I4b6cf3b78c122b406e09fe4234a8ea8ce81b4986
Reviewed-on: https://dart-review.googlesource.com/41641
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-15 07:12:34 +00:00
Ben Konyi 5716109abd [VM / Hot-Reload] Fixed tests that were failing due to different failure messages generated by the VM parser and CFE.
Change-Id: I6840c993300b3ba36c44bfc8f5c0ce6b8043d6f7
Reviewed-on: https://dart-review.googlesource.com/41571
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-02-15 01:03:04 +00:00
Ben Konyi 0fd6aa87a3 [VM / Hot-Reload] Treat fields with null initializers as having no initializer set during reload.
Change-Id: I685f6944ca27fd680e4d912877a922125d7d7ca5
Reviewed-on: https://dart-review.googlesource.com/41568
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-02-15 00:26:33 +00:00
asiva 9884447cc5 Add a new API function to sniff a snapshot to determine if the
snapshot is a Dart2 snapshot or a Dart1 snapshot.
This will be used by the flutter engine to initialize itself
correctly based on the snapshot provided.

Change-Id: I06adaac74b350f96aa6ebb55887e4a81f09fbd14
Reviewed-on: https://dart-review.googlesource.com/41082
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-02-14 23:27:38 +00:00
Régis Crelier 3d756ec4ab [VM runtime] In strong mode, restrict subtyping rules of callable instances (fixes #32154).
Update kernel status files.

Change-Id: I2bf6097b5229d80cc90baed92fd8dcc750667b23
Reviewed-on: https://dart-review.googlesource.com/41482
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-14 21:48:27 +00:00
Régis Crelier 933a0ae895 [Kernel] Check return type of native functions in strong mode (fixes #32090).
[VM] Check return type of all functions in strong mode.

Change-Id: I01ff80e9ec5c625a0855a22498f9c2d738de4678
Reviewed-on: https://dart-review.googlesource.com/40641
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-02-14 20:30:43 +00:00
Alexander Markov c823888580 [vm] Avoid setting result type to dynamic for recognized methods
The list of recognized methods in the VM includes information about
result type. If there is no known/concrete result cid, the list
contains dynamic. When StaticCallInstr for recognized method is created,
its result type was pulled from the list even if it was dynamic.

This change avoids setting result type to dynamic in such case
and fixes the assertion for conflicting result types from the list of
recognized methods and from global type inference.
Now, if list of recognized methods has dynamic, and inferred type
is available, the latter will be used.

Change-Id: I7da7313f93ca08a142226026a4645124c30cfd8f
Reviewed-on: https://dart-review.googlesource.com/41080
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-02-14 17:29:23 +00:00