Commit Graph

1248 Commits

Author SHA1 Message Date
Martin Kustermann 6f44e99f6e [vm/aot] Add test which passes both AOT size information flags --print-instructions-sizes-to/--write-v8-snapshot-profile-to
It was reported that passing both flags would sometimes crash
gen_snapshot. This test can ensure it works and continues to work.

Change-Id: Ib58685e815a628efb786a001b91e48728d4b5a8d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122142
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-21 21:19:18 +00:00
Alexander Markov a170fc54b9 [vm] Fix DirectChainedHashMap iterator
BaseDirectChainedHashMap<KeyValueTrait, B, Allocator>::Iterator::Next()
was first checking if array_index_ is larger than the size of map's array,
and only then it was looking at remaining entries in the collision list.

So, when there is a collision in the last bucket, array_index_ was bumped
and the first entry in the list was returned. After that, Next() returned
NULL, skipping remaining entries in the collision list.

This caused incorrect stack state management in BytecodeFlowGraphBuilder
and BytecodeFlowGraphBuilder::DropUnusedValuesFromStack() was removing
too many entries from the stack, which caused crash in
BytecodeFlowGraphBuilder::BuildStoreIndexedTOS().

Issue: https://github.com/dart-lang/sdk/issues/38979
Change-Id: Ie073ca7014da5b04999b7984d508984b4c9743b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122176
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-21 18:30:54 +00:00
Alexander Markov 9220890dc7 [vm/bytecode] Do not emit inferred type if unreachable
Closes: https://github.com/dart-lang/sdk/issues/38965

Change-Id: Id74ed952f2f632fe8028a765d0cf717e04830954
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64-try,app-kernel-linux-debug-x64-try,vm-kernel-linux-debug-ia32-try,vm-dartkb-linux-debug-simarm64-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-dartkb-linux-debug-x64-try,vm-kernel-precomp-linux-debug-x64-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-asan-linux-release-x64-try,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122147
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-18 18:29:02 +00:00
Clement Skau a9fc9f7fd4 [SDK] Fixes run_appended_aotsnapshot_test on Windows.
Bug: https://github.com/dart-lang/sdk/issues/38974
Change-Id: I5fafb29252f20a536b5543d309ddeb4ccd3421ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122145
Auto-Submit: Clement Skau <cskau@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-10-18 15:20:36 +00:00
Clement Skau 8d8faa7dea [SDK] Fixes loading appended snapshots when executed with PATH.
Loading of appended snapshots used to try read the executable itself
via arg[0] which holds the "path" to the executable.
However, when the executable is being invoked via PATH the "path"
can be just the name of the executable with no actual path.
This would cause the file reading to fail to find the file and
therefore fail to read.
This in turn caused standalone executables to fail to run when invoked
via PATH.

Bug: https://github.com/dart-lang/sdk/issues/38912
Change-Id: I08501661441db90ce6cff96a9337a5770ec3524d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121853
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-18 10:30:48 +00:00
Samir Jindel 548f7f3d6e [vm/aot] Deprecate blob snapshots.
Change-Id: I850d28bf6dd405b41646482e810d4d0b4498c66c
Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm64-try,vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121704
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-17 13:13:39 +00:00
asiva 65bf2f0bcd [VM] Fix name demangling in AOT mode.
Change-Id: I7e6fd25aa6073fefa0151728e30e465cf312d2cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121776
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-15 22:29:04 +00:00
asiva fa3f88efe9 Fix AOT build breakage (new extension method names were failing as demangling is not done in AOT builds).
Change-Id: Ifa4432fb22934cbf451addb63c8ef2b82432e956
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121651
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-14 22:49:22 +00:00
asiva a551c507bd [VM] Implement name demangling of extension methods.
Change-Id: Id64ae1aa0de89260b6bf2d6f40260a0dc9ef5c16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121000
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-10-14 20:40:09 +00:00
Régis Crelier 5fad012d02 [gardening] Skip slow vm test in hot-reload mode.
Change-Id: Ib3bc25f3fe7c5261daa117aa1287aea4b98c84b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121415
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-10-11 23:39:29 +00:00
Vyacheslav Egorov 94c0319b29 [vm/compiler] Accommodate for potential aliasing when accessing view with a const index.
When creating a place for an indirect indexed access into typed data
list (one which uses LoadUntagged to load base pointer), don't consider
this place to be constant indexed even if index itself is a constant.

