Commit graph

271 commits

Author SHA1 Message Date
Alexander Aprelev
0c481a196c Revert Reland '[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).' as it breaks flutter profile execution on ios 32-bit platform.
Fixes https://github.com/flutter/flutter/issues/40114

Change-Id: If8d71e9c19c2e794d29f7ecbacb87457890a2fd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116883
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-09-12 00:10:09 +00:00
Ryan Macnak
03b195164b Revert "[vm, snapshot] Use data image pages for kFull snapshots."
This reverts commit c8f3f132ad.

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

This reverts commit 1d6ab52f38.

Bug: b/140791872
Change-Id: I34c42310e3ec4a09048967f34a0e1ddc6a67ea93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116688
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-09-10 23:52:52 +00:00
Alexander Markov
ef2a21ffd9 [vm/bytecode] Use local variable information when compiling from bytecode
This includes types and names of local variables.
Fixes vm/cc/IRTest_TypedDataAOT_FunctionalGetSet with bytecode.

Change-Id: I6130f19b4028f4930dbfcb282b90dd2ec4f963e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116082
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-09-09 19:23:16 +00:00
Ryan Macnak
84db16381d [vm] Remove dead --load_deferred_eagerly and dependent code tracking for library prefixes.
Since Dart 2, library prefixes are always loaded eagerly on the VM.

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

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

Change-Id: I896d104260593b146ad15e1845e391ae765e60e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115341
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-06 18:24:19 +00:00
Martin Kustermann
a64b06ec83 [gardening] Migrate most files to be implicit-bool-conversion free
Issue https://dart-review.googlesource.com/c/sdk/+/115701

Change-Id: Ib579f0bbc8d694aec74afd837217316a10baf910
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115707
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-09-05 21:41:42 +00:00
Samir Jindel
c219a76652 Reland "[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs)."
The original change is in Patchset 1.
The dependency contains the fix for the non-bare-instructions bot.

Change-Id: Iab02ab0736a2ee9144b667d2777ca526341b2a36
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try,vm-dartkb-linux-release-x64-abi-try,vm-kernel-precomp-bare-linux-release-x64-try,vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115241
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-09-05 20:19:22 +00:00
Samir Jindel
72e8bdc56b Revert "[vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs)."
This reverts commit ecbea5a58e.

Reason for revert: broken with bare instructions and ABI bot

Original change's description:
> [vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).
> 
> To do this, we add writable data sections (currently uninitialzed) to ELF and Asm snapshots
> and allow Instructions to have patchable relocations against (the start of) these sections.
> 
> Issue https://github.com/dart-lang/sdk/issues/37295 (see also for design & discussion).
> 
> Change-Id: If20bfa55776f4044aaa6bb8ea2101d2ada41842c
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110221
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

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

Change-Id: I9787da6d42575ca4f5ae0a698052a19ac4275afd
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-product-x64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-android-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115240
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-09-03 12:31:15 +00:00
Samir Jindel
ecbea5a58e [vm/ffi] Implement FFI callbacks on AOT for ELF and Asm snapshots (excl. blobs).
To do this, we add writable data sections (currently uninitialzed) to ELF and Asm snapshots
and allow Instructions to have patchable relocations against (the start of) these sections.

Issue https://github.com/dart-lang/sdk/issues/37295 (see also for design & discussion).

Change-Id: If20bfa55776f4044aaa6bb8ea2101d2ada41842c
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-linux-debug-x64-try,vm-kernel-precomp-linux-product-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-linux-release-x64-try,vm-kernel-precomp-android-release-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110221
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-09-03 12:02:02 +00:00
Ryan Macnak
fdbc2920c7 [vm, bytecode] Use the global lookup cache for dynamic calls.
Removes all ICData from bytecode, avoding the need to clear bytecode when CIDs are reassigned.

Change-Id: I185f9f7acef6a32ef46adb73c6d2652bc1231bab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114053
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-22 21:43:43 +00:00
Ryan Macnak
64e407bc04 [vm] Remove stale filtering of SendPorts when writing snapshots.
Change-Id: Iec1fb01fa1e43bbb93f3482cf295656e42150a36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113137
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-15 17:35:10 +00:00
Ryan Macnak
cd16fba718 [vm, bytecode, reload] Rebind static referents instead of clearing bytecode.
Fixes vm/cc/IsolateReload_SavedClosure.

