Commit Graph

14501 Commits

Author SHA1 Message Date
Stevie Strickland 64718ea369 Simplify control flow in ICData::FindFreeIndex.
Change-Id: Icb8111b7d4f202ce72c47fad4e0b3c769c41bc45
Reviewed-on: https://dart-review.googlesource.com/c/85763
Auto-Submit: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-12-03 15:34:39 +00:00
Alexander Aprelev dc346e6fdd Revert "[vm/aot] Fill in names of properties in snapshot profile."
This reverts commit 465f8595ec as it
breaks windows and mac bots.

Change-Id: I94a939d711f69a28f405ee32680315ad6677b09e
Reviewed-on: https://dart-review.googlesource.com/c/85722
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-11-30 19:52:23 +00:00
Samir Jindel 465f8595ec [vm/aot] Fill in names of properties in snapshot profile.
Change-Id: Ic709a3dc40390463ffb5fd76fd8eb63ebd87acc0
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/85292
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-30 18:38:05 +00:00
Vyacheslav Egorov 040ef6aabb [gardening] Lower core rlimit to 0 if test is expected to crash.
We do not archive core dumps generated by tests that are expected
to crash - so there is no need to generate those dumps.

It seems that generating core dumps is very slow on Mac and causes
timeouts.

Fixes #35275

Remove Timeout expectations from Crashing tests

Change-Id: I36c89fd583a6a94521560544163f02414cbbf41a
Reviewed-on: https://dart-review.googlesource.com/c/85680
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-11-30 11:15:06 +00:00
Ryan Macnak 31e4c9de6e [vm] Remove dead pre-Observatory debugger code.
Change-Id: I13779b9a4878f84aa3995043a99fab9253e8e093
Reviewed-on: https://dart-review.googlesource.com/c/85641
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-30 00:01:19 +00:00
Ryan Macnak bfcbd25102 [vm] Use decimal thread ids to match gdb and eu-stack.
Makes it easier to match things up between the bot test failure output and core dumps.

Change-Id: I8ed89dc67b0c46716d4bfed3ec1a7cdbc5411eea
Reviewed-on: https://dart-review.googlesource.com/c/85466
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-29 22:06:20 +00:00
Ryan Macnak 6fbc7d27c4 [vm] Remove source-based loading APIs.
Change-Id: I07cd591bd6162a743770d221e48d491597a1b7c1
Reviewed-on: https://dart-review.googlesource.com/c/85545
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-29 21:58:14 +00:00
Ryan Macnak 488d1f375c [vm] Make profiler bailout counters available over the VM service.
Change-Id: I4c0d30b21371e33f66ab142636aa669a46f8a799
Reviewed-on: https://dart-review.googlesource.com/c/85547
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-29 21:53:24 +00:00
Martin Kustermann 44f7295195 [VM] Free the current working directory string if we happen to re-initialize the VM
This is an attempt to fix a flakily reported ASAN leak of the form:

  Direct leak of 28 byte(s) in 1 object(s) allocated from:
      #0 0x55827f0dacf2 in __interceptor_realloc /b/s/w/ir/kitchen-workdir/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cc:107:3
      #1 0x7f52fe7a41ca in getcwd (/lib/x86_64-linux-gnu/libc.so.6+0xf01ca)

  SUMMARY: AddressSanitizer: 28 byte(s) leaked in 1 allocation(s).
Change-Id: I7c76be43eecd2c445631af22a93c710df93379f4
Reviewed-on: https://dart-review.googlesource.com/c/85562
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-11-29 11:44:10 +00:00
Martin Kustermann d93c19acb9 [Gardening] Update status file to extend test markers from Crash to Timeout (on MacOS)
Issue https://github.com/dart-lang/sdk/issues/35275

Change-Id: I95f72ab6eb2736c90c1b6bfe193f3c6410c8b83a
Reviewed-on: https://dart-review.googlesource.com/c/85560
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-29 11:12:54 +00:00
Aart Bik ef419f68f9 Revert "[vm/compiler] Express control dependence as data dependence."
This reverts commit 41f3d4326e.

Reason for revert: I hit +2 by accident when I wanted to submit do a dry run