Base pointer returned by LoadUntagged can be pointing into some other
typed array - meaning that the actual index is C plus an unknown
offset.

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

Change-Id: I1fb50c2d265537d2b6dd185c10ddc74dc06147b2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121123
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-10 19:22:44 +00:00
Martin Kustermann e998c6c284 [vm/compiler] Use environment from branch instruction in slow path of CheckedSmiComparison.
The environment of the comparison instruction gets removed when the
branch becomes the owner of the comparison. To ensure the slow path
of CheckedSmiComparison has an environment for generating of catch
entries, we use the environment from the branch.

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

Change-Id: Ib8f86b2b9cc65f606654a89846fabe57a4023cd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120587
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-10-10 17:22:44 +00:00
Ryan Macnak 71ecb73a2b [vm] Fix one MSAN failure; add UBSAN configuration.
Change-Id: I5b1d43836f3eb09983195fc3792f369aa3f8079f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120750
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-09 23:38:30 +00:00
Ben Konyi f5ce3a6e7f [ VM / Compiler ] Fixed issue where TMP was being used as source for store with large offset on ARM
While emitting code for a ParallelMove on ARM32, the TMP register was
being used as a dest/src. When the stack slot offset is large,
StoreToOffset creates a new base in TMP in order to use a smaller
offset. Since the ParallelMove implementation was hardcoding TMP as the
dest/src register, the assert that the register != TMP failed with large
offsets. Now we instead perform a check to see if the offset will fit to
determine whether or not we can use TMP or if we need to fall back and
use LR as our temporary (we can do this since we're in the middle of a
ParallelMove).

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

Change-Id: I4d8cc8b54f6090d86992aabb8ff44d088bc02d3e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119584
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-10-09 17:06:00 +00:00
Ryan Macnak d5feab0c53 [vm] Create builds for LeakSanitizer, MemorySanitizer and ThreadSanitizer.
Change-Id: I65905ec76fcde8b7f4063cb5b80a3d034b453153
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120323
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-10-07 16:24:22 +00:00
Ryan Macnak 836d9bf168 Reapply "[vm, bytecode] Fix missing dependencies in --snapshot-deps output."
Avoid Windows path differences. Skip for simulators (i.e., running from kernel file instead of source).

Change-Id: I7045591f026c392d92f2ec3247ed5b6e1b5e25df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120023
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-04 19:30:06 +00:00
Ryan Macnak 1d5bdb2cee Revert "[vm, bytecode] Fix missing dependencies in --snapshot-deps output."
This reverts commit f2e32b5e65.

Reason for revert: Simulators and Windows

Original change's description:
> [vm, bytecode] Fix missing dependencies in --snapshot-deps output.
> 
> Change-Id: Ib0bcb43f52e0a086174f508222d60b894a5855f8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120004
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=rmacnak@google.com

Change-Id: I0848e2fc5dd4623b2e9d2913ed211cc1da5b73e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120022
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-04 00:21:17 +00:00
Ryan Macnak f2e32b5e65 [vm, bytecode] Fix missing dependencies in --snapshot-deps output.
Change-Id: Ib0bcb43f52e0a086174f508222d60b894a5855f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120004
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-03 22:59:02 +00:00
Teagan Strickland 0e24c2e6e5 [vm/compiler] Don't serialize precompiled constructors.
The code from these precompiled constructors is thrown away,
and if we are adding constants to the LLVM constant pool, then
we may add constants that will not actually appear in the final
program which may cause issues for tree shaking.

If these constructors are actually used, then they will be
recompiled normally.

In addition, we also do not add unreferenced constants to the
constant pool. That is, these constant definitions will not have
an `llvm_index` value in their serialized form when the LLVM
constant pool is populated.