Change-Id: I792dad83c1d96c17bac9f65eb80cefa2875b5307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113132
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-15 16:31:01 +00:00
Jens Johansen
39a007678e [VM] Save kernel binary version in KernelProgramInfo
This is the beginning of allowing us to - wherever we process kernel
data - make decisions based on the kernel version. Said another way,
we can actually start to change the kernel format without breaking
backwards compatibility in the VM.

Change-Id: Ied7b3d9fe72976c4f3c0895d02b6ab70e0f5dba9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111642
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-08-05 06:51:24 +00:00
Clement Skau
722b839111 [VM] Fixes bug in CodeDeserial..::PostLoad due to Code::function.
This was triggered by 85360 which introduced external code observers
called during dart init.
The bug is however susceptible to racing as tests often shutdown the VM
before the code is fully deserialised.

Code::function() is deceptive as it does in fact not guarantee that its
return value is a Function. This in turn caused observer code to try access
non-exists members on not-actually-Functions.

Tested:
  tools/test.py -n dartk-asan-linux-debug-x64 vm/cc/DartAPI_DartInitializeCallsCodeObserver

Change-Id: I12e367be06a3630d2d401a37b9097273c13f31e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107289
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-26 14:06:34 +00:00
Ryan Macnak
5c1d5444d6 [vm, bytecode] Fix some source position discrepancies.
Fix most cases of accessing metadata; parameter annotations still missing.

Change-Id: Ie78c3d817a86a656548cdc5775f837250a710095
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106967
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-06-25 00:57:26 +00:00
Clement Skau
5b113ee193 Adds external CodeObserver callback to the VM.
This enables external (such as by the embedder) accounting of the code objects for resolving stack traces.

Bug: b/117752777
Change-Id: I824fb9b27e9aa97373b155cf07e9e8f17722ba07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/85360
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-24 15:42:43 +00:00
Alexander Markov
9b5718ca7e [vm/bytecode] Cleanup support for bytecode formats older than v7
Bytecode format v7 was introduced 2019 May 08,
in 68de477535.

Change-Id: I79d94f7153d66d418088707c3658d928a3ec41ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106969
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-21 21:38:09 +00:00
Liam Appelbe
a6eb2cd309 [vm] Support for simarm_x64
Third sub-CL of https://dart-review.googlesource.com/c/sdk/+/100644
The first was here https://dart-review.googlesource.com/c/sdk/+/103487
The second was here https://dart-review.googlesource.com/c/sdk/+/104286

This is the last major CL to support simarm_x64. Now that the other two
CLs have put the required infrastructure in place, this CL actually
adds the new mode..

Bug: https://github.com/dart-lang/sdk/issues/36839
Change-Id: Ie2f850bf33544f2462f37854e762191c78b1bde6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105500
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-21 04:00:35 +00:00
Alexander Markov
da8cb470cc [vm/bytecode] Represent classes, libraries, scripts and recursive types in bytecode
Size of a large application:
Before: 26628600
After: 21480120 (-19.3%)

Size of snapshots:

isolate_snapshot_framework.bin
Before: 9322496
After: 6782976 (-27.2%)

isolate_snapshot_product_framework.bin
Before: 9166848
After: 6602752 (-27.9%)

Regressions in tests:

1) Test language_2/type_alias_equality_test/04 fails similarly to default mode, as VM
does not implement comparison of function types according to the specification.
Previously this test was passing as function types were canonicalized in bytecode,
which was not always correct. This CL fixes the problem with canonicalization of
function types in bytecode and the test starts failing again.

2) Tests standalone_2/entrypoints_verification_test, standalone_2/io/test_extension_test,
standalone_2/io/test_extension_fail_test fail as native extensions are not supported
in bytecode yet. These tests start passing after df5e7aac17,
which switched bytecode tests to kernel service (on x64), because kernel service doesn't
drop ASTs. This CL switches from reading AST library declarations to bytecode even if
AST is not removed, so tests fail again.