Original change's description:
> [vm/compiler] Express control dependence as data dependence.
> 
> Rationale:
> This provides a more robust way of expressing control
> dependences between bounds checks and their uses, while
> still allowing for CSE and LICM where possible.
> This also fixes the original bug that started this
> whole redesign: invalid LICM of checkbound.
> 
> Note:
> Deals with bounds check, null check still TBD.
> 
> Mini design doc:
> runtime/docs/compiler/data_dep_for_control_dep.md
> 
> https://github.com/dart-lang/sdk/issues/35139
> https://github.com/dart-lang/sdk/issues/34684
> https://github.com/dart-lang/sdk/issues/30633
> 
> Change-Id: Icfbd3ca60662e37046e48b95be7f81d05d94af88
> Reviewed-on: https://dart-review.googlesource.com/c/85470
> Commit-Queue: Aart Bik <ajcbik@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,kustermann@google.com,rmacnak@google.com,alexmarkov@google.com,asiva@google.com,ajcbik@google.com

Change-Id: Id20699f957681c248851b37d545b330fd4972d7a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/85522
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-11-29 03:02:17 +00:00
Aart Bik 41f3d4326e [vm/compiler] Express control dependence as data dependence.
Rationale:
This provides a more robust way of expressing control
dependences between bounds checks and their uses, while
still allowing for CSE and LICM where possible.
This also fixes the original bug that started this
whole redesign: invalid LICM of checkbound.

Note:
Deals with bounds check, null check still TBD.

Mini design doc:
runtime/docs/compiler/data_dep_for_control_dep.md

https://github.com/dart-lang/sdk/issues/35139
https://github.com/dart-lang/sdk/issues/34684
https://github.com/dart-lang/sdk/issues/30633

Change-Id: Icfbd3ca60662e37046e48b95be7f81d05d94af88
Reviewed-on: https://dart-review.googlesource.com/c/85470
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-29 01:47:18 +00:00
Ryan Macnak 581468fa63 [vm] Fix gcc build.
Change-Id: I16b29aa813956c7235307e2c811a9bc457ead4ae
Reviewed-on: https://dart-review.googlesource.com/c/85468
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-28 17:53:13 +00:00
Martin Kustermann f5d1229081 Reland "[VM] Inline ClassID.getID() eagerly, extend pattern matching logic to recognize it, use it to special case ascii decoding"
This change extends/fixes the exiting "pattern recognition" which tries
to recognize the pattern

  v2 <- LoadClassIdInstr(v1)
  BranchIf v2 == IntegerConstant(cid)

Furthermore we start inlining the recognized `ClassID.getID` method very
early in the pipeline.  This allows the VM to recognize the above
pattern and insert redefinitions before the actual inlining pass.

Furthermore we special-case two very hot methods in utf8 decoding by
manually having two loops, one of which is guarded by a class-id check
against the _Uint8ArrayView class, which is most common.  (In the future
we would like to unify the typed data layouts so we no longer need to
use `ClassId.getID`, thereby also allowing non core library code to use
this).

This improves dart-aot by
  * 31%+ for a protobuf decoding benchmark we care about

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

Change-Id: I7181bbf096aabe303634fd3b2bff9cc96d69719c
Reviewed-on: https://dart-review.googlesource.com/c/85443
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-11-28 10:43:32 +00:00
Martin Kustermann c9a8589ba6 [VM] Remove dead code in precompiler
Our precompiler uses the kernel2kernel constant evaluator. It no longer
execute code during AOT compilation.

Change-Id: Ic70d4d4ebb9ff036fdcb2f4027f28872913ba556
Reviewed-on: https://dart-review.googlesource.com/c/85446
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-11-28 10:36:09 +00:00
Martin Kustermann 4aff8f93fb [VM] Ensure we handle devirtualized calls inside ApplyClassIds() as well
After recent changes to pragmas, TFA devirtualizes more calls, which has
regressed a Prime

This gets rid of the 5% regression in PrimeNumber/PrimeNumberTyped in
dart-aot (which 0ef66e0f5 introduced). Furthermore it improves MD5/SHA
by double digits percent.

Change-Id: Ia4d1fb62512495dec7111efc53c4d7a4de5ef3af
Reviewed-on: https://dart-review.googlesource.com/c/85398
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-11-28 09:21:00 +00:00
Régis Crelier a3874044e7 [gardening] Restrict timeout status to MacOS.
This modifies recent commit 25262fe9.

