Commit graph

11255 commits

Author SHA1 Message Date
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
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
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
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 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
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
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
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 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 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
Alexander Markov 13a69b5631 [vm/bytecode] Replace ICData constant pool entries with DynamicCall
VM no longer relies on distinct ICData entries in constant pool, and
it no longer creates actual ICData objects.

This change introduces new DynamicCall constant pool entry which is
 * de-duplicated;
 * stores arguments descriptor inline instead of allocating a separate
   constant pool entry and referencing it by index;
 * reserves extra slot in constant pool (like other call constants), so
   we can eventually remove creation of extra UnlinkedCall objects.

Change-Id: I8d21954803ca5be5b6fc8335b700e8a9086245cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116120
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-07 02:17:37 +00:00
Régis Crelier c0f49b05dd [vm/debugger] Pick the correct context async variable in bytecode frames.
Variable descriptors constructed from bytecode have all variables of
enclosing functions, even shadowed by the current function.
Pick the variable with the highest context level.

This fixes service/regress_28443_test.dart failure in bytecode mode.

Change-Id: Ifd0db566b5e74d29075ed17e91810ffe6953af77
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116140
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-09-07 01:08:19 +00:00
Ben Konyi 68dede011e [ VM / Service ] Add getCpuProfileSamples RPC which returns a minimally processed sample buffer.
Change-Id: Ic0a47d5eea692b235327622508d904f7396babe3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112265
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-07 01:04:08 +00:00
Ryan Macnak 84db16381d [vm] Remove dead --load_deferred_eagerly and dependent code tracking for library prefixes.
Since Dart 2, library prefixes are always loaded eagerly on the VM.

Also remove reload check for deferred prefixes. This check was added to avoid behavior of library prefixes giving spurious "not loaded" errors after a reload, but now this error can never occur. Resolves a difference in reload between AST and bytecode modes, since bytecode mode isn't surfacing the deferred property.

Change-Id: Ide5fb6cac2efc90ca1b108a35bc09d342cbd60de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116051
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-09-06 23:37:33 +00:00
Ryan Macnak 1d6ab52f38 [vm] Fix CoreSnapshotSize and StandaloneSnapshotSize to account for the image page size.
Should have been part of c8f3f132ad.

Change-Id: I2a346f66490e6e97d846d4646ca7042be0b19cb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116101
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-06 23:36:19 +00:00
Martin Kustermann f5c0e2e362 [vm/concurrency] Ensure instance size in class table is either 0 or the correct size
Until now it was possible to register classes with a default size (16 bytes on 64-bit)
and later on change the size for the cid.

This CL changes this to ensure the size information in the class table
for a given cid is either 0 or the final instance size (and adds an
ASSERT for it)

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

Change-Id: I94c61c6a1566c13dec7b9eb80c9ae0dadf0e6b6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115861
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-06 22:06:30 +00:00
Alexander Markov 8ad0832bcb [vm/bytecode] Use static types of parameters when compiling from bytecode
Change-Id: Iefcad78db4bd05542ff5c05ebf298bfa6154810f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115773
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-09-06 21:04:09 +00:00
Régis Crelier 6f4ceb887e [vm] Provide a couple more gdb helpers to print stack traces.
Use with caution.

Change-Id: Ic2a3055ede694406596596d57ba54909a6985cde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116080
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-09-06 19:25:31 +00:00
Ryan Macnak c8f3f132ad [vm, snapshot] Use data image pages for kFull snapshots.
- Enables writing bytecode's PcDescriptors on when IA32 writes app snapshots.
 - Breaks word-size portability of kFull snapshots.

Change-Id: I896d104260593b146ad15e1845e391ae765e60e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115341
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-06 18:24:19 +00:00
Aske Simon Christensen 0242f0c724 [kernel] FileUriExpression node
Change-Id: I8ea3cbeb17d555cebd6d693fbf2bb3148e9f2db3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114321
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-09-06 12:22:09 +00:00
Ryan Macnak f4229da6ab [vm, bytecode] Produce compile-time errors instead of crashing when failing to resolve libraries etc.
Compare c3043367cd, which did the same for the kernel loader.

Causes tests involving libraries with data URIs to fail the same way during reload testing with ASTs and bytecode.

Change-Id: I7ade75e427eefa666b89c48ced70b574160fceb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115764
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-05 21:59:31 +00:00
Martin Kustermann a64b06ec83 [gardening] Migrate most files to be implicit-bool-conversion free
Issue https://dart-review.googlesource.com/c/sdk/+/115701

Change-Id: Ib579f0bbc8d694aec74afd837217316a10baf910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115707
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-09-05 21:41:42 +00:00
Aart Bik d9a9346c3f [vm/compiler] Fix truncating logic
Rationale:
The representation mask should not be used to
do the truncation, which is more subtle around
the sign bit. With regression test.

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

Change-Id: I9745f6d73f4761eb6210e0b60b2b0504994f5cbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115607
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-09-05 21:13:43 +00:00
Samir Jindel c219a76652 Reland "[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs)."
The original change is in Patchset 1.
The dependency contains the fix for the non-bare-instructions bot.

Change-Id: Iab02ab0736a2ee9144b667d2777ca526341b2a36
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-bare-linux-release-x64-try,vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115241
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-05 20:19:22 +00:00
Ben Konyi 9a847a98e8 [ VM / Service ] Fix docs for @Instance not including optional closureFunction and closureContext fields
Fixes https://github.com/dart-lang/sdk/issues/37989