Change-Id: I8b7ba44bfa49d0b1599b2509553ff7c831a4e244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104700
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-20 18:27:21 +00:00
Régis Crelier
4403c58640 [vm] Delete obsolete await_token_positions_ from Code object and flow graph.
Change-Id: I80fff049c8d0b45ec7276b1d0ae71f492ad97b9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106564
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-06-19 23:38:02 +00:00
Samir Jindel
48f19ef961 [vm/ffi] Fix snapshot serialization of FFI objects.
Change-Id: I78557211da79f5282339fbcf30b3f81ab56cb361
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106345
Commit-Queue: Samir Jindel <sjindel@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-18 13:17:14 +00:00
Ryan Macnak
31d5ba8790 Reapply "[vm, interpreter] Bytecode support for dynamic invocation forwarders."
Add missing entries to RAW_CLASSES_AND_FIELDS.

Change-Id: Ib90f4878d3eff81a6a059f7e38f1d6593cd85cfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105820
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-06-12 20:51:44 +00:00
Ryan Macnak
433cb12a87 Revert "[vm, interpreter] Bytecode support for dynamic invocation forwarders."
This reverts commit 1d94323b5b.

Reason for revert: v8_snapshot_profile_writer_test

Original change's description:
> [vm, interpreter] Bytecode support for dynamic invocation forwarders.
> 
> Change-Id: I8fb26ca5b7d395c9275b7e1860b47b5c176c00b3
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104941
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>

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

Change-Id: I7f3660e2148683567397a53f0b88ffab76671d94
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105724
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-06-12 19:01:55 +00:00
Ryan Macnak
1d94323b5b [vm, interpreter] Bytecode support for dynamic invocation forwarders.
Change-Id: I8fb26ca5b7d395c9275b7e1860b47b5c176c00b3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104941
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-06-12 18:09:54 +00:00
Alexander Markov
5167ec93fc [vm] Remove Class::NumOwnTypeArguments()
Calculation of Class::NumTypeArguments() is reimplemented so that it does
no require separate calculation of Class::NumOwnTypeArguments().
Number of own type arguments is no longer stored in Class, and has_pragma
bit is moved into state_bits.

This simplifies overall calculation and does not require to keep both
num_type_arguments and num_own_type_arguments. This also allows us to add
up to 15 more flag bits to Class.

Change-Id: Iac7a751145fea7adb673ab9369eeb8eea5c5794d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105544
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-06-11 00:57:46 +00:00
Liam Appelbe
e4196ce8c6 [vm] Namespace constants like offsets and sizeofs to use runtime_api.h
Second sub-CL of https://dart-review.googlesource.com/c/sdk/+/100644
The first was here https://dart-review.googlesource.com/c/sdk/+/103487

Now that offsets_extractor is checked in, and we have a big header full
of hard coded constants, the next step is to make sure everything is
using those constants. This is essentially everything in the original
CL, except the new simarm_x64 architecture.

Bug: https://github.com/dart-lang/sdk/issues/36839
Change-Id: I236e4f30aa1df6d92209891c983b792d1835b608
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104286
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-10 02:55:25 +00:00
Alexander Markov
0e6b74543c Revert "[vm/kernel] Use GC-tracked ExternalTypedData/TypedDataView for kernel buffers"
This reverts commit ab6aeaa106.

Revert "[vm/compiler] Speed up the compiler part which deals with kernel reading up in DEBUG mode"

This reverts commit b316210d94.

Reason for revert: regression of snapshot sizes (DNO-599).

Original change's description:
> [vm/kernel] Use GC-tracked ExternalTypedData/TypedDataView for kernel buffers
>
> Until now we often leaked kernel buffers (e.g. hot reload buffers) because various
> objects were referencing ExternalTypedData objects pointing into the middle of
> c-allocated memory. This made it impossible for the GC to determine when the last
> reference is gone.
>
> This CL ensures that the actual buffers are *always* made available via
> ExternalTypedData and any inner pointers into it are created via TypedDataViews.
>
> The embedder guarantees to the free kernel buffers it has provided to:
>     - Dart_CreateIsolateFromKernel
>     - Dart_LoadScriptFromKernel
>     - Dart_LoadLibraryFromKernel
>     - Dart_SetDartLibrarySourcesKernel
> on isolate shutdown.
>
> All other kernel buffers will get a finalizer attached, which ensures the
> kernel buffers get freed by the GC once they are no longer referenced:
>     - Kernel blobs for expression evaluation
>     - Kernel blobs for Hot-Reload
>     - Kernel blobs for cc tests
>
> Fixes https://github.com/dart-lang/sdk/issues/33973
> Fixes https://github.com/dart-lang/sdk/issues/36857
> Issue https://github.com/dart-lang/sdk/issues/37030
>
> Change-Id: I1cc410c94c0f4b229413e793728a261afcb10aaf
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103130
> Reviewed-by: Ryan Macnak <rmacnak@google.com>
> Commit-Queue: Martin Kustermann <kustermann@google.com>

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

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