Change-Id: I19f8bc5bcefacbf761479869f79140702c37305b
Reviewed-on: https://dart-review.googlesource.com/c/85464
Auto-Submit: Régis Crelier <regis@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-11-28 00:47:52 +00:00
Régis Crelier 25262fe9b3 [gardening] Tests already marked as crashing or failing sometimes also time out.
Change-Id: I6bdbc45f5ec38789e6e5e830e89a8218fc098466
Reviewed-on: https://dart-review.googlesource.com/c/85414
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-11-27 21:02:30 +00:00
William Hesse faafdb4b2f Revert "[VM] Inline ClassID.getID() eagerly, extend pattern matching logic to recognize it, use it to special case ascii decoding"
This reverts commit d7cf6959bb.

Reason for revert: This causes crashes on the vm-obfuscate builder at https://ci.chromium.org/p/dart/builders/luci.dart.ci.sandbox/vm-kernel-precomp-obfuscate-linux-release-x64
like

FAILED: dartkp-dart_precompiled release_x64 corelib_2/linked_hash_map_test
Expected: Pass
Actual: Crash
Unexpected compile error.

--- Command "vm_compile_to_kernel" (took 11.000189s):
DART_CONFIGURATION=ReleaseX64 /b/s/w/ir/cache/builder/sdk/pkg/vm/tool/gen_kernel --aot --platform=out/ReleaseX64/vm_platform_strong.dill -o /b/s/w/ir/cache/builder/sdk/out/ReleaseX64/generated_compilations/dartkp/tests_corelib_2_linked_hash_map_test/out.dill /b/s/w/ir/cache/builder/sdk/tests/corelib_2/linked_hash_map_test.dart --packages=/b/s/w/ir/cache/builder/sdk/.packages -Ddart.developer.causal_async_stacks=true

exit code:
0

--- Command "precompiler" (took 583ms):
DART_CONFIGURATION=ReleaseX64 out/ReleaseX64/gen_snapshot --snapshot-kind=app-aot-assembly --assembly=/b/s/w/ir/cache/builder/sdk/out/ReleaseX64/generated_compilations/dartkp/tests_corelib_2_linked_hash_map_test/out.S --obfuscate --sync-async --ignore-unrecognized-flags --packages=/b/s/w/ir/cache/builder/sdk/.packages /b/s/w/ir/cache/builder/sdk/out/ReleaseX64/generated_compilations/dartkp/tests_corelib_2_linked_hash_map_test/out.dill

exit code:
-6

stderr:
Warning: This VM has been configured to obfuscate symbol information which violates the Dart standard.
         See dartbug.com/30524 for more information.

===== CRASH =====
version=2.2.0-edge.83712405657ff736033380cb24b0bd5a62fc3692 (Tue Nov 27 16:56:07 2018 +0000) on "linux_x64"
si_signo=Segmentation fault(11), si_code=1, si_addr=0xd1400050e5f
Dumping native stack trace for thread 2b71
  [0x000056001fc426c7] Unknown symbol
  [0x000056001fc426c7] Unknown symbol
  [0x000056001fe5763d] Unknown symbol
  [0x000056001fe4c99c] Unknown symbol
  [0x000056001fe6166a] Unknown symbol
  [0x000056001fe59c0c] Unknown symbol
 

Original change's description:
> [VM] Inline ClassID.getID() eagerly, extend pattern matching logic to recognize it, use it to special case ascii decoding
> 
> This change extends/fixes the exiting "pattern recognition" which tries
> to recognize the pattern
> 
>   v2 <- LoadClassIdInstr(v1)
>   BranchIf v2 == IntegerConstant(cid)
> 
> Furthermore we start inlining the recognized `ClassID.getID` method very
> early in the pipeline.  This allows the VM to recognize the above
> pattern and insert redefinitions before the actual inlining pass.
> 
> Furthermore we special-case two very hot methods in utf8 decoding by
> manually having two loops, one of which is guarded by a class-id check
> against the _Uint8ArrayView class, which is most common.  (In the future
> we would like to unify the typed data layouts so we no longer need to
> use `ClassId.getID`, thereby also allowing non core library code to use
> this).
> 
> This improves dart-aot by
>   * 31%+ for a protobuf decoding benchmark we care about
> 
> 
> Issue https://github.com/dart-lang/sdk/issues/31954
> 
> Change-Id: Ia567b92b7e76ff28eda1726deaafda32732ed8f5
> Reviewed-on: https://dart-review.googlesource.com/c/85281
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Jenny Messerly <jmesserly@google.com>
> Commit-Queue: Martin Kustermann <kustermann@google.com>

