Commit Graph

14731 Commits

Author SHA1 Message Date
Jason Simmons aaf97448b0 Extract EnumListParameter values before checking for matches
Previously EnumListParameter would find a match if the parameter starts with
any of the values in the enum.  This would misfire if an enum value is a prefix
of another enum value.

Change-Id: I3dc45359afbf7483d9c16a76c0114b5c42daed83
Reviewed-on: https://dart-review.googlesource.com/c/91620
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-31 18:30:28 +00:00
Jens Johansen 14b2255584 Status update after c3c5250
app_jitk also fails.

Change-Id: I7252d2a7b6e05151337dfff1cc7470ea34f8484a
Reviewed-on: https://dart-review.googlesource.com/c/91740
Auto-Submit: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-01-31 12:36:34 +00:00
Jens Johansen c3c525079b Demonstrate bug for the VMs way of doing initializers in face of mixins
See http://dartbug.com/34841#issuecomment-458917175
and test in this CL for explanation.

Change-Id: Ie1d15078a9c5f71aa6edacd792b440520a3eb877
Reviewed-on: https://dart-review.googlesource.com/c/91660
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2019-01-31 10:08:15 +00:00
Aart Bik 40fca03d07 [vm/compiler] fix assert failure on minint64
Rationale:
The new modulo optimization assert fails when doing
the power-of-two-of-abs test on minint64 (since abs
of minint64 is minint64). Note that we could actually
optimize this case by masking with maxint64 pattern
but since it bails for non-smi masks right now, this
fix does the same.

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

Change-Id: Ic592dad89ff6ffcd84dba9e17d4bccd79dc01f18
Reviewed-on: https://dart-review.googlesource.com/c/91704
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-31 00:55:01 +00:00
Aart Bik 689b17d69b [vm/compiler] Fix missing incremental DOM update
Rationale:
Pending improvements to the new graph checker discovered
missing DOM relation on inlined blocks, which was traced
to this missing update.

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

Change-Id: I3b3c796228d130d765c6e10ca819a072731c8bd5
Reviewed-on: https://dart-review.googlesource.com/c/91585
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-01-30 01:37:54 +00:00
Ryan Macnak 1e92b5ebd0 [vm] Note the flow graph builder when checking type feedback compatibility.
Change-Id: Ic4d9447d6a48e4afbe231888003f2fe41be53d5b
Reviewed-on: https://dart-review.googlesource.com/c/91422
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-29 23:29:43 +00:00
Ryan Macnak 7ee0e00f0b [vm, gc] Reset growth policy after finishing kernel loading.
Objects allocated during loading are expected to live forever. Cf. reset after loading a full snapshot.

Change-Id: I224a8bbc6a69b2d3ed667fff887b90bb2d4492d6
Reviewed-on: https://dart-review.googlesource.com/c/91107
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-29 23:27:54 +00:00
Ben Konyi b625926038 [ VM / dart:io ] Updated Link implementation for Windows to use actual symbolic links.
Change-Id: I22a598e7c1f249d9150cc5ceee96daa0291e753e
Reviewed-on: https://dart-review.googlesource.com/c/90362
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-01-29 19:26:47 +00:00
Samir Jindel 267e91a0ea Re-land "[vm] Prevent access to non-annotated members through native API."
Two fixes:

  - Make entrypoints_verification_test work on configurations where CFE compilation
    is separate from execution.
  - Add missing entry-point annotation for Windows.

The original revision is in patchset 1.

Change-Id: I6c4b52b1bae7bc730546dad6a3e31d8625f850b1
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
Reviewed-on: https://dart-review.googlesource.com/c/90942
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-29 15:10:34 +00:00
Martin Kustermann d5a558d6c4 [VM/AOT] Make DartTemplateCall::Selector() work even if there is no ICData
Closes https://github.com/dart-lang/sdk/issues/35703

Change-Id: I59713cb2baac695786cceeb54f6d8a7a3ed4a722
Reviewed-on: https://dart-review.googlesource.com/c/91226
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-01-29 08:21:52 +00:00
Alexander Markov 601094e3f2 [vm/bytecode] Fix max used block id when compiling from bytecode
Fixes https://github.com/dart-lang/sdk/issues/35789