Change-Id: I49715d2400f4a5c8806b7d6a2912b7258f671a0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/104343
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Auto-Submit: Alexander Markov <alexmarkov@google.com>
2019-05-31 22:15:51 +00:00
Alexander Markov
372b02d97f [vm/bytecode] Add information about local variables to bytecode
Change-Id: I22bbd3b7ea0cccc0a8d721c3766a80ae1c72060d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/87701
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-30 21:21:44 +00:00
Martin Kustermann
ab6aeaa106 [vm/kernel] Use GC-tracked ExternalTypedData/TypedDataView for kernel buffers
Until now we often leaked kernel buffers (e.g. hot reload buffers) because various
objects were referencing ExternalTypedData objects pointing into the middle of
c-allocated memory. This made it impossible for the GC to determine when the last
reference is gone.

This CL ensures that the actual buffers are *always* made available via
ExternalTypedData and any inner pointers into it are created via TypedDataViews.

The embedder guarantees to the free kernel buffers it has provided to:
    - Dart_CreateIsolateFromKernel
    - Dart_LoadScriptFromKernel
    - Dart_LoadLibraryFromKernel
    - Dart_SetDartLibrarySourcesKernel
on isolate shutdown.

All other kernel buffers will get a finalizer attached, which ensures the
kernel buffers get freed by the GC once they are no longer referenced:
    - Kernel blobs for expression evaluation
    - Kernel blobs for Hot-Reload
    - Kernel blobs for cc tests

Fixes https://github.com/dart-lang/sdk/issues/33973
Fixes https://github.com/dart-lang/sdk/issues/36857
Issue https://github.com/dart-lang/sdk/issues/37030

Change-Id: I1cc410c94c0f4b229413e793728a261afcb10aaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103130
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-05-22 01:23:46 +00:00
Alexander Markov
6fe73e4544 [vm/bytecode] Support compact bytecode instructions in VM (part 2/3)
While adding support for new compact bytecode instructions,
VM also keeps support for old bytecode instructions to preserve
backwards compatibility and allow soft transition.

This change is separate from bytecode generator changes in order
to test VM with old bytecode generator.

Corresponding bytecode generator changes:
https://dart-review.googlesource.com/c/sdk/+/99400

Change-Id: Icf5ceee7d51f27ffe3f79d0eae81e0ddc0a7e855
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/101062
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-05-08 17:33:15 +00:00
Matthew Dempsky
4ce3aa7af1 [vm] Replace ^= assignments with = where possible
Change-Id: I04ac2e9c4b8bb654b7c660e728be3867aa4e1513
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100923
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Matthew Dempsky <mdempsky@google.com>
2019-05-01 00:04:44 +00:00
Stevie Strickland
4028fec3b5 Reland "[vm] Finish adding support for ECMAScript 2018 features."
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.

This adds support for the following features:

* Interpreting patterns as Unicode patterns instead of
  BMP patterns
* the dotAll flag (`/s`) for changing the behavior
  of '.' to also match line terminators
* Escapes for character classes described by Unicode
  property groups (e.g., \p{Greek} to match all Greek
  characters, or \P{Greek} for all non-Greek characters).

The following TC39 proposals describe some of the added features:

* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes

These additional changes are included:

* Extends named capture group names to include the full
  range of identifier characters supported by ECMAScript,
  not just ASCII.
* Changing the RegExp interface to return RegExpMatch
  objects, not Match objects, so that downcasting is
  not necessary to use named capture groups from Dart

**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.