TBR=vegorov@google.com,kustermann@google.com,jmesserly@google.com,johnniwinther@google.com,sra@google.com

Change-Id: I912b0768c32cbb00297ce48db29dbdbea44c14fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/85441
Reviewed-by: William Hesse <whesse@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2018-11-27 18:15:36 +00:00
Liam Appelbe 8371240565 Reland https://dart-review.googlesource.com/c/sdk/+/84683
The timeout issue in app-kernel-linux-product-x64-try seems to have resolved itself.

Bug: https://github.com/dart-lang/sdk/issues/34895
Change-Id: If503aa4e63628c38d8ee86a5b6b5202ea953d6a8
Reviewed-on: https://dart-review.googlesource.com/c/85406
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2018-11-27 16:56:07 +00:00
Martin Kustermann d7cf6959bb [VM] Inline ClassID.getID() eagerly, extend pattern matching logic to recognize it, use it to special case ascii decoding
This change extends/fixes the exiting "pattern recognition" which tries
to recognize the pattern

  v2 <- LoadClassIdInstr(v1)
  BranchIf v2 == IntegerConstant(cid)

Furthermore we start inlining the recognized `ClassID.getID` method very
early in the pipeline.  This allows the VM to recognize the above
pattern and insert redefinitions before the actual inlining pass.

Furthermore we special-case two very hot methods in utf8 decoding by
manually having two loops, one of which is guarded by a class-id check
against the _Uint8ArrayView class, which is most common.  (In the future
we would like to unify the typed data layouts so we no longer need to
use `ClassId.getID`, thereby also allowing non core library code to use
this).

This improves dart-aot by
  * 31%+ for a protobuf decoding benchmark we care about


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

Change-Id: Ia567b92b7e76ff28eda1726deaafda32732ed8f5
Reviewed-on: https://dart-review.googlesource.com/c/85281
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-11-27 13:14:27 +00:00
Liam Appelbe 9906819fb7 Remove kernel isolate API from the public dart_api.h
This is the first step in moving the kernel isolate out
of the VM and into the standalone embedder.

Bug: https://github.com/dart-lang/sdk/issues/33433
Change-Id: Ie8d9ac1c27efe2661f0441b75275119966d197af
Reviewed-on: https://dart-review.googlesource.com/c/84829
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-11-26 22:47:20 +00:00
Ryan Macnak e24b3b7772 [test] Further debugging for appjit_determinism_test.
Bug: https://github.com/dart-lang/sdk/issues/35092
Change-Id: Icbd9fcf74cdb25930a2ab0d5c428646543271206
Reviewed-on: https://dart-review.googlesource.com/c/85423
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-26 22:18:05 +00:00
Keerti Parthasarathy b578e9ba6e Update vm_sources.gni, add a couple of missing file extensions
Change-Id: Ifa75568e63bfbdaf3915f2389228fc9c69abbd33
Reviewed-on: https://dart-review.googlesource.com/c/85403
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2018-11-26 21:56:30 +00:00
Aart Bik 01e85fa2e0 [vm/compiler] Replace simple induction analysis with new framework
Rationale:
Replacing the simple induction analysis in the range analyzer
with the new framework for finding induction variables removes
a lot of code and even saves some memory in the IR (for phis).
Note that this is only the first phase, i.e. using the new
framework for the same behavior in the range analyzer. In the
second phase, the new framework will be fully exploited to
compute more accurate ranges in many more cases.
Change-Id: Iae5bd5a155ef8592558b5bdb2388c5aa9da64e59
Reviewed-on: https://dart-review.googlesource.com/c/84500
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-11-26 19:05:01 +00:00
Ryan Macnak cdd4adf467 [vm, kbc, dbc] Remove dependency on computed goto.
Change-Id: I0727a431149123640b883e29d4e3ca83cb953dce
Reviewed-on: https://dart-review.googlesource.com/c/84341
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-11-26 18:20:27 +00:00
Martin Kustermann d31e83b909 [VM] Do simple block re-ordering in AOT by moving throwing blocks to the end
If we inline something inside a loop which might throw, the throwing blocks
are currently spliced in the middle of the loop.  This CL moves those blocks
to the very end.

