Commit Graph

15405 Commits

Author SHA1 Message Date
Régis Crelier 66693ea6e2 [VM runtime] For now, do not use field guards when using kernel bytecode.
Change-Id: I6619d329eda70a4fd684f2c2bed4ba2934d1271f
Reviewed-on: https://dart-review.googlesource.com/68540
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-08-07 19:06:48 +00:00
Ryan Macnak c439ebead0 [vm, gc] Update old allocation stats when scanning instead of pushing.
Avoids the incremental barrier needing to deal with allocation stats, and avoids a repeated size calculation.

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: I9104ffca30174a3e659c93d20b4888678e8e759a
Reviewed-on: https://dart-review.googlesource.com/68221
Reviewed-by: Zach Anderson <zra@google.com>
2018-08-07 17:49:03 +00:00
Samir Jindel 9767af2550 [vm/precomp] Support @pragma for fields and remove associated entry-point entries.
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-win-release-x64-try
Change-Id: I584aae2360771cf0599d9fb1b5ae2735b20d3413
Reviewed-on: https://dart-review.googlesource.com/65820
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-08-07 16:47:50 +00:00
Samir Jindel de408202a5 [vm/precomp] Take 4 for procedure- and class-entrypoints.
This reverts commit 08f59e5de3.

There are no changes to take 3 except fixing merge conflicts.

Change-Id: I45d5a16274c80f469827c19f4e4f4ca724e85a67
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-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-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/68363
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-08-07 13:54:27 +00:00
Samir Jindel 1ac34f1513 [vm] Fix @pragma detection in KernelLoader.
Change-Id: If09f26a27f84bbed4841eb6d868aea38af564e4a
Cq-Include-Trybots: luci.dart.try:vm-kernel-win-release-x64-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-win-release-x64-try
Reviewed-on: https://dart-review.googlesource.com/68362
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-08-07 13:54:27 +00:00
Dmitry Stefantsov 53321309da [kernel] Remove Vector-related Kernel nodes
They were supposed to be used as a part of the closure conversion pass,
which is now obsoleted.

Change-Id: Ie063f6c44487df7cd5d21895e8edc03251525d5f
Reviewed-on: https://dart-review.googlesource.com/68662
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-08-07 11:49:49 +00:00
Jens Johansen 6814dace8d Add bug number to kernel service status line
Change-Id: I2f503ce783c8b32ac01a7c94df62559e6d1e40f4
Reviewed-on: https://dart-review.googlesource.com/68640
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
2018-08-07 09:55:16 +00:00
Jens Johansen ad1d9e4f85 Update status for app_jitk after 164c7e3
Change-Id: I5bba0e4a3db3c6c40356b1f1db1c2f54f6f55476
Reviewed-on: https://dart-review.googlesource.com/68661
Reviewed-by: Jens Johansen <jensj@google.com>
2018-08-07 09:43:05 +00:00
Jens Johansen 4deab5bfa1 Observatory: Don't give a stacktrace on Sentinel
E.g. on this:
```
import "dart:developer";

class C {
  foo2() {
    var temp = 1;
    [1, 2, 3].forEach((outer_ea){
      [1, 2, 3].forEach((inner_ea){
         debugger();
         throw "Two!";
      });
    });
  }
}

main() {
  new C().foo2();
}
```

Saying `p this` in the debugger when it stops now says `<optimized out>`
instead of something like
```
Internal error: TypeError: Instance of 'qp': type 'qp' is not a subtype of type 'b6'

TypeError: Instance of 'qp': type 'qp' is not a subtype of type 'b6'
    at Object.m (http://127.0.0.1:54975/main.dart.js:1630:3)
    at Object.os (http://127.0.0.1:54975/main.dart.js:1830:26)
    at Object.b (http://127.0.0.1:54975/main.dart.js:1835:3)
    at http://127.0.0.1:54975/main.dart.js:26687:14
    at a1I.a (http://127.0.0.1:54975/main.dart.js:3202:71)
    at a1I.$2 (http://127.0.0.1:54975/main.dart.js:3547:23)
    at TB.$0 (http://127.0.0.1:54975/main.dart.js:39207:33)
    at Tz.lp (http://127.0.0.1:54975/main.dart.js:39181:9)
    at TC.$2 (http://127.0.0.1:54975/main.dart.js:39205:15)
    at TB.$0 (http://127.0.0.1:54975/main.dart.js:39207:33)
```
Change-Id: I7e001816742ff84dad5859f83b08da86d1043ccf
Reviewed-on: https://dart-review.googlesource.com/68660
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-07 09:41:38 +00:00
Jens Johansen f36ab38bf3 Detect isKernel better in service tests
Change-Id: I38ef62dd7db1dbda8bdc0477d16f92192cf8bff3
Reviewed-on: https://dart-review.googlesource.com/68621
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-07 09:10:08 +00:00
Jens Johansen 164c7e3195 Debugging sync* and yield
Set position on yield in sync* functions; use yield position in VM.

