Commit Graph

13143 Commits

Author SHA1 Message Date
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
Teagan Strickland d2e99c4935 [vm/compiler] Continued work on the IL serializer.
Adds support for:
  Constant
  Goto
  JoinEntry
  PushArgument
  StaticCall

Adds canonical name parsing, which allows us to parse Function
and Field values. Adds ImmutableList, Instance, and TypeParameter
parsing.

Results from compiling hello world program:

* Early round trip:
    * Contains unhandled instructions: 4070
    * Failed during deserialization: 2
    * Successful round trips: 106
* Late round trip:
    * Contains unhandled instructions: 3789
    * Failed during deserialization: 4
    * Successful round trips: 385

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: If9cb4c133e3ba8c62016e545f8471c67cc126290
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113684
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-09-03 09:14:00 +00:00
asiva a2228905b5 [VM/runtime] Add some asserts and remove reference to String::MakeExternal
from comments as this method does not exist anymore.

Change-Id: I484ab2bfd101cb3069ab0f285de5b781834b3932
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114980
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-08-30 23:29:09 +00:00
Régis Crelier 1f9ef866a5 [vm/debugger] Properly handle 'force-optimized' functions in debugger.
The debugger and runtime should not try to deoptimize 'force-optimized'
functions. This fixes #38108.

Change-Id: I74e24d8fb4793e4560267c2cb32ac40caa95bf35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115014
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-08-30 21:28:48 +00:00
Ryan Macnak 36985859e4 [vm] Don't copy when reading typed data in messages sent to native ports.
Bug: https://github.com/dart-lang/sdk/issues/37833
Change-Id: Iac906e58320e003365c4c0624b4587579f352db1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114970
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-30 17:49:28 +00:00
asiva 6f85cb83cf [SDK] Remove dart:profiler library which has been deprecated since Dart 1.2
and remove all references to it in tests and the SDK build scripts.

Change-Id: I65a4d71b74c66ca090eba28e922e2f70a7b2989d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114965
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-08-30 17:03:04 +00:00
Ryan Macnak 7e7369cd98 [vm, bytecode] Don't write Bytecode::var_descriptors_ in snapshots.
This matches the behavior for Code::var_descriptors and causes the field to effectively be nulled when writing a snapshot. It may be lazily recomputed by the reader. Fixes various app-jit tests in bytecode mode that causes the var descriptors to be generating by printing stack traces.

Change-Id: I04fddaf46508050eeab8af63d5c6eb1e1b7fa51f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115000
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-29 22:29:13 +00:00
Alexander Markov d7c944b4c0 [vm/bytecode] Support library dependencies in bytecode for mirrors and vm-service.
Library dependencies are serialized in bytecode as extended annotations.

Fixes the following tests with bytecode:
co19_2/Language/Metadata/before_export_t01
co19_2/Language/Metadata/before_import_t01
service/library_dependency_test

Change-Id: Idfbac6fcd56318d994d179864f0f5fd7d95089a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114928
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-08-29 21:07:06 +00:00
Aart Bik d1c9a2b06f [vm/compiler] Improve DIV and MOD performance
Rationale:
Mostly an AOT 64-bit improvement of DIV and MOV by constant
on X64_64. Also a few minor supporting optimizations
that were missed. With unit tests.

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

Change-Id: I2f12d6a24bbe983324521d7d4d778f20b34d18a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114901
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-08-29 20:32:10 +00:00
Alexander Markov 9c8646267d [vm/compiler] Get original ICData in FlowGraphCompiler::GenerateStaticCall
StringInterpolateInstr::EmitNativeCode calls FlowGraphCompiler::GenerateStaticCall
with null ICData, so GenerateStaticCall gets ICData using GetOrAddStaticCallICData.
GetOrAddStaticCallICData may return existing ICData object, which could be cloned
in case of background compilation, so GenerateStaticCall should get Original()
ICData before using it.

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

Change-Id: I6f4b72cba0a09eddd467790b0ab31926aa2dcfab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112180
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-29 18:49:29 +00:00
Teagan Strickland 1573f4e877 [vm/compiler] Further work on the IL deserializer.
Adds support for:
  CheckStackOverflow
  Parameter
  SpecialParameter

Adds handling of Integer, Double, Class, Type, and TypeArguments
in ParseDartValue. Adds handling of values visited in the graph prior
to the corresponding definition to keep traversal of block contents as
one pass.

Results from compiling hello world program:

* Early round trip:
    * Contains unhandled instructions: 4157
    * Failed during deserialization: 0
    * Successful round trips: 21
