Commit Graph

2008 Commits

Author SHA1 Message Date
Liam Appelbe 9e03c2c506 [vm] Add required flag to parameters, and implement subtyping rules.
This CL only covers AST mode, and doesn't address function resolution.

Bug: https://github.com/dart-lang/sdk/issues/39755
Change-Id: I19280fb0d373aa9eb17da13677fd5bb1230385da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131701
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2020-02-26 00:38:54 +00:00
Alexander Markov 55cc495451 [vm/nnbd] Rename --strong-non-nullable-type-checks to --null-safety and pass it to CFE
Issue: https://github.com/dart-lang/sdk/issues/38845
Change-Id: I9baeb4a384a6b2de79df9f97e82c127ae4f611c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137120
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2020-02-25 20:05:39 +00:00
Régis Crelier baa0bc0d8e [VM/nnbd] Fix type parameter comparison used in type equality.
This is a partial fix for issue #40733.
Handling of required named parameters is not implemented yet.

This is also fixing:
language_2/type/alias_equality_test/03 was fixed (RuntimeError -> Pass)
language_2/type/alias_equality_test/04 was fixed (RuntimeError -> Pass)

Change-Id: I97f6327fa08c6fc140c1d8805f85eaa204ebc037
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136881
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-25 02:31:50 +00:00
Régis Crelier fd20c7b92b [VM/nnbd] Print nullability of types by default.
Only '?' is shown by default.
To print '*' and '%', use debugging flag --show-internal-names.
Fix expectations in tests.

Change-Id: Idc60fbfb4d477602eb0c713f4bdcc1e573a3328a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135790
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2020-02-20 21:43:25 +00:00
Martin Kustermann dae308461c [vm/concurrency] Share [Heap] and [SharedClassTable] between all isolates within one isolate group
This CL:

  * Moves [Heap]/[SharedClassTable] from [Isolate] to [IsolateGroup], which
    will make all isolates in the group use the same heap. The GC will use
    the shared class table for object size information.

  * Adds support for entering/leaving an isolate group as a helper thread
    (e.g. via [Thread::EnterIsolateGroupAsHelper]). The current active
    isolate group can be accessed via TLS `IsolateGroup::Current()` or
    `Thread::isolate_group_`. When entering as a helper thread there will be
    no current isolate.

  * Changes the GC to use the above mechanism and ensures GC works without
    a currently active isolate. The GC will use information purely available via
    [IsolateGroup]. The GC will iterate all isolates within an isolate
    group e.g. for scanning roots.

  * Makes spawning of new isolates start in their own isolate group.
    Once the isolate is fully functional it's heap will be merged into
    the original isolate group

  * Moves ApiState, containing persistent and weak persistent handles,
    from [Isolate] to [IsolateGroup], plus adds appropriate locking.

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

Change-Id: Ia8e1d8aa78750e8400864200f4825395a182c004
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126646
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-02-20 21:08:35 +00:00
Régis Crelier f7a901751b Reland "[VM/runtime] Fix type tests with LHS FutureOr (fixes #38906)."
This is a reland of 3ef5270f71