Bug: https://github.com/dart-lang/sdk/issues/38661
Change-Id: I2a3702fd3f174504a5f01458064306cd687d7949
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119339
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-02 10:07:29 +00:00
Teagan Strickland 0e8b94feb8 [vm/compiler] Add snapshot-serialized constant pool.
Bug: https://github.com/dart-lang/sdk/issues/38297
Change-Id: I6a8f1d0a727816e8d7e9cec9d62cc21f9dd7412a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118045
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-24 10:01:47 +00:00
Clement Skau f546362691 [SDK] Adds dart2exe to create standalone executables.
Tested:
  ./tools/build.py --arch x64 --mode release --verbose create_sdk copy_gen_kernel_snapshot copy_dart2aot
  ./tools/build.py --arch x64 --mode product --verbose copy_gen_snapshot copy_dartaotruntime
  cp -r out/ProductX64/dart-sdk/bin/{dartaotruntime,utils/} out/ReleaseX64/dart-sdk/bin/
  out/ReleaseX64/dart-sdk/bin/dart2native ~/src/hello_world.dart
  ~/tmp/hello_world.exe

  dart tools/bots/aot_smoke_tests.dart

  python tools/test.py -n dartkp-linux-release-x64 vm/dart/run_appended_aot_snapshot_test

Change-Id: I149fcd18405cdf0a87b8f4b4072c0f0e8f98c067
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117140
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-23 12:00:08 +00:00
Alexander Markov 125ed45eff [vm] Fix ResolveDynamicAnyArgs to avoid returning incorrect method extractor
Consider the following situation:

class A { foo() {...} }
class B extends A { foo() {...} }

During AOT compilation (in case FLAG_lazy_dispatchers == false)
Resolver::ResolveDynamicAnyArgs was not looking for possible methods
when getter is requested. As a result, if method extractor A.get:foo
has been created, but B.get:foo hasn't, then lookup for B.get:foo
incorrectly returns A.get:foo (instead of null).

Similar situation was previously fixed for a particular call site of
ResolveForReceiverClass (which uses ResolveDynamicAnyArgs):
https://dart-review.googlesource.com/c/sdk/+/30520

However, there are more calls to ResolveForReceiverClass in the compiler
where its incorrect result may be used.

Change-Id: I4ebd6b91157cc048b94e5a5ce182c42dc808f4f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118260
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-20 17:37:05 +00:00
Martin Kustermann a350f6e57d [gardening] Always use Dart binary from checked-in sdk when running gen_kernel in vm/dart tests
This avoids using e.g. a out/DebugX64/dart VM (which is very slow).

This should fix some tests which started to time out.

Change-Id: I6a64e29e5376fbdc91f7170e75c68f90660fabc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116962
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-09-12 12:14:56 +00:00
Martin Kustermann a9a9765eb3 [gardening] Skip dart/run_appended_aot_snapshot_test on simarm_x64
This test assumes `gen_snapshot` is available in the build folder where
the test gets run from. Though simarm_x64 is special in that only
test.py knows about the location of the right `gen_snapshot`.