Change-Id: Ie62e6082a0e2fedc1680ef2576ce0c6db80fc19a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100641
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stevie Strickland <sstrickl@google.com>
2019-04-29 09:11:48 +00:00
Keerti Parthasarathy
9238e25305 Revert "[vm] Finish adding support for ECMAScript 2018 features."
This reverts commit 5ebb640a67.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> [vm] Finish adding support for ECMAScript 2018 features.
> 
> This work pulls in v8 support for these features with
> appropriate changes for Dart and closes
> https://github.com/dart-lang/sdk/issues/34935.
> 
> This adds support for the following features:
> 
> * Interpreting patterns as Unicode patterns instead of
>   BMP patterns
> * the dotAll flag (`/s`) for changing the behavior
>   of '.' to also match line terminators
> * Escapes for character classes described by Unicode
>   property groups (e.g., \p{Greek} to match all Greek
>   characters, or \P{Greek} for all non-Greek characters).
> 
> The following TC39 proposals describe some of the added features:
> 
> * https://github.com/tc39/proposal-regexp-dotall-flag
> * https://github.com/tc39/proposal-regexp-unicode-property-escapes
> 
> These additional changes are included:
> 
> * Extends named capture group names to include the full
>   range of identifier characters supported by ECMAScript,
>   not just ASCII.
> * Changing the RegExp interface to return RegExpMatch
>   objects, not Match objects, so that downcasting is
>   not necessary to use named capture groups from Dart
> 
> **Note**: The changes to the RegExp interface are a
> breaking change for implementers of the RegExp interface.
> Current users of the RegExp interface (i.e., code using Dart
> RegExp objects) will not be affected.
> 
> Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
> Commit-Queue: Stevie Strickland <sstrickl@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=lrn@google.com,kustermann@google.com,jmesserly@google.com,johnniwinther@google.com,sstrickl@google.com

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

Change-Id: I1eda0fee4fd9e94df095944049833a67b07277e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100560
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2019-04-25 14:29:51 +00:00
Ryan Macnak
225516466f [vm, interpreter] noSuchMethod dispatchers as a bytecode.
Change-Id: I0e105a56b733322737b6f22a7641f7c6b8afac79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100283
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-24 22:58:35 +00:00
Stevie Strickland
5ebb640a67 [vm] Finish adding support for ECMAScript 2018 features.
This work pulls in v8 support for these features with
appropriate changes for Dart and closes
https://github.com/dart-lang/sdk/issues/34935.

This adds support for the following features:

* Interpreting patterns as Unicode patterns instead of
  BMP patterns
* the dotAll flag (`/s`) for changing the behavior
  of '.' to also match line terminators
* Escapes for character classes described by Unicode
  property groups (e.g., \p{Greek} to match all Greek
  characters, or \P{Greek} for all non-Greek characters).

The following TC39 proposals describe some of the added features:

* https://github.com/tc39/proposal-regexp-dotall-flag
* https://github.com/tc39/proposal-regexp-unicode-property-escapes

These additional changes are included:

* Extends named capture group names to include the full
  range of identifier characters supported by ECMAScript,
  not just ASCII.
* Changing the RegExp interface to return RegExpMatch
  objects, not Match objects, so that downcasting is
  not necessary to use named capture groups from Dart

**Note**: The changes to the RegExp interface are a
breaking change for implementers of the RegExp interface.
Current users of the RegExp interface (i.e., code using Dart
RegExp objects) will not be affected.

Change-Id: I0709ed0a8d5db36680e32bbad585594857b9ace4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95651
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-24 09:24:16 +00:00
Ryan Macnak
dfa56c7031 [vm, interpreter] Invoke field as a bytecode.
Simplify invocation.

Fix missing AOT exclusion of Function::HasByteCode.

Change-Id: I71f698da3531a9f53d40fdaa5d77b25a9d1c9a59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100082
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-22 18:15:59 +00:00
Ryan Macnak
3d1ca4ae39 Revert "[vm, interpreter] Invoke field as a bytecode."
This reverts commit c85631330d.

Reason for revert: precompilation build failure

Original change's description:
> [vm, interpreter] Invoke field as a bytecode.
> 
> Simplify invocation.
> 
> Change-Id: I2d605d5f2f17e0e98499a19b9d9b6059682100b5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99884
> Reviewed-by: Régis Crelier <regis@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

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

Change-Id: If417cb83e55e392895cdbdd263757f3e877f5ee5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99961
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-19 23:38:24 +00:00
Ryan Macnak
c85631330d [vm, interpreter] Invoke field as a bytecode.
Simplify invocation.

