Commit Graph

16217 Commits

Author SHA1 Message Date
Liam Appelbe f4780a6450 [vm] Late modifier for non-static final fields.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: Ib2b3189b20bd056b6378fa5d7a6166acef9a5c67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124465
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-11-07 23:50:57 +00:00
Ryan Macnak 23770fcc6c [vm, gc] Increase HeapPage size to 512k; increase max heap size to 32GB.
Change-Id: I0d5649d37a73caea39d3f703f429a4af7b4c29c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113950
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-11-07 22:45:47 +00:00
Samir Jindel 43329adf84 [vm/aot] Remove uses of blobs from tests and scripts.
Change-Id: I03ccdba1f45ddb1b6774557d55b8fd47f87c7dd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121842
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-07 14:06:07 +00:00
Samir Jindel e85184eb72 [vm/aot] Put all non-writable segments together to work around bug in Jelly Bean.
Fixes https://github.com/flutter/flutter/issues/43259

Change-Id: I8c9041baf34bd07bf203469d0ebfbb2e6379ee08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123733
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-07 14:01:07 +00:00
Ryan Macnak d3d19f3ca5 [vm, gc] Fix a case of dropping safepoint interrupts.
Consider the interleaving:
  Mutator: read stack limit (generated code)
  Mutator: read safepoint requested (RUNTIME_ENTRY)
    Helper: set safepoint requested
    Helper: set stack limit (ScheduleInterrupts)
  Mutator: clear stack limit  (GetAndClearInterrupts)

Bug: https://github.com/dart-lang/sdk/issues/39246
Change-Id: I5640c65eee514bb8f58779a472530cfe05d368a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124280
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-11-06 23:43:53 +00:00
Liam Appelbe 2ae9b6f653 [vm] Handle late fields with no initializer.
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I23526e7e8cc5928c22c53414dd201c07199b9610
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124210
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-11-06 23:39:22 +00:00
Régis Crelier 4b9638aaa1 [VM/nnbd] Use a single byte in snapshot to write flags and nullability of types.
This saves one byte per Type and per TypeParameter objects in the snapshot.

Change-Id: Ie5241c992a5c5cc6b3d7a211f20e7a0ddbd00b72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124300
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-11-06 22:44:33 +00:00
Liam Appelbe c154677699 [vm] Handle trivial initializers for late fields
Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I9db9d4815ad27f3f97d43a7a9f1fb74f08673528
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124201
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-06 17:46:32 +00:00
Zichang Guo 46ae3e4e7a [vm] not remove port if socket was listening by other isolates
Crashes come from assertion in ReturnTokens() and new_mask() in Eventhandler.
Another issue is when multiple serversockets bind to the same address, Socket will be reused to all Dart_Ports. But Socket didn't keep track of corresponding Dart Port.
When one of isolates is killed, finalizer wakes up and close most recent Dart Port that sends data.

After this cl, Socket may not be reused by different Dart Sockets. All Dart socket will has its own Socket object. But Sockets can have same fd.
This will guarantee finalizer will close right Dart Port.