Change-Id: I1c92fd47e3c8d4f747242e076007c122ea0d2186
Reviewed-on: https://dart-review.googlesource.com/68366
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-07 08:39:32 +00:00
Jens Johansen f609258f3f Use the position on as when issuing AssertAssignable for as
E.g. the following program gives a type error, but previously didn't
tell what line had an error. This CL fixes the issue.

```
import "dart:async";

Future<Object> foo() {
  return Future.value("hello");
}

main() async {
  int x = await foo();
}
```

Change-Id: I27ae483b8b7ca63b9efac555a5cbc651296f227a
Reviewed-on: https://dart-review.googlesource.com/68367
Reviewed-by: Kevin Millikin <kmillikin@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2018-08-07 06:35:28 +00:00
Régis Crelier 35a982ba8f [VM kernel] Add missing type parameter finalization in type reader.
Change-Id: I09ae8dc759a4fb4d98c0c71ddda7d38de3525324
Reviewed-on: https://dart-review.googlesource.com/68431
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-08-03 22:40:40 +00:00
Régis Crelier 8cbbd7a741 [VM interpreter] Use write barrier in implicit setter.
Change-Id: I68351f5e009c1101bd7afc443b1b016197f62032
Reviewed-on: https://dart-review.googlesource.com/68427
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-08-03 21:42:16 +00:00
Aart Bik bfa890dcd1 [vm/compiler] Various 64-bit operator improvements.
Rationale:
Improves the slow path of 64-bit REM/TRUNCDIV on
X64 and ARM64. Also introduces 64-bit negate operator,
which was needed to expose negative contants
(viz. x / -3 was represented as x / - (3) first).
The negate operator is not recognized in AOT mode yet,
since shifts by out-of-range constants should learn
how to throw rather than deopt....


https://github.com/dart-lang/sdk/issues/33967
https://github.com/flutter/flutter/issues/19677

Change-Id: I7d81c9b1c72d99e8c4018f68c0501c7b599e073f
Reviewed-on: https://dart-review.googlesource.com/68280
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-03 19:49:56 +00:00
Samir Jindel 8d3d82ab39 [vm/kernel] Untangle the spaghetti-code in BuildGraphOfFunction and fix bugs.
Also remove Fragment initializer-list constructor.

Bugs:

1. We were always building the body of a constructor even if the initializers
   graph was closed. This would confuse the inliner exit collector which was
   informed about return instructions inside the body which were never linked
   into the graph.

2. We were not checking for stack overflow on each call to an sync-yielding
   closure; only on the first call.

3. Not a behavioral bug, but the prologue flow graph is no longer built out of
   order (dartbug.com/29737).