This improves a number of typed data benchmarks in dart-aot mode by 5-10%.

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

Change-Id: I5dc86291240d8dac61798ff873ffa7205edc0007
Reviewed-on: https://dart-review.googlesource.com/c/85263
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-26 17:22:56 +00:00
Zach Anderson 3ad0571cf9 [fuchsia] Fixes for the Fuchsia build
Makes public some include paths needed for the dart_runner to depend on
dart_io.

Also updates some dart:io implementations to give and OSError
instead of crashing when something is unimplemented.

Change-Id: I862fc7cc43f56e74de791ecc021b88238b54a8e5
Reviewed-on: https://dart-review.googlesource.com/c/84920
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-11-26 16:30:33 +00:00
Samir Jindel 880dfa0bca [vm/aot] Refactor clustered snapshot serialization to allow reflection of field names.
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try
Change-Id: I6553e4a7964e953d1722975d20c89fee441ceb61
Reviewed-on: https://dart-review.googlesource.com/c/84627
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
2018-11-26 14:17:47 +00:00
Samir Jindel 60d6ca0de7 [vm] Fix v8_snapshot_profile_writer_test on Mac.
Change-Id: Iab5fd7f839b0af3eb0372cc62e2238370a48966c
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-mac-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/85220
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-23 18:00:45 +00:00
Vyacheslav Egorov 92d2a70a9a [gardening] Update v8_snapshot_profile_writer_test status for dartkp-mac-release-simarm64
Change-Id: Ibe9f07012adf9c9bebd1f045047752fcaed69ee1
Reviewed-on: https://dart-review.googlesource.com/c/85283
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-23 13:09:25 +00:00
Samir Jindel 4a641a69fc [vm] Update status file for v8_snapshot_profile_writer_test.
Marking this as failing while I work on a solution.

Change-Id: Ifb0ddc1c05cf48d8f8301e2e0b59db68e788cdf3
Reviewed-on: https://dart-review.googlesource.com/c/85221
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-11-22 19:41:18 +00:00
Samir Jindel 8aa0af0654 [vm] Fix C++ incompatibility in V8SnapshotProfileWriter
Change-Id: Ib676762594783b2bc755b8362d7a2dd3522efcb1
Reviewed-on: https://dart-review.googlesource.com/c/85201
Commit-Queue: Samir Jindel <sjindel@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2018-11-22 17:18:05 +00:00
Martin Kustermann 0ef66e0f5c [VM] Add @pragma("vm:non-nullable-result-type") annotation
A field/function annotated with this pragma must be guaranteed to not
return `null` at runtime.

Make use of this non-nullable annotation in the VM's type propagator.

Annotates the "_TypedListView._typedData" field to ensure the VM knows it
returns a non-nullable _TypedListView.

Furthermore annotates methods on the integer implementation.  Those particular
methods are recognized methods with a "dynamic" return type.  This caused
the type propagator to use CompileType::Dynamic() as result type.  Since a
previous CL started to only utilize the annotated type if it is better than
"dynamic" more integer operations got handled in-line, though with null-checks.
Annotating those methods to return non-null improves the in-line handling of
integer operations.

This improves dart-aot

On arm7hf:
  SHA256: +5%, SHA: +6%, JsonObjectRoundTrip: +7%, ...

On arm8:
  SHA1: +28%, MD5: +25%, SHA256: +15%, TypedData.Int16ListViewBench: +18.5%, StringInterpolation: +18%, ...


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

Change-Id: Ia4263a37241a36c9dc35e8a48893297effa6f4b2
Reviewed-on: https://dart-review.googlesource.com/c/84421
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-11-22 16:18:27 +00:00
Samir Jindel cde4270e47 Re-land "[vm/aot] Snapshot size analysis."
Minor fixes have been applied, see diff against patchset 1.

This reverts commit 9b937f1226.