Change-Id: I1e59dc9d27bc5c032d964207dca67bd8f4ce68ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115610
Reviewed-by: Gary Roumanis <grouma@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-09-05 18:53:32 +00:00
Aart Bik 8ee3f314cb [vm/gardening] clang tidy fixes
https://github.com/dart-lang/sdk/issues/38196

Change-Id: I0a61eae20d8cfc1c2ada8d6a607d437d02136d33
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115609
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-09-05 17:00:33 +00:00
Ryan Macnak edceedff90 [vm, reload] Allow any change to a class that hasn't yet been declaration loaded.
Change-Id: I3da7a2f156e4b2cb1a60597d66f4514c1563785c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115560
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-05 16:51:39 +00:00
Ryan Macnak a7723d5c40 [vm] Out-line handle allocation.
Handle allocation is extremely common, and it always already has a call to VMHandles::Allocate[Zone]Handle, so we save a lot of binary size by avoiding inlining the TLS and initialization code.

-488k (-2.04%) out/ProductX64/exe.stripped/dart
-256k (-5.07%) out/ProductX64/exe.stripped/dart_precompiled_runtime

Change-Id: I677005c9653c87597ba20144b4326b66d0bf0ee5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115608
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-09-05 16:43:33 +00:00
Teagan Strickland 7d0266a604 [vm/compiler] Fix use of enum value as bool in serializer.
Also fix check that a new value hasn't been added to the
StoreBarrierType enum.

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I8d781948082b45011466a9cc735ba2c94f130ea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115708
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-05 14:48:03 +00:00
Clement Skau b31566b297 [nit] Adds missing newlines to error prints.
Bug: 132924757
Change-Id: I1354534bfac13006897f204990270d636fc0063f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114519
Auto-Submit: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2019-09-05 12:56:49 +00:00
Johnni Winther 34004f7f6b [cfe] Support modular compilation of extensions
Includes serialization/deserialization of Extension and
ExtensionMemberDescriptor.

Change-Id: I04df581355b0d6f9e6bfa638241c8b7f210d3ce5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115369
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-09-05 11:19:53 +00:00
Teagan Strickland 4525105db9 [vm/compiler] Add support for more instructions to deserializer.
Adds support for:
  AllocateObject
  CheckNull
  LoadField
  StrictCompare

Results from compiling hello world program:

* Early round trip:
  * Contains unhandled instructions: 3065
  * Failed during deserialization: 6
  * Successful round trips: 1109
* Late round trip:
  * Contains unhandled instructions: 3085
  * Failed during deserialization: 7
  * Successful round trips: 1086

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I09d25ca413a9facd27ba5a1b81e72a1fd126a3cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114860
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-05 10:36:13 +00:00
Teagan Strickland 7c8c197559 [vm/compiler] More work on the IL serializer.
Adds support for:
  DebugStepCheck
  StoreInstanceField

Also:
* Adds context information to closure serialization.
* Adds parsing for serialized Closure and Slot values.
* Gets rid of some two-value enums in il.h that were acting as bools.

Results from compiling hello world program:

* Early round trip:
    * Contains unhandled instructions: 3433
    * Failed during deserialization: 2
    * Successful round trips: 745
* Late round trip:
    * Contains unhandled instructions: 3562
    * Failed during deserialization: 3
    * Successful round trips: 613

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I409b232b64c4847623378462fc993460a858acb1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114840
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-05 10:34:43 +00:00
Régis Crelier 15c1487874 [vm/bytecode] Allow breakpoint on rethrow; mark closures as debuggable or not.
Generated rethrow statements do not require a 'DebugCheck', but explicit rethrow
statements do, so that user breakpoints can be set on rethrow.
Add a IsDebuggable flag on bytecode closures and set it properly.
Remove unused code in a service test.
Add verbosity to debugger.

Change-Id: Ia436cbe62e38cfaec6f9fdf7f8cc2ee5607228e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115602
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-04 23:56:16 +00:00
Aart Bik 6be60a76e4 [vm/compiler] fix missing unbox code
Rationale:
Two safe non-speculative cases were missing,
causing AOT to crash on some fuzzing sessions.
Note fuzzer is regression test here.

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

Change-Id: I12c633d66e387c703f1bcf0b6eebd50165bb2970
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115445
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-09-04 20:40:31 +00:00
Alexander Markov ea5f0db671 [vm/bytecode] Load bytecode class declaration when referencing class from type in AST
When running from a dill file with AST on the VM with bytecode, we should
ensure that bytecode class declarations are loaded when class is referenced
from a type in AST. Otherwise we could attempt to finalize a type without
proper class declaration.

This change fixes pkg/vm/test/transformations/protobuf_aware_treeshaker/treeshaker_test
with bytecode.

Change-Id: I7a9975e1af6b9e04575f41c5e78b1c2154106e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115460
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-04 19:45:11 +00:00
Ryan Macnak 67bb2b7819 [vm, compiler] Consistently use CallTargets instead of ICData or MegamorphicCache.
Bug: https://github.com/dart-lang/sdk/issues/37575
Change-Id: I15f3862af380b04498cb58c8658aa6de76212733
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114445
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-04 18:49:40 +00:00