* Late round trip:
    * Contains unhandled instructions: 4023
    * Failed during deserialization: 29
    * Successful round trips: 126

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: Icb2972749ee86891d5847519a3b5097ad5c63c54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113326
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-29 16:52:24 +00:00
asiva 45b85e12d2 [VM] - Remove rules to build vm_legacy_platform
Change-Id: If79375d73e24f99017cbeafd3357e03001925162
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114924
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2019-08-29 15:57:54 +00:00
Teagan Strickland 1f9bf308b2 [vm/compiler] Early work on IL deserializer.
At this point, we do get some successful deserializations (of
methods that are optimized into constant value returns).

Adds support for:
  GraphEntry (including constant pool)
  FunctionEntry
  TargetEntry
  Return

Results from compiling hello world program:

* Early round trip
    * Contains unhandled instructions: 4180
    * Failed during deserialization: 0
    * Successful round trip: 0
* Late round trip
    * Contains unhandled instructions: 4163
    * Failed during deserialization : 0
    * Successful round trip: 15

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I9e0919f6ffbfe059ce0efd55f9a767c1ba805795
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113325
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-08-29 15:49:59 +00:00
Samir Jindel 2e2d5bcca6 [vm] Make v8_snapshot_profile_writer_test less flaky and avoid user error with crossword config.
Fixes https://github.com/dart-lang/sdk/issues/37834

Change-Id: Ida9010a8294f2ab6e06969c671575f80c58b6697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114850
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-29 12:03:43 +00:00
Martin Kustermann 8667223d72 [vm/concurrency] Have custom weak table per isolate used for snapshot writing
Currently the snapshotter will just reset the weak tables once it's
done. Once we have a shared heap this would not work anymore since the
resetting of the weak tables can happen while another isolate is in the
middle of snapshotting.

We therefore make each isolate have it's own weak table used for
snapshotting messages.

The memory for the weak tables is managed by a std::unqiue_ptr in the isolate.

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

Change-Id: Ic0f4c4a96b6e66606be9e004259d2fee995f7099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114858
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-08-29 08:41:33 +00:00
Régis Crelier dda69953e2 [vm/bytecode] Debugger should not signal breakpoint resolution twice.
If the debugger has already signaled the resolution of a breakpoint in a
bytecode function, it should not signal its resolution in code again.

This fixes test service/breakpoint_async_break_test

Change-Id: I88743b65eb3049a1a9476cb67f17ebf4275f8455
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114923
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-08-29 00:51:35 +00:00
Liam Appelbe 05c28c6115 Reland "Scaffolding for dart:wasm"
This reverts commit 9198813a55.

Reason for revert: Relanding with a fix

Original change's description:
> Revert "Scaffolding for dart:wasm"
> 
> This reverts commit f39a3f188e.
> 
> Reason for revert: https://golem.corp.goog/BuildInfo?target=flutter-profile&machine-type=android-armv7&revision=84750
> 
> Original change's description:
> > Scaffolding for dart:wasm
> > 
> > This CL doesn't have any tests because it's just boilerplate. I'll
> > add a test in the follow up CLs where I add actual functionality.
> > 
> > Bug: https://github.com/dart-lang/sdk/issues/37882
> > Change-Id: I47c81f5f1be724f8226e756ba5d01880a45f1ac7
> > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112841
> > Reviewed-by: Siva Annamalai <asiva@google.com>
> > Reviewed-by: Liam Appelbe <liama@google.com>
> > Commit-Queue: Liam Appelbe <liama@google.com>
> 
> TBR=asiva@google.com,liama@google.com
> 
> Change-Id: I0fd0f29d66a07fc29e840ddaec2d4161c8d599cb
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114044
> Reviewed-by: Liam Appelbe <liama@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

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

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

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: Idb43cbd3a0521776ac420bfef91c8a9a4362f18e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114757
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-08-28 23:11:21 +00:00
Régis Crelier a290271dea [vm/bytecode] Throw should be 'debug checked', but not ReThrow.
Since both throw and rethrow statements share the same 'Throw' bytecode opcode
(differentiated by an operand), we make the opcode not implicitly 'debug
checked' anymore.
Instead, we emit a 'DebugCheck' opcode for the throw statement only.

This fixes the following test:
service/async_single_step_exception_test

Change-Id: I4e540ea0a640fda5365d51933ce4e5125548e2f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114754
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-28 22:20:53 +00:00
Alexander Markov 7b17602c74 [vm/bytecode] Include function name into source fingerprints
This change aligns BytecodeFingerprintHelper::CalculateFunctionFingerprint
with KernelFingerprintHelper::CalculateFunctionFingerprint.