Change-Id: I8e4bbc0b88e33d3b554e91c17d1f849e24a1ccb3
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-win-product-x64-try, vm-kernel-precomp-win-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/84845
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
2018-11-22 15:14:46 +00:00
Daco Harkes 5ced1f1cd2 add documentation to Function::parameter_types
Change-Id: I36012624f0224003cb8c4186bc787172cbc78bc6
Reviewed-on: https://dart-review.googlesource.com/c/85169
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-11-22 15:08:37 +00:00
Martin Kustermann ad7fbb6dd7 [VM] Fix flow graph builder to not generate different code in unoptimized/optimized mode
Change-Id: I752be6bd97dcd892ea6ba5d7fdd30575d4cee489
Reviewed-on: https://dart-review.googlesource.com/c/84720
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-22 14:05:47 +00:00
Martin Kustermann 2ebdf7c0f8 [VM] Ensure the _TypedListView.{offsetInBytes,length} fields are always initialized with _Smi's
Until now a typed data view was first constructed and then afterwards the
constructor body validated that the offsetInBytes/length are non-null
and in range.

This CL moves the range check to the call sites of the constructor,
thereby guarenteeing that we will never initialize the
_TypedListView.{offsetInBytes,length} fields with non-_Smi values. (The
views are constructed only within the "dart:typed_data" library.  Neither the
embedder nor the runtime construct them.)

Further more this CL removes the redundant _defaultIfNull() call, since
the call sites already handled the `length == null` case.

This CL also starts annotating _TypedListView.{offsetInBytes,length}
with @pragma("vm:exact-result-type", "dart:core#_Smi") to ensure any
[LoadFieldInstr] will have the right type attached, thereby avoiding any
null-checks and mint-handling.

This improves dart-aot

On arm7hf:
    MD5: +38%, SHA256: +87%, SHA1: +89% (plus various typed data microbenchmarks)
    JsonParseDefaultReviver/StringBuffer/StringIdiomatic/JsonParseCustomReviver: -5-8% (probably due to not inlining static calls, will find out)

On arm8:
    MD5: +6.5%, SHA256: +12%, SHA1: 3.6%, JsonUtf8RoundTrip: 8% (plus various typed data microbenchmarks)
    DeltaBlue: -6.7% (probably due to not inlining static calls, will find out)

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

Change-Id: I37c822e6879f5a2d17fd9650a68cf2eee4326b01
Reviewed-on: https://dart-review.googlesource.com/c/84241
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-22 14:02:27 +00:00
Martin Kustermann 08a4e020b3 [VM] Get rid of duplicate return-type-cid information from method recognizer
When @pragma('vm:exact-result-type') was introduced, the return types
specified in the recognized method lists were **duplicated** (they were
in the method recognizer macro lists as well as in the dart source code).

This CL removes this duplication by removing the result types from the
method recognizer lists.

Change-Id: I2082110cf77fc3b97d1a541cb153abb8c17990d0
Reviewed-on: https://dart-review.googlesource.com/c/84220
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-22 11:53:27 +00:00
Martin Kustermann 94c325a889 Reland "[VM] Make @pragma annotations work generally"
Currently the @pramga('vm:exact-result-type') annotation only works if
the function is a recognized method.  This change changes that to make
the VM just look if a function has the annotation (no matter if it's
also in the list of recognized methods or not).

Furthermore this CL lets the type propgagator use
@pragma('vm:exact-result-type') annotations to narrow the [CompileType]
set on [LoadFieldInstr]s.

Since the @pragma is a general feature, this CL moves the
`Function::FindPragma()` to `Library::FindPragma` (which is where any
other metadata lookup happens).  We also let the `FindPragma` accept any
of Class/Function/Field objects.

Furthermore the `FindPragma()` function is fixed to handle the case
when the evaluation of the metadata results in an error.
In this case we simply claim to not have found a pragma annotation.

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

Change-Id: If03f566e334cd53549985823ee3dd6b5e9672969
Reviewed-on: https://dart-review.googlesource.com/c/85163
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-22 10:54:44 +00:00
Ryan Macnak edba6fbfaa [vm, gc] Add --force-evacuation flag to aid finding untracked pointers.
Bug: https://github.com/dart-lang/sdk/issues/34934
Change-Id: Ibba2ae5837985a32bd84da4b33bd091dcec3427d
Reviewed-on: https://dart-review.googlesource.com/c/85141
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-21 22:58:57 +00:00
Ben Konyi fcde804eb4 [ VM / API ] Added Dart_IsTearOff to the Dart API.
Fixes issue #35183

Change-Id: I72b84f367c0d8fa467b386597a9784dfb9334e84
Reviewed-on: https://dart-review.googlesource.com/c/84861
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Ben Konyi <bkonyi@google.com>
2018-11-21 18:26:37 +00:00
Ryan Macnak e1ffe76a36 [vm] Replace StubEntry with Code handles.
StubEntry was holding raw pointers across safepoints in several places in the compiler.

