Commit Graph

15893 Commits

Author SHA1 Message Date
Aart Bik 95d7749f48 [vm/compiler] OSR on non-empty stack integrity
Rationale:
Leaving a push argument on the stack in slightly more
complex flow graphs (try-catch, loop back, conditinals)
required a bit more bookkeeping. This CL also introduces
more integrity checks to make sure the stack is as
expected at each block and instruction.

Note:
Fuzzer is regression test for new feature.

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

Change-Id: I8f7e605937d76c1a429df601e69380111737dd94
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116545
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-13 00:58:24 +00:00
Aart Bik 683dca0e9a [vm/fuzzer] Fix an inconsistency with local names
Rationale:
Some expression have the property that a variable has been declared
but cannot be used yet (viz.  T x = .... no x ....). The old
fuzzer would avoid this by only introducing x after the declaration.
However, now that we also allow for-loops inside expressions
due to control flow collections, this mechanism would start
to hide local names since the bookkeeping was off. This PS
fixes that by introducing "typeless" locals, which are in
scope, but cannot be lvalled yet.
Change-Id: I11f752dc8b85305644901faad1ac7814424a9c1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117120
Reviewed-by: Felicitas Hetzelt <felih@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-09-13 00:27:40 +00:00
Ryan Macnak d7dc524b5f [vm, bytecode] Use call-scoped temporaries for NativeArguments to reduce the frame size of Interpreter::Call.
This reduces the frame size of Interpreter::Call on Clang x64 from 3544 to 216, and so fixes the stack overflow errors in the kernel service when compiling tests/language_2/deep_nesting_*.  Unlike gcc, Clang would give each local NativeArguments a separate spill slot even though they have disjoint lifetimes.

Change-Id: Ib8a1168544f6a590703ba2ea627fcd8452503eab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117061
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-13 00:01:27 +00:00
Felicitas Hetzelt a09845fe3d [vm/fuzzer] Track and print invalid test cases
Rationale:
To make debugging timeouts and skipped test cases easier, we
print them at the end of each isolate run.
Change-Id: I953c9103341dcf23616e2b550af5ebb5ce17739b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117060
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-09-12 23:49:17 +00:00
Zichang Guo 35d1333c2f [vm] remove token position for ExceptionHandlers
Remove this unnecessary field. Both ExceptionHandlerList and ExceptionHandlers not use token position. TokenPosition passed from CatchBlockEntryInstr() is always NoSource.
Change-Id: I3857ff3d1f9217f565c2d159fa980350ebd4bc47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117040
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-09-12 21:48:32 +00:00
Alexander Markov cfd1efc0d9 [vm/bytecode] Fix getting of target of dynamic invocation forwarder
Before this change, there were 2 ways of getting target of dynamic invocation
forwarder: Function::GetTargetOfDynamicInvocationForwarder() which looks up
using the name, and Function::ForwardingTarget() which returns a target saved
when dynamic invocation forwarder was created.

Apparently we should use Function::ForwardingTarget() when compiling dynamic
invocation forwarder, as we might find a different function after hot reload.

It was the last use of GetTargetOfDynamicInvocationForwarder(), so cleaned it up.

Fixes language_2/flatten_test/01 with bytecode in hot reload mode.

Change-Id: Ibe3117c16509fe5d94fcdd1a2a2b12f2049efad2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117014
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-12 21:23:52 +00:00
Alexander Aprelev 68022510a4 Revert "[vm, service] Remove _collectAllGarbage."
This reverts commit 09ce6d30e7 as it
breaks Flutter, which currently uses this method.

Change-Id: I2a06d48260970cc086a922f1d1f87d17716e8920
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117006
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-12 18:41:08 +00:00
Zichang Guo 59bcc4ea1e [vm/kernel] record yield positions at streaming flow graph builder
Collect yield positions inside StreamFlowGraphBuilder. BuildGraph() when yield_positions() are required. All yield positions will be stored into script as a hashmap. Key of hashmap is the starting token position of function, value is an array containing all yield positions.

Bug: https://github.com/dart-lang/sdk/issues/37635
Change-Id: I6d301d1cb0f74c432f855c9dbc20ac2c13acb07f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116743
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-09-12 16:37:16 +00:00
Teagan Strickland 420b292410 [vm/compiler] More work on the IL serializer.
Adds support for:
  AssignAssertable
  BooleanNegate
  LoadClassId
  NativeCallInstr
  Throw

Results from compiling hello world program:

* Early round trip:
  * Contains unhandled instructions: 1565
  * Failed during deserialization: 10
  * Successful round trips: 2696
* Late round trip:
  * Contains unhandled instructions: 2404
  * Failed during deserialization: 12
  * Successful round trips: 1755

Deserialization failure reasons:
* Early round trip:
  * no handling for local functions: 10
* Late round trip:
  * no handling for local functions: 7
  * out of range index for pushed argument: 5
    (see https://github.com/dart-lang/sdk/issues/38354)

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I56f875a68876b4d94ac1256be207df8b98ba0ea0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116320
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-09-12 14:18:40 +00:00
Teagan Strickland ebf1f01ca5 [vm/compiler] Continued work on the IL deserializer.
Adds support for:
  AssertBoolean
  InstanceCall

Also handles deserializing of TypeRefs and
serialization/deserialization of non-megamorphic
ICData.

Results from compiling hello world program:

* Early round trip:
  * Contains unhandled instructions: 2469
  * Failed during deserialization: 9
  * Successful round trips: 1772
* Late round trip:
  * Contains unhandled instructions: 2892
  * Failed during deserialization: 11
  * Successful round trips: 1268

Deserialization failure reasons:
* Early round trip:
  * no handling for local functions: 9
* Late round trip:
  * no handling for local functions: 6
  * out of range index for pushed argument: 5
    (see https://github.com/dart-lang/sdk/issues/38354)

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I7a3731d4cc3df0bfa1e270adbdfc2faddd110af0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115219
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-12 13:29:26 +00:00
Dmitry Stefantsov bdf237fa77 [cfe] Add a bit to Library to inticate if it's opted in for NNBD
Closes #37682.

Bug: http://dartbug.com/37682.
Change-Id: Ibe21cd0a1eac25a2883d2e2241d7476ca627edba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114857
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2019-09-12 12:15:56 +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
Régis Crelier 596a4ab14d [vm/bytecode] No need to set breakpoints in bytecode if interpreter is not used.
Breakpoints are still set in compiled bytecode.
When the interpreter is used, breakpoints are set in both interpreted and
compiled bytecode, as before.
This fixes service/breakpoint_async_break_test in app-jit mode.

Change-Id: Ia60f6f99497821b476b664fe8b86ee4aa15748a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116840
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-12 01:01:35 +00:00
Alexander Aprelev 0c481a196c Revert Reland '[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).' as it breaks flutter profile execution on ios 32-bit platform.
Fixes https://github.com/flutter/flutter/issues/40114

Change-Id: If8d71e9c19c2e794d29f7ecbacb87457890a2fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116883
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-12 00:10:09 +00:00
Alexander Markov 586869c3f6 [vm/bytecode] Fix iteration of bytecode local variables
Previously, BytecodeLocalVariablesIterator::IsDone() returned true
when iterator was standing at the last entry.
As a result, if the last entry is a scope without variables, then it was
ignored and bytecode flow graph builder would not get a correct context
level for that scope.

The fix is for IsDone() to return true only after stepping past the last
entry.

Fixes service/async_generator_breakpoint_test/1 with bytecode.

Change-Id: I768eec9a0e43342cc0f155a6c35cb3de50f3d14a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116880
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-11 23:46:29 +00:00
Felicitas Hetzelt c8e389ff62 [vm/fuzzer] List versions for each git commit
Rationale:
Go through all git commits and list dartfuzz versions.
Change-Id: I2d6ac23fcff51631a40a97bb53289fd60e65000c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116747
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-09-11 22:54:29 +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
Ryan Macnak fb2e6c6d0d [test] Remove non-kernel versions of service tests.
Change-Id: I3b849e5af72a021208836d98e251d771740c80dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116553
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-11 16:55:47 +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
Teagan Strickland 488a8ae69b [vm/compiler] Don't propagate non-constants as constants.
Change-Id: Icf56be9657c16596adfdd3083f1154c53933d10b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116524
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2019-09-11 11:19:57 +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
Ryan Macnak cbdbb464ca [vm] Repair fingerprinting of recognized methods.
Bug: https://github.com/dart-lang/sdk/issues/36376
Change-Id: I8102d5d10abc98e4410c16d0d08bf5015e459b46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116481
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-11 01:11:34 +00:00
Felicitas Hetzelt 1e9a065dad [vm/fuzzer] Restrict depth of ... operator
Rationale:
Causes bugs in compiler
Change-Id: I11039e0efa8ea97d576b7527554dc26499c492d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116700
Commit-Queue: Felicitas Hetzelt <felih@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-09-11 01:08:54 +00:00
Felicitas Hetzelt a0fd607d10 [vm/fuzzer] add missing space
Change-Id: I39e4bf30a908a77dc96b2a1fb81f2251705de3be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116543
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-09-11 00:40:44 +00:00
Aart Bik 13ba681398 [vm/compiler] DIV/MOD magic for ARM64
Rationale:
Follow up on prior CL, now with the ARM64 version.
Unit tests were included in that previous CL.
(https://dart-review.googlesource.com/c/sdk/+/114901)

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

Change-Id: I6177b48743cd615914dbfbddab166a6c71ef71c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115064
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-09-10 23:55:32 +00:00
Ryan Macnak 03b195164b Revert "[vm, snapshot] Use data image pages for kFull snapshots."
This reverts commit c8f3f132ad.

Revert "[vm] Fix CoreSnapshotSize and StandaloneSnapshotSize to account for the image page size."

This reverts commit 1d6ab52f38.

Bug: b/140791872
Change-Id: I34c42310e3ec4a09048967f34a0e1ddc6a67ea93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116688
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-10 23:52:52 +00:00
Aart Bik 5303538a09 [vm/fuzzer] re-enable control flow collections
Rationale:
Let's stress test this feature again. Note
that this will increase the number of skipped
tests quite a bit since the CFE complains
about a lot of the generated constructs.
It is still TBD to find out if this is
in the grammar or in the FE.

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

Change-Id: Iec4bcb2aa9039f5b01293f82e3e156cc2e35414f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116663
Reviewed-by: Felicitas Hetzelt <felih@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-09-10 23:09:58 +00:00
Aart Bik 2305d9f3a6 [vm/compiler] Better be ready for OSR in field init
Rationale:
OSR was happening in a field initializer, but the kernel
binary flow graph builder assumed this never happened.
With regression test.

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

Change-Id: I91243b4422cac76ec7ee2460d466bd0e1cf608ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116558
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-09-10 22:17:22 +00:00
Régis Crelier 64360e9f1a [vm/bytecode] Do not expect _ClosureCall in interpreted async stack traces.
In interpreteted bytecode mode, _AsyncAwaitCompleterStart does not use
_ClosureCall to invoke the async_op function. Adjust expectations in debugger
when collecting async stack trace.
Refactor computation of try_index in interpreted mode.

Fixes service/pause_on_unhandled_async_exceptions_test in interpreted mode.

Change-Id: Id13c36e2616e55911f77eb4db2591861d337d24a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116556
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-09-10 21:52:38 +00:00
Felicitas Hetzelt ca7baa4013 [vm/fuzzer] Add virtual methods
Rationale:
Randomly overvwrite some methods of the parent in the child classes.
Change-Id: I64533c255915d3c1614ba41883ed6b5fd319c5c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115009
Commit-Queue: Felicitas Hetzelt <felih@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-09-10 18:38:01 +00:00
Felicitas Hetzelt 2b966a9743 [vm/fuzzer] Fix reproduction output
Rationale:
Add space between fp and seed parameter. Check whether generate variable
is set in TestRunnerKBC.
Change-Id: I3f1b21b65e75286d2ca560d9fa8c05ed3e4e5f55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116542
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-09-10 18:30:51 +00:00
Ryan Macnak 7bbfd532de [vm, reload] Remove _getUnusedChangesInLastReload.
This function has been unused for a long time.

Also, computing fingerprints for bytecode function causes bytecode to be loaded, which can lead to an old enum class being initialized with enum values for the new enum class, causing a forwarding loop when migrating enum values.

Change-Id: Iad9b2bb11aaf161d66f7752cb99cc4b4fc9fb310
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116442
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-10 17:36:24 +00:00
Martin Kustermann 300c3333d1 [gardening] Always tag class_id register on arm64 in subtype test cache stub
LoadClassById no longer tags class_id register as side-effect. This change
was missing for arm64 in ef9d699f.

Change-Id: I92278b01ec2211dc9be860c1a5386ecd4253fb0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116526
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-09-10 15:34:46 +00:00
Martin Kustermann 6717bfe423 [vm/concurrency] Lock weak table to prepare for concurrent access.
Right now there is only one mutator working on a heap and it can
therefore access the heap's weak maps without locking. The GC is the
only other user of the weak maps and it accesses it within a safepoint
operation scope.

Once we move the heap to the isolate group there can be concurrent
accesses to the weak maps. As a preparation step this CL adds locking
around the non-GC API.

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

Change-Id: I84acce24612b12a7393154cab816f0eff9c7589a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116201
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-10 14:33:46 +00:00
Martin Kustermann 9357b48a8d [gardening] Use target::kWordSizeLog2 instead of kWordSizeLog2 on arm (fixes broken build)
Change-Id: I669387d5a8dbc13de0f94181065f871a46613589
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116523
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-09-10 13:37:49 +00:00
Martin Kustermann ef9d699f07 [vm/concurrency] Move all information except for the class pointers out of [ClassTable] into [SharedClassTable]
This CL moves heap related information (namely instance sizes and
allocation stats) out of the [ClassTable] into a [SharedClassTable].
Both classes are always in sync (i.e. they have the same number of entries).

This CL also changes GC related code to start using the size information
from the new [SharedClassTable].

In a futher step we will move the heap as well as this shared class
table out of the [Isolate] and into [IsolateGroup].

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

Change-Id: Id54a89c9251ad3bbc13e60d32dc4f7bcc7f1d805
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116064
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-10 12:48:16 +00:00
Ben Konyi 62f78a7abb [nit] Fixes two typos: build flag and error string.
Change-Id: I0e0b7a8aeb113dc82177a8e1c9acd4c3e0b715ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115706
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2019-09-10 11:31:46 +00:00
Dmitry Stefantsov ccb6ba948b [cfe] Gather constraints from both possibilities for FutureOr
Closes #37778.

Bug: http://dartbug.com/37778.
Change-Id: Ia8828c27ccc912831a0fea8a473c547184c99229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115243
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-09-10 09:50:30 +00:00
Régis Crelier 9fccb5120b [vm/bytecode] Fix clobbering of exception handler types in bytecode reader.
This fixes service/pause_on_unhandled_async_exceptions_test in compiled bytecode
mode, but not yet in interpreted bytecode mode.
Improve debugger verbosity.

Change-Id: I89e32179b0a3f043716d5117f958bf6a0de3ccac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116483
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-10 02:03:39 +00:00
Felicitas Hetzelt 424ef3646e [vm/fuzzer] Print steps to reproduce on divergence
Change-Id: I0bf112e42c3b1d2575fac89adab0462b0fe34ded
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116420
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Felicitas Hetzelt <felih@google.com>
2019-09-10 00:35:54 +00:00
Alexander Markov 76bc894576 [vm/bytecode] Generate explicit DebugCheck for assignment to static field
Instead of always implying debugger stop at StoreStaticTOS bytecode,
bytecode generator now explicitly generates (or omits) DebugCheck bytecode.
This is needed to match behavior of AST flow graph builder of omitting
extra debugger stops when RHS expression is not trivial.

Fixes service/debugging_test with bytecode.

Change-Id: Id2e70998efb2a32a101fba4133ffa6a259ab1eb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116443
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-09 23:24:09 +00:00
Alexander Aprelev 95db62d6a2 [vm/io] Return data right away if it's ready.
This fixes problem with directory watching on Windows where data might be accumulated before dart stream is setup.

Bug: https://github.com/dart-lang/sdk/issues/37909

Change-Id: I601842522e76e4a6a4e6a22d6b376a49af200e6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115801
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-09 23:16:52 +00:00
Alexander Markov ef2a21ffd9 [vm/bytecode] Use local variable information when compiling from bytecode
This includes types and names of local variables.
Fixes vm/cc/IRTest_TypedDataAOT_FunctionalGetSet with bytecode.

Change-Id: I6130f19b4028f4930dbfcb282b90dd2ec4f963e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116082
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-09 19:23:16 +00:00
Alexander Markov c2e55a26bc [vm/bytecode] Cleanup support for old bytecode format versions before v10
Version 10 of bytecode format was introduced Jun 20 2019 in
da8cb470cc.

Change-Id: I9c895b101ad18b5fc62e8aa736b6811e73efba7a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116121
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-09 17:59:45 +00:00
Ryan Macnak 2e8d912848 [developer] Allow async end events to have independent arguments.
This matches the behavior in the Chrome and Fuchsia tracing macros.

Change-Id: I7e5759409af5262e6e2596384c67a2eb70d48cd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114545
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-09 17:00:47 +00:00
Ryan Macnak 09ce6d30e7 [vm, service] Remove _collectAllGarbage.
System.gc() considered harmful.

Change-Id: I227a092e7734176b55c269f4f611ef1d4293da99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116044
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-09-09 16:56:27 +00:00