Change-Id: I2d605d5f2f17e0e98499a19b9d9b6059682100b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99884
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-19 23:05:07 +00:00
Ryan Macnak
6d91643073 [vm, interpreter] Handle closure case of invoke-field-dispatchers as bytecode.
This will appear to regress the "interp-only" mode on Golem because it will no longer cheat by inlining into a machine code version of the closure call method.

Bug: https://github.com/dart-lang/sdk/issues/36410
Change-Id: I5daa2cffb6d18b6dd2da61ce08d5bc90092a250a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99561
Reviewed-by: Régis Crelier <regis@google.com>
2019-04-17 21:28:51 +00:00
Ryan Macnak
38049f3cb6 [vm, interpreter] Handle implicit static getters as bytecode.
Handle bytecode without a function in stack trace collection.

Bug: https://github.com/dart-lang/sdk/issues/36410
Change-Id: I828fbc11fb0c7ad617ff7a31f44adb021f9b6edf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99378
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-17 19:48:37 +00:00
Ryan Macnak
f819c866e7 [vm, interpreter] Handle method extractors as a bytecode.
Bug: https://github.com/dart-lang/sdk/issues/36410
Change-Id: Ifb803d88456227ce03f43b285b4d950c75ae379e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98947
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-04-10 18:24:36 +00:00
Martin Kustermann
592aee4838 Revert "Reland "Temporary revert of two changes which potentially caused performance regressions in Flutter.""
The change was already reverted and I accidentally relanded this.

Change-Id: I62ff3367db7aaaf3a470727fdb587830a23fe53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98566
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-04-03 12:50:57 +00:00
Ben Konyi
debd918696 Reland "Temporary revert of two changes which potentially caused performance regressions in Flutter."
This is a reland of 49c94d3600

It appears that the major regressions were introduced not by the typed data unification
changes but rather by 3fd124db1f "[vm] Repair the resolver abstraction." which got
reverted in e979895efb "Revert "[vm] Repair the resolver abstraction."


Original change's description:
> Temporary revert of two changes which potentially caused performance regressions in Flutter.
>
> Revert "[vm] Re-number class ids for internal/external typed data and typed data views"
>
> This reverts commit a062221b76.
>
> Revert "[vm] Unify internal/external/view typed data into new RawTypedDataBase class"
>
> This reverts commit 94362f1af0.
>
> Change-Id: I7189c976aa86cdcf0a3802631bff754baf3ca2cc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98521
> Reviewed-by: Ben Konyi <bkonyi@google.com>

Change-Id: I758775ccc426a02bce538d07ea04d9c67e8933d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98562
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
2019-04-03 12:04:23 +00:00
Ben Konyi
d63d0b4bcd Revert "Temporary revert of two changes which potentially caused performance regressions in Flutter."
This reverts commit 49c94d3600.

Reason for revert: Relanding

Original change's description:
> Temporary revert of two changes which potentially caused performance regressions in Flutter.
> 
> Revert "[vm] Re-number class ids for internal/external typed data and typed data views"
> 
> This reverts commit a062221b76.
> 
> Revert "[vm] Unify internal/external/view typed data into new RawTypedDataBase class"
> 
> This reverts commit 94362f1af0.
> 
> Change-Id: I7189c976aa86cdcf0a3802631bff754baf3ca2cc
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98521
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,asiva@google.com

Change-Id: I5c5be67fcec05434283153cb2592ba41afd1f41f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98505
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-04-02 23:53:42 +00:00
Ben Konyi
49c94d3600 Temporary revert of two changes which potentially caused performance regressions in Flutter.
Revert "[vm] Re-number class ids for internal/external typed data and typed data views"

This reverts commit a062221b76.

Revert "[vm] Unify internal/external/view typed data into new RawTypedDataBase class"

This reverts commit 94362f1af0.

Change-Id: I7189c976aa86cdcf0a3802631bff754baf3ca2cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98521
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-04-02 23:53:12 +00:00
Martin Kustermann
94362f1af0 [vm] Unify internal/external/view typed data into new RawTypedDataBase class
This moves the length field as well as an inner pointer to the start of
the data into the RawTypedDataBase class.  The inner pointer is updated
on allocation, scavenges and old space compactions.