Bug: https://github.com/dart-lang/sdk/issues/34934
Change-Id: Id17cb7651f4d3508915c8cb90f5cb2353df6dac0
Reviewed-on: https://dart-review.googlesource.com/c/85040
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-21 17:45:11 +00:00
Lasse R.H. Nielsen e79cb0232f Fix return for Socket.setOption.
BUG= http://dartbug.com/34983

Change-Id: Ib139d02b9ce658d384b125c68aa6c756fc6573e0
Reviewed-on: https://dart-review.googlesource.com/c/83700
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2018-11-21 08:33:55 +00:00
Martin Kustermann 9ca6369ef5 [VM] Add locking around accessing constants arrays on scripts
Both the mutator as well as the background compiler are accessing constants
arrays attached to [Script] objects, which can cause races where mutator is
modifying the hashmap while the background compiler is reading.

This CL adds locking around those accesses.

Change-Id: Iac7bbbe242d13b964698ae95fe1653fb4ce28a36
Reviewed-on: https://dart-review.googlesource.com/c/84903
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-20 21:46:08 +00:00
Martin Kustermann 83ba397368 [VM] Propagate [UnwindError]s directly instead of wrapping them in [LanguageError]s
During VM shutdown generally, or during killing isolate more
specifically, OOB messages will be sent to the isolate which cause an
[UnwindError] to be raised.

This error has to be propgated through as many dart frames and runtime
frames there are **until the very end**, namely to the event loop.

Currently the constant evaluator was sometimes wrapping [UnwindError]s
into [LanguageError]s which caused unwinding to stop, leaving us
kernel-isolate/service-isolate hanging around instead of shutting down.

Change-Id: Iade46aff3ca3459ec53f155b4f40305050380a7b
Reviewed-on: https://dart-review.googlesource.com/c/84904
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-20 21:43:18 +00:00
asiva 0ca1c57593 Reland "[VM] Remove unused flags"
This is a reland of 1a4cff1bd4

Original change's description:
> [VM] Remove unused flags
> 
> Remove the following flags which are always ON
> --strong
> --reify_generic_functions
> 
> and these flags which are not applicable anymore
> --error-on-bad-override
> --error-on-bad-type
> --enable-type-checks
> 
> Change-Id: I6e1aeb68e663953f4ae49ca94ea0daa87b661900
> Reviewed-on: https://dart-review.googlesource.com/c/79431
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

Change-Id: Ib4452c22fb05eed38820708abb648939e03b1df0
Reviewed-on: https://dart-review.googlesource.com/c/84923
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-11-20 17:25:42 +00:00
Martin Kustermann b0730135ff [VM] Use ArrayOfTuplesView for invocation dispatchers
This makes it easier to access and safer to use.

Change-Id: Ida12708975a250a57faf71007a0d9ebb65c23dd2
Reviewed-on: https://dart-review.googlesource.com/c/84020
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-20 16:15:25 +00:00
Siva Annamalai f6c41ac3bc Revert "[VM] Remove unused flags"
This reverts commit 1a4cff1bd4.

Reason for revert: The precompiled arm bot failed a test.

Original change's description:
> [VM] Remove unused flags
> 
> Remove the following flags which are always ON
> --strong
> --reify_generic_functions
> 
> and these flags which are not applicable anymore
> --error-on-bad-override
> --error-on-bad-type
> --enable-type-checks
> 
> Change-Id: I6e1aeb68e663953f4ae49ca94ea0daa87b661900
> Reviewed-on: https://dart-review.googlesource.com/c/79431
> Commit-Queue: Siva Annamalai <asiva@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

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

Change-Id: Ib0fe4f33c044047ef1cb31bca9d38591176b7d40
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/84883
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2018-11-20 07:32:11 +00:00
asiva 1a4cff1bd4 [VM] Remove unused flags
Remove the following flags which are always ON
--strong
--reify_generic_functions

and these flags which are not applicable anymore
--error-on-bad-override
--error-on-bad-type
--enable-type-checks

Change-Id: I6e1aeb68e663953f4ae49ca94ea0daa87b661900
Reviewed-on: https://dart-review.googlesource.com/c/79431
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-11-20 06:41:06 +00:00