Commit Graph

65 Commits

Author SHA1 Message Date
Jens Johansen 1555594ddb Include a per-library index of owned sources in kernel
This for instance allows the VM to include all patches
(e.g. the previously missing `runtime/lib/date_patch.dart`)
in what's returned from `LoadedScripts()`.

Over time this also allows for `LoadedScripts()` to be simplified and
become faster (it's currently something like O(m + m*n) where m is the
number of results in DictionaryIterator(*this) and n is the number of
returned scripts).

Change-Id: I4b5a6a0fe666b774fc0987d099ed02e81ac97b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-04-11 12:40:49 +00:00
Stevie Strickland af5fc2d4d2 [VM] Partial support for named regexp captures.
See https://github.com/tc39/proposal-regexp-named-groups
for a high-level description of the feature and examples.  This is one of the
features requested in https://github.com/dart-lang/sdk/issues/34935.

This is a partial implementation because while there is a way to retrieve
groups via Dart by name, it requires casting the returned Match to the
new RegExpMatch interface to avoid changing the RegExp interface.
Changing the RegExp interface will happen in a future update, since there
are other planned changes to the RegExp interface coming soon and that way
we only change it once. See https://github.com/dart-lang/sdk/issues/36171
for more details on the planned changes.

Also, since only BMP regular expressions are supported, not full
Unicode ones (i.e., those with the /u flag in ECMAscript), \k<NAME>
will only be parsed as a named back reference if there are named
captures in the string. Otherwise, the \k will be parsed as the identity
escape for backwards compatibility. The new tests illustrate this
difference.

Change-Id: Ieeb0374813db78924c9aa8ac3e652dfb6d4a5934
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95461
Commit-Queue: Stevie Strickland <sstrickl@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-03-19 10:40:15 +00:00
Zichang Guo 4ec72c1eb1 [VM-Runtime]Fix source report coverage to not include field without function initializer
Fix issue created by 89173. Also rename HasInitializer to HasInitializerFunction to distinguish from has_initializer.

Bug= https://github.com/flutter/flutter/issues/28542

Change-Id: Id9f898937c2f4f350a6d619019dc12611505801f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95680
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Zichang Guo <zichangguo@google.com>
2019-03-07 02:04:41 +00:00
Daco Harkes 7d46d4b5cb [vm / library] Foreign function interface prototype
Prototype for `dart:ffi` on Linux/MacOS x64 in JIT mode.
`dart:ffi` is experimental and its API is likely to change in the future.
Progress and design decisions are tracked in https://github.com/dart-lang/sdk/projects/13


issue: https://github.com/dart-lang/sdk/issues/34452
Change-Id: Ifa4566388e42c8757f154741d11e303465ef305d
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-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-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try, vm-kernel-mac-debug-x64-try, vm-kernel-asan-linux-release-x64
Reviewed-on: https://dart-review.googlesource.com/c/80124
Reviewed-by: Samir Jindel <sjindel@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2019-02-13 12:42:47 +00:00
Ryan Macnak 78509055b6 [vm] Add names for more types to the V8 snapshot profile output.
Fix some types of base objects in the V8 snapshot profile output.

Rename ICData::ic_data_ to entries_ as it does not point to an ICData.

Change-Id: Ie80974e2eb741810a5f540dd40e5d60a519d8e4e
Reviewed-on: https://dart-review.googlesource.com/c/92665
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-02-12 17:54:58 +00:00
Samir Jindel d972c2b7b7 [vm] Update raw_object_fields.cc after 7e81f56a.
Change-Id: I5b738c31a0bd056c7720e0b0d66ec0c69cbae950
Reviewed-on: https://dart-review.googlesource.com/c/92129
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-02-06 12:20:22 +00:00
Ryan Macnak b6b4836d1d [vm] Reference type test stubs through Code; use the type as the owner of a type test stub.
Directly referencing VM isolate instructions from an isolate snapshot causes the instructions to be copied into the isolate's image page because instructions do not use the indirection of the ref array. Duplicating the instructions caused TypeTestingStubFinder::LookupByAddresss to be unable to identity the duplicate copies of the VM isolate type testing stubs.