Change-Id: I061d8d5b709fa5469824c8f5d7490aa2038746a3
Reviewed-on: https://dart-review.googlesource.com/c/91440
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-01-28 22:29:17 +00:00
Ryan Macnak ff2e8eb681 [vm, gc] Fix backwards write-barrier logic used by Object::Clone.
Change-Id: Ib614c0e85a96604252a47ad81ad6a8e70509a671
Reviewed-on: https://dart-review.googlesource.com/c/91242
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-28 22:28:37 +00:00
Aart Bik fc417a73ed [vm/compiler] Disable max block id check (for now)
https://github.com/dart-lang/sdk/issues/35789

Change-Id: Id37ca8191eb78431bb9bfaf23dd982b4cc5b44df
Reviewed-on: https://dart-review.googlesource.com/c/91421
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-01-28 20:21:07 +00:00
Aart Bik e02399da33 [vm/compiler] Introduce graph checker
Rationale:
This is a start with a graph checker that verifies
the consistency of the flow graph after each compiler
pass with the goal of detecting errors as early as
possible. The checks add overhead, so are only run
in debug mode. The objective is that all written
and unwritten assumptions on the flow graph that
are relatively easy to check will be converted
into actual code.
Change-Id: Iad9927d5b0fd87a43dc6a7369174d52761d89c9e
Reviewed-on: https://dart-review.googlesource.com/c/91143
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-01-28 18:16:47 +00:00
Aart Bik 2881a92c4e [vm/compiler] Fix missing incremental DOM update
Rationale:
Found by the new graph checker! Dominance relation was
not complete after incremental update (note that most
passes get around this by just recomputing the full
relation). Graph checkers are very useful to find
such omissions.
Change-Id: I4f2c8bfaee54b7a092aaaec04886635c86b451fa
Reviewed-on: https://dart-review.googlesource.com/c/91244
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-01-28 18:08:47 +00:00
Alexander Aprelev df34f65d90 Restore TLABs.
This reverts commit 324718fadd as it fixes performance issue found on Flutter benchmark.

The fix is to make TLAB smaller than new heap semi-space. Original implementation had TLAB occupy whole semi-space.

Change-Id: I4b5b5a3027b2d352ccb80538079a042406b5cf54
Reviewed-on: https://dart-review.googlesource.com/c/91171
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-01-26 06:24:18 +00:00
Vyacheslav Egorov 759234b05a [vm] Fix disassembler test after f496e538f4
Allocate comment strings in old space.

TBR=kustermann@google.com

Change-Id: Ie670b87791d01848b9c1b12931bd932331818839
Reviewed-on: https://dart-review.googlesource.com/c/91224
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Vyacheslav Egorov <vegorov@google.com>
2019-01-25 19:37:24 +00:00
Ryan Macnak 169331abb1 [vm] Misc timeline tweaks.
- Move compiler pass events to a new CompilerVerbose stream
 - Remove serialization phase events
 - Add class name to class finalization event (lost along with finalization events in recent cleanups of finalization)
 - Add event for kernel loading

Change-Id: Ie72bced978400ea174c1551c961baa55c691b019
Reviewed-on: https://dart-review.googlesource.com/c/90883
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-25 18:37:05 +00:00
Ryan Macnak 9043e5be44 [vm, gc] Remove --gc_at_alloc.
Change-Id: Ied987c5fb0389432474a6ef8ee62ed7089c9e672
Reviewed-on: https://dart-review.googlesource.com/c/91142
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-25 18:03:30 +00:00
Vyacheslav Egorov 27760001f5 [vm] Fix build after f496e538f4
* Introduce forward declaration for RawObject;
* Move compiler::target::ClassTable::ClassOffsetFor under ifdef PRODUCT

Change-Id: Iacf5cbdaec0c2999aae7c8e0683a58e392f3e960
Reviewed-on: https://dart-review.googlesource.com/c/91220
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-01-25 18:01:50 +00:00
Vyacheslav Egorov f496e538f4 [vm] Decouple assemblers from runtime.
This is the next step towards preventing compiler from directly peeking
into runtime and instead interact with runtime through a well defined
surface. The goal of the refactoring to locate all places where compiler
accesses some runtime information and partion those accesses into two
categories:

- creating objects in the host runtime (e.g. allocating strings, numbers, etc)
during compilation;
- accessing properties of the target runtime (e.g. offsets of fields) to
embed those into the generated code;

This change introduces dart::compiler and dart::compiler::target namespaces.

All code in the compiler will gradually be moved into dart::compiler namespace.
One of the motivations for this change is to be able to prevent access to
globally defined host constants like kWordSize by shadowing them in the
dart::compiler namespace.

The nested namespace dart::compiler::target hosts all information about
target runtime that compiler could access, e.g. compiler::target::kWordSize
defines word size of the target which will eventually be made different
from the host kWordSize (defined by dart::kWordSize).

The API for compiler to runtime interaction is placed into compiler_api.h.

Note that we still permit runtime to access compiler internals directly -
this is not going to be decoupled as part of this work.

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

Change-Id: If4396d295879391becfa6c38d4802bbff81f5b20
Reviewed-on: https://dart-review.googlesource.com/c/90242
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-01-25 16:45:13 +00:00
Martin Kustermann dfeee239c4 [VM] Fix use-after-free: move free after use
Change-Id: Idcedbd8bdbd94f126846c5390c6cb8d00a21de57
Reviewed-on: https://dart-review.googlesource.com/c/91180
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-01-25 13:14:19 +00:00
Martin Kustermann 51bc367806 [VM/AOT] Ensure we set flags from snapshot very early in the VM initialization
There are uses of flags before the VM snapshot gets read, so we need to
move the "snapshot sniffing" code to the very beginning of Dart::Init().

Due to the fact that FullSnapshotReader/Deserializer assume there is a
[Thread] available - and we don't have a [Thread] yet when we should
process the flags - this CL moves version/feature logic into a new
[SnapshotHeaderReader] class which does not depend on Thread/...

Change-Id: I38a45041f0696b96e44fc2b294e3442a5fba1a81
Reviewed-on: https://dart-review.googlesource.com/c/90941
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-01-25 10:31:48 +00:00
Martin Kustermann 8c439c7e84 [VM/AOT] Turn bare instructions on by default
Issue https://github.com/dart-lang/sdk/issues/33274

Change-Id: I44850d5906143a53d6b1872eb729364c3a509f9a
Reviewed-on: https://dart-review.googlesource.com/c/91060
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-01-25 10:25:18 +00:00
Matthew Dempsky adf48e4d4b [vm] Fix header includes
In https://dart-review.googlesource.com/c/sdk/+/91104, I meant to
delete #include <endian.h>, and accidentally removed #include
<errno.h> instead.

Change-Id: I52e55350d2817c3e6543a8bf806492f1b1dcf3db
Reviewed-on: https://dart-review.googlesource.com/c/91109
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-01-25 02:03:51 +00:00
Matthew Dempsky b11f2d8e69 [vm] Implement VirtualMemory::Allocate using AllocateAligned
Instead of implementing separate aligned and unaligned memory
allocation primitives for each OS, just change the unaligned allocator
into a wrapper around the aligned primitive.

While here, we can optimize the AllocateAligned logic slightly: if we
want an N-page-aligned allocation, we only need to increase the
allocation size by N-1 pages instead of N.

Notably, this means 1-page-aligned allocations don't require any extra
alignment pages, so the new logic behaves identically as before on
Android, Fuchsia, Linux, and macOS.

On Windows, it behaves slightly differently only in that unaligned
requests used to be handled as a single VirtualAlloc call with
MEM_RESERVE | MEM_COMMIT, but now they're handled as two separate
calls (reserve *then* commit). Naively, I don't expect this matters in
practice, but if it does, we can always add a fast path for
alignment==page_size_ without affecting the OS-independent API.

Change-Id: I42b2cf5dfc6e137546d8acfb6cc8939a01687948
Reviewed-on: https://dart-review.googlesource.com/c/91081
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-01-25 01:22:20 +00:00
Ryan Macnak 41dc546c6b [vm] Check compiler flags for Dart_Save/LoadTypeFeedback.
Change-Id: Ic733591ce1cac7d69fde28a115f11d43902923bc
Reviewed-on: https://dart-review.googlesource.com/c/90640
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-25 00:53:55 +00:00
asiva fb2d829a0e [VM / Compiler] Change some OS::PrintErr to THR_Print
We still see some trace messages related to the compiler coming from the
service isolate when debugging compilations. Chnaged some of the