Fixes vm/cc/FunctionSourceFingerprint with bytecode.

Change-Id: I72fd25cbd2d04935c30cfe52838ef5aa890e1291
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114750
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-28 20:32:51 +00:00
Martin Kustermann 69b7082290 [vm] Remove left-over code from unevaluated constants.
Change-Id: Ife7e6678aabcbd7152d6d77757226c0dc3161ff6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114855
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-08-28 16:28:23 +00:00
Martin Kustermann 28f692165e [vm] Improve error message from Dart_InvokeVMServiceMethod()
Change-Id: Ib7dad8a4e7fcc7ebb224bee848728e235f04459e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114508
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Clement Skau <cskau@google.com>
2019-08-28 13:18:52 +00:00
Jens Johansen 8621e63190 [kernel/VM] cleanup unused dill tags
Change-Id: I76a3985abf7806f038cdb6971e526accd7cc20a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114605
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2019-08-28 09:30:04 +00:00
Alexander Markov 1017a562d7 [vm/bytecode] Fix crash while querying parameter descriptors for static implicit closure
Fixes https://github.com/dart-lang/sdk/issues/38035

Change-Id: Ib060a0b43ff0ca85d984642e9faca8fd966a1e62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114634
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-28 02:26:33 +00:00
Ryan Macnak 0da7763bae [vm, gc] Fix racy access to the growth policy in ForceGrowthSafepointOperationScope.
Compare 6653611ae4

Bug: b/139666100
Change-Id: I9828ed08ae49062dbe77483c6c2e2218682ab213
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114722
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-08-28 01:38:53 +00:00
Aart Bik 451a7dd4ea [vm/assembler] Add IMUL with implicit operands
Rationale:
Needed for an upcoming improvement of DIV/MOD by constant.

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

Change-Id: I3966049a3f14fd3becec797c4bc0038f2852bc1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114680
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-28 00:17:13 +00:00
Ryan Macnak 040fdf22c5 [vm, gc] Run old space GC when the allocation limit is crossed during NotifyIdle, even if it would exceed the idle deadline.
If a program is allocating only in new space, and scavenges are happening only at idle time, this is the only check preventing unbounded growth in old space.

Bug: b/139666100
Bug: https://github.com/dart-lang/sdk/issues/33314
Change-Id: Ib20369e43e288b1056fc220e6cb895f6f3158d6f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114721
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-08-27 23:19:42 +00:00
Régis Crelier 726762c4bd [vm/bytecode] Remove source information from setAsyncThreadStackTrace in prolog.
Removing source information for this call prevents the debugger to set a
breakpoint in compiled bytecode on this call which occurs prior to the first
DebugStepCheck in the function.

However, this change uncovered a bug in debugging interpreted bytecode:
The first source range of an async_op function gets split into 3 ranges, with
the middle range specifying a NoSource token position. The debugger does not
set a breakpoint in the first range, because DebugCheck is not yet encountered,
which is correct, but it failed to look for another range (the 3rd one) with the
same token position.

Change-Id: I11dcc75d115cb57b37f62afd83c783cf563b63e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114700
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-08-27 22:45:52 +00:00
Ryan Macnak 2bc0f49c00 [vm, gc] Add timeline event for growth policy updates.
Change-Id: If20f19606b73b70071b93909093cf024c387e971
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114561
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2019-08-27 18:46:23 +00:00
Samir Jindel c7ac27bf50 [vm/ffi] Refactor and fix pipeline for force-optimized code.
Change-Id: I18429fcfe44065c73674c9a00977e222e5abb5de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114513
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-27 11:06:53 +00:00
Teagan Strickland 7c6cab995a [vm] Adds Update method to hash maps.
The Insert method runs in constant time, but inserting multiple
pairs with the same key results in all pairs being added to the
map. Remove only removes the most recent pair with a key equal
to its argument, so this means calling Remove after an Insert
does not guarantee that Lookup for a key will fail.

The new Update method, when used instead of Insert, guarantees
that the map contains at most one pair for a set of equal keys.
This means that Lookup is guaranteed to fail after a Remove
call, but the Update method requires walking the existing
chain of entries for the key's hash value.

(In practice, our code tends to call Lookup before Insert to
avoid adding pairs with equal keys more than once, but this
practice does mean that updating the value returned by Lookup
cannot be done without first removing the old entry. This new
method simplifies that workflow if used consistently.)