To avoid writing more assembly the typed data view factory constructors
will be generated using IL, which will update the inner pointer. This
required adding new IR instructions and changing the existing
UnboxedIntConverter instruction.

This is the foundation work to de-virtualize calls on the public typed
data types, e.g. Uint8List.


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

Cq-Include-Trybots: luci.dart.try:vm-canary-linux-debug-try, vm-dartkb-linux-debug-x64-try, vm-dartkb-linux-release-x64-try, vm-kernel-asan-linux-release-x64-try, vm-kernel-checked-linux-release-x64-try, vm-kernel-linux-debug-ia32-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-debug-x64-try, vm-kernel-linux-product-x64-try, vm-kernel-linux-release-ia32-try, vm-kernel-linux-release-simarm-try, vm-kernel-linux-release-simarm64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-linux-release-x64-try, vm-kernel-optcounter-threshold-linux-release-ia32-try, vm-kernel-optcounter-threshold-linux-release-x64-try, vm-kernel-precomp-android-release-arm-try, vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-bare-linux-release-x64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-precomp-linux-product-x64-try, vm-kernel-precomp-linux-release-simarm-try, vm-kernel-precomp-linux-release-simarm64-try, vm-kernel-precomp-linux-release-x64-try, vm-kernel-precomp-obfuscate-linux-release-x64-try, vm-kernel-precomp-win-release-simarm64-try, vm-kernel-precomp-win-release-x64-try, vm-kernel-reload-linux-debug-x64-try, vm-kernel-reload-linux-release-x64-try, vm-kernel-reload-rollback-linux-debug-x64-try, vm-kernel-reload-rollback-linux-release-x64-try, vm-kernel-win-debug-ia32-try, vm-kernel-win-debug-x64-try, vm-kernel-win-product-x64-try, vm-kernel-win-release-ia32-try, vm-kernel-win-release-x64-try
Change-Id: I1aab0dd93fa0f06a05299ab4cb019cf898b9e1ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97960
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-03-30 14:02:50 +00:00
Alexander Markov
61f0f5bc43 [vm/bytecode] Declare members in bytecode
This change replaces kernel AST declarations of fields and functions
with bytecode declarations.

Size of dilp files is reduced by 11-12%.

Startup latency:
Time to the first full frame: 1.945s -> 1.687s
FinalizeClass: 554ms -> 277ms
FinishClassLoading: 296ms -> 156ms

There are following regressions in bytecode mode, which will be fixed
in future:

* dart:mirrors are not supported yet (implementation of mirrors relies
  on reading kernel AST in certain cases).

  As the result, lib_2/mirrors/* tests fail.

* native extensions are not supported yet (annotations on libraries
  and classes in AST are cleaned up as they could reference members
  which are now removed from AST).

  As the result, standalone_2/entrypoints_verification_test test fails.

* language_2/spread_collections/const_error_test/* tests fail
  due to https://github.com/dart-lang/sdk/issues/36286.

Change-Id: I5130f401fd7b84038b136136e7ccc1a6e51b6cea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97561
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-03-26 21:40:10 +00:00
Alexander Aprelev
59b8a9c4bb [vm] Free readonly header bit so it can be used for other uses.
This is reland of https://dart-review.googlesource.com/c/sdk/+/97340 rebased on top of removal of GraphMarked bit, which was not compatible with this ReadOnly->InVMIsolateHeap change(due to how write-pages are not covered by Contains check)

Change-Id: I34c6421afb4baeafa5a449787020dab9fa800d05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97545
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-03-22 23:46:51 +00:00
Ryan Macnak
298dacfef5 [vm] Avoid main thread compilation of implicit accessors.
Main thread compilations: 337 functions / 87.8 ms -> 111 functions / 45.5ms

Change-Id: I64ed6c2aca98c0b3849a9142d698a8a94ed418cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97405
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-03-21 20:18:32 +00:00
Alexander Aprelev
34af8b95e5 Revert "[vm] Free readonly header bit so it can be used for other uses."
This reverts commit 59931e3340 as it
breaks jitk and optcounter bots.

Change-Id: If87ce52ac3d4015608436bfd7ee661ea1414dc7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97480
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2019-03-21 06:23:50 +00:00