Fixes identity of StubCode::*TypeTest broken by duplication in snapshot.
Fixes generating AppJIT snapshots after loading from AppJIT snapshots.
Fixes attribution of ticks for type test stubs in the AOT profiler.

Change-Id: I9879a85bd548e694ee36e14f795898582ccdddb0
Reviewed-on: https://dart-review.googlesource.com/c/90501
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-01-23 22:59:47 +00:00
Régis Crelier 1a260925ef [vm] Unify CanonicalType and DeclarationType on 'Class' VM class.
CanonicalType is a leftover method/field from the time classes were keeping
track of their own canonical types and is still used for non-generic classes.
DeclarationType is more general and can be used where CanonicalType is used.
The field canonical_type_ is renamed to declaration_type_ and now caches the
DeclarationType.

Change-Id: I585c7bc2d3ae760a4a0e783bc77fb8d8efdbf682
Reviewed-on: https://dart-review.googlesource.com/c/87482
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-12-19 18:46:39 +00:00
Régis Crelier cb8c0ab8f5 [vm] Remove MixinAppType VM class and VM code supporting type resolution.
In Dart2, mixin application classes are generated by kernel and type resolution
is performed by kernel. In Dart1, using the VM parser, these tasks were done
during class and type finalization.

Change-Id: I927b1446d906ffd76ed9591c96e0d974df09f3bf
Reviewed-on: https://dart-review.googlesource.com/c/87025
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-12-13 20:18:36 +00:00
Régis Crelier d8bd7d68b8 [vm] Fix bots after commit 5f36c5f9.
Add signature_ field to runtime/vm/raw_object_fields.cc.
This field was changed from a union (sig_or_err_) to a proper field and was
previously not listed in runtime/vm/raw_object_fields.cc.

Change-Id: I03736c003811a3e3b17c56d7419c53796d3ea0ec
Reviewed-on: https://dart-review.googlesource.com/c/86840
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-12-10 23:53:12 +00:00
Régis Crelier 5f36c5f9d8 [vm] Delete BoundedType class in VM.
In Dart2, type bounds checking is either performed by the common front-end or
by explicitly generated code, but not by type finalization or runtime anymore,
as it was done in Dart1.
Consequently, the class BoundedType is not needed anymore, and malbounded or
malformed types are not seen by the runtime either.

Change-Id: I5d6e4c68d153d6730fa7ff7f6d9dcfa611299c16
Reviewed-on: https://dart-review.googlesource.com/c/86687
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-12-10 23:15:27 +00:00
Samir Jindel 5ad8bf78e2 Add KPI::bytecode_component_ to raw_object_fields.cc
Change-Id: I4db32b38291d5494d9c5acf80aca295c3a90f9b6
Reviewed-on: https://dart-review.googlesource.com/c/85772
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-12-03 19:59:07 +00:00
Samir Jindel 96dda6a516 Re-land "[vm/aot] Fill in names of properties in snapshot profile."
This reverts commit dc346e6fdd.

Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-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-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try, vm-kernel-precomp-win-release-x64-try
Change-Id: I1b9181683757cf47f917274d21c8fc1c463218c7
Reviewed-on: https://dart-review.googlesource.com/c/85709
Commit-Queue: Samir Jindel <sjindel@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-12-03 19:11:42 +00:00
Alexander Aprelev dc346e6fdd Revert "[vm/aot] Fill in names of properties in snapshot profile."
This reverts commit 465f8595ec as it
breaks windows and mac bots.

Change-Id: I94a939d711f69a28f405ee32680315ad6677b09e
Reviewed-on: https://dart-review.googlesource.com/c/85722
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2018-11-30 19:52:23 +00:00
Samir Jindel 465f8595ec [vm/aot] Fill in names of properties in snapshot profile.
Change-Id: Ic709a3dc40390463ffb5fd76fd8eb63ebd87acc0
Cq-Include-Trybots: luci.dart.try:vm-kernel-optcounter-threshold-linux-release-x64-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-linux-release-x64-try, vm-kernel-precomp-mac-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/85292
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-30 18:38:05 +00:00