Change-Id: I2944472a7fc74c1de41cb25eb9469a7c7e491ceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114069
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-27 10:00:18 +00:00
Teagan Strickland 6c67280e44 [vm] Move C-string-based hash maps to hash_map.h.
Fixes assumption about pointer equality of keys.

Adds comment to document current assumption that multiple pairs
with equivalent keys are not inserted.

Change-Id: Ieb17d1b357f903dcc09274ac648c1a97e7ee85d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113686
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-27 09:52:13 +00:00
Martin Kustermann 4a01dc1341 [vm/compiler] Remove load_invalidation_gen logic
The `Isolate::IncrLoadingInvalidationGen()` function is no longer used
and the integer therefore stays always at 0.

Change-Id: I862d8b058db88400072a7d76a17baff2b7c2e16a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114323
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-08-27 09:41:24 +00:00
Aart Bik 64a42600ea [vm/compiler] Avoid unnessary checks on 64-bit
Rationale:
Follow up from two previous CLs. Use of 64-bit macro
(requested by Martin) and avoid unnessary check on
64-bit platforms (requested by Alex)

https://github.com/dart-lang/sdk/issues/37868
https://github.com/dart-lang/sdk/issues/37895

Change-Id: I80e6825953090f5079377d0452b70e48c5be92a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114550
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-08-26 20:34:22 +00:00
Aart Bik cebb64f249 [vm/compiler] Avoid deopt for non-clamping typed data
Rationale:
The recent introduction of non-SMI deopt to fix the
clamping bug is a bit too restrictive for the other,
truncating operations. In particular, we observed
a unnecessary regression in one of our performance
benchmarks.

https://github.com/dart-lang/sdk/issues/37868
https://github.com/dart-lang/sdk/issues/37895

Change-Id: Iabf59db5c50b775a717c6e961efb3a5f4b6a964e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114447
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2019-08-26 19:04:32 +00:00
Régis Crelier 4210112bfd [vm/debugger] Increase verbosity of --verbose-debug when setting breakpoints.
This helped investigate an async* issue.
Also rename 'BP' to 'breakpoint'.

Change-Id: Ie4f59c47b4282a4e19713e41afe996cfca55a16c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114462
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-08-26 17:27:04 +00:00
Martin Kustermann 48f8454960 [vm] Force raw variables created during scope building to be on the stack
Fixes https://github.com/dart-lang/sdk/issues/37984

Change-Id: I9aa283becbb836d4a0480f954aaa6d387bbc1fdc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114511
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2019-08-26 13:58:35 +00:00
Samir Jindel 43417df9c7 [vm/ffi] Fix crashes on stacktraces and debugging with force-optimized frames.
Issue https://github.com/dart-lang/sdk/issues/37910

Change-Id: I76630fbc6733712c8709b782619a76190c70bfd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113999
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-26 10:18:34 +00:00
Teagan Strickland ab54ea60e5 [vm/compiler] Add the framework for the IL deserializer.
This adds in a version of the IL deserializer that doesn't actually do
any deserialization yet.

However, it adds in a couple of compile passes that passes the FlowGraph
for compiled functions through the serializer and deserializer.  If the
deserialization step succeeds, then the FlowGraph stored in the
CompilerPassState is replaced with the new FlowGraph for the rest of the
compiler.

Also change the default zone handling in the FlowGraphSerializer to use
the zone for the current thread, instead of the zone stored in the
FlowGraph, so that it is appropriately affected by StackZone uses.

Bug: https://github.com/dart-lang/sdk/issues/36882
Change-Id: I8fa1c7af434f724ccec45ddb73263f84730af5b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113184
Commit-Queue: Teagan Strickland <sstrickl@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
2019-08-26 08:58:23 +00:00
Alexander Markov 41981f4192 [vm/bytecode] Ensure top-level class is loaded when querying library annotations
Fixes co19_2/Language/Metadata/before_library_t01 in bytecode mode.

Change-Id: I2c488ca76e6eeede83fe046aa1dd00e6ced5b25e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114450
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-23 23:36:01 +00:00
Alexander Markov 6ee9e67156 [vm/bytecode] Mark synthetic calls in source positions so debugger can skip them
Change-Id: I40ea385f650e04433ed404c51ee78e128f37445a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114303
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-08-23 17:06:11 +00:00
Martin Kustermann 3c54aeae6b [vm/compiler] Ensure proper release/aquire fences are used when turning ICData to be megamorphic.
The mutator has to ensure all writes to the ICData are flushed before we set the
megamorphic bit.