OS::PrintErr calls in the trace code under the compiler to THR_Print
so traces from the service isolate can be filtered out.
Change-Id: Ib370cb3bf4a1ce175b4ade9fafa187fecfa91cef
Reviewed-on: https://dart-review.googlesource.com/c/91140
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-01-24 23:52:02 +00:00
Matthew Dempsky ec6b212421 [vm] Remove unused endian-conversion code
These seem to have accidentally snuck in as part of
https://codereview.chromium.org/14299008

Change-Id: I861eba1655d6f175ddfabf2a39908168b890d911
Reviewed-on: https://dart-review.googlesource.com/c/91104
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-01-24 23:32:33 +00:00
Matthew Dempsky 0193dd58fa [vm] Deduplicate POSIX-based memory allocation code
The Android, Linux, and macOS VirtualMemory implementations were
identical and using the same POSIX-standardized interfaces, so
deduplicate them into a common virtual_memory_posix.cc implementation.

Change-Id: I58a2aaa959aac69af52d9faba88865a4ef20d004
Reviewed-on: https://dart-review.googlesource.com/c/91080
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
2019-01-24 22:39:50 +00:00
Matthew Dempsky 8e2f3ea4d6 [fuchsia] Always allocate executable memory in W^X mode
In W^X mode (i.e., FLAG_write_protect_code), the Dart VM allocates
code memory with is_executable==false and then later makes it
executable with Protect(kReadExecute). However, on Fuchsia, this will
require a VMO with ZX_RIGHT_EXECUTE (which soon will not be the
default).

This CL takes the approach of always adding ZX_RIGHT_EXECUTE when in
W^X mode. This is suboptimal because it means all VM allocated memory
can be changed to executable, but currently the OS-independent
VirtualMemory::Allocate API doesn't provide us a way to identify
memory that doesn't need to be executable now but will in the future.
(Note that ZX_RIGHT_EXECUTE only *allows* mapping the memory as
executable; the memory is still initially mapped by
VirtualMemory::Allocate as non-executable.)

Extending the VirtualMemory::Allocate API is tracked in FL-172.

Bug: SEC-42
Change-Id: I20555c546c5ab1798c4c36b7394f6221d3993c9e
Reviewed-on: https://dart-review.googlesource.com/c/90882
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2019-01-24 16:59:08 +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
Aart Bik a1b7fad86a [dart/vm] Annotate _ByteDataView to reduce code size
Rationale:
Slava's excellent code size difference tools enables
very fine-grained analysis of the impact of changes.
This CL improves Flutter Gallery size by 18984 bytes.

+------------------------------------------------------+-----------------------------------------+--------------+
| Library                                              | Method                                  | Diff (Bytes) |
+------------------------------------------------------+-----------------------------------------+--------------+
| package:flutter/src/painting/decoration_image.dart   | paintImage                              |         +936 |
| dart:ui                                              | Paint.toString                          |         +592 |
| package:flutter/src/material/tab_indicator.dart      | _UnderlinePainter.paint                 |         +552 |
| package:flutter/src/material/progress_indicator.dart | _CircularProgressIndicatorPainter.paint |         +308 |
| package:flutter/src/services/message_codecs.dart     | StandardMessageCodec.readValueOfType    |         +172 |
| package:flutter/src/services/message_codecs.dart     | StandardMessageCodec.readValue          |          +60 |
| package:flutter/src/services/message_codecs.dart     | StandardMethodCodec.decodeEnvelope      |          +56 |
| package:flutter/src/services/message_codecs.dart     | StandardMethodCodec.decodeMethodCall    |          +56 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| package:flutter/src/widgets/semantics_debugger.dart  | _paint                                  |         -484 |
| dart:ui                                              | Paint.maskFilter=                       |         -568 |
| dart:ui                                              | Paint.colorFilter=                      |         -572 |
| package:flutter/src/painting/borders.dart            | paintBorder                             |         -656 |
| dart:ui                                              | _unpackPointerDataPacket                |         -744 |
| dart:ui                                              | Paint.isAntiAlias=                      |         -808 |
| dart:ui                                              | Paint.strokeCap=                        |         -812 |
| dart:ui                                              | Paint.filterQuality=                    |         -812 |
| dart:ui                                              | Paint.isAntiAlias                       |         -972 |
| dart:ui                                              | Paint.invertColors                      |         -976 |
+------------------------------------------------------+-----------------------------------------+--------------+
Total change -18984 bytes.

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