Therefore we skip this test on simarm_x64 (which is '$builder_tag ==
crossword").

Change-Id: I677c781a970dec358f593c4504051ac515d48d0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116961
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-12 09:23:21 +00:00
Ben Konyi e6887536aa [ VM ] Ignore contexts which have been optimized out during stack overflow checks
Fixes https://github.com/dart-lang/sdk/issues/38182

Change-Id: I2b042b9a320e16fc88bee6ea2c0c93598e574c00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115880
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-09-12 01:20:05 +00:00
Alexander Aprelev dabfda5770 Revert "[vm/compiler] Check def/use relation for PushArguments in environment."
This reverts commit 88e94994b1 as it breaks flutter:

```
[ +192 ms] executing: $FH/engine/src/out/ios_profile_arm/clang_x64/gen_snapshot --causal_async_stacks
--deterministic --snapshot_kind=app-aot-elf --elf=build/aot/app.so --strip --no-sim-use-hardfp
--no-use-integer-division build/aot/app.dill
[+12798 ms] ===== CRASH =====
[   +1 ms] si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x28
[        ] version=2.6.0-dev.0.0.flutter-88e94994b1 (Wed Sep 11 12:00:07 2019 +0000) on "macos_simarm"
[        ] thread=775, isolate=isolate(0x7fe116011200)
[        ]   pc 0x000000010afd1970 fp 0x00007ffee4e6cc30

dart::AotCallSpecializer::TryExpandCallThroughGetter(dart::Class const&, dart::InstanceCallInstr*)
[        ]   pc 0x000000010afd0ee0 fp 0x00007ffee4e6ccf0
dart::AotCallSpecializer::VisitInstanceCall(dart::InstanceCallInstr*)
[        ]   pc 0x000000010b047199 fp 0x00007ffee4e6cd30 dart::FlowGraphVisitor::VisitBlocks()
[        ]   pc 0x000000010b0f9e32 fp 0x00007ffee4e6cd50
dart::CompilerPass_ApplyICData::DoBody(dart::CompilerPassState*) const
[        ]   pc 0x000000010b0f8d84 fp 0x00007ffee4e6cde0 dart::CompilerPass::Run(dart::CompilerPassState*) const
[        ]   pc 0x000000010b0f8fc1 fp 0x00007ffee4e6ce00
dart::CompilerPass::RunInliningPipeline(dart::CompilerPass::PipelineMode, dart::CompilerPassState*)
[        ]   pc 0x000000010b0a3280 fp 0x00007ffee4e6d2f0 dart::CallSiteInliner::TryInlining(dart::Function const&,
dart::Array const&, dart::InlinedCallData*, bool)
[        ]   pc 0x000000010b0af278 fp 0x00007ffee4e6d3d0 dart::CallSiteInliner::InlineStaticCalls()
[        ]   pc 0x000000010b0aa115 fp 0x00007ffee4e6d4e0 dart::CallSiteInliner::InlineCalls()
[        ]   pc 0x000000010b0a9d01 fp 0x00007ffee4e6d5d0 dart::FlowGraphInliner::Inline()
[        ]   pc 0x000000010b0f9fdf fp 0x00007ffee4e6d640
dart::CompilerPass_Inlining::DoBody(dart::CompilerPassState*) const
[        ]   pc 0x000000010b0f8d84 fp 0x00007ffee4e6d6d0 dart::CompilerPass::Run(dart::CompilerPassState*) const
[        ]   pc 0x000000010b0f9271 fp 0x00007ffee4e6d700
dart::CompilerPass::RunPipeline(dart::CompilerPass::PipelineMode, dart::CompilerPassState*)
[        ]   pc 0x000000010afde14e fp 0x00007ffee4e6dd00
dart::PrecompileParsedFunctionHelper::Compile(dart::CompilationPipeline*)
[        ]   pc 0x000000010afdf725 fp 0x00007ffee4e6ded0 dart::PrecompileFunctionHelper(dart::Precompiler*,
dart::CompilationPipeline*, dart::Function const&, bool)
[        ]   pc 0x000000010afdb95c fp 0x00007ffee4e6df80 dart::Precompiler::CompileFunction(dart::Precompiler*,
dart::Thread*, dart::Zone*, dart::Function const&)
[        ]   pc 0x000000010afda83d fp 0x00007ffee4e6dfe0 dart::Precompiler::ProcessFunction(dart::Function const&)
[        ]   pc 0x000000010afd7294 fp 0x00007ffee4e6e010 dart::Precompiler::Iterate()
[        ]   pc 0x000000010afd5274 fp 0x00007ffee4e6e1c0 dart::Precompiler::DoCompileAll()
[        ]   pc 0x000000010afd4ddc fp 0x00007ffee4e6e570 dart::Precompiler::CompileAll()
[        ]   pc 0x000000010b200102 fp 0x00007ffee4e6e630 Dart_Precompile
[        ]   pc 0x000000010ad939cc fp 0x00007ffee4e6e7d0 dart::bin::main(int, char**)
[        ]   pc 0x00007fff5ae163d5 fp 0x00007ffee4e6e7e0 start
[        ] -- End of DumpStackTrace
[   +1 ms] Dart snapshot generator failed with exit code -6
```
Change-Id: I609493026eeed1fbe68adc9aa52a5b872d08bca0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116888
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-12 01:03:36 +00:00
Alexander Markov 315e9c13f5 [gardening] Avoid --deterministic in regress_merge_blocks_with_phis_test
regress_merge_blocks_with_phis_test test uses --deterministic and
low optimization counter threshold which considerably slows it down
and causes timeouts on vm-kernel-win-debug-x64 bot.
This test verifies compilation in OSR case, which doesn't involve
background compilation, so it doesn't need --deterministic.

Verified that the original problem (fixed in https://dart.googlesource.com/sdk/+/5999cd983801c6fc0c4c11f9263236470f569e9a)
still reproduces on this regression test after removing --deterministic.

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

Change-Id: I97ad08121e9864e7d52e4373c7d7fd8bc72e72c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116745
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-11 21:54:59 +00:00
Clement Skau a7e71c3351 [test] Fixes run_appended_aot_snapshot_test in precompiled mode.
Change-Id: I883f3f4cc82df6c591d7c0dec8c71645467c193d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116766
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-11 16:46:38 +00:00
Teagan Strickland 88e94994b1 [vm/compiler] Check def/use relation for PushArguments in environment.
Fix an AOT call specialization that broke this relationship.

When printing environments in the FlowGraphPrinter, also print the
underlying value for any PushArguments.

Change-Id: I39803b7d995abac720702ea4b9d6a78fcbc45d4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115981
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-11 12:00:07 +00:00
Clement Skau 46b58397f8 [Runtime] Adds appended blob runtime mode.
The Dart runtime will be able to load snapshot blobs appended at the end of
itself.
This is a step on the way to a self-contained native executable.

Tested:
  $ dart2aot hello_world.dart hello_world.aot
  $ <Some steps to hand-craft appended binary ..>
  $ dartaotruntime_plus_hello_world.bin
  Hello, world!

  python tools/test.py -n dartk-linux-debug-x64 vm/dart/run_appended_aot_snapshot_test

Change-Id: I79d5500c4e2668da31cf1d27145296d17470e04c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112382
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-11 10:56:57 +00:00
Robert Nystrom 89ad636b58 Remove the old "preview Dart 2" flags from the test runner.
Dart 2 shipped a year ago, so we're pretty well past a "preview". :)

Change-Id: I6c5d21ae4181e4228cc1fc49b6344cdb8fc43794
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115544
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Mayank Patke <fishythefish@google.com>
Auto-Submit: Bob Nystrom <rnystrom@google.com>
2019-09-05 16:59:43 +00:00
Alexander Markov 5999cd9838 [vm/compiler] Account for phis in the successor block when merging blocks
This fixes language_2/control_flow_collections/for_inference_test
with bytecode and --optimization-counter-threshold=5.

Change-Id: I61ea83c92ea04a71edf564a9a68b57af1a17103f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115077
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-03 17:42:01 +00:00
Teagan Strickland 1f9bf308b2 [vm/compiler] Early work on IL deserializer.
At this point, we do get some successful deserializations (of
methods that are optimized into constant value returns).

Adds support for:
  GraphEntry (including constant pool)
  FunctionEntry
  TargetEntry
  Return

Results from compiling hello world program:

* Early round trip
    * Contains unhandled instructions: 4180
    * Failed during deserialization: 0
    * Successful round trip: 0
* Late round trip
    * Contains unhandled instructions: 4163
    * Failed during deserialization : 0
    * Successful round trip: 15

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I9e0919f6ffbfe059ce0efd55f9a767c1ba805795
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113325
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-08-29 15:49:59 +00:00
Samir Jindel 2e2d5bcca6 [vm] Make v8_snapshot_profile_writer_test less flaky and avoid user error with crossword config.
Fixes https://github.com/dart-lang/sdk/issues/37834

Change-Id: Ida9010a8294f2ab6e06969c671575f80c58b6697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114850
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-29 12:03:43 +00:00
Martin Kustermann dfbb9083c6 [vm] Allow vm tests to import private platform libraries for testing purposes
Issue https://github.com/dart-lang/sdk/issues/36097

Change-Id: I1acec0b7c683ffa363e9b6f7056e76ea2f61d27d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114843
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-08-28 10:19:22 +00:00
Teagan Strickland ab54ea60e5 [vm/compiler] Add the framework for the IL deserializer.
This adds in a version of the IL deserializer that doesn't actually do
any deserialization yet.

However, it adds in a couple of compile passes that passes the FlowGraph
for compiled functions through the serializer and deserializer.  If the
deserialization step succeeds, then the FlowGraph stored in the
CompilerPassState is replaced with the new FlowGraph for the rest of the
compiler.

Also change the default zone handling in the FlowGraphSerializer to use
the zone for the current thread, instead of the zone stored in the
FlowGraph, so that it is appropriately affected by StackZone uses.

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I8fa1c7af434f724ccec45ddb73263f84730af5b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113184
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-08-26 08:58:23 +00:00
Martin Kustermann 68e805f9f6 [vm/cocurrency] Add simple spawn function test and test with/without isolate groups
This fixes also an issue when running without isolate groups.

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

Change-Id: I0fb64b3f2b755ccab4c36c6a0fafee7edff239cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114204
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-08-23 15:15:58 +00:00
Ben Konyi 1219c5e3ab [ VM / Service ] Use the name of the a function's defining mixin instead of the
mixin application to qualify function names in profiler and exception stack traces.

Given:

```
class Foo {
  foo() => "foo";
}

class Bar with Foo {}
```

The stack frame for `foo()` currently displays as `Bar&Foo.foo`. Now,
the stack frame for `foo()` will have the name `Foo.foo`.

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

Change-Id: Ic1c0d00f38725ee088812ff0926eef4f343ebdf1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111482
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-08-15 21:10:47 +00:00
Alexander Markov 896c053803 Enable vm/cc tests on dartkb bots
Change-Id: Ibde7a25180c550b556b98ef70ed611d42f4acd97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112651
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-12 16:19:06 +00:00
Teagan Strickland 48f18231ba [vm/compiler] More serialization support for closures and instances.
* Adds non-static final field printing for `Instance`s
* Adds specialized printing for `Closure`s (tearoffs).
* Instances of `Mint` and `Type` can also appear in constant
  pools, so handle both in ObjectToSExp.
* DartValueToSExp is a wrapper method for ObjectToSExp that
  also checks to see if the value is defined in the constant
  pool. If it is, the object is serialized as a reference to
  that definition.
* Reworks the `tmp_*_` fields used for non-reentrant cases
  to be per function to make it easier to understand how they
  interact. (Only cross-function tmp field that remains is
  `tmp_string_`, since its contents are always immediately
  converted to a C string and then no longer needed.)

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: Ibad4bc2497dd1f580d1daa536c4a267818981c14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111425
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-07 08:28:18 +00:00
Teagan Strickland f822dfa3ea Reland "[vm/compiler] Implement new inlining pragmas."
This change introduces two new pragmas:

* `@pragma('vm:never-inline')`
* `@pragma('vm:prefer-inline')`

These replaces the old way of specifying AlwaysInline or NeverInline
annotations when the (now removed) --enable-inlining-annotations flag
was used.

Bug: https://github.com/dart-lang/sdk/issues/36571
Change-Id: Iee152c1d67abde8d58c58fa967449d36e77c8c93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110440
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-07-30 12:01:06 +00:00
Alexander Markov 575f5c8b90 Revert "[vm] Fix uri/path discrepancy preventing running snapshots via spawnUri"
This reverts commit c4b829ba2c.

Reason for revert: failures on several bots:

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8906839588400817728/+/steps/test_results/0/logs/unapproved_failing_tests__logs_/0

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8906839597885007504/+/steps/test_results/0/logs/unapproved_failing_tests__logs_/0

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8906839588760701184/+/steps/test_results/0/logs/unapproved_failing_tests__logs_/0

Original change's description:
> [vm] Fix uri/path discrepancy preventing running snapshots via spawnUri
> 
> Change-Id: I718d7012d074b73eacfb0d4922fc744b6d2bd77b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110547
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

Change-Id: Id43441d2259a17dff538c95d455a3839b284cad3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110800
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-26 21:27:23 +00:00
Mike Fairhurst c4b829ba2c [vm] Fix uri/path discrepancy preventing running snapshots via spawnUri
Change-Id: I718d7012d074b73eacfb0d4922fc744b6d2bd77b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110547
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-07-26 20:27:11 +00:00
Alexander Markov fedd74669a [vm/bytecode] Support multiple entry points when compiling from bytecode
DeltaBlueClosures +26.54%

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

Change-Id: I8920c7985366a2c955a06013aa9f58763fcbced9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109580
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-20 00:05:23 +00:00
Alexander Markov 09418f4402 [vm/tests] Re-enable tests for multiple entry points, take 2.
Closes https://github.com/dart-lang/sdk/issues/37144

This is a re-land of 00eb034de7.

Change-Id: Ib46d4590de460a520415280b3253e75d8f947b81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109584
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-19 00:21:35 +00:00
Alexander Markov 38deecec39 Revert "[vm/tests] Re-enable tests for multiple entry points"
This reverts commit 00eb034de7.

Reason for revert: test failure on vm-kernel-optcounter-threshold-linux-release-x64 bot

Original change's description:
> [vm/tests] Re-enable tests for multiple entry points
> 
> Closes https://github.com/dart-lang/sdk/issues/37144
> 
> Change-Id: I9935db44cf01dda106c9211978dca33aac7fcb16
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109551
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Alexander Markov <alexmarkov@google.com>

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

Change-Id: I582c014c4e02216be1575609aa950e8afb7e0702
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109600
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-18 23:16:21 +00:00
Alexander Markov 00eb034de7 [vm/tests] Re-enable tests for multiple entry points
Closes https://github.com/dart-lang/sdk/issues/37144

Change-Id: I9935db44cf01dda106c9211978dca33aac7fcb16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109551
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-07-18 22:11:10 +00:00
Teagan Strickland 2b3336b51e [vm/compiler] Initial IL serialization implementation.
Adds the --serialize_flow_graphs_to flag, which takes a
filename to which to serialize all compiled functions.
This flag is only active for the AOT compiler.

Bug: https://dartbug.com/36882
Change-Id: Ib7e328ad93373168806539f0a61ec0a07506a51d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107400
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-07-17 09:11:15 +00:00
Siva Annamalai 27001fb289 Revert "[vm/compiler] Implement new inlining pragmas."
This reverts commit 629f38cf87.

Reason for revert: This CL seems to depend on constant_update_2018 flag being turned on by default. The CL that turns on constant_update_2018 has been reverted, so this CL is also being reverted.

Original change's description:
> [vm/compiler] Implement new inlining pragmas.
> 
> This change introduces two new pragmas:
> 
> * `@pragma('vm:never-inline')`
> * `@pragma('vm:prefer-inline')`
> 
> These replaces the old way of specifying AlwaysInline or NeverInline
> annotations when the (now removed) --enable-inlining-annotations flag
> was used.
> 
> Bug: https://github.com/dart-lang/sdk/issues/36571
> Change-Id: I2495c72819d94e43cefc837d4eb454b7b3d4140c
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99148
> Commit-Queue: Teagan Strickland <sstrickl@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>

TBR=sjindel@google.com,sstrickl@google.com

Change-Id: Idc8e8344adb026a308af20c8b0d0224edb891d9c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/36571
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/109320
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-07-16 22:33:00 +00:00
Teagan Strickland 629f38cf87 [vm/compiler] Implement new inlining pragmas.
This change introduces two new pragmas:

* `@pragma('vm:never-inline')`
* `@pragma('vm:prefer-inline')`

These replaces the old way of specifying AlwaysInline or NeverInline
annotations when the (now removed) --enable-inlining-annotations flag
was used.

Bug: https://github.com/dart-lang/sdk/issues/36571
Change-Id: I2495c72819d94e43cefc837d4eb454b7b3d4140c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99148
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-07-16 09:41:12 +00:00