Change-Id: I467fbf171fd627492bf01cd96d6353c57e143eaa
Reviewed-on: https://dart-review.googlesource.com/67561
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-08-03 16:32:02 +00:00
William Hesse 46743f3868 Remove $runtime == drt sections and uses of drt from status files.
Change-Id: Iffd934a67668901176a84c9b01512711a011652d
Reviewed-on: https://dart-review.googlesource.com/67803
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: William Hesse <whesse@google.com>
2018-08-03 12:40:46 +00:00
Dmitry Stefantsov 637e55d4be [kernel] Add VariableDeclarations to represent formals of Typedefs
Change-Id: Ic1575dadb4fcf644dfdeb436612e2bed72d41a03
Reviewed-on: https://dart-review.googlesource.com/68083
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
2018-08-03 12:28:11 +00:00
Martin Kustermann 4c455e7876 [VM] During hot-reload check if .packages was modified, tell IKG to re-load it if so
Change-Id: Ice7bbe0ccd98e450ec9c90a22259ec7b406b2c83
Reviewed-on: https://dart-review.googlesource.com/68360
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-08-03 11:03:08 +00:00
Alexander Markov 4ab8408e00 [vm/kernel/bytecode] Support partial tear-off instantiation constants in bytecode generator and bytecode reader
Change-Id: I24855274df292903646844bb56ece0c35a62e9ef
Reviewed-on: https://dart-review.googlesource.com/68300
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-08-02 23:32:43 +00:00
Régis Crelier b04def964c [VM interpreter] Save previous argdesc_ and pp_ on reentry, restore on exit.
Fix previously broken AssertAssignable bytecode failing to throw.
Do not assume interpreter is never called on generic closure.
Propagate error after failed getter invocation in GetFieldForDispatch runtime
call.

Change-Id: I548a49829cc29addbbd310f1dc19ce8073738015
Reviewed-on: https://dart-review.googlesource.com/67922
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-08-02 17:56:50 +00:00
Aart Bik 206f955c43 [vm/compiler] Non-speculative ARM64 long division/remainder.
Rationale:
Having a non-speculative implementation avoids deopting
under JIT and enables AOT. Done for X64 and now also ARM64.

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

Change-Id: I83302a5950aa2dc1a7220367755af748cfaa4393
Reviewed-on: https://dart-review.googlesource.com/67920
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-08-02 15:50:26 +00:00
Vyacheslav Egorov c5f933fdf7 [vm/lib] String._identityHashCode should be the same as String.get:hashCode
On 64-bit platforms we use a field in the header to cache results of
Object.get:_identityHashCode. The very same field is also used to
cache String.get:hashCode result. Which means that their implementations
must be the same.

Fixes https://github.com/flutter/flutter/issues/20122

Change-Id: I98eef9eddf833c0d7c4c6f452728fe48e232efdc
Reviewed-on: https://dart-review.googlesource.com/68042
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-08-02 11:24:25 +00:00
Vyacheslav Egorov 4fa139b4b8 [vm/compiler] Rework how logical expressions are compiled to IL.
When logical expression is evaluated in the control context (e.g. if (cond) { ... })
avoid materializing a boolean value and then dispatching on it. Instead connect
true and false successors directly to then and else branches.

This CL also improves IL generated when logical expression is evaluated for value
(e.g. x = (cond)): we similarly avoid materializing intermediate results and also
avoid comparisons that are not needed, e.g. when evaluating x = A && B we construct
graph x = A ? B : false, instead of x = A ? (B == true ? true : false) : false style
of graph.

Change-Id: I204d414cc6751949641b6c46423a6319f6e2d89b
Reviewed-on: https://dart-review.googlesource.com/67562
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-08-02 10:51:53 +00:00
Jens Johansen 2580bf87ae Fix invalid assert that slipped by in ac8fdb5a
Change-Id: Iae23403b9bb7c57617c374034060cb1804e52bbd
Reviewed-on: https://dart-review.googlesource.com/68020
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2018-08-02 08:08:37 +00:00
Jens Johansen 1c2043e3a6 Update service test more to not be different in sync async mode
Before this CL the test fails because the stacktrace was not as expected
when running in sync async mode.
This CL changes the test so async methods are not executed synchronously
by adding an "await null;" as the first thing in those methods.

An alternative fix would have been to pass --no-sync-async.

Bug: #29158

Change-Id: Idd9bd159610405bbdd479d50d823953a9ad1abde
Reviewed-on: https://dart-review.googlesource.com/63742
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-02 07:24:02 +00:00
Jens Johansen ac8fdb5a58 Add :controller_stream and call _asyncStarListenHelper
This changes how we step out of async* functions slightly to match how
Dart1 behaves.

Bug: #29158