Original change's description:
> [VM/runtime] Fix type tests with LHS FutureOr (fixes #38906).
> 
> Fixes tests/language_2/subtyping_static/future_or_subtype_test
> Also simplifies code making use of TypeAtNullSafe().
> 
> Change-Id: I045a030b2ece9d6980f7a9ba785948f0c10f697b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135625
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

Change-Id: Ie3254f6aca3d47a00aead0ac34f3a6b9f301d8dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136680
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-02-20 21:01:25 +00:00
Régis Crelier 088e31036b Revert "[VM/runtime] Fix type tests with LHS FutureOr (fixes #38906)."
This reverts commit 3ef5270f71.

Reason for revert: precomp not tested by CQ and failing

Original change's description:
> [VM/runtime] Fix type tests with LHS FutureOr (fixes #38906).
> 
> Fixes tests/language_2/subtyping_static/future_or_subtype_test
> Also simplifies code making use of TypeAtNullSafe().
> 
> Change-Id: I045a030b2ece9d6980f7a9ba785948f0c10f697b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135625
> Commit-Queue: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

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

Change-Id: Ie6399e6c6cfd602dc7388a1a9ef5a7c335e70c65
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136528
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2020-02-20 01:47:45 +00:00
Régis Crelier 3ef5270f71 [VM/runtime] Fix type tests with LHS FutureOr (fixes #38906).
Fixes tests/language_2/subtyping_static/future_or_subtype_test
Also simplifies code making use of TypeAtNullSafe().

Change-Id: I045a030b2ece9d6980f7a9ba785948f0c10f697b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135625
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-20 01:14:15 +00:00
Samir Jindel 1fbc71da0f Re-land "[vm] AOT blobs snapshots are obsolete. Remove dead code."
Original change is in Patchset 1. I erroneously assumed DART_PRECOMPILER
was only used AOT compilation (it is also used for JIT snapshots).

Change-Id: I77f6c463db7f2b482c9b098f353dc28f0676ea0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135900
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2020-02-17 11:12:15 +00:00
Alexander Markov c1616f92ef [vm] Introduce FutureOr class in the VM
This makes it possible to use FutureOrCid in the VM and efficiently
test if type is FutureOr. This also makes it possible to use predicates
like IsTopType very early during VM bootstrapping (before reusable
handles are initialized). The latter is needed to correctly select
type testing stub for top types.

Change-Id: I4c482143c0ebaafa1c8e13e95dc6f20e3af7059a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136000
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-14 21:40:17 +00:00
Teagan Strickland 6d04a0db25 [vm] Clean up interfaces/encoding for CompressedStackMaps.
Change-Id: Ie897f44fc02e1e9ae37f2625f3cb0ac4df1595d6
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135651
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-14 17:57:47 +00:00
Siva Annamalai edd64e6d5c Revert "[vm] AOT blobs snapshots are obsolete. Remove dead code."
This reverts commit bcc0900e6a.

Reason for revert: This CL is breaking the Fuchsia Flutter build see https://github.com/flutter/engine/pull/16604/checks?check_run_id=445155807 

Original change's description:
> [vm] AOT blobs snapshots are obsolete. Remove dead code.
> 
> Change-Id: I35cf4befbe66b92197dcd659172f90be3de30f8e
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134840
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

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

Change-Id: I9dd32a71bf43907f59ed766b98bf453bab99ea3c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135881
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-02-14 06:40:31 +00:00
Samir Jindel bcc0900e6a [vm] AOT blobs snapshots are obsolete. Remove dead code.
Change-Id: I35cf4befbe66b92197dcd659172f90be3de30f8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134840
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-02-13 14:16:49 +00:00
Alexander Markov 0966e06ee4 Reland "[vm/nnbd] Enable type testing stubs in NNBD weak mode"
This is a reland of bffc9d101e

Original change's description:
> [vm/nnbd] Enable type testing stubs in NNBD weak mode
> 
> According to the current NNBD spec we should use legacy subtyping rules
> when running in weak mode (disregarding nullability and accepting 'null'
> in type casts). So we can reuse exactly the same type testing stubs as
> we used before (in NNBD weak mode).
> 
> Change-Id: I387660fc2c8b36eb993239de9e34cc2bf9f7bb93
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135381
> Commit-Queue: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

Change-Id: Id40fe1465e480caaca1ab568664d2c45c96539a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135526
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-12 22:00:57 +00:00
Martin Kustermann e441b9fa9b [vm/concurrency] Add locking to ApiState as preparation for multiple isolates using the same api state
Once multiple isolates share one heap we'll start sharing the set of
weak/persistent handles present in the ApiState.

This is split out of the shared heap cl to make it smaller.

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

Change-Id: I3b8eb1ebd9361ff56f5272042ae002f57fa61ddd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/135308
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2020-02-11 22:19:45 +00:00
Régis Crelier 4f35a405ff [VM/nnbd] Update runtime and code generation of 'is instance of' for NNBD.
This implements the recent spec changes.
Fixes #40276.

Change-Id: Ia458d62154281dd74f019cb14c08e232859840e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134807
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-10 20:00:04 +00:00
Teagan Strickland e01457d138 Reland "[vm/aot] Remove object wrapping of bare instructions for AOT snapshots."
Now, when writing an AOT snapshot in bare instructions mode, only
the actual instructions in the RawInstructions payload are serialized
instead of the entire RawInstructions object.

Since there are no longer RawInstructions objects in these AOT
snapshots, we also change how Code objects are serialized. Instead
of just containing a reference to the RawInstructions object, we
serialize two pieces of information: where the instructions
payload for this Code object begins and whether there was a single
entry for the instructions payload. (To save space, the single
entry bit is serialized as the low order bit of the unchecked
offset, which was already being serialized).

While we also need the length of the instructions payload, we
approximate it for all but the last Code object by subtracting
the next Code object's payload start from this Code object's
payload start. For the last Code object, we assume it extends
to the end of the instructions image.

Changes on flutter gallery in release mode:
armv7: instructions size -2.70%, total size -1.73%
armv8: instructions size -6.04%, total size -3.63%

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

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Change-Id: Ia0a5c4e5e47c956776dc62503da38ec55a143c04
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134325
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-10 15:08:04 +00:00
Ryan Macnak a73b0ceda2 [vm, lib] Teach mirrors about the Never type and member signatures.
Bug: https://github.com/dart-lang/sdk/issues/12478
Bug: https://github.com/dart-lang/sdk/issues/40497
Bug: https://github.com/dart-lang/sdk/issues/40510
Change-Id: I841d7e239b8235555ec26fbcb74ca41b5de60f58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134806
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-07 20:57:46 +00:00
Alexander Markov 7bf057bdfa [vm/nnbd] Stop using Function::nnbd_mode() in a couple of places
This CL fixes crashes

../../runtime/vm/compiler/frontend/kernel_binary_flowgraph.cc: 3637: error: expected: nnbd_mode == parsed_function()->function().nnbd_mode()

due to Function::nnbd_mode() returning incorrect result when function
belongs to a synthetic mixin application class.

Change-Id: I7860eb6120b7291848d655d8151af2472421920d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134785
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-06 22:44:34 +00:00
Régis Crelier 3598d4340d [VM/nnbd] Consider nullability of type parameters in function type tests.
This also fixes issue #40259.

Change-Id: I2e603e927e98270bb24b726444490993e6360f97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134572
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-06 01:45:29 +00:00
Alexander Markov e8cb7f1bc9 [vm/nnbd] Make sure nullability is not changed after type testing stub is selected
Fixes https://github.com/dart-lang/sdk/issues/40465

Change-Id: Iaa221440e941b725e8ca123b6708b510b8ef015b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134413
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2020-02-05 18:02:20 +00:00
Teagan Strickland bb24f98616 Revert "[vm/aot] Remove object wrapping of bare instructions for AOT snapshots."
This reverts commit 7475c637c3.

Reason for revert: Breakage on simarm_x64 (and thus arm_x64)

Original change's description:
> [vm/aot] Remove object wrapping of bare instructions for AOT snapshots.
> 
> Now, when writing an AOT snapshot in bare instructions mode, only
> the actual instructions in the RawInstructions payload are serialized
> instead of the entire RawInstructions object.
> 
> Since there are no longer RawInstructions objects in these AOT
> snapshots, we also change how Code objects are serialized. Instead
> of just containing a reference to the RawInstructions object, we
> serialize two pieces of information: where the instructions
> payload for this Code object begins and whether there was a single
> entry for the instructions payload. (To save space, the single
> entry bit is serialized as the low order bit of the unchecked
> offset, which was already being serialized).
> 
> While we also need the length of the instructions payload, we
> approximate it for all but the last Code object by subtracting
> the next Code object's payload start from this Code object's
> payload start. For the last Code object, we assume it extends
> to the end of the instructions image.
> 
> Changes on flutter gallery in release mode:
> armv7: instructions size -2.66%, total size -1.68%
> armv8: instructions size -5.81%, total size -3.49%
> 
> Fixes https://github.com/dart-lang/sdk/issues/38451.
> 
> Change-Id: Ia458e8d99bae18f5c3b6e849df2519027f06f574
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131067
> Commit-Queue: Teagan Strickland <sstrickl@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,rmacnak@google.com,sstrickl@google.com

Change-Id: If2c8ca6b0993211b2509b275af7ff11a8fa2baa3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-simarm_x64-try, vm-kernel-precomp-android-release-arm64-try, vm-kernel-precomp-android-release-arm_x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134322
Reviewed-by: Teagan Strickland <sstrickl@google.com>
Commit-Queue: Teagan Strickland <sstrickl@google.com>
2020-02-04 17:32:28 +00:00
Victor Lima e076e793a7 [vm] Allow unboxed integer fields in AOT
flutter arm-v8:
  gallery instructions size: -0.46%
  gallery total size: -0.35%

  sync_star_generated (Pixel 2): -8.04% (less is better)
  velocity_tracker_bench (Pixel 2): -9.18% (less is better)

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

Change-Id: Ieb7bf426af37f77fd543ebc5314a94224da3aaeb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132606
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-04 12:37:21 +00:00
Teagan Strickland 7475c637c3 [vm/aot] Remove object wrapping of bare instructions for AOT snapshots.
Now, when writing an AOT snapshot in bare instructions mode, only
the actual instructions in the RawInstructions payload are serialized
instead of the entire RawInstructions object.

Since there are no longer RawInstructions objects in these AOT
snapshots, we also change how Code objects are serialized. Instead
of just containing a reference to the RawInstructions object, we
serialize two pieces of information: where the instructions
payload for this Code object begins and whether there was a single
entry for the instructions payload. (To save space, the single
entry bit is serialized as the low order bit of the unchecked
offset, which was already being serialized).

While we also need the length of the instructions payload, we
approximate it for all but the last Code object by subtracting
the next Code object's payload start from this Code object's
payload start. For the last Code object, we assume it extends
to the end of the instructions image.

Changes on flutter gallery in release mode:
armv7: instructions size -2.66%, total size -1.68%
armv8: instructions size -5.81%, total size -3.49%

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

Change-Id: Ia458e8d99bae18f5c3b6e849df2519027f06f574
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm_x64-try,vm-kernel-precomp-android-release-arm64-try,vm-kernel-precomp-android-release-arm_x64-try,vm-kernel-precomp-mac-release-simarm64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131067
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-02-04 10:28:43 +00:00
Aske Simon Christensen 76c6282de6 [vm/aot] Use a global dispatch table for instance calls in AOT.
This is a Dart-tailored implementation of the "row-displacement
dispatch table" technique for closed-world instance calls:

All interface targets in the program are grouped into selectors such
that all targets that could potentially be called from the same call
site have the same selector (currently just grouped by name).

Each selector is assigned a selector offset such that offset + classid
is unique for all selector/classid combinations where the class
implements the selector.

At every instance call site that has an interface target (i.e. where
the static type of the receiver is not dynamic), the selector offset +
receiver classid is computed and used as index into a global table of
entry points.

If the receiver can be null (as determined by the front-end TFA and the
VM type propagation), a null check is inserted before the call.

An arguments descriptor is provided (only) for selectors that need it
(those which have type parameters or optional/named parameters).

The dispatch table calls don't need the monomorphic entry code, so for
functions that are only called via dispatch table calls (i.e. never
called dynamically), the monomorphic entry code is left out.


Some future improvements to the table dispatch implementation are
mentioned in https://github.com/dart-lang/sdk/issues/40188


The table dispatch flag is disabled by default in this commit. A
separate commit enables the flag.

Change-Id: Ic2911742b4a2c9a8d3bc7df60605454cbe4c0714
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126648
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-02-03 11:04:15 +00:00
Martin Kustermann bada62ba7b [vm/reload] Fix crash in scavneger / GC after reload on ia32
If generated code refers to a constant object (which are old and canonical), a pointer
to it will be embedded in the instruction stream on ia32.

If we now reload and morph this constant object and allocate the
morph'ed copy in new space, the become operation will make RX writable
and the slot in the instruction stream gets updated to point to a new
space object and the code gets added to the remembered set.

The next scavenge operation will scan the remembered set as roots, see
the poitner to a new object, move the object and updates the pointer in
the instruction stream.
  => We hit a SEGV trying to write the RX memory

We can avoid this problem by ensuring to morph old+canonical instances
always into old space on ia32.

Change-Id: Id63eb6ee1735bbb661dbeceb1e8d0c6ac92225ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133228
Auto-Submit: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-31 16:42:42 +00:00
Victor Lima b68d95ec9e [vm] Reland support for real unboxed floating point fields in AOT
Issue https://github.com/dart-lang/sdk/issues/40404

Change-Id: Icfa801ff0640a6b27bb3c13d0b737c40452cbf7d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133983
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-31 12:56:31 +00:00
Zichang Guo 162d6c5634 Revert "[vm] Add support for real unboxed floating point fields in AOT"
This reverts commit 9eb531bde4.

Reason for revert: Bots are red. Some tests are failing.

https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-obfuscate-linux-release-x64/6039

https://ci.chromium.org/p/dart/builders/ci.sandbox/vm-kernel-precomp-android-release-arm_x64/957

Original change's description:
> [vm] Add support for real unboxed floating point fields in AOT
> 
> Non-nullable floating point fields (double, Float32x4, Float64x2)
> are fully unboxed in their classes.
> 
> A bitmap for each class was added to the shared class table in order to keep
> track of the pointers of the classes. Since all classes in Flutter Gallery
> have less than 64 fields, the bitmap is represented by a 64 bit integer and
> fields whose offset is more than 64 words are not unboxed.
> 
> The instance sizes and field offsets might change between target and host
> in cross-compilation, since the number of words used to store unboxed fields
> may differ.
> 
> dart-aot Xeon
> 
>   SplayLatency               -4.62%
>   SplayHarderLatency         -4.17%
>   NavierStokes               -2.20%
>   Tracer                      8.72%
>   ParticleSystemPaint         2.90%
>   NBodySIMD                   8.35%
>   NBody                      25.59%
> 
> With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable:
> 
> flutter arm-v8:
> 
>   gallery total size: -1%
> 
>   matrix_utils_transform_rect_perspective   -16.70% (less is better)
>   matrix_utils_transform_rect_affine        -31.82% (less is better)
>   matrix_utils_transform_point_perspective  -24.90% (less is better)
>   matrix_utils_transform_point_affine)      -27.26% (less is better)
>   rrect_contains_bench                      -4.719% (less is better)
> 
> Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824
> Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>

TBR=kustermann@google.com,rmacnak@google.com,sjindel@google.com,victoragnez@google.com

Change-Id: Ic73858f6adb7f55c4129d4f46ff4731b378cb634
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134020
Reviewed-by: Zichang Guo <zichangguo@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2020-01-30 18:13:28 +00:00
Victor Lima 9eb531bde4 [vm] Add support for real unboxed floating point fields in AOT
Non-nullable floating point fields (double, Float32x4, Float64x2)
are fully unboxed in their classes.

A bitmap for each class was added to the shared class table in order to keep
track of the pointers of the classes. Since all classes in Flutter Gallery
have less than 64 fields, the bitmap is represented by a 64 bit integer and
fields whose offset is more than 64 words are not unboxed.

The instance sizes and field offsets might change between target and host
in cross-compilation, since the number of words used to store unboxed fields
may differ.

dart-aot Xeon

  SplayLatency               -4.62%
  SplayHarderLatency         -4.17%
  NavierStokes               -2.20%
  Tracer                      8.72%
  ParticleSystemPaint         2.90%
  NBodySIMD                   8.35%
  NBody                      25.59%

With hack TFA to make doubles in Rect/Offset/Size classes in flutter non-nullable:

flutter arm-v8:

  gallery total size: -1%

  matrix_utils_transform_rect_perspective   -16.70% (less is better)
  matrix_utils_transform_rect_affine        -31.82% (less is better)
  matrix_utils_transform_point_perspective  -24.90% (less is better)
  matrix_utils_transform_point_affine)      -27.26% (less is better)
  rrect_contains_bench                      -4.719% (less is better)

Change-Id: I9ae09c9c3167d99f9efd071a92937aa51093fd1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131824
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2020-01-30 13:45:08 +00:00
Ryan Macnak a067265272 [vm] Scrub and qualify names without allocating on the Dart heap.
Sometimes we needs to produce these names in a NoSafepointScope, such as when generating a snapshot.

Bug: https://github.com/dart-lang/sdk/issues/40143
Change-Id: I0d66134c936313b16c38f8699b33a7c7bd443e75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133153
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2020-01-24 20:36:18 +00:00
Alexander Aprelev e2aadc7a07 Reland "[vm/fieldtable] Move current field values out of Field object into separate table."
This reverts commit c8f8c11b70 with the fix for https://github.com/flutter/flutter/issues/49008 in Patchset 2.

Change-Id: I85406b92a69ed950d0ba945f96997658be3cae64
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132302
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-01-17 18:12:24 +00:00
Alexander Aprelev c8f8c11b70 Revert "[vm/fieldtable] Move current field values out of Field object into separate table."
This reverts commit 85e396a1de as it broke internal app running on android arm in release mode.

Change-Id: Iaff0cf3c1ef859e35b4eaeb3ac8243ce3c6737b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132168
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2020-01-17 00:24:20 +00:00
Samir Jindel d0909e068a Reland "[vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object."
This reverts commit 5f81efb4a3.

Reason for revert: 3xH bot is green again.

Original change's description:
> Revert "[vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object."
> 
> This reverts commit ab2026af45.
> 
> Reason for revert: Flutter 3xH is broken on Golem.
> 
> Original change's description:
> > [vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object.
> > 
> > Flutter Gallery ARMv8: -0.8% total, -1.3% instructions
> > Flutter Gallery ARMv7: -0.7% total, -1.2% instructions
> > 
> > There are some performance regressions, in four categories:
> > 
> > 1. Arithmetic on num types (e.g. MinLib, MaxLib):
> >    We believe arithmetic on num types is rare in practice, and can be optimized later
> >    by specializing the call-sites.
> > 
> > 2. Lack of types (e.g. MeshDecompression, ImagingGaussianBlur, Crypto*):
> >    These (and similar benchmarks) are written in a very untyped style, which is not
> >    representative of Dart 2 style. We've confirmed that the regressions disappear if
> >    the benchmarks are annotated with appropriate types.
> > 
> > 3. Megamorphic calls which are specialized in the benchmark (e.g. DeltaBlue):
> >    DeltaBlue uses string interpolation in one place, so the toString() method in the
> >    string interpolation helper is monomorphic for _Smis. However, in a realistic programs,
> >    string interpolation is used much more frequently and with different types, so it's very
> >    unlikely that this call would be monomorphic. When string interpolation is removed, there's
> >    a remaining 1.3% regression on DeltaBlue which is not yet accounted for.
> > 
> > 4. Noisy benchmarks
> >    The remaining regressions are on benchmarks which show frequent jitter historically.
> > 
> > There are also 1-4% improvements on many benchmarks (Golem's "noise" analysis is hiding
> > many of them, look at the graphs).
> > 
> > For the reasons above, we believe the regressions justified by the code size improvement.
> > 
> > Change-Id: Ic9b281d4383a6111de9d6f44347976ffa61a6ca6
> > Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm64-try
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128667
> > Commit-Queue: Samir Jindel <sjindel@google.com>
> > Reviewed-by: Ryan Macnak <rmacnak@google.com>
> > Reviewed-by: Martin Kustermann <kustermann@google.com>
> 
> TBR=kustermann@google.com,rmacnak@google.com,alexmarkov@google.com,sjindel@google.com
> 
> Change-Id: I411aae4b230f2a08146ad3bf3e7a10aa6592db0e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131660
> Reviewed-by: Samir Jindel <sjindel@google.com>
> Commit-Queue: Samir Jindel <sjindel@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I36e4e9d598033fcc934c2cdf5b061aa11255d3b2
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131837
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2020-01-16 14:21:16 +00:00
Victor Lima afa98b977a [vm] Ensure abstract classes are marked as such and get a size of 0 in shared class table.
Change-Id: If19444e702a2b73a829bd9f581ff36ad041ecf41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131801
Commit-Queue: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-16 10:34:53 +00:00
Samir Jindel 5f81efb4a3 Revert "[vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object."
This reverts commit ab2026af45.

Reason for revert: Flutter 3xH is broken on Golem.

Original change's description:
> [vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object.
> 
> Flutter Gallery ARMv8: -0.8% total, -1.3% instructions
> Flutter Gallery ARMv7: -0.7% total, -1.2% instructions
> 
> There are some performance regressions, in four categories:
> 
> 1. Arithmetic on num types (e.g. MinLib, MaxLib):
>    We believe arithmetic on num types is rare in practice, and can be optimized later
>    by specializing the call-sites.
> 
> 2. Lack of types (e.g. MeshDecompression, ImagingGaussianBlur, Crypto*):
>    These (and similar benchmarks) are written in a very untyped style, which is not
>    representative of Dart 2 style. We've confirmed that the regressions disappear if
>    the benchmarks are annotated with appropriate types.
> 
> 3. Megamorphic calls which are specialized in the benchmark (e.g. DeltaBlue):
>    DeltaBlue uses string interpolation in one place, so the toString() method in the
>    string interpolation helper is monomorphic for _Smis. However, in a realistic programs,
>    string interpolation is used much more frequently and with different types, so it's very
>    unlikely that this call would be monomorphic. When string interpolation is removed, there's
>    a remaining 1.3% regression on DeltaBlue which is not yet accounted for.
> 
> 4. Noisy benchmarks
>    The remaining regressions are on benchmarks which show frequent jitter historically.
> 
> There are also 1-4% improvements on many benchmarks (Golem's "noise" analysis is hiding
> many of them, look at the graphs).
> 
> For the reasons above, we believe the regressions justified by the code size improvement.
> 
> Change-Id: Ic9b281d4383a6111de9d6f44347976ffa61a6ca6
> Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128667
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

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

Change-Id: I411aae4b230f2a08146ad3bf3e7a10aa6592db0e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131660
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2020-01-14 14:58:45 +00:00
Samir Jindel ab2026af45 [vm/aot] Only patch call-sites to monomorphic entry-points when the receiver is proven to be a heap object.
Flutter Gallery ARMv8: -0.8% total, -1.3% instructions
Flutter Gallery ARMv7: -0.7% total, -1.2% instructions

There are some performance regressions, in four categories:

1. Arithmetic on num types (e.g. MinLib, MaxLib):
   We believe arithmetic on num types is rare in practice, and can be optimized later
   by specializing the call-sites.

2. Lack of types (e.g. MeshDecompression, ImagingGaussianBlur, Crypto*):
   These (and similar benchmarks) are written in a very untyped style, which is not
   representative of Dart 2 style. We've confirmed that the regressions disappear if
   the benchmarks are annotated with appropriate types.

3. Megamorphic calls which are specialized in the benchmark (e.g. DeltaBlue):
   DeltaBlue uses string interpolation in one place, so the toString() method in the
   string interpolation helper is monomorphic for _Smis. However, in a realistic programs,
   string interpolation is used much more frequently and with different types, so it's very
   unlikely that this call would be monomorphic. When string interpolation is removed, there's
   a remaining 1.3% regression on DeltaBlue which is not yet accounted for.

4. Noisy benchmarks
   The remaining regressions are on benchmarks which show frequent jitter historically.

There are also 1-4% improvements on many benchmarks (Golem's "noise" analysis is hiding
many of them, look at the graphs).

For the reasons above, we believe the regressions justified by the code size improvement.

Change-Id: Ic9b281d4383a6111de9d6f44347976ffa61a6ca6
Cq-Include-Trybots:luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-bare-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128667
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-14 13:18:05 +00:00
Samir Jindel 8617867757 [vm] Clone boxes for unboxed numeric fields upon rematerialization.
Fixes https://github.com/dart-lang/sdk/issues/39112

Change-Id: I0d6a7686fdef6182bba16fdceb2ff773650a0e28
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128062
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Victor Agnez Lima <victoragnez@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-14 12:57:55 +00:00
Martin Kustermann a4207fd03c [vm/aot] Avoid loading the code register (in bare-AOT) and zeroing IC data reg (in AOT) for closure calls
This removes two instructions per closure call and makes them faster.

Change-Id: I0fe3befe694dd8fab50d382d84459e7896865d21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131062
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-13 11:08:54 +00:00
Régis Crelier d36805e0ac [VM//nnbd] Update code generation of 'is instance of' for NNBD.
This also fixes the implementation of 'null is T' in legacy vs opted-in library
by making it independent of strong/weak mode.
Includes updates to type propagation and call specializer.

Change-Id: I2d347ef277e08cef779faf51a972e863244ef095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130922
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
2020-01-11 01:28:52 +00:00
Régis Crelier e2e290b4cf [VM/nnbd] Simplify NNBDMode enum class.
NNBDMode does not reflect the semantics (legacy or nnbd) of type tests anymore.
Instead, the semantics are derived from the value of the strong mode flag.
This required one function to be specialized, namely the implementation of
'null is Type' in weak mode in an opted-in library, which still requires
nnbd semantics although run in weak mode.
Relevant changes are in object.h and object.cc:
- methods NNBD_NullIsInstanceOf and NNBD_IsTopType are new.
- methods IsNullType, IsTopType, and IsNeverType are modified.

Change-Id: I36cd43d93d2cfabd110cbcc6b26487a583bb089d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130444
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-08 19:35:00 +00:00
asiva ac4b43f0a8 [VM/runtime] - Remove DART_NO_SNAPSHOT
- Remove the define DART_NO_SNAPSHOT in all the build configs
- Remove all conditional code under DART_NO_SNAPSHOT

Change-Id: Ia01d09de7c4b1813a5e172a630950e637e476713
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130566
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-08 18:56:21 +00:00
Samir Jindel 8a39cb8f66 [vm] Enable multiple entry-points on IA32.
Issue https://github.com/dart-lang/sdk/issues/34162

Change-Id: If3ca8448012dd1e3dc6e5f638e24202f53ccaf60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129716
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-01-07 17:05:44 +00:00
Régis Crelier 482ae8cb5b [VM/nnbd] Implement weak and strong mode type checking in runtime.
This does not yet include checking of required named parameters.
Also, inlined type testing code, type testing stubs, and type propagation are
not yet updated.

Change-Id: If6d8996635474e349d28b7fd207d724838d08881
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129922
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-01-06 22:32:19 +00:00
Alexander Aprelev 85e396a1de [vm/fieldtable] Move current field values out of Field object into separate table.
This is to support sharing of Field objects between isolate group's isolates.

Each isolate will have it's own field table with static instances/values.
field_table is stored on isolate, copied over to thread for easier access.

This also removes the write barrier from static field assignments; the field table is a GC root.

Bug: https://github.com/dart-lang/sdk/issues/37835
Bug: https://github.com/dart-lang/sdk/issues/36097
Change-Id: I232a86f059ac4cacc3e9f54bcc31d1d0524f9496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127582
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2020-01-06 18:58:11 +00:00
Martin Kustermann addd5eea00 [vm/compiler] Consistently use pc-offsets of pointing to instruction after call in static calls table, to ensure unique offsets
The pc-relative calls were recorded with pc-offsets pointing to the start of the
call instruction, where as code-based calls were recorded with
pc-offsets pointing to the next instruction (i.e. return address).

This is inconsistent and caused us to hit an assert in
`Code::set_static_calls_target_table`. The assert was benign, but it is
good to maintain the uniqueness guarantee in the static calls table, so
we'll unify the encoding to use offsets to the instruction after the
call in both cases.

Closes https://github.com/dart-lang/sdk/issues/39811

Change-Id: Id0305befd78f09ed0b0e100f39641bca9e764442
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129717
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2020-01-03 17:17:59 +00:00
Régis Crelier b92fefdfe9 [VM/nnbd] Pass nnbd mode from compiler via generated code or bytecode to runtime functions performing type checks or type reification.
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>
2019-12-20 03:26:29 +00:00
Liam Appelbe 730191fcbd [vm] Implement nullability check in type equality intrinsic
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>
2019-12-19 16:55:23 +00:00
Jens Johansen 8d11c1dce6 [kernel][vm] Add uris only from mixins to libraries sourceReferences
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>
2019-12-19 06:59:28 +00:00
Liam Appelbe 44da51fc72 [vm] More fast paths in type equality intrinsic
Change-Id: I2a5b02c6803b15226ec4bdcab698043252500413
Bug: https://github.com/dart-lang/sdk/issues/39755
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128005
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-12-17 20:39:14 +00:00
Ryan Macnak 6b5d9f1d1b [vm] Progress toward running without TSAN warnings.
- 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>
2019-12-16 18:32:23 +00:00