Change-Id: Iceeb820ed506794e1ac3e7c17f8f116a22bca742
Reviewed-on: https://dart-review.googlesource.com/c/90861
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-01-23 22:48:37 +00:00
Régis Crelier 27316cc97b Revert "[vm] Prevent access to non-annotated members through native API."
This reverts commit 0203243381.

Reason for revert: breaking several bots

Original change's description:
> [vm] Prevent access to non-annotated members through native API.
> 
> We will issue warnings and throw an API error when the native API is used to access members which were not appropriately
> annotated as entry-points, if the flag "--verify-entry-points" is passed.
> 
> Also, fixes Class::Invoke against fields (isn't allowed through native API but
> could be allowed with mirrors, and is inconsistent with Library::Invoke behavior).
> 
> I've checked locally that this would have caught the bug in
> "Wrap the user entrypoint function in a zone with native exception callback. (#7512)".
> 
> Change-Id: I617c71e1965457c956c97761359765bb9bb18c1c
> 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
> Reviewed-on: https://dart-review.googlesource.com/c/90060
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

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

Change-Id: I554b389780e4ba652183c044b040b0c524beb5c2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
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
Reviewed-on: https://dart-review.googlesource.com/c/90841
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-01-23 20:37:22 +00:00
Aart Bik bc0cbac5cc [dart/fuzzer] remove obsolete reference to py file
Change-Id: I4532e425904d95d3f4883422da943bc5a9ab9c7c
Reviewed-on: https://dart-review.googlesource.com/c/90782
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-01-23 19:13:36 +00:00
Samir Jindel 0203243381 [vm] Prevent access to non-annotated members through native API.
We will issue warnings and throw an API error when the native API is used to access members which were not appropriately
annotated as entry-points, if the flag "--verify-entry-points" is passed.

Also, fixes Class::Invoke against fields (isn't allowed through native API but
could be allowed with mirrors, and is inconsistent with Library::Invoke behavior).

I've checked locally that this would have caught the bug in
"Wrap the user entrypoint function in a zone with native exception callback. (#7512)".

Change-Id: I617c71e1965457c956c97761359765bb9bb18c1c
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
Reviewed-on: https://dart-review.googlesource.com/c/90060
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-23 19:04:26 +00:00
Aart Bik 7078c9a69e [dart/fuzzer] Further development DartFuzz
Rationale:
Adds a few more constructs, avoid situations that go out-of-memory
too easily, prepares library method format for automatic generation
of library tables.

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

Change-Id: I24b4656ea073fbe41175aa08952588e28d4363a1
Reviewed-on: https://dart-review.googlesource.com/c/90320
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-01-23 17:21:11 +00:00
Martin Kustermann f1f688215a [VM/AOT] Initialize global VM flags by reading them from vm-isolate snapshots
Issue https://github.com/dart-lang/sdk/issues/33274

Change-Id: I2dca1fb9a8807294fb756ea796bb7560bb6d17cc
Reviewed-on: https://dart-review.googlesource.com/c/90221
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-01-23 09:49:46 +00:00
Chinmay Garde ec6a7310c9 Allow embedders to get a closurized _startMainIsolate function.
Change-Id: Ib4b2654c60c02f137832e3898fd38b724c4e4dbc
Reviewed-on: https://dart-review.googlesource.com/c/90582
Commit-Queue: Chinmay Garde <chinmaygarde@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-01-23 01:30:13 +00:00
Ryan Macnak 2e9cf40002 [vm, isolate] Fix length truncation in message snapshots, take 2.
Only run test on x64 VMs.

Bug: https://github.com/dart-lang/sdk/issues/35635
Change-Id: I3ab16a96669a9f29187954896e59a3341dce5dc4
Reviewed-on: https://dart-review.googlesource.com/c/89925
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-23 01:29:44 +00:00
Aart Bik dc182cc951 [dart/vm] Add assert in Selector() method
Rationale:
This would have made triaging the bug below a lot quicker.

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