Change-Id: I8ee2df5eee8167fd1907a6e9f30c9dc7ab6939b1
Reviewed-on: https://dart-review.googlesource.com/63625
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-02 06:49:47 +00:00
Jens Johansen 2e98da68f9 Call _asyncStarMoveNextHelper in kernel
This changes how we step into async* functions slightly to match how
Dart1 behaves.

Bug: #29158
Change-Id: I4969ca48f798bd51f9d2d5bc26dd224fa7eff627
Reviewed-on: https://dart-review.googlesource.com/63624
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-02 06:16:15 +00:00
Alexander Markov c5ac5c0a2c [vm/kernel/bytecode] Fix serialization of closures with type arguments
Before this change, ConstantClosureFunction was holding a clone of original
FunctionNode without body (in order to omit body during serialization).
It is not correct: original FunctionNode, which is used to generate
closure's bytecode may reference original type parameters and those
type parameters could be used in types written into constant pool.
A cloned FunctionNode has its own cloned copies of type parameters
and it does not provide a sufficient serialization/deserialization context.
This resulted in 'Type parameter T is not indexed' errors.

This CL fixes this problem by removing cloning. In order to avoid
serialization of the FunctionNode body, body is temporarily dropped
while writing ConstantClosureFunction.

Also, this CL fixes type finalization of signature types of closure functions
read from bytecode. If signature type is not finalized, VM crashes with
'../../runtime/vm/object.cc: 18580: error: expected: IsFinalized()'.

Change-Id: Id88e99609ee387352fc011a8c297024d05e24037
Reviewed-on: https://dart-review.googlesource.com/67960
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-08-02 00:12:14 +00:00
Alexander Markov ff0327be67 [vm] Streamline passing of ICData through compilation pipeline
After this change, ICData map is always unpacked in CompileParsedFunctionHelper::Compile
regardless of the optimizing mode. The unpacked ICData array is passed
both to FlowGraphBuilder and to FlowGraphCompiler.