Similarly the BG compiler has to ensure (during cloning of ICData) that all
loads from the ICData happen after we've determined whether the megamorphic
bit has been set.

This allows us to maintain the invariant that if the ICData is marked as
megamorphic, the entries in it will have reached FLAG_max_polymorphic_checks.

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

Change-Id: Idec7aef8ca1369668f5c9c57b7b32759acbd270d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114322
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2019-08-23 14:51:18 +00:00
Régis Crelier 06d3769ac6 [vm/bytecode] Correctly resolve breakpoints in inner functions.
Also deoptimize before setting breakpoints into bytecode functions as they
may get compiled and optimized.

Change-Id: Ida049d2aafbe1a484f102b57c77c91d562adef76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114305
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2019-08-23 01:38:22 +00:00
Alexander Markov d5a9a732a5 [vm/bytecode] Register closure functions in the object store's list of closures
Change-Id: I3917c1725d51b70dcf84f358a588a6cf79c452b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114041
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2019-08-22 23:54:42 +00:00
Alexander Markov 5e428ed638 [vm/bytecode] Fixes for expression evaluation
* Set parent for TypeParameters created in createExpressionEvaluationComponent.

* Resolve references from bytecode to an expression evaluation class
  using real class. Expression evaluation class could be referenced
  from type parameters.

* Avoid registering expression evaluation classes in hierarchy. They
  shouldn't be discovered through direct subclasses or implementors,
  as expression evaluation classes don't have cids.

* Add :function_type_arguments_var local variable to bytecode local
  variables info, so expression evaluation can find function type
  arguments which are in scope.

Change-Id: I515431a989b4d02af4ecf90579931dd59d3acadd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114182
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2019-08-22 22:53:12 +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
Régis Crelier 223724fa76 [vm/bytecode] Lookup source and line starts for bytecode scripts specifying uri only.
Collect token positions of field declared in bytecode.
Improve debugger debugging: Disassemble both bytecode and code when applicable.

Change-Id: I56188cf24ef4bfe8a93cce11c2f4505152abdd02
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112680
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2019-08-22 18:31:18 +00:00
Ryan Macnak 0176526799 [vm, compiler] Always clone MegamorphicCaches before accessing on a background compiler thread.
This is to prevent the compiler from becoming confused by mutations from the Dart execution thread.

Bug: https://github.com/dart-lang/sdk/issues/37575
Bug: https://github.com/dart-lang/sdk/issues/37595
Change-Id: I43c42feff54d76b780beb6e8d627f1b1641f4bee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114054
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-22 18:26:39 +00:00
Liam Appelbe 9198813a55 Revert "Scaffolding for dart:wasm"
This reverts commit f39a3f188e.

Reason for revert: https://golem.corp.goog/BuildInfo?target=flutter-profile&machine-type=android-armv7&revision=84750

Original change's description:
> Scaffolding for dart:wasm
> 
> This CL doesn't have any tests because it's just boilerplate. I'll
> add a test in the follow up CLs where I add actual functionality.
> 
> Bug: https://github.com/dart-lang/sdk/issues/37882
> Change-Id: I47c81f5f1be724f8226e756ba5d01880a45f1ac7
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112841
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Liam Appelbe <liama@google.com>
> Commit-Queue: Liam Appelbe <liama@google.com>

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

Change-Id: I0fd0f29d66a07fc29e840ddaec2d4161c8d599cb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/37882
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114044
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-08-21 21:06:10 +00:00
Liam Appelbe f39a3f188e Scaffolding for dart:wasm
This CL doesn't have any tests because it's just boilerplate. I'll
add a test in the follow up CLs where I add actual functionality.

Bug: https://github.com/dart-lang/sdk/issues/37882
Change-Id: I47c81f5f1be724f8226e756ba5d01880a45f1ac7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112841
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Liam Appelbe <liama@google.com>
Commit-Queue: Liam Appelbe <liama@google.com>
2019-08-21 19:55:04 +00:00
Samir Jindel bc16959fc7 Reland "[vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable."
The original revision is in patchset 1.

Three bugs are fixed:

1. Fix SIMARM_X64 build: no need to generate trampolines for AOT or simulated JIT.
2. Hot-reload: Fix hot-reload: don't invalidate Code for force-optimized functions.
3. Windows: Provide shadow space to runtime routines.

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-release-ia32-try,vm-kernel-win-release-x64-try
Change-Id: I326009cfacb51a84e9de4ddf9ff2d6d415460f91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113829
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-21 13:33:37 +00:00