Change-Id: I23451f1b2944f9447a1f1c1c85af073a7211fe4b
Reviewed-on: https://dart-review.googlesource.com/c/90302
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-01-22 19:03:18 +00:00
Ryan Macnak 5812a3bf74 [vm] Fix scoping in TIMELINE_DURATION.
Change-Id: I67d53f0e6d17d904b1bebc89bd4d7d45aaf95122
Reviewed-on: https://dart-review.googlesource.com/c/90342
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-01-22 18:38:49 +00:00
Vyacheslav Egorov 9b01358ba0 [vm/io] On Windows do not consider sockets with pending operations closed.
ClientSocket might have pending operations associated with it, so we should
not delete it until those operations fire.

This aligns ClientSocket::IsClosed with IsClosed implementation for other
handles, which check if handle has any associated pending operations.

The situation that sometimes arises it that if we issue Read, Disconnect operation,
they might complete in the opposite order DisconnectComplete, ReadComplete, which
is why we need to check for pending operations.

MSDN contains sentences like these: "Please note that while the packets are
queued in FIFO order they may be dequeued in a different order."

It seems that a more uniform fix would be to it increment a reference count
of a handle whenever an asynchronous operation is started and decrement it
whenever it is completed - but such fix requires much more thorough
refactoring of eventhandler_win.cc.

Bug: https://github.com/flutter/flutter/issues/22558
Change-Id: I4e6a7d5fdeaa85b9903d005b5bb95338033228f1
Reviewed-on: https://dart-review.googlesource.com/c/90484
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-01-22 16:34:54 +00:00
Samir Jindel 55c3106a3f [vm] Improve SelectRepresentations.
It's no longer necessary to prove that a phi will fit into 64 bits to unbox it,
because all ints in Dart 2 are 64-bit.

Also, we add a new heuristic to always unbox a phi if all inputs are unboxed.

This improves MD5 performance on ARM32 AOT by 27%, matching existing JIT performance.

Change-Id: I9ebbfc3bb8d565e746d3740528fdf7ee32c0f7a4
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
Reviewed-on: https://dart-review.googlesource.com/c/88841
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-01-22 12:42:48 +00:00
Samir Jindel 85515884c2 [vm] Fix inference of shifts' RHS in range analysis for nullable SMIs.
Change-Id: I9b84c751b7a148ec9c0196b99dd78ab8f70ee66c
Reviewed-on: https://dart-review.googlesource.com/c/90225
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Samir Jindel <sjindel@google.com>
2019-01-22 11:44:24 +00:00
Martin Kustermann cc9607b04c [VM/AOT] Make trampolines look like free list elements to enable heap walking
Issue https://github.com/dart-lang/sdk/issues/33274

Change-Id: Ib6afdbc80012326134d409c4065a680d67de3ed8
Reviewed-on: https://dart-review.googlesource.com/c/90064
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-01-19 13:37:09 +00:00
Régis Crelier 38a7f0097f [vm/finalizer] Stop background compiler before sorting classes.
Prevent background compiler from adding deferred classes or canonicalizing
new types while classes are being sorted and type hashes are modified.
This should fix issue #34627 and its duplicate #35690.


Change-Id: I3e52602e77ad6b80b58f5292721c01eea22abfb0
Reviewed-on: https://dart-review.googlesource.com/c/90300
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-01-18 23:08:21 +00:00
Devon Carew b0b055541b Make Script.tokenPosTable optional.
Change-Id: I681f6c3c762e16a2eff8a9aac1d680856aa94935
Reviewed-on: https://dart-review.googlesource.com/c/90321
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2019-01-18 22:46:23 +00:00
Zichang Guo 970390a36e Add field evaluation to source report generation
Change-Id: I62808852a35ef53c05ac1ea715d4559db46bb3d5
Reviewed-on: https://dart-review.googlesource.com/c/89173
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-01-18 19:15:44 +00:00
Ben Konyi 2e5453ddb4 [ VM ] Updated licenses to match other licenses in project
Change-Id: I0848e49c63de5a6a6385fa926e7d5550d9a41c1d
Reviewed-on: https://dart-review.googlesource.com/c/90301
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-01-18 18:23:26 +00:00