Bug: https://github.com/dart-lang/sdk/issues/36106
Change-Id: Ib4620ada5f120ffda719052297009280c73b4315
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122490
Commit-Queue: Zichang Guo <zichangguo@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-06 16:28:12 +00:00
Martin Kustermann e31c7ff591 [vm/concurrency] Move idle timeout detection from message handler to [Isolate]
Right now a message handler is taking care of detecting idle timeouts
and notifying the isolate (or rather it's heap) that a compaction can
start.

Once we move the heap to the isolate group, we should only notify the
heap that we're idle if *all* isolates are idle. As a preparatory step
we move the idle timer functionality into it's own class and make the
isolate own it.

When the heap gets moved from isolate to isolate group, we'll also move
the idle time handler.

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

Change-Id: If9b244baf0425ef343f909ee3a8a1147f966845b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116200
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-11-05 20:25:43 +00:00
Ben Konyi f908fb67ce [ VM / Service ] Fix potential race in service test helper
We attempted to delete the file with service protocol information
immediately after retrieving the URI. However, the spawned process could
potentially still have that file open which will cause the deletion to
fail on Windows. Fix is to wait until the process closes before deleting
to ensure it's not holding onto the file.

Change-Id: I85f715ad0570d121365373d498e539a667bd9d02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124165
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2019-11-05 20:21:43 +00:00
Liam Appelbe 1f8ef384d9 [vm] First pieces of late modifier implementation.
This implements the logic for initializing, getting, and setting
non-final instance fields that have initializers. It doesn't address
statics, finals, local variables, or the no-initializer case, and is
only implemented for bytecode.

Bug: https://github.com/dart-lang/sdk/issues/38841
Change-Id: I3b9e2772abdc04e3bfede56d2fcf06738f234cbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122489
Commit-Queue: Liam Appelbe <liama@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-11-05 19:48:03 +00:00
Aske Simon Christensen 8bdca37e98 [vm] Bump minimum kernel version to 29.
This paves the way for removing the old constant evaluator from the VM,
by no longer supporting versions without front-end constant evaluation.

For the front-end test that tests old kernel versions on the newest VM,
the dill files for versions before 29 are deleted.

Version 29 is from 2019-08-16: eae781c73e

Change-Id: Icb472bffc764d6e37ed1349a0cb4ff281e0e1b21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123739
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
2019-11-05 13:31:41 +00:00
Konstantin Shcheglov 0804a6f260 Don't use deprecated analyzer elements in dartfuzz.
Change-Id: Ib6a1ddb831854c60604fa57aeac2103443ee8efe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124101
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-04 22:37:45 +00:00
Alexander Markov 5279b6438c [vm/bytecode] Fix raw casts in DynamicCall in the interpreter
This is the follow-up for https://dart-review.googlesource.com/c/sdk/+/123920.

RAW_CAST macro in the interpreter doesn't properly handle objects of
subclasses of a tested class (e.g. RAW_CAST(String, x) fails in debug mode
if x is OneByteString). So this CL replaces a couple of recently added
RAW_CAST with a more reliable RawCast.

Change-Id: Ifa94ce79985a5ae60c6f4d86ff7552b5124f649c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124102
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-11-04 20:28:37 +00:00
Martin Kustermann ab5cf0f854 [vm] Ensure create_sdk GN build has working dart2native iff AOT is supported
This CL

   * adds a GN flag "include_dart2native" off by-default (switched on explicitly for our GN build)
   * ensures every GN build of the "create_sdk" target has a working dart2native (except ia32)
   * removes not-working dart2native script from ia32 dart-sdk (no AOT support in ia32)
   * removes the "dartaotruntime" GN target, since it is the same as "dart_precompiled_runtime"

This should ensure every downstream consumer of the "create_sdk" GN target will
have a working version of dart2native.

For the particular "dart-sdk" we create on dart-sdk-{linux,windows,mac}
we will override the default AOT compiler&runtime with the product mode,
which produces smaller AOT snapshots and has smaller AOT runtime (making
the native executables significantly smaller)

Change-Id: Ib5042589297cdb055c41dc56abdff86a4612ef5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123724
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
2019-11-04 12:01:56 +00:00
Alexander Markov ed1910006c [vm/bytecode] Cleanup support for bytecode format before v20
Bytecode format v20 was introduced Sep 06 2019 in
https://dart-review.googlesource.com/c/sdk/+/116120.
This change drops support for older bytecode format versions from VM.

Change-Id: I11b75ba16e6b7570e0346f9ac024265b08c0c801
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123920
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-11-01 20:36:32 +00:00
Ryan Macnak d96cd87896 [vm, reload] Initialize new fields in existing instances lazily.
Change-Id: I29c52feba2a404a7910888ce2bbb46e9aa8dd50f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123547
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-11-01 20:06:52 +00:00
Alexander Markov 8b67fcbbd1 [vm] Cleanup script tags
VM creates Script objects with kKernelTag only, so this CL cleans up
all uses of script tags and Script::kind() along with code
which is no longer reachable.

Change-Id: Ia765e7757264aa614e18eddd16d21937f855c129
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123889
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-11-01 19:08:42 +00:00
Alexander Markov ebc6340e36 [gardening] Skip bytecode_with_ast_in_aot_test on crossword-ast bot
Fixes https://github.com/dart-lang/sdk/issues/39199

Change-Id: I290d286d0cb2a04cf516ed1c4b5b6db03dcac1c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123887
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-11-01 17:17:12 +00:00
Ryan Macnak 79c7d3d8bc [vm] Always use bytecode when it is present in a kernel file. Let FLAG_use_bytecode_compiler only control whether the kernel isolate generates bytecode.
We no longer generate kernel files containing both AST and bytecode, so we don't need a flag to choose between them.

Change-Id: I1a4f7df507c649019c9fe254fa18a5826e2006aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122402
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-11-01 17:06:02 +00:00
Régis Crelier df678dbec0 [VM/nnbd] Introduce type Never in VM and bytecode.
Introduce enum NNBDMode for subtype test checking mode.

Change-Id: Id9c39ee8c975c664ac58e313b7dd05e6e219dfc1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123557
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-11-01 00:43:59 +00:00
Ben Konyi 917ba19c1a [ VM / Service ] Remove flaky portion of get_flag_list_rpc_test
Change-Id: I307589d3b38d15dee5e4c05020fa8d733241c7db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123695
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-11-01 00:23:50 +00:00
Ben Konyi bc6cadfac4 [ VM / Service ] Fix get_flag_list_rpc_test for real this time
Change-Id: I41c31d06ba1a685275b1a7d66baaecd5deaf4fa0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123821
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-10-31 23:40:57 +00:00
Ben Konyi 3224a6633b [ VM / dart:io ] Replace usage of SecTrustEvaluate with SecTrustEvaluateWithError on MacOS >= 10.14
SecTrustEvaluate is now deprecated as of 10.15.

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

Change-Id: Id057ef47d4c4be0ad012203dbabc0266be58ad8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123556
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2019-10-31 22:17:17 +00:00
Ben Konyi 0dd494bc54 [ VM / Service ] Fix get_flag_list_rpc_test failing on release builds.
Change-Id: I1976bb80463da728acc6178707a22cb4b7013c3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123693
Reviewed-by: Ben Konyi <bkonyi@google.com>
2019-10-31 21:59:54 +00:00
Alexander Markov 8a09d7ab5a [vm/bytecode] Remove alignment of sections in bytecode
Previously, before switching to compact encoding of bytecode
instructions, we had to align bytecode instructions by 4.
Since that time sections of bytecode binary were aligned.

However, this alignment doesn't work well in AOT mode if dill file
contains both bytecode and AST, as other metadata (such as obfuscation
prohibitions) may precede bytecode metadata and may make the whole
bytecode binary misaligned.

This results in incorrect calculation of section offsets,
failed assertion

  assert(writer.offset - start == section.offset);

and VM may fail to load bytecode binary with error

  bytecode_reader.cc: 1368: error: unreachable code

In order to fix these problems, extra alignment of bytecode
sections is removed.

Change-Id: Iaa3b7c46999615aaa446781a7018db409261ead8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123686
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-31 21:37:44 +00:00
Filip Filmar d9b069b27d [vm] Use fuchsia.deprecatedtimezone
This sets us up for migrating away from a dedicated timezone service
into a more general `fuchsia.intl.*`.

As a first step, let's use only one of the two equivalent FIDL service sets.
In fuchsia they are implemented by exactly the same handlers, so are equivalent
to the best of my knowledge.

Fixes #39174.

Change-Id: I229670bb96816af808a0cb14e6d2cba283f9ef62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123487
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-31 21:34:49 +00:00
Ben Konyi 60c34ac420 [ VM / Service ] Allow for the profiler to be enabled/disabled via SetFlags RPC
Disabling the profiler will **not** release the sample buffer on Linux,
MacOS, and other platforms which utilize signals for profiling as
there's no way to ensure all signals have been receieved after the
thread interrupter has been shutdown.

Change-Id: Ifb3230fdb95e9bc9147cbd4b85d1a84e976ce119
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123554
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-10-31 21:18:38 +00:00
Ryan Macnak b164a892e2 [vm] Fix spurious MSAN failures when accessing arguments to runtime calls.
Compare existing logic for arguments to native calls.

Change-Id: I89479ac913a10d92ddb871beb2da838c82a53f23
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123488
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-30 21:55:25 +00:00
Jason Simmons 262fadc6cf Change the type of RetainingPathItem.parentField to String in the observatory
This matches a change in the type of parentField within the VM service
(see https://dart-review.googlesource.com/c/sdk/+/108560)

Change-Id: Ib0d20c79bb26a3674cef1c52bf9509fb316bb52c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123472
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2019-10-30 17:36:14 +00:00
Martin Kustermann 4ea512b4c1 [llvm_codegen] Use exclusively SExpression support from VM and nothing else.
The LLVM code generator should only consume the serialized IR and not use any other VM functionality.
This CL adds a custom zone which can be used for the deserialized IR nodes and removes any
Dart_SetVMFlags/Dart_Initialize/ApiZone/... calls.

This works with the existing example:

    % ninja -C out/ReleaseX64 codegen
    % out/ReleaseX64/codegen runtime/llvm_codegen/test/codegen/Inputs/hello.sex
    ...
    define void @"hello.dart::main"() {

    B1:
      %0 = call i8* @llvm.stacksave()
      %1 = ptrtoint i8* %0 to i64
      %2 = load i64, i64 addrspace(256)* inttoptr (i64 72 to i64 addrspace(256)*)
      %3 = icmp ult i64 %1, %2
      br i1 %3, label %4, label %5
      ...
      ret void
    }
    ...
Change-Id: I1d07ba6bc122d100c73f97cfa961d36240489666
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/120792
Commit-Queue: Martin Kustermann <kustermann@google.com>
Auto-Submit: Martin Kustermann <kustermann@google.com>
Reviewed-by: Teagan Strickland <sstrickl@google.com>
2019-10-30 16:27:04 +00:00
Maxim cb2f45ea6b Fixed Dart->C++ mapping of IPPROTO_IPV6 socket option
Fixes mapping of Dart `RawSocketOption` in `RawSocketOption_GetOptionValue` function.

Closes #39165
https://github.com/dart-lang/sdk/pull/39165

GitOrigin-RevId: 696478de091bfb2221edc565ff55d4e69b1b2e1f
Change-Id: Ibcd67a25ab2f85d30696a6050bf844a5b09aa819
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123440
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2019-10-30 14:53:54 +00:00
Régis Crelier eb4ab61349 [VM/nnbd] Duplicate workaround to force nullability of Null type.
This is a follow up to https://dart-review.googlesource.com/c/sdk/+/121414.
This duplicates a workaround used when reading bytecode and applies it also when
reading binary kernel.

Change-Id: I9522da185a76c4a4aa8b98aaf60c6e2f923660ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123474
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-10-30 01:32:05 +00:00
Régis Crelier efb4511916 [VM/nnbd] Propagate nullability info on types from kernel to VM and bytecode.
Change-Id: I2f2b5819a58d55b60aaf82418e0d2feaad4aaa32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121414
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-10-29 23:39:36 +00:00
Alexander Markov ae5a86d790 [vm] Fix Script::GetTokenLineUsingLineStarts to work on scripts without line numbers
Scripts loaded from kernel AST always have non-null line_starts
(line_starts could be zero-length if there are no line numbers).
Scripts loaded from bytecode can have null line_starts if line
numbers are not present, so Script::GetTokenLineUsingLineStarts is
fixed to handle this correctly.

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

Change-Id: I84b5e7ef804b07b3d35420eba5c17246264d8baa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123482
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-29 21:29:56 +00:00
Ryan Macnak b34f11adbd [vm, gc] Remove expensive, low-value GC verification flags.
--verify_gc_contains is roughly O(heap^2) and gives false errors in some cases involving remembered cards
--verify_on_transition takes over 30 minutes for even hello world

Change-Id: Idee7e535bb96b11f0fa620532debbd21ca9d7135
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123329
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-29 19:25:16 +00:00
Alexander Markov 0b96f9f9ae [vm] Fix dropping values from the middle of the stack when there is a temporary variable
Fixes https://github.com/dart-lang/sdk/issues/39152

Change-Id: I62e7f1286f5b629ab4ff649aa15ce2b26872b7b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123342
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-10-29 01:39:55 +00:00
Martin Kustermann 5fba90b2f8 [vm/metrics] Ensure the metrics exposed by VM also include on-the-fly metrics
The lower-case "value()" metrics getter can only be used to obtain
metrics which are explicitly set by the VM.

The metrics we expose also include ones which are computed on-the-fly.
Those have to be accessed via "Value()".

Change-Id: I283c3c7c660d47c383b880b4bff6357a4dba9c01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123252
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-10-28 19:58:53 +00:00
Ivan Inozemtsev 5b69b31fc2 Remove unnecesary backslash after comment
Change-Id: Ia3e85ff0959daf67a9a14c0c5fdc1f6f8b800df1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123244
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Ivan Inozemtsev <iinozemtsev@google.com>
2019-10-28 12:52:16 +00:00
Samir Jindel c885bdde1d [vm] DBC is obsolete. Remove dead code.
Change-Id: Ica33af158cca53c8e951e4b2582de83660e8a60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121851
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-27 18:18:29 +00:00
Ryan Macnak 6354b0b97d [vm, gc] Add a release barrier to prevent header initialization of an old object from being ordered after publishing stores of that object.
Compare f4f0831c69, which implicitly removed a barrier from PageSpace::AllocateBlack.

Bug: https://github.com/dart-lang/sdk/issues/39090
Change-Id: I3a9274b90875a6860cb102a238b6f95a6a7b2ff2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123004
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-10-25 22:16:05 +00:00
Aart Bik 74433e70da [vm/compiler] fix assertion bug in SSA builder
Rationale:
Our "front-end" may leave CreateArray on stack
in control-flow-collection (viz. BuildMapLiteral()
and BuildListLiteral()).

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

Change-Id: I423a431aa9fac985996fb09df6a98c46aed3d696
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122960
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-10-25 20:11:17 +00:00
Alexander Markov 1cf7c40d32 [vm] Fix crash when AST constant references a not yet loaded bytecode class
Classes declared in bytecode are loaded lazily. So, in case there is
a mix of bytecode and AST kernel files, it's OK if AST constant
references a class which is not loaded yet, if that class is declared in
bytecode.

Change-Id: I6e28da7c6a97d19d88e16d6cd8abd0e9b61df388
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122847
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-10-25 19:55:09 +00:00
Ryan Macnak c873220e43 [vm, arm64] Adjust CSP during the invocation stub instead of each function prologue.
Since 6e2c4636cd, we have more reliable information about the stack limit.

This saves 8 bytes from each function.

Flutter Gallery:
Instructions(CodeSize): 6491472 ->  6375472 (-1.79%)
Total(CodeSize):       10375882 -> 10258802 (-1.13%)

Bug: https://github.com/dart-lang/sdk/issues/26472
Bug: https://github.com/dart-lang/sdk/issues/39083
Change-Id: I1d8e4c4bfd858eca1d0e4e5640faae15f4dbbe8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122845
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-10-25 19:21:56 +00:00
Dmitry Stefantsov 9910fa8454 [cfe] Implement the first part of NNBD-aware isSubtypeOf
This CL is a squashing of the following smaller CLs:

* https://dart-review.googlesource.com/c/sdk/+/120669/
* https://dart-review.googlesource.com/c/sdk/+/120670/
* https://dart-review.googlesource.com/c/sdk/+/121331/
* https://dart-review.googlesource.com/c/sdk/+/121381/
* https://dart-review.googlesource.com/c/sdk/+/121383/
* https://dart-review.googlesource.com/c/sdk/+/121620/
* https://dart-review.googlesource.com/c/sdk/+/121707/
* https://dart-review.googlesource.com/c/sdk/+/122144/
* https://dart-review.googlesource.com/c/sdk/+/122360/
* https://dart-review.googlesource.com/c/sdk/+/122381/
* https://dart-review.googlesource.com/c/sdk/+/122783/
* https://dart-review.googlesource.com/c/sdk/+/122787/

Change-Id: I9d850f531f0fce07055ff9b5cd39abb605752005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122868
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2019-10-25 16:37:39 +00:00
Alexander Thomas e62c7ae3bb [infra] Add legacy AST mode builder to the test-matrix.json
This also removes the now redundant bytecode testing from the dartkb
builders.

Replace the useKernelBytecode boolean option with a more flexible
genKernelOptions string list option.

See also See also https://dart-review.googlesource.com/c/sdk/+/122321/ for the
corresponding Luci config updates.

Change-Id: Iabb207bc02637b758c42c00ae9175bd52f46559f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122320
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-25 15:11:00 +00:00
Samir Jindel 36cd2e22d4 [vm/aot] Expose static symbols in directly-generated ELF snapshots.
Also use the function labels for Dwarf in Assembly snapshots to avoid creating
duplicate labels.

Fixes https://github.com/dart-lang/sdk/issues/38978
Issue https://github.com/dart-lang/sdk/issues/38526

Change-Id: Icafd3d3a86381990ec8097397a21b16ad4a7a766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122150
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-10-25 11:53:14 +00:00
Fizaa Luthra b42c2af535 [vm/compiler] Refactoring binary operation and unary operation evaluation logic
Rationale:
1) Centralize constant expression evaluation logic.
2) Avoid code duplication with constant folding in unoptimized code.

Bug:
https://github.com/dart-lang/sdk/issues/36409


Change-Id: I0ee4916e9e731df3dd8eb30dd5f182bc40e1dfa3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122172
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Fizaa Luthra <fizaaluthra@google.com>
2019-10-24 22:30:57 +00:00
Clement Skau 17b5ddeeb8 [SDK] Adds tests for async stacktraces.
Bug: https://github.com/dart-lang/sdk/issues/37668
Change-Id: Id29704d086dbae066c8b34e347b75cd374b1ce2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121986
Commit-Queue: Clement Skau <cskau@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-24 13:38:34 +00:00