Previously when --save-debugging-info=<...> was used when not
compiling to ELF, we generated the requested snapshot format
and the separate debugging information as two separate snapshot
generation passes. However, we want to avoid this, to remove the
assumption that instruction snapshot serialization must be
deterministic.
Fixes https://github.com/dart-lang/sdk/issues/39803.
Also allows --strip to be used with --snapshot-kind=app-aot-assembly,
so that DWARF sections are not output in the generated assembly code.
Fixes https://github.com/dart-lang/sdk/issues/37560.
Change-Id: Ibdf1f5c771bae21870af252b38e64250fde53603
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128735
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This continues the work started in https://dart-review.googlesource.com/c/sdk/+/124105
The nnbd mode is now part of the type arguments instantiation cache,
since the resulting vector depends on the mode.
Change-Id: I803c07fa9473024557db8585e87286f16681169a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128307
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
This makes the location of the `.git` folder a GN argument, so it
can be configured differently when using git-worktree.
See sdk_args.gn for documentation on how to use this.
Fixes#33619 (http://dartbug.com/33619)
Change-Id: Ia8144f401c462a6fbb91a965979949f286b04d1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127485
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
After dab60b485c we decide to use shared
slow path for BoxInt64Instr based on FLAG_use_bare_instructions.
However, even in --use_bare_instructions mode we might be compiling
something before VM isolate stubs are replaced with isolate-specific
stubs. In such case we shouldn't use shared slow path as
BoxInt64Instr::EmitNativeCode generates PC-relative call to the stub.
This change fixes the assertion
../../runtime/vm/compiler/backend/il_arm.cc: 4650: error: expected: !stub.InVMIsolateHeap()
version=2.8.0-edge.dab60b485ca4544d58970d9be299d5aaf78cf9e5 (Thu Dec 19 17:29:12 2019 +0000) on "linux_simarm"
thread=28698, isolate=isolate(0x5640171cd800)
pc 0x000056401446060c fp 0x00007ffec2747190 dart::Profiler::DumpStackTrace(void*)
pc 0x00005640141d23b2 fp 0x00007ffec2747270 dart::Assert::Fail(char const*, ...)
pc 0x00005640145fa85d fp 0x00007ffec2747300 out/DebugSIMARM_X64/gen_snapshot+0xa1285d
pc 0x00005640145b35b6 fp 0x00007ffec2747470 dart::FlowGraphCompiler::VisitBlocks()
pc 0x00005640145bfd94 fp 0x00007ffec27474a0 dart::FlowGraphCompiler::CompileGraph()
pc 0x000056401454aa07 fp 0x00007ffec2747af0 dart::PrecompileParsedFunctionHelper::Compile(dart::CompilationPipeline*)
pc 0x000056401454cf3f fp 0x00007ffec2747d00 out/DebugSIMARM_X64/gen_snapshot+0x964f3f
pc 0x000056401454765e fp 0x00007ffec2747da0 dart::Precompiler::CompileFunction(dart::Precompiler*, dart::Thread*, dart::Zone*, dart::Function const&)
pc 0x0000564014470016 fp 0x00007ffec2747de0 out/DebugSIMARM_X64/gen_snapshot+0x888016
pc 0x000056401446d72c fp 0x00007ffec2747e70 dart::ProgramVisitor::VisitClasses(dart::Visitor<dart::Class>*)
pc 0x000056401446d9f3 fp 0x00007ffec2747f00 dart::ProgramVisitor::VisitFunctions(dart::Visitor<dart::Function>*)
pc 0x000056401453e474 fp 0x00007ffec27480c0 dart::Precompiler::DoCompileAll()
pc 0x000056401453e245 fp 0x00007ffec27484b0 dart::Precompiler::CompileAll()
pc 0x00005640149c60eb fp 0x00007ffec2748570 Dart_Precompile
pc 0x00005640141a7a5f fp 0x00007ffec27486f0 dart::bin::main(int, char**)
-- End of DumpStackTrace
in debug mode.
Change-Id: I5095e8def7b3d8067423455f32bce5aea1e0c381
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129141
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
BoxInt64Instr::MakeLocationSummary pretended that it is using shared
slow path, but it was not actually used in --no-use-bare-instructions mode.
As a result, BoxInt64Instr slow path pushed only live registers, but
stack map was generated for all registers. This caused various crashes,
mostly in GC.
The fix is to correctly create LocationSummary with kCallOnSlowPath
instead of kCallOnSharedSlowPath if we're not going to use shared
slow path (if --no-use-bare-instructions is specified).
Fixes https://github.com/dart-lang/sdk/issues/39853
Fixes https://github.com/dart-lang/sdk/issues/39854
Change-Id: Iaba7cd7d88143f2621a007c8559b932bb171de4f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129004
Reviewed-by: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
I'm not able to write a test for this yet, but I manually verified that
it's doing the kLegacy -> kNonNullable mapping correctly, on all 4
architectures.
Bug: https://github.com/dart-lang/sdk/issues/39755
Change-Id: I8d1b014c4d4d067fd55e96166b19015d50c9cc6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128982
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
This change stops seting unbox_numeric_fields flag to false in AOT.
It also sets the speculative mode to be non speculative for store
unboxed fields instructions in AOT, since unboxing is done based on TFA.
Change-Id: Ic7a6391f8569e22eea13128251d83d109b06083c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127884
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This CL is responsible for inlining Float32x4 and Float64x2 arithmetic
operations in order to reduce their run-time cost.
Null-checks were required in order to allow the unbox instructions to
be non-speculative.
CheckNullInstr was modified to throw ArgumentError when checking
arguments for those operations.
Change-Id: I18b36d96a36011647480f301eb6dc6bb478f59a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128589
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
index to fix VMs coverage issue
This CL fixes the VM not always reporting coverage for mixin usages
properly.
* When asking the VM for coverage you can do it in one of two ways
* Ask the VM for coverage for everything; or
* Ask the VM for coverage for a specific script
* Asking the VM for coverage for everything works perfectly fine.
The VM goes through everything and reports coverage correctly.
* Asking the VM for coverage for a specific script (which is, at least
now, what the flutter tools does) doesn't work in the simple mixin
case described at http://dartbug.com/39779: The VM goes through the
libraries, asking for the list of scripts they "know about",
and checks for matches against what you asked for.
In this case, when asking for 'master.dart', the library for
'lib.dart' says no when it shouldn't --- because of the way the mixin
transformation works the content is actually in lib.dart.
This CL updates the content of the field 'sourceReferences' on Library
to fix the issue.
Fixes#39779
Change-Id: I0c38a323c81d1784ade704837b67ece549fc95d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128585
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This change removes support for all bytecode format versions up to the
current version (27) from the VM.
Version 27 landed Nov 15 2019 in 329d0913ca.
Change-Id: I6af2851543fbb7119bd4b22759f9f05e8c2517dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128940
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This reverts commit 4dee4bd204 as it now has the fix for precompiled flow in patchsets 3, 7.
Change-Id: Ib99763a91073df7698e8b597a67e11e557fc131e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128574
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
We only check the expected stack starting from the call to
foo in main, so we no longer depend on what is captured in
the stacktrace for how main is invoked.
Also removes the old status lines for this test, which are no
longer applicable, and cleans up the documentation a little.
Fixes https://github.com/dart-lang/sdk/issues/39766.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try
Change-Id: I66746f5a5169bce425bfd1f01a6a912b062e99c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128737
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
Note that when generating unstripped ELF snapshots with --obfuscate,
this means DWARF sections in the resulting snapshot will leak
otherwise obfuscated information. To avoid this, use both --strip
to strip the generated snapshot and --save-debugging-info=<...> to
save the unobfuscated DWARF information to a separate file.
Fixes https://github.com/dart-lang/sdk/issues/35563.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I545a737bd58fcd99c329386a552bd8951acf38b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128732
Reviewed-by: Martin Kustermann <kustermann@google.com>
Removes an unnecessary change to the names of type testing stubs that
allowed name collisions to happen.
Old commit message:
The flag can be used when creating AOT snapshots. The resulting file can be
used with package:vm/dwarf/convert.dart to convert DWARF-based stack traces
to stack traces with function, file, and line number information.
Currently the saved file will be an ELF file with DWARF debugging information,
but this is subject to change in the future. To avoid being affected by any
changes in format, read the DWARF information from the file using
Dwarf.fromFile() in package:vm/dwarf/dwarf.dart.
Also adds --dwarf-stack-traces to the VM global flag list, so its value at
compilation will be read out of snapshots by the precompiled runtime.
Fixes https://github.com/dart-lang/sdk/issues/39512, which was due to
a missing compiler::target:: prefix for Instructions::HeaderSize() in
BlobImageWriter::WriteText().
Exposes the information suggested in
https://github.com/dart-lang/sdk/issues/39490 so that package:vm/dwarf
can appropriately convert absolute PC addresses to the correct virtual
address for a given DWARF line number program.
Bug: https://github.com/dart-lang/sdk/issues/35851
Change-Id: I6723449dceb0b89c054a1f1e70e7acd7749baf14
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128730
Reviewed-by: Martin Kustermann <kustermann@google.com>
CodeSourceMapBuilder::NoteDescriptor(..) would previously only emit
CSM entries if its stack_traces_only_ flag was set, which
FlowGraphCompiler would only do if compiled in PRODUCT mode:
runtime/vm/compiler/backend/flow_graph_compiler.cc:162
Bug: https://github.com/dart-lang/sdk/issues/39525
Change-Id: I78c56a18a5a95ef3c8c37a2d7eae6ab612e6674f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127464
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
REASON: the first commit in the chain contains a change that breaks internal
Flutter roll due to duplicated symbols for type testing stubs in assembly
snapshots.
Revert "[vm/compiler] Add --save-debugging-info flag to gen_snapshot."
This reverts commit c2b6c2e1db.
Revert "[vm] De-obfuscate function and file names in DWARF sections."
This reverts commit 4b8fd3c412.
Revert "[vm] Add docs for DWARF stack traces and related tools/libraries."
This reverts commit 5543e5ceb8.
Revert "[vm] Weaken dwarf_stack_trace expected stack trace."
This reverts commit 5824d3ed53.
Change-Id: I95ecd16fe493f61ae761dabfdd91a6ec0c2f0ca3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128776
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This makes --disassemble output more uniform (as other dump sections already
print their function names), and makes it easier to grep through:
Example output:
Code for optimized function 'dart:core__AbstractType@0150898__AbstractType@0150898.' {
[...]
}
Source positions for function 'dart:core__AbstractType@0150898__AbstractType@0150898.' {
[...]
}
PC Descriptors for function 'dart:core__AbstractType@0150898__AbstractType@0150898.' {
pc kind deopt-id tok-ix try-ix yield-idx
empty PcDescriptors
}
Code for optimized function 'dart:core__ImmutableMapKeyIterable@0150898__ImmutableMapKeyIterable@0150898.' {
[...]
}
Change-Id: I76957e0105a39e47d59d3166dfae6d4593ebd86a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128588
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
- Ignore all data races on object headers. These are harmless because of higher-level constraints in the GC.
- Make all concurrent marker tasks check-in with the monitor to indicate they are done marking roots, not just the last one. This establishes synchronization between the which ever task read the handle blocks and the mutator resuming and writing to the handle blocks.
- When a helper thread exits the isolate, perform clearing of the reusable handles under the thread registry's lock so it doesn't race with the GC visiting thread roots.
- Disable background compilation when running under TSAN. There are lots of races here. Many are harmless. It's hard to annotate these without effectively disabling TSAN checks for the entire Dart heap, so simply disabling the background compiler will give us the most TSAN coverage for the time being.
- Fix race in abandoning TLABs during helper thread exit.
- Remove harmless race between concurrent sweeper and allocation of new heap pages.
- Suppress TSAN on known race in array truncation.
- Remove racy access FLAG_stacktrace_every, which is no longer needed as compilation can no longer trigger execution to evaluate constants.
Bug: https://github.com/dart-lang/sdk/issues/39611
Change-Id: Ibaa101b4f12ff5fa30678471fb37e63608ba7f8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128305
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This CL removes the character encoding for types in the fuzzer.
Change-Id: I00fd76158932d8b5723c3f760e2d6c71beb5e5cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127820
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Fizaa Luthra <fizaaluthra@google.com>
In the current compiler pipeline, PushArgument instructions can
end up outliving the calls to which they are an argument in some
circumstances. For example, the PushArgument is left in the graph
if it also appears in the environments of interleaving instructions.
When the dead code eliminator calculates liveness of a definition,
it ignores appearances in PushArgument instructions. Instead, it
looks for uses of the definition either directly or via
PushArgument in the arguments of calls and environments of other
instructions in the graph. An separate pass run before DCE
removes environments from instructions, so a definition used only
in PushArguments that have outlived their calls is considered dead.
The current DCE removes dead definitions but leaves PushArgument
instructions be. For orphaned PushArguments of dead definitions,
this means after DCE they now reference definitions no longer in
the graph.
This change instead checks the definitions referenced by
PushArgument instructions for liveness. If a PushArgument
references a dead definition, then the DCE removes the PushArgument
instruction, as its call must have already been removed (else
the definition would still be live), and environments, and thus
environmental uses, have already been removed from the graph.
Bug: https://github.com/dart-lang/sdk/issues/39767
Change-Id: I74c8e92a0d93f2aae42f8ff6f06ee70899b2f794
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128403
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
If the dst_type of an AssertAssignable is a type parameter, the AssertAssignable
implementation will load the value of the type parameter using
the (instantiator or function) type arguments. It will then call the
type testing stub (TTS) of that type.
If the TTS is not exhaustive (e.g. because `T = X<..>` wher `X` is
implemented), it can fall back to the slower SubTypeTestCache implementation.
Right now the STC fallback will get the loaded value of the type
parameter for `dst_type` instead of the type parameter. Doing so is
incorrect.
=> This CL ensures we preserve dst_type = TypeParameter for the STC
fallback.
Issue https://github.com/dart-lang/sdk/issues/39716
Change-Id: Id5b318ed4940b4d749f6ab8b4c2a4efc295d9dde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127888
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
We only check the expected stack starting from the call to
foo in main, so we no longer depend on what is captured in
the stacktrace for how main is invoked.
Also removes the old status lines for this test, which are no
longer applicable, and cleans up the documentation a little.
Fixes https://github.com/dart-lang/sdk/issues/39766.
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-obfuscate-linux-release-x64-try
Change-Id: I61f0465dcd55d090c49db9c6af503ae9c0df6313
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128401
Reviewed-by: Clement Skau <cskau@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Change-Id: I018ddd6add8b8ff447019cc61bff579104084f00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128072
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Note that when generating unstripped ELF snapshots with --obfuscate,
this means DWARF sections in the resulting snapshot will leak
otherwise obfuscated information. To avoid this, use both --strip
to strip the generated snapshot and --save-debugging-info=<...> to
save the unobfuscated DWARF information to a separate file.
Fixes https://github.com/dart-lang/sdk/issues/35563.
Change-Id: I8795e2a5623ad5fc5362257007f677e622a7700b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127166
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
The flag can be used when creating AOT snapshots. The resulting file can be
used with package:vm/dwarf/convert.dart to convert DWARF-based stack traces
to stack traces with function, file, and line number information.
Currently the saved file will be an ELF file with DWARF debugging information,
but this is subject to change in the future. To avoid being affected by any
changes in format, read the DWARF information from the file using
Dwarf.fromFile() in package:vm/dwarf/dwarf.dart.
Also adds --dwarf-stack-traces to the VM global flag list, so its value at
compilation will be read out of snapshots by the precompiled runtime.
Fixes https://github.com/dart-lang/sdk/issues/39512, which was due to
a missing compiler::target:: prefix for Instructions::HeaderSize() in
BlobImageWriter::WriteText().
Exposes the information suggested in
https://github.com/dart-lang/sdk/issues/39490 so that package:vm/dwarf
can appropriately convert absolute PC addresses to the correct virtual
address for a given DWARF line number program.
Bug: https://github.com/dart-lang/sdk/issues/35851
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I80d900fd9e5f1e2399ad3f2fd25c85131a7ea43c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121857
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Samples for managing native memory without finalizers.
Design: go/dart-ffi-resource-lifetime
Related issue: https://github.com/dart-lang/sdk/issues/35770
Change-Id: I2d0ac1acb65a78db9f57aea3dd5f25b4948ef6d6
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-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-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-precomp-mac-release-simarm_x64-try,dart-sdk-linux-try,analyzer-analysis-server-linux-try,analyzer-linux-release-try,front-end-linux-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123662
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
ClobberAndCall was using an incorrect register for the first parameter
on Windows (rdx instead of rcx). This caused crashes on
vm-kernel-precomp-win-release-x64 bot after landing unrelated change
(https://dart-review.googlesource.com/c/sdk/+/127381).
Change-Id: I5a150ecc743abdb3e00c8afd0d1dd851b777f2e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128009
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
There's just one case where we can't get the offset for Instructions
from somewhere else, and that's when we reset active_instructions_ to
instructions_ in Code::Enable(). Thus, we add a caching field for the
uncached offset to RawCode, but only when the active_instructions_
field is added (when not running in the precompiled runtime).
We also output the unchecked offset in snapshots for Code objects so
we can recalculate the entry point cache on loading. (For full JIT
snapshots, we output both the cached offset and the offset for
active_instructions_.)
Bug: https://github.com/dart-lang/sdk/issues/38451
Change-Id: I78572ec83d1574b00820df148bccb57e5c79eaaa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125400
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
This reverts commit 20ec71d447.
Reason for revert: Performance regressions and seemingly broken TypedData.* benchmarks.
Original change's description:
> [vm/compiler] Fix TypeTestingStub -> SubtypeTestCache fallback code if dst_type = TypeParameter
>
> If the dst_type of an AssertAssignable is a type parameter, the AssertAssignable
> implementation will load the value of the type parameter using
> the (instantiator or function) type arguments. It will then call the
> type testing stub (TTS) of that type.
>
> If the TTS is not exhaustive (e.g. because `T = X<..>` wher `X` is
> implemented), it can fall back to the slower SubTypeTestCache implementation.
>
> Right now the STC fallback will get the loaded value of the type
> parameter for `dst_type` instead of the type parameter. Doing so is
> incorrect.
>
> => This CL ensures we preserve dst_type = TypeParameter for the STC
> fallback.
>
> Issue https://github.com/dart-lang/sdk/issues/39716
>
> Change-Id: Idea2405efbdc01c031ee68dbb345820e721533eb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127640
> Commit-Queue: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
TBR=vegorov@google.com,kustermann@google.com,regis@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I79f2d7db8747743a778126088e375bb4d268c91a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128020
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Map nullable Never type to Null type when reading kernel files and also during
type parameter instantiation.
Change-Id: Iea2d895631661fc01adac65bfd6234e9adeecb1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128001
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
This means that when snapshots are loaded, the nnbd experiment flag they
were compiled with must match the flag the VM currently has.
Bug: https://github.com/dart-lang/sdk/issues/37479
Change-Id: I907a68f49c7c1ac4467c4c39ce033075eba457a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127961
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
When trying to inline SIMD shuffle operation in InlineSimdOp
(inliner.cc), FunctionEntry instruction was created and inherited
deopt_id and environment from call. Inheriting environment also
added FunctionEntry into env_use_list of other instructions.
If inlining didn't actualy happen due to invalid mask argument,
created FunctionEntry still left in the env_use_list.
Later optimization passes (for example AllocationSinking) may crash
while trying to update environment uses of instructions.
Fixes https://github.com/dart-lang/sdk/issues/39520
Change-Id: I6bdb7c6f7a7947259ea5ad097d05eebe5d73269b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127802
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Also build Dart_LoadELF_Fd on Linux as well to get minimal coverage for Fuchsia.
Change-Id: I4be3eeae3e4559e95413fd60a26b9e6d2edabb32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127644
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
If the dst_type of an AssertAssignable is a type parameter, the AssertAssignable
implementation will load the value of the type parameter using
the (instantiator or function) type arguments. It will then call the
type testing stub (TTS) of that type.
If the TTS is not exhaustive (e.g. because `T = X<..>` wher `X` is
implemented), it can fall back to the slower SubTypeTestCache implementation.
Right now the STC fallback will get the loaded value of the type
parameter for `dst_type` instead of the type parameter. Doing so is
incorrect.
=> This CL ensures we preserve dst_type = TypeParameter for the STC
fallback.
Issue https://github.com/dart-lang/sdk/issues/39716
Change-Id: Idea2405efbdc01c031ee68dbb345820e721533eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127640
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
- Modify setter logic for late final local variables.
- Remove extra visitVariableDeclaration in late_var_init_transformer
that was causing nodes to be visited multiple times.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: Id39925e4b9560a1da1b01e1cf14ef20c515f3928
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127720
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
The nullability of runtimeType must be consistent with the nullability of
a class DeclarationType. Currently, it is always kLegacy. However, this
needs to be set to kNonNullable when the NNBD experiment is enabled.
Note that the nullability of the null instance remains kNullable.
Change-Id: I4ba974c2551c3a7fbd190b02175804090f9b48b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125721
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Legacy types are considered equal to their non-nullable variant.
Type hash is modified to be consistent with the new definition.
Change-Id: If90f7f13cf77e519d5b90b57d9dbf4988f71be13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126283
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Arguments to simd type constructors were being checked in the bootstrap
natives entrypoint but not elsewhere. Checking for null in Dart code
ensures that we don't accidentally miss these checks in AOT.
The changes to sdk_nnbd are required in order to ensure the number of
arguments passed to native code match the number of arguments from the
non-NNBD implementation (we needed to remove the implicit type args
parameter).
Fixes https://github.com/dart-lang/sdk/issues/39518
Change-Id: Iaf7d8790c154f1e85db613b6dc84004c8013df9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126905
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Include major memory users known to the VM: isolate heaps, profiling buffers, timeline buffers.
Change-Id: I2580ad74b5d4d07c5c75fde28bb7a5d71fddb09b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127382
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Mechanically, this renames shallowSize to internalSize and redefines shallowSize as internalSize + externalSize.
Change-Id: I734f5714ad6dff341627e3d6e51e3bdcf26c63ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125993
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
- Set a flag on LocalVariable if it's late, and store its initializer offset
- Visit late var init in when visiting var get in scope builder
- Initialize late vars to the sentinel
- Check the sentinel and run the initializer in late var get
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I5500ed133537ab663e2b3d8cfb5cca04233be25e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126982
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
On POSIX platforms, execvp was being run wrapped in
`VOID_TEMP_FAILURE_RETRY` which blocked SIGPROF, resulting in SIGPROF
being blocked in the new application. This would cause Dart applications
spawned through dart:io as a new process to not receive profiler ticks.
This should fix the issue where `flutter run -d {linux,macos}` would
result in profiling being broken for the spawned desktop application.
Change-Id: I7b176ce48144bcbca29d4ae63c82599623ce3c35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127451
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
The separation will allow flutter/flutter integration tests to run the
non-vmspecific parts.
Change-Id: I0e771f1247ec62d2f0c3faa95ee10560e62524f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127144
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
The CL also updates a number of pragma annotations to be conditional on
non-product mode.
Change-Id: Ia00b5089d54bbb8f6f6006ef67d65859ab56c132
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127004
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
On Linux it is an error for a thread name to exceed 16 bytes. Thus also changing the VM thread pool to use the shorter "DartWorker" name.
Change-Id: I4c5cc2bfb831a5593a8652d6435631b9d3803720
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126163
Commit-Queue: Kirill Nikolaev <cyriln@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Our inlining heuristics are not stable and can decide to inline
something on the second attempt, which was not inlined before
leading to generation of new allocation stubs which were not
generated before.
Fixes https://github.com/dart-lang/sdk/issues/39606
Change-Id: I49d6df35d6b0568429abc84a140469e0aae065de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127143
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
The `tests/ffi/prepare_flutter_bundle.dart` script will try to discover
all synchronous, positive test from the "ffi" test suite, rewrite them
slightly and output a directory which can be used in a flutter/flutter
FFI integration test.
We split the ffi test functions into two parts, because a subset of the
C functions will issue calls to the VM via `dart_api.h`, which is not
available for the flutter/flutter integration test.
=> We make `runtime/bin/ffi_test/ffi_test_functions.cc` a pure C
library, usable without `dart_api.h` and move the remaining VM
specific code to .../ffi_test_functions_special.cc contains.
All tests from `tests/ffi/*_test.dart` will be included in the generated
bundle, which
* don't use async/isolates
* don't rely on VM api
* don't rely on DynamicLibrary.{process,executable}
* don't take too long to execute
The script can be used as follows:
sdk % dart tests/ffi/prepare_flutter_bundle.dart foo
Using SDK root: .../sdk
The following tests will be included:
aliasing_test.dart
data_not_asan_test.dart
data_test.dart
extension_methods_test.dart
external_typed_data_test.dart
function_structs_test.dart
negative_function_test.dart
regress_37254_test.dart
regress_39044_test.dart
regress_39063_test.dart
regress_39068_test.dart
stacktrace_regress_37910_test.dart
structs_test.dart
variance_function_test.dart
The following tests were filtered due to using dart_api.h/async/DynamicLibrary.{process,executable}/...
function_callbacks_test.dart
function_gc_test.dart
function_test.dart
object_gc_test.dart
regress_37100_test.dart
regress_37511_callbacks_test.dart
regress_37511_test.dart
regress_37780_test.dart
Please copy generated files into FFI flutter test application
* foo/lib/src/generated
* foo/ios/Classes
Change-Id: Ia13f97df3bbc90829bb8fde8265a7e1d2c0f8260
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127006
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
When creating a KernelProgramInfo, we create several logical views into the kernel buffer. These are fresh ExternalTypedDatas, rather than proper TypedDataViews, so they do not automically keep the original ExternalTypedData alive. Create an explicit reference to the orginal ExternalTypedData in the KernelProgramInfo. When creating snapshots, this reference is ignored/null'd and the views are turned into copies, effectively dropping the parts of the original buffer that do not have views.
Fixes a leak with reload and a use-after-free with eval.
Bug: https://github.com/dart-lang/sdk/issues/33973
Bug: https://github.com/dart-lang/sdk/issues/39610
Change-Id: I09d3830133314ccbaa0341d904127c2b6925c4ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126825
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This reverts commit 63333deed6.
Reason for revert: Causes failures on Flutter HHH CI in the "flutter test hostonly_devicelab_tests" step due to kernel binary format version mismatch.
Original change's description:
> [vm/cfe] Elaborate for-in statements during async transform
>
> This allows us TFA to analyze the iterator calls and we generate much tighter
> code in AOT.
>
> However, due to the increased inlining opportunities, we end up emitting 0.5%
> more code. Inlining of the _GrowableList iterator specifically also includes the
> concurrent modification check and error handling.
>
> Calls to get:iterator, moveNext and get:current account for 7.12% of all InstanceCall
> instructions in Flutter Gallery.
>
> Fixes https://github.com/dart-lang/sdk/issues/39516
> Issue https://github.com/dart-lang/sdk/issues/39566
> Issue https://github.com/dart-lang/sdk/issues/39565
>
> Change-Id: I8dcc08b7571137e869a16ceea8cc73539eb02a5a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126381
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
TBR=kustermann@google.com,sjindel@google.com,johnniwinther@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I89b88c3d9f7c743fc340ee73a45c3f57059bcf30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126734
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
Changes:
- Initialize late static fields to the sentinel.
- Mark implicit setters for static fields as static functions.
- Call the setters and getters in StreamingFlowGraphBuilder.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I6b40aa86e44d5cea94bcf22f995ea36e01258197
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126920
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
We eagerly add objects into the global object pool while generating
code. However code generation can be aborted and retried at any point
due to various reasons (branch distance or speculative inlining). Such
bailouts and retries would leave dead global pool entries behind.
This CL avoids this by switching to a accumulate&commit scheme for
populating global object pool.
This solution is not entirely clean because we sometimes perform
nested code generation (i.e. to create allocation stubs) which
means that we can't always commit accumulated entries into the
global pool at the same indices as we expected them to be - meaning
that commit can fail and we have to retry compilation.
We try to minimize amount of retries by pregenerating some stubs
ahead of the main code generation.
Change-Id: I5bd3f70272cf49189b754f3a9a2c31d2e6165353
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126343
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This allows us TFA to analyze the iterator calls and we generate much tighter
code in AOT.
However, due to the increased inlining opportunities, we end up emitting 0.5%
more code. Inlining of the _GrowableList iterator specifically also includes the
concurrent modification check and error handling.
Calls to get:iterator, moveNext and get:current account for 7.12% of all InstanceCall
instructions in Flutter Gallery.
Fixes https://github.com/dart-lang/sdk/issues/39516
Issue https://github.com/dart-lang/sdk/issues/39566
Issue https://github.com/dart-lang/sdk/issues/39565
Change-Id: I8dcc08b7571137e869a16ceea8cc73539eb02a5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126381
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Also load 'this' directly rather than through the context in methods, since it cannot
be modified.
Flutter gallery code size -0.16% total.
Change-Id: I0e73fa642363f38e2abe2a5738e988df2bc12646
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126100
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
When CPU profiling is disabled, the getCpuSamples RPC would return with
a ServerRpcException stating that the profiler was disabled. This wasn't
being caught when the RPC was invoked, but was being caught in
`ObservatoryApplication` and swallowed. This resulted in the timeline
page being stuck at the timeline loading dialog.
Also includes fixes from "[observatory] Properly wait for Catapult's iframe to load. Give
message while fetching timeline.", commit 3b99524167, which was reverted.
Change-Id: I2fe23d4dba5e20f717e111c519563866bb1a221c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126402
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This reverts commit b3cf5ef327.
Reason for revert: Breaking timeline view for users in Google3
b/141889413
b/145128403
Original change's description:
> [observatory] Properly wait for Catapult's iframe to load. Give message while fetching timeline.
>
> Change-Id: I342c9315fc31021fb1387bc0e409645cd7a99d6a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125468
> Reviewed-by: Ben Konyi <bkonyi@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
TBR=bkonyi@google.com,rmacnak@google.com,asiva@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I38b92a5a50955983369f4de7afb577d1a959e724
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126360
Reviewed-by: Ben Konyi <bkonyi@google.com>
This is done by collecting all frames on the current stack until an async/async* frame is hit
which has yielded before (i.e. is not in sync-async case).
From there on it finds the closure of the async/async* frame and starts traversing the listeners:
while (closure != null) {
yield_index = closure.context[Context::kAsyncJumpVarIndex]
pc = closure.function.code.pc_descriptors.LookupPcFromYieldIndex(yield_index);
<emit pc in frame>
closure = closure.context[Context::kAsyncCompleterVarIndex]._future._resultOrListeners.callback;
}
Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: I97030d22e529bf8a74ecd30a8a2589cfe57ad330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122644
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Take full advantage of PushPair (stp) in code generation
visitors; use PushRegisterPair for ThrowErrorSlowPathCode.
This change improves Flutter Gallery code size by:
Instr: -0.24%
Total: -0.15%
Change-Id: Icba42cb956b07966861b52d3a8653d21eafab3b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125971
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Also fixes the low and high PC information in the DWARF output of
inlining nodes.
Bug: https://github.com/dart-lang/sdk/issues/35851
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-mac-release-x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: I11c3577bdc5c12abdc88aa799c1aae3f505294df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123734
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
If a late final field initializer is recursive, it can write multiple
values to the field. Only the first should succeed, and the rest should
throw.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I87ffdc0b8fcd429c47f102fe76a0e6a577ae6c30
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125934
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
This reverts commit b7de866bee.
Reason for revert: assertion failures on reload stress bots
Original change's description:
> [vm] Avoid holding canonical hashes at rest.
>
> Canonical hashes are only stored during a round of canonicalization to avoid expontential time in cases such as those in tests/language_2/canonicalization_hasing_*. Clearing them avoids the GC spending time to visit them.
>
> Bug: https://github.com/dart-lang/sdk/issues/37523
> Change-Id: Icad1fad30dcb7eb95864bea8a26991aeccd7adc6
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125760
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com
Change-Id: I2e6b29fd1b529d6302ab979acd4757f45bf989ef
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37523
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125935
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Canonical hashes are only stored during a round of canonicalization to avoid expontential time in cases such as those in tests/language_2/canonicalization_hasing_*. Clearing them avoids the GC spending time to visit them.
Bug: https://github.com/dart-lang/sdk/issues/37523
Change-Id: Icad1fad30dcb7eb95864bea8a26991aeccd7adc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125760
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Block R22 to hold a cached version of NullObject();
refresh it in the same way as for BARRIER_MASK register.
Alter assembler to avoid emitting load and to use NR
register directly instead.
This change improves Flutter Gallery code size by:
Instr: -1.81%.
Total: -1.16%.
Change-Id: Ifec654e799737527eec1d8a0e87b4a197ad0298a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125662
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This CL also addes CodeSourceMap source positions to the disassembler output.
Change-Id: I49f6cb5257394badc8a005167f906e185509a3e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125663
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Allocating in new-space allows this objects to be collected quickly during the next scavenge, instead of acculumating in old-space until the next mark-sweep and potentially increasing the process's peak memory footprint.
Change-Id: Id73c4c3934f6d84ba7af9e3333a350b809946ebb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125360
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Rationale:
Rename traverses blocks in DOM order, not in execution order.
As a result, blocks that are directly entered from the entry
should introduce synthetic phis during OSR with non-empty stack
to make sure incoming stack values are merged properly.
https://github.com/dart-lang/sdk/issues/39193
Change-Id: Ic35961169aa535657333c2ab14fbd2c4e1f0783f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125489
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Rationale:
Loop analysis did not take outer indices used as bounds
(triangular loops) into account to enhance analysis. This
left some obvious BCE optimizations on the table (mainly AOT).
Observed improvements (performance and code size):
About 5-15% performance on golem benchmarks:
mainly armv7, and TypedData*Bench
Minor overall code size reduction on flutter gallery (arm32,arm64)
Comparing ./orig32.json (old) to ./new32.json (new)
Old : 6614912 bytes.
New : 6600336 bytes.
Change: -14576 bytes.
Comparing ./orig64.json (old) to ./new64.json (new)
Old : 6459216 bytes.
New : 6458736 bytes.
Change: -480 bytes.
Similar on velocity_tracker_bench (arm32,arm64)
Comparing orig32.json (old) to new32.json (new)
Old : 804280 bytes.
New : 794552 bytes.
Change: -9728 bytes.
Comparing orig64.json (old) to new64.json (new)
Old : 705520 bytes.
New : 705312 bytes.
Change: -208 bytes.
Change-Id: Ifc3b3a378ae6fd98743c48944a86a9e90ce4da5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117200
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
Normally we consult /proc to determine the host architecture. However, this
reports the actual host architecture, not the QEMU-simulated one.
Also, GDB cannot debug position-independent executables in QEMU, so we disable
PIE when compiling for execution in QEMU.
Pass '--use-qemu' to 'gn.py' to build for QEMU.
Change-Id: Ib125127ceb0582b66754cfc0da22e09d224ee1e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125267
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
CodeObservers is not available in PRODUCT, but FORCE_INCLUDE_DISASSEMBLER will
enable code that uses (but doesn't strictly need) it.
This is related to https://dart-review.googlesource.com/c/sdk/+/125404.
Tested:
./tools/build.py --arch x64 --mode product dart_precompiled_runtime gen_snapshot
Change-Id: I5f0c0765a608b50704045c918b41c71398b89390
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125263
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
Right now `Script::yield_positions()` is an array mapping function start
token positions to arrays. Those arrays contain token positions and are
indexed by yield index.
=> This `Script::yield_positions()` is not available in AOT mode.
The fast async stack implementation will need to be able to find out
where an async closure was suspended. It does so by looking at the
":await_jump_var", which contains the yield index. It then needs to
associate the yield index to token position of the yield.
This CL adds an entry into the PcDescriptors for every yield in a
async/async* function and removes `Script::yield_positions()`.
The entry will associate the yield index with the token position.
Flutter gallery total size impact for flutter-release:
- armv7: +0.016%
- armv8: +0.045%
Issue https://github.com/dart-lang/sdk/issues/37668
Change-Id: I0b2ce41e85d8f5d590201bf2fb091578d7379890
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125408
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This CL enables passing --disassemble to e.g. a product mode gen_snapshot
which used to not have the flag even when the disasm. was forcefully
included.
This CL also:
- Fixes numerous typos: marco -> macro.
- Reorders the _four_ types of flags in order of strictness.
Change-Id: I8e3ef75ea0a748a6af5fa48cf289a57beeb51148
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125404
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Runtime functions do not yet implement the NNBD semantics.
In a next change, generated code will pass NNBD mode to the runtime.
Declare one new VM flags: --strong-non-nullable-type-checks
Change-Id: I050a468e4a6b665ce46c345bafba04a947cf7cb0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124105
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Setting the `enableTimelineLogging` property of `HttpClient` to true results in
timeline events being created for HTTP connections and HTTP requests.
Timeline events contain general connection information, including:
- Request type
- Status code
- Request / response headers
- Cookies
- Non-sensitive proxy information
- Relevent error messages for failed connections
Change-Id: Ibe16a312ab5398c9ae886ea07bea5ca70b63e440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123540
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Removes support for accumulators, which now repeat the current live values.
Decreases performance difference between release and product modes.
Fixes inaccuracy when counters are queried before the first full GC.
Golem geomean x64 4.687%
Golem geomean arm64 5.770%
Bug: https://github.com/dart-lang/sdk/issues/37678
Change-Id: I12b26a9834b0f0f911ddcc6e8e5ff4573272607d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116885
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
I also added a test for top level late variables (they already worked).
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I6720e6476a067c7f8b21a34b87b23ab14fc866a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125224
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
DART_PRECOMPILER define is used when building gen_snapshot and
run_vm_tests. Both gen_snapshot and run_vm_tests support AOT and
JIT modes, selected by FLAG_precompiled_mode.
Before this change, DART_PRECOMPILER always used AOT exception
handling (catch_entry_moves_maps). This works fine even if code is
generated in JIT mode, but it is not compatible with JIT exception
handling. run_vm_tests uses kernel service which comes from app-jit
snapshot (on x64), which is generated in JIT mode with JIT exception
handling. This causes crash if there is a Dart exception in kernel
service.
This change adjusts exception handling in DART_PRECOMPILER mode to
support both AOT and JIT implementations and select one using
FLAG_precompiled_mode.
Fixes https://github.com/dart-lang/sdk/issues/39388
Change-Id: I6c9ce05552a98bd4eeaea18c082a98e9bdbe9460
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125302
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
The test explicitly passes --enable-isolate-groups (off by-default in JIT).
It will be enabled once full hot-reload with multiple isolates in one IG is implemented.
Change-Id: I8c71a948406f6911c450161a3b5b0b0c0519b0d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125403
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Similar to the split of ClassTable into ClassTable/SharedClassTable,
this CL splits up the IsolateReloadContext into:
* IsolateGroupReloadContext: Consists of reload-related information across all
isolates. The [Reload()] method is split up in phases that are
performed on all isolates before the next phase is started.
=> This allows each isolate to add reasons for rolling back, if no
reasons are found the reload will be accepted atomically.
* IsolateReloadContext: Constists of reload-related information for a
particular isolate (e.g. mappings of old to new classes)
The assumption is that all isolates have the same source (and therefore
the same libraries). For certain things, e.g. discovering which libraries
changed, it is necessary to examine the object store. We use the first
isolate in a group (but could use any of them) to do so, since the
isolate group does not have this information atm.
This is a preparation CL for supporting hot-reloading multiple isolates
within one isolate group. Though the support in this CL stays at having
only a single isolate in a group.
=> This CL turns off FLAG_enable_isolate_groups in JIT mode.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: I7f4d536d4f5ab4a2a73fb0c7618ba967c9b77234
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123254
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This is practically a copy of the change in
https://dart-review.googlesource.com/c/sdk/+/118040 but applied to the non-nnbd
sdk.
Even though there is no intent to run the non-nnbd sdk with the non-nullable
experiment, we need to add this annotation because of how we
intend to gradually start testing NNBD. The libraries.json under
sdk_nnbd is allowed to point to libraries under the non-nnbd sdk in order to
temporarily build without errors until all patch files are migrated and all CFE
issues are addressed.
Change-Id: I53c1123a8d86c10695832a8a0ad35adb7b4d92fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125181
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Don't trigger an interrupt when concurrent marking finishes, which could trigger cause synchronous finalization in the middle of a frame; instead wait for the next allocation failure or idle notification.
Change-Id: I969c7e8de05ee1eb70103eda2df98cb2320085b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125082
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
The goal of this change is to make it possible to start iterating on nnbd tests
for DDC. This keeps the current philosophy of keeping NNBD and non-NNBD build
configurations separate, except that NNBD builds are allowed to consume library
sources from the non-nnbd sdk.
This change addresses the first set of errors that are encountered when trying
to build a fully NNBD configuration:
* CFE has issues with type promotion, for that reason we remove
`--enable-experiment=non-nullable` in vm build rules, and we use a smaller
training data when creating the dartdevc app-jit snapshot.
* We'd hit compile-time errors with nnbd libraries with inconsistent
patchfiles. To avoid that, the libarries.json points to the non-nnbd SDK
sources for most dart:* libraries.
Change-Id: Ie6226b3bd8a92b4a1632dd84a5db2f04238fd4f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125080
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Original change is in patchset 1.
The issue was that the expected "_Closure.call" frame is not always present.
Change-Id: I91116861e785a72536dde300f4771de4f6fa9d3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124988
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
--code-comments should be passed both at compile/training-time and run-time to get
comments in the disassembled instructions.
The required --disassemble-* flags need only be passed at run-time. Flow-graph printing
is not yet supported because we don't save flow-graph like assembly comments.
This functionality is excluded from product builds.
Change-Id: If35fbb08cff6eae40069f916ecec9c6f589c0cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124989
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
A similar abort was removed in the refactor in 5cce1e4a.
Change-Id: I9921c3f9f2bbe36c4560388471f93356c2d1f12d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125200
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
When we are writing a snapshot, canonicalize all entries within
CompressedStackMaps payloads. We do this by creating a global table
of stack map information (bit counts + bit payload) that we store
in the isolate object store, and then for each existing CSM, we
replace it with an alternate version that refers to the global table.
This gets back some of the canonicalization we lost when we moved from
individual StackMap objects to per-Code CompressedStackMaps objects.
Here, we also represent the global table as a CompressedStackMaps
object. This means that there are three types of CompressedStackMaps:
* The original version that directly contains all entry information.
* The version where each entry is just the PC offset delta and an
offset into the global table payload.
* A version representing the global table where the entries are like
the original version except they don't contain a PC offset delta.
-----
The impact on AOT snapshot size when compiling the Flutter Gallery
in release mode:
armv7: Total size -0.88% (Isolate RO: -5.05%, Isolate snapshot: +0.00%)
armv8: Total size -1.04% (Isolate RO: -5.28%, Isolate snapshot: +0.00%)
-----
Bug: https://github.com/dart-lang/sdk/issues/35274
Change-Id: I1ce0f8b3cc58e2f11584f3c218e0fdf8984b799b
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-debug-simarm_x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120667
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Fix vm/cc/OldGC_Unsync to not change FLAG_marker_tasks while incremental marking is in progress.
Fix vm/cc/IterateReadOnly to not mark the heap as read-only while marking or sweeping are in progress.
Remove unnecessary WaitForGCTasks leftover from background finalization.
Bug: https://github.com/dart-lang/sdk/issues/39299
Change-Id: Ib3340e514b44230b9735b74b1f2012ca9b998d50
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124824
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Compare 6354b0b97d, which did the same for direct old-space allocations.
Change-Id: Ifc047b48dfa10891ea7f1b39794f5fdbc7cf2ec8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124841
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This reverts commit ea57b1e62c.
Reason for revert: Please see https://buganizer.corp.google.com/issues/144304690
Original change's description:
> [VM/nnbd] Pass nullability when creating Class::DeclarationType.
>
> Passing nullability rather than forcing kLegacy helps slightly reduce the number
> of Types in the VM and in snapshots.
> This allows to remove the kludge about declaration type of Null being kNullable.
> Also pass nullability when creating a simple type may help.
>
> Note that CFE is still producing super types and some interface types that are
> non-nullable, even with nnbd features disabled. But this should get fixed and
> further reduce the number of types in the snapshot.
>
> Change-Id: I397f00902026ee5bc91d36328f4156427702efdb
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124480
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com,regis@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Icae0a69cda6cc531bba4d5d12471e7267a277340
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125102
Reviewed-by: Siva Annamalai <asiva@google.com>
This reverts commit 3771dddf43.
Reason for revert: see https://buganizer.corp.google.com/issues/144304690
(This CL is dependent on https://dart-review.googlesource.com/c/sdk/+/124480 which caused the regression).
Original change's description:
> [VM/nnbd] Force the DeclarationType of a class to have legacy nullability.
>
> This is a workaround to avoid caching a non-legacy type (possibly provided
> by the CFE) as the canonical type of a non-generic class and later returned as
> the runtime type of an instance of this class.
>
> Hopefully fixes https://buganizer.corp.google.com/issues/144304690
>
> Change-Id: Iaea364b9b743b05bde600f0aa784d5a8105728d7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124920
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Régis Crelier <regis@google.com>
TBR=rmacnak@google.com,alexmarkov@google.com,asiva@google.com,regis@google.com
Change-Id: If8b2671f3cf4b0d080ba9f0472738326fec701d3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125100
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
This is a workaround to avoid caching a non-legacy type (possibly provided
by the CFE) as the canonical type of a non-generic class and later returned as
the runtime type of an instance of this class.
Hopefully fixes https://buganizer.corp.google.com/issues/144304690
Change-Id: Iaea364b9b743b05bde600f0aa784d5a8105728d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124920
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
While 'this' variable (receiver) is in scope in closures inside
instance methods, closures do not take it as a parameter and they
shouldn't declare a local variable for receiver unless it's captured.
Fixes https://github.com/dart-lang/sdk/issues/38743
Fixes https://github.com/dart-lang/sdk/issues/39285
Change-Id: Ic5c735fd50457a5fb39acb3ec3590964e4dddba3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124825
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This fixes `package:stack_trace` in the sync-start case of async/async* calls.
Change-Id: I5c41a35283439f533ab19c9fd1cc542931de4b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124560
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This change allow builds to succeed on Arch Linux with python 2.7, 3.7.4
and 3.8. Otherwise it fails with python 3.7.4 and 3.8.
- bin_to_assembly.py
Using ord(byte) here is an error on python 3.x use a conditional
expression instead.
- create_archive.py
Using ord(byte) here is an error on python 3.x use a conditional
expression instead.
Use `as inst` syntax which is required by 3.x
- create_string_literal.py
- gen_library_src_paths.py
Use `as inst` syntax which is required by 3.x
- make_version.py
print >> sys.stderr syntax is not supported by 3.x use file=sys.stderr
and add `from __future__ import print_function`
vmhash.update requires a string use encode('utf-8')
versopm+cc+text.replace requires a str so use `decode`.
Test: No added tests as there are no behavioral changes.
Change-Id: Id9b0a3187d06ad2b2dce3cf2244144393caddc9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124211
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Passing nullability rather than forcing kLegacy helps slightly reduce the number
of Types in the VM and in snapshots.
This allows to remove the kludge about declaration type of Null being kNullable.
Also pass nullability when creating a simple type may help.
Note that CFE is still producing super types and some interface types that are
non-nullable, even with nnbd features disabled. But this should get fixed and
further reduce the number of types in the snapshot.
Change-Id: I397f00902026ee5bc91d36328f4156427702efdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124480
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This saves one byte per Type and per TypeParameter objects in the snapshot.
Change-Id: Ie5241c992a5c5cc6b3d7a211f20e7a0ddbd00b72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124300
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
Crashes come from assertion in ReturnTokens() and new_mask() in Eventhandler.
Another issue is when multiple serversockets bind to the same address, Socket will be reused to all Dart_Ports. But Socket didn't keep track of corresponding Dart Port.
When one of isolates is killed, finalizer wakes up and close most recent Dart Port that sends data.
After this cl, Socket may not be reused by different Dart Sockets. All Dart socket will has its own Socket object. But Sockets can have same fd.
This will guarantee finalizer will close right Dart Port.
Bug: https://github.com/dart-lang/sdk/issues/36106
Change-Id: Ib4620ada5f120ffda719052297009280c73b4315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122490
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Right now a message handler is taking care of detecting idle timeouts
and notifying the isolate (or rather it's heap) that a compaction can
start.
Once we move the heap to the isolate group, we should only notify the
heap that we're idle if *all* isolates are idle. As a preparatory step
we move the idle timer functionality into it's own class and make the
isolate own it.
When the heap gets moved from isolate to isolate group, we'll also move
the idle time handler.
Issue https://github.com/dart-lang/sdk/issues/36097
Change-Id: If9b244baf0425ef343f909ee3a8a1147f966845b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116200
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
We attempted to delete the file with service protocol information
immediately after retrieving the URI. However, the spawned process could
potentially still have that file open which will cause the deletion to
fail on Windows. Fix is to wait until the process closes before deleting
to ensure it's not holding onto the file.
Change-Id: I85f715ad0570d121365373d498e539a667bd9d02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124165
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
This implements the logic for initializing, getting, and setting
non-final instance fields that have initializers. It doesn't address
statics, finals, local variables, or the no-initializer case, and is
only implemented for bytecode.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I3b9e2772abdc04e3bfede56d2fcf06738f234cbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122489
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
This paves the way for removing the old constant evaluator from the VM,
by no longer supporting versions without front-end constant evaluation.
For the front-end test that tests old kernel versions on the newest VM,
the dill files for versions before 29 are deleted.
Version 29 is from 2019-08-16: eae781c73e
Change-Id: Icb472bffc764d6e37ed1349a0cb4ff281e0e1b21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123739
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
This is the follow-up for https://dart-review.googlesource.com/c/sdk/+/123920.
RAW_CAST macro in the interpreter doesn't properly handle objects of
subclasses of a tested class (e.g. RAW_CAST(String, x) fails in debug mode
if x is OneByteString). So this CL replaces a couple of recently added
RAW_CAST with a more reliable RawCast.
Change-Id: Ifa94ce79985a5ae60c6f4d86ff7552b5124f649c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124102
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This CL
* adds a GN flag "include_dart2native" off by-default (switched on explicitly for our GN build)
* ensures every GN build of the "create_sdk" target has a working dart2native (except ia32)
* removes not-working dart2native script from ia32 dart-sdk (no AOT support in ia32)
* removes the "dartaotruntime" GN target, since it is the same as "dart_precompiled_runtime"
This should ensure every downstream consumer of the "create_sdk" GN target will
have a working version of dart2native.
For the particular "dart-sdk" we create on dart-sdk-{linux,windows,mac}
we will override the default AOT compiler&runtime with the product mode,
which produces smaller AOT snapshots and has smaller AOT runtime (making
the native executables significantly smaller)
Change-Id: Ib5042589297cdb055c41dc56abdff86a4612ef5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123724
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Bytecode format v20 was introduced Sep 06 2019 in
https://dart-review.googlesource.com/c/sdk/+/116120.
This change drops support for older bytecode format versions from VM.
Change-Id: I11b75ba16e6b7570e0346f9ac024265b08c0c801
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123920
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
VM creates Script objects with kKernelTag only, so this CL cleans up
all uses of script tags and Script::kind() along with code
which is no longer reachable.
Change-Id: Ia765e7757264aa614e18eddd16d21937f855c129
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123889
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
We no longer generate kernel files containing both AST and bytecode, so we don't need a flag to choose between them.
Change-Id: I1a4f7df507c649019c9fe254fa18a5826e2006aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122402
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Previously, before switching to compact encoding of bytecode
instructions, we had to align bytecode instructions by 4.
Since that time sections of bytecode binary were aligned.
However, this alignment doesn't work well in AOT mode if dill file
contains both bytecode and AST, as other metadata (such as obfuscation
prohibitions) may precede bytecode metadata and may make the whole
bytecode binary misaligned.
This results in incorrect calculation of section offsets,
failed assertion
assert(writer.offset - start == section.offset);
and VM may fail to load bytecode binary with error
bytecode_reader.cc: 1368: error: unreachable code
In order to fix these problems, extra alignment of bytecode
sections is removed.
Change-Id: Iaa3b7c46999615aaa446781a7018db409261ead8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123686
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This sets us up for migrating away from a dedicated timezone service
into a more general `fuchsia.intl.*`.
As a first step, let's use only one of the two equivalent FIDL service sets.
In fuchsia they are implemented by exactly the same handlers, so are equivalent
to the best of my knowledge.
Fixes#39174.
Change-Id: I229670bb96816af808a0cb14e6d2cba283f9ef62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123487
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Disabling the profiler will **not** release the sample buffer on Linux,
MacOS, and other platforms which utilize signals for profiling as
there's no way to ensure all signals have been receieved after the
thread interrupter has been shutdown.
Change-Id: Ifb3230fdb95e9bc9147cbd4b85d1a84e976ce119
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123554
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
The LLVM code generator should only consume the serialized IR and not use any other VM functionality.
This CL adds a custom zone which can be used for the deserialized IR nodes and removes any
Dart_SetVMFlags/Dart_Initialize/ApiZone/... calls.
This works with the existing example:
% ninja -C out/ReleaseX64 codegen
% out/ReleaseX64/codegen runtime/llvm_codegen/test/codegen/Inputs/hello.sex
...
define void @"hello.dart::main"() {
B1:
%0 = call i8* @llvm.stacksave()
%1 = ptrtoint i8* %0 to i64
%2 = load i64, i64 addrspace(256)* inttoptr (i64 72 to i64 addrspace(256)*)
%3 = icmp ult i64 %1, %2
br i1 %3, label %4, label %5
...
ret void
}
...
Change-Id: I1d07ba6bc122d100c73f97cfa961d36240489666
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120792
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Scripts loaded from kernel AST always have non-null line_starts
(line_starts could be zero-length if there are no line numbers).
Scripts loaded from bytecode can have null line_starts if line
numbers are not present, so Script::GetTokenLineUsingLineStarts is
fixed to handle this correctly.
Fixes https://github.com/dart-lang/sdk/issues/39168
Change-Id: I84b5e7ef804b07b3d35420eba5c17246264d8baa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123482
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
--verify_gc_contains is roughly O(heap^2) and gives false errors in some cases involving remembered cards
--verify_on_transition takes over 30 minutes for even hello world
Change-Id: Idee7e535bb96b11f0fa620532debbd21ca9d7135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123329
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
The lower-case "value()" metrics getter can only be used to obtain
metrics which are explicitly set by the VM.
The metrics we expose also include ones which are computed on-the-fly.
Those have to be accessed via "Value()".
Change-Id: I283c3c7c660d47c383b880b4bff6357a4dba9c01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123252
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Classes declared in bytecode are loaded lazily. So, in case there is
a mix of bytecode and AST kernel files, it's OK if AST constant
references a class which is not loaded yet, if that class is declared in
bytecode.
Change-Id: I6e28da7c6a97d19d88e16d6cd8abd0e9b61df388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122847
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
This also removes the now redundant bytecode testing from the dartkb
builders.
Replace the useKernelBytecode boolean option with a more flexible
genKernelOptions string list option.
See also See also https://dart-review.googlesource.com/c/sdk/+/122321/ for the
corresponding Luci config updates.
Change-Id: Iabb207bc02637b758c42c00ae9175bd52f46559f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122320
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
This reverts commit b5b322962a.
Reason for revert: low frequency of crashes in service tests
Original change's description:
> [vm, arm64] Adjust CSP during the invocation stub instead of each function prologue.
>
> Since 6e2c4636cd, we have more reliable information about the stack limit.
>
> This saves 8 bytes from each function.
>
> Flutter Gallery:
> Instructions(CodeSize): 6491472 -> 6375472 (-1.79%)
> Total(CodeSize): 10375882 -> 10258802 (-1.13%)
>
> Bug: http://dartbug.com/26472
> Change-Id: Ief1ddd25eecd32a8314c71fdb470dd73046e5dc0
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122408
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
TBR=rmacnak@google.com,alexmarkov@google.com,ajcbik@google.com
Change-Id: I0b45e1c81c1534e123dd85d27b7af27217e08795
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: http://dartbug.com/26472
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122725
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Since 6e2c4636cd, we have more reliable information about the stack limit.
This saves 8 bytes from each function.
Flutter Gallery:
Instructions(CodeSize): 6491472 -> 6375472 (-1.79%)
Total(CodeSize): 10375882 -> 10258802 (-1.13%)
Bug: http://dartbug.com/26472
Change-Id: Ief1ddd25eecd32a8314c71fdb470dd73046e5dc0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122408
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Removed a couple of unused KernelLoader members; several members
changed from public to private.
Change-Id: I3950a260e8476229ca7de2ee795cac581d307b29
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122492
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>