FlowGraphCompiler::FlowGraphCompiler no longer unpacks ICData array, and
the duplicated code for unpacking of ICData map is replaced with debug asserts.
Change-Id: Ib6864acdb6bcd02fe7acd1cb5bcf70d6c69808af
Reviewed-on: https://dart-review.googlesource.com/67505
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-08-02 00:00:59 +00:00
Régis Crelier 804fc2add3 [VM runtime] Consider partial instantiation when printing closures (fixes #34034).
Add regression test.

Change-Id: Ie83e8dc68e853942b186314cc572b2cf075d455f
Reviewed-on: https://dart-review.googlesource.com/67681
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-08-01 15:43:48 +00:00
Aart Bik 8bad5c7b29 [vm/compiler] Non-speculative X64 long division/remainder.
Rationale:
Having a non-speculative implementation avoids deopting
under JIT and enables AOT.

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

Change-Id: Ib38200502f5a8f63912ff5d7a808ea6e27f9001d
Reviewed-on: https://dart-review.googlesource.com/67502
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-08-01 00:13:55 +00:00
Zach Anderson 00e3109368 [VM] Adjust flags for creating depfiles
Currently, the VM can create depfiles when writing out a snapshot.
The snapshot file is the output file for the depfile. This change
allows creating a depfile when not writing out a snapshot. It
accomplishes this by adding a new flag --depfile_output_filename,
which allows the user to supply the output filename for the depfile,
which would otherwise be ambiguous when we are not creating a snapshot.

This change also adds the flag --depfile, which
--snapshot_depfile is now an alias of.

related #34026

Change-Id: I45eee463c499fc542e577d805b7ef9911ccb72a7
Reviewed-on: https://dart-review.googlesource.com/67420
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-07-31 17:09:31 +00:00
Alexander Markov 07c462b471 [vm] Refactoring: extract BaseFlowGraphBuilder to a separate file
Also, a few methods (needed for bytecode compiler) moved from
FlowGraphBuilder to BaseFlowGraphBuilder

Change-Id: Ibee87e6d5fdc8143786fd41763a9fd4897d06cba
Reviewed-on: https://dart-review.googlesource.com/67504
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-07-31 16:53:14 +00:00
Ben Konyi 079bebb78b [ VM ] Added missing token position for assert statements
Fixes #33610

Change-Id: I9e7a286d63f051686a196134d49a100364f81fb9
Reviewed-on: https://dart-review.googlesource.com/67620
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
2018-07-31 16:17:04 +00:00
Régis Crelier a98feb0f01 [VM interpreter] Fix exception handling.
Convert bytecode indices to pc offsets when reading bytecode exception tables.
Print pc descriptors and exception handlers in bytecode disassembly.
Propagate unhandled exceptions after calling interpreter.

Change-Id: Idb3b5459165ab0a124877452b1d9865d27c06d56
Reviewed-on: https://dart-review.googlesource.com/67501
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-07-30 23:31:07 +00:00
Martin Kustermann 72960de5f9 [VM] Fix one more place where bound error allocation happened on BG thread in new space
Change-Id: I991e720446a447abea37fea92bd47caa8df7d979
Reviewed-on: https://dart-review.googlesource.com/67348
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-07-30 17:34:31 +00:00
Martin Kustermann 23ba527735 [VM] Ensure to alloate bound errors in old space on BG compiler
Change-Id: I703f1a5e81013674923456acdab1adb099d1758b
Reviewed-on: https://dart-review.googlesource.com/67343
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-07-30 15:58:58 +00:00
Vyacheslav Egorov beaf05efa3 [vm] When generating JITDUMP also dump IR and attach it as source to code.
This allows to see IR intermixed with code in perf-annotate.

Change-Id: Ib7261df2cb789bfb6e3854a32d5300d0c27302ba
Reviewed-on: https://dart-review.googlesource.com/66575
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-07-30 12:35:45 +00:00
Vyacheslav Egorov 24158b773d [vm/compiler] Do not LICM LoadStaticField for uninitialized fields.
We permit CSE for loads from final static fields because - however we should
not be permitting LICM for such loads unless field is already initialized.

This bug was only affecting programs running from app-jit snapshots because
under normal circumstances a static get would not be inlined.

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

Bug: 34016
Change-Id: I48f30013d1541d14812b8e17b6dd75037945227d
Reviewed-on: https://dart-review.googlesource.com/67322
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-07-30 12:29:35 +00:00
Vyacheslav Egorov 68bfaf3ac3 [vm/compiler] Avoid crashes when canonicalizing unreachable AssertAssignable.
Our IL graphs can contain portions that can not be reached due to execution
and all optimizations need to take that into account.

In this particular case AssertAssignable::Canonicalize should have taken
into account that constant instantiator type arguments might not necessarily
correspond to the correct class - because AssertAssignable is on the
path that will never be reached during execution.

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

Bug: http://dartbug.com/33999
Change-Id: Ia151a3902b2bc7f0f8d4aa6dcdb302fe6b1d626d
Reviewed-on: https://dart-review.googlesource.com/67321
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-07-30 11:57:55 +00:00
Martin Kustermann 8e287dc037 [VM] Only add direct implementor when reading script snapshots if the implemented class is from the full snapshot
Change-Id: Id6ad0d266a3e0b6ed3d1d50c8c2671fe13e0e9ff
Reviewed-on: https://dart-review.googlesource.com/67320
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-07-29 17:52:54 +00:00
Martin Kustermann 6e81d74fcc [VM] Optimize generation of type testing stubs in JIT mode.
This CL introduces, similar to RawClass::direct_subclasses_, a
RawClass::direct_implementors field which is kept up-to-date.

The generation of type testing stubs uses this cached
reverse-relationship information for faster cid-range calculation (time
spent in type testing stub generation is decreased by an order of
magnitude).

This CL also enable type testing stubs for any instantiated type.

This seems to improve

  * analysis-server-cold-analysis by 6%
  * analysis-server-warm-analysis by 11%

as well as other non-analysis benchmarks in JIT mode.

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

Change-Id: If01ee06ac08251b2ed27f79d6b82ad7354c8336e
Reviewed-on: https://dart-review.googlesource.com/66576
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-07-28 20:22:05 +00:00
Aart Bik 4482d13ff7 [vm/compiler] Bug fix in 64-bit MOD (%) operator.
Rationale:
While writing tests for the ongoing native 64-bit
MOD/TRUNCDIV support in AOT, I noticed a floating-point
crash in our VM due to evaluating the constant mod case:

  Expect.equals(0, mod(minInt64, -1));
  Expect.equals(minInt64, truncdiv(minInt64, -1));

This fixes the constant evaluation part.

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

Change-Id: I9a4e6b3cd4d0d0dee39c690d2b981b5812501be4
Reviewed-on: https://dart-review.googlesource.com/67281
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-07-28 00:52:42 +00:00
Ben Konyi 08f59e5de3 These changes are causing a segfault in DartEntry::InvokeFunction in dart_entry.cc in Flutter,
which was blocking the Dart SDK roll.

Revert "Take 3 for "[vm/kernel/precomp] Remove procedures from entry points files.""

This reverts commit 567109df7f.

Revert "[vm/precomp] Extend @pragma entry-points to classes."

This reverts commit 232698047c.

Change-Id: Ib63d1afb8a1c978be7ddf282af0e7d5547111cc3
Reviewed-on: https://dart-review.googlesource.com/67300
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-07-28 00:01:50 +00:00
Samir Jindel 01e69cc0c4 Take 3 for "[vm] Factor out more of the slow-path of the store barrier into the stubs."
There is no difference from the previous version of this CL.

This depends on https://dart-review.googlesource.com/c/sdk/+/67220/3 which fixes a bug
in `CompileType` that was causing `ShouldEmitStoreBarrier()` to return different results
across multiple calls on the same instruction.

The buildbot on which this caused a failure is run as a tryjob below.

Change-Id: I078b587f7e23e88d95f3b05c966019a433ba57d9
Reviewed-on: https://dart-review.googlesource.com/67221
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-07-27 18:51:20 +00:00
Samir Jindel 5c10a8328c [vm] Fix bug with cid_ caching in CompileType.
Test Plan:

Previously this caused the following assert to fail in
`StoreInstanceFieldInstr::MakeLocationSummary` on some tests:

```
ASSERT(ShouldEmitStoreBarrier() == ShouldEmitStoreBarrier())
```

I've confirmed that the assert now succeeds.

Change-Id: I5efb1d89ab1685c136d1947ae01ccb21136061a5
Reviewed-on: https://dart-review.googlesource.com/67220
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-07-27 18:23:49 +00:00
Alexander Markov cb70de8afa [vm/compiler] Fix negated integer comparisons in AOT
Fixes https://github.com/flutter/flutter/issues/19612

Change-Id: I5cf45b7243e4c2b50bb29f8b0f3dafc55a1f1838
Reviewed-on: https://dart-review.googlesource.com/67040
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-07-27 17:35:58 +00:00
Paul Berry 31af5ce13c Revert CLs reworking generator class handling of non-lvalues.
This arc of work is breaking the Flutter roll--see
https://github.com/dart-lang/sdk/issues/33993.

This reverts the following commits:

- 55c0857037 (Create a common generator class to handle non-lvalues.)

- c9b197017c (Rename "assignment_of" -> "assignment_to".)

- 32fd7b15e4 (Remove special case for assignment to parenthesized
  expressions.)

- 432e59e589 (Fix error reporting if a for-in statement attempts to
  assign to a prefix.)

- 232bed3d11 (Change UnresolvedNameGenerator to use
  NonLvalueGenerator.)

- 0b778d0697 (Change IncompleteErrorGenerator to make use of
  NonLValueGenerator.)

- 1a5f94a0a4 (Fix analyzer-CFE integration of illegal references to
  instance members from static contexts.)

Change-Id: Id637e5ec60150a73031c05d7bb4c6effefd2aa8a
Reviewed-on: https://dart-review.googlesource.com/67091
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2018-07-27 17:18:28 +00:00
Aart Bik 502b4ffea5 [vm/compiler] Non-speculative ARM long multiplication.
Rationale:
The former speculative long multiplication on 32-bit
achitectures is no longer necessary with 64-bit
arithmetic wrap-around semantics. Having a non-speculative
implementation avoids deopting under JIT and enables AOT.

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

Change-Id: I3543e5ed63e443aa21c1af84499e46c07880d462
Reviewed-on: https://dart-review.googlesource.com/67084
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-07-27 16:05:55 +00:00