Commit Graph

672 Commits

Author SHA1 Message Date
Vyacheslav Egorov c9bcfe877b [vm] Fix byte displacement printing in x86 disassembler
Use int8_t type instead of char - which does not have a defined signedness.

Change-Id: I14d43419d3e59cea71fb27f15bb1f72e450baca6
Reviewed-on: https://dart-review.googlesource.com/76563
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-25 22:42:36 +00:00
Ryan Macnak 94481adbd4 [vm] Only include debugger/profiler slots in RawCode in product mode.
Saves 5 words per Code in product mode JIT.

Change-Id: I799a9c3bc1f4492d329c588ba1ea98f5b8baa304
Reviewed-on: https://dart-review.googlesource.com/75421
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-25 01:30:53 +00:00
Alexander Markov 62d154f6a3 [vm/bytecode] Record null-initialized fields in bytecode
If a field is initialized with null (either explicitly or implicitly),
field store can be omitted in bytecode. In such case, bytecode should
still convey the information about this initialization to VM for
field guards to work correctly.

Change-Id: I1fd45b858c3c521b97fa5dbffe0e15b1ea75d92f
Reviewed-on: https://dart-review.googlesource.com/76060
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-09-24 17:56:35 +00:00
Zach Anderson dba8b37d38 [vm] Benchmark for reading kernel bytecode
Change-Id: I07617a553193495fcc4fc0ce4a6382996ee7dc51
Reviewed-on: https://dart-review.googlesource.com/75821
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2018-09-24 15:54:49 +00:00
Alexander Markov 654c4babc8 [vm/bytecode] Fix a couple of assertions when running with bytecode
Also, add more tests to dartkb bots.

Change-Id: I6fbcbe73d6b9065ec03e64bf150b4ebd742e4d28
Reviewed-on: https://dart-review.googlesource.com/75981
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-09-21 22:54:39 +00:00
Alexander Markov 19e2040f35 [vm] Cleanup the ability to specify entry points via JSON and text files
Entry points files (both JSON and text) are replaced with
@pragma("vm:entry-point") annotations.

This change removes obsolete:
* --embedder_entry_points_manifest option in gen_snapshot;
* --entry-points option in gen_kernel and frontend_server;
* --print_precompiler_entry_points VM option;
* 'entry_points' argument in Dart_Precompile() API.

Change-Id: I503f50f51df27e8e9635388c013058686b3b6ff1
Reviewed-on: https://dart-review.googlesource.com/75793
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-21 16:51:48 +00:00
Alexander Markov 46ec629096 [vm/bytecode] Trigger JIT-compilation from interpreter
Performance on Richards benchmark (no bytecode in platform, release build):

Interpreter (--enable-interpreter --compilation-counter-threshold=-1)
Richards(RunTime): 177228.34433333334 us.

Interpreter + bytecode compilation with default threshold 10 (--enable-interpreter)
Richards(RunTime): 930.8050725919032 us.
Varies from run to run, spikes up to 4178.005912317328 (no OSR yet, only background compilation).

Bytecode compilation (--use-bytecode-compiler)
Richards(RunTime): 830.1371626556016 us

Default pipeline:
Richards(RunTime): 880.1557113946327 us.

Numbers on Richards benchmark (platform with bytecode, release build):

Interpreter (--enable-interpreter --compilation-counter-threshold=-1)
Richards(RunTime): 354553.6346666667 us.

Interpreter + compilation with default threshold 10 (--enable-interpreter)
Richards(RunTime): 934.7108855140189 us.

Bytecode compilation (--use-bytecode-compiler)
Richards(RunTime): 822.74178403949 us.


Change-Id: Ic13e9f7c7d98f2930e6de4c4f74bac4d28478249
Reviewed-on: https://dart-review.googlesource.com/75781
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-20 20:57:08 +00:00
Alexander Markov 3263550e86 [vm] Decouple bytecode reading from compilation
This way requests to compile won't end prematurely after reading
bytecode if interpreter is enabled.

Change-Id: Ic06cae98ea65bc4656ef491fbd306d34b0e1ef4c
Reviewed-on: https://dart-review.googlesource.com/75628
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-20 16:22:33 +00:00
Alexander Markov a386c07281 [vm/aot] Add extra call specialization pass
The extra call specialization pass after constant propagation is able to
replace more calls in AOT, as constant propagation removes unreachable
code and subsequent type propagation infers more accurate types.

Performance improvement (armv8):
DartMicroBench.IntPower3 196.4%
DartMicroBench.IntPower2 273.1%

Change-Id: I7076608f828484c4045e7a7b605ed8ff7981a868
Reviewed-on: https://dart-review.googlesource.com/75564
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-19 20:49:28 +00:00
Aart Bik a890d95a26 [vm/compiler] Avoid !(x>y) -> x<=y on fp operands.
Rationale:
Two closely related bugs found with fuzz testing!
NaN must be preserved. We may improve comparisons
on fp in the long run, but this CL avoids the
incorrect optimization.

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

Change-Id: Ie3667632eea2583098cf5f86a723ab4304d5d6c5
Reviewed-on: https://dart-review.googlesource.com/75242
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-19 19:58:09 +00:00
Alexander Markov bc79674bc1 [vm/aot] Fix inferred type of implicitly initialized final fields
Bug: https://github.com/flutter/flutter/issues/21957
Change-Id: I63e1b6787761aaf7acfda653775518755ffcb0b5
Reviewed-on: https://dart-review.googlesource.com/75382
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-19 17:54:57 +00:00
Alexander Markov d44ffba254 [vm/tfa] Stop accepting non-empty entry points json files
Entry points JSON files are deprecated (replaced with pragmas).
So TFA should not require them. As a sanity check, it will complain
if an entry points JSON file is not empty.

Change-Id: Ie64121ab4cdd0c330f81a8cb71a671e1df82f136
Reviewed-on: https://dart-review.googlesource.com/75423
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-19 01:41:30 +00:00
Aart Bik 4eb879133a Revert "[vm/compiler] Restrict !(x>y) -> (x<=y) to integral x,y"
This reverts commit 0471d7e3a1.

Reason for revert: crashes are happening on the Nullable test
                   I will fix this in the follow-up CL that was
                   already pending

Original change's description:
> [vm/compiler] Restrict !(x>y) -> (x<=y) to integral x,y
> 
> Rationale:
> Bug found with fuzz testing! For FP, behavior around
> NaN must be preserved.
> 
> Bug: https://github.com/dart-lang/sdk/issues/34466
> 
> 
> Change-Id: Ia4ed831fc130e58318edb838bd46e30b93f62ff3
> Reviewed-on: https://dart-review.googlesource.com/75208
> Commit-Queue: Aart Bik <ajcbik@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,sjindel@google.com,asiva@google.com,ajcbik@google.com

Change-Id: Ie2e233a612cbe00478475d086eec87ff2b3d652b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/34466
Reviewed-on: https://dart-review.googlesource.com/75383
Reviewed-by: Aart Bik <ajcbik@google.com>
Commit-Queue: Aart Bik <ajcbik@google.com>
2018-09-18 19:20:33 +00:00
Aart Bik 0471d7e3a1 [vm/compiler] Restrict !(x>y) -> (x<=y) to integral x,y
Rationale:
Bug found with fuzz testing! For FP, behavior around
NaN must be preserved.

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


Change-Id: Ia4ed831fc130e58318edb838bd46e30b93f62ff3
Reviewed-on: https://dart-review.googlesource.com/75208
Commit-Queue: Aart Bik <ajcbik@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-17 23:39:12 +00:00
Vyacheslav Egorov 6cc9d5325b [vm] Use vmovdr instead of vmovsr when loading from Float64List
vmovsr can't access halfs of D16 and above.

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

Bug: 34462
Change-Id: I55042ff4e143b5a8d1ac6f4e6f5b888ec8d588ab
Reviewed-on: https://dart-review.googlesource.com/75021
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-17 23:34:47 +00:00
Vyacheslav Egorov c8e26d68cb [vm/compiler] Improve allocation sinking precision.
When we added support for sinking allocation of contexts
we forgot to update IsSafeUse method - meaning that non-escaping
objects stored into sinkable contexts would not be considered
sinkable.

This change rectifies the problem. With this change the method

test_vm_field() {
  var obj;
  inner() => obj.x = 42;
  var a = new V();
  obj = a;
  var t1 = a.x;
  var t2 = inner();
  return a.x + t1 + t2;
}

Compiles down to

test_vm_field() => 84;

Before this change we would not sink allocation of V.

R=alexmarkov@google.com

Change-Id: If431e58fe1d958b31ea597e35cba3856558a0cca
Reviewed-on: https://dart-review.googlesource.com/75222
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-17 23:24:45 +00:00
Ryan Macnak 0c80630577 [vm] Fix ia32/x64 gcc build.
(The simulators are broken at runtime.)

Change-Id: I10089cad44fca57145cfdd598342279f07c6d7fd
Reviewed-on: https://dart-review.googlesource.com/75205
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-17 22:27:43 +00:00
Ryan Macnak 29d36dd8d0 [vm, kernel] Fast-path for reading non-generic types.
Change-Id: I24d598aa66efa414b04e364bf5dce10bdc917904
Reviewed-on: https://dart-review.googlesource.com/75122
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-17 20:28:23 +00:00
Alexander Markov 050561fd82 [vm] Relax recently added assertion in Dart 1 mode
This CL relaxes assertion added recently in
c6c4748185 as it could fail in Dart 1
mode.

This should fix 'checked vm tests' step on debug bots which still runs
tests in Dart 1 mode.

Change-Id: Ifdd6e27087b44822ce9cd5be48750af1c7d45a8e
Reviewed-on: https://dart-review.googlesource.com/75201
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-17 17:36:00 +00:00
Alexander Markov 76091c13db [vm/bytecode] Add PushNull, PushTrue, PushFalse and PushInt bytecodes
These bytecode instructions are added in order to shrink constant pools
and reduce time spent for reading constant pool entries.

Change-Id: I8522f73dc7a6236969ac0422c6cb89b945559b2d
Reviewed-on: https://dart-review.googlesource.com/75125
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-15 17:55:46 +00:00
Alexander Markov c6c4748185 [vm/bytecode] Bytecode compilation
Change-Id: I09192e4e929a397920c217b605580f8c4880e7c2
Reviewed-on: https://dart-review.googlesource.com/74002
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-09-14 22:02:29 +00:00
Ryan Macnak 78d9a281d3 [vm, arm] Globally block LR for register allocation.
Flutter Gallery release:
Instructions(CodeSize): 5668368 -> 5670880 (+0.044%)

Fixes #34411

Bug: https://github.com/dart-lang/sdk/issues/34411
Change-Id: I5281ac9609ec5953cdaa881226f7034a5697d0ce
Reviewed-on: https://dart-review.googlesource.com/74923
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-14 21:58:29 +00:00
Vyacheslav Egorov 229d793602 [vm/compiler] Support materializing unboxed variables when entering catch.
Previously we tried to rely on the assumption that all variables would be
boxed - so the machinery for setting correct catch-entry state only
supported tagged values and constants. However this both leads to worse code
and is not entirely correct assumption.

This also:

- renames various confusingly named classes: we move away from talking
about "catch entry state" to "catch entry moves" - because we only
record a subset of moves that needs to be performed and that does
not describe the whole state;
- refactors a bunch of associated code to be more readable and maintainable;
- adds documentation about catch implementation in optimized code
to runtime/docs/compiler;

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

Change-Id: I03ae361a1bb7710acbd9f661ae014e663a163c59
Reviewed-on: https://dart-review.googlesource.com/74860
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-14 17:39:12 +00:00
Régis Crelier a6a48f2e52 [VM runtime] Follow up to new NativeEntryData class.
Demote newly introduced VM class NativeEntryData from a VM instance class
to a simple TypedData wrapper class.

Change-Id: I44aacee33500c93eb283d2d349cd7a24dd94de65
Reviewed-on: https://dart-review.googlesource.com/74323
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-12 18:49:06 +00:00
Vyacheslav Egorov e7bde9195b [vm/compiler] Don't try to load receiver in tear-offs of static no-such-method forwarders.
Such forwarders can arise as a result of hot-reload (e.g. IsolateReload_TearOff_Remove).

Change-Id: Id3c5ef28c44415f3388bd2d0c24ebac5845e912f
Reviewed-on: https://dart-review.googlesource.com/74581
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2018-09-12 18:06:45 +00:00
Régis Crelier ce75b485ad [VM bytecode] Allow library of symbol to be null.
This fixes a cast failure introduced in
https://dart-review.googlesource.com/c/sdk/+/74322

Change-Id: If4688df152cba1457a9e102d1a68ce09cdfa5872
Reviewed-on: https://dart-review.googlesource.com/74498
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-12 01:33:50 +00:00
Régis Crelier a2fae0125f [VM interpreter] Mark activation frames as interpreted instead of crashing.
This is a first step in supporting bytecode in the debugger.

Change-Id: Ieb06b8b534fcc7f0291457cd6912d772b8ee247a
Reviewed-on: https://dart-review.googlesource.com/74012
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2018-09-12 00:33:30 +00:00
Ryan Macnak dad327c174 [vm, arm64] LR is available to the write barrier in non-intrinsic mode.
Flutter Gallery release:
Instructions(CodeSize): 6128832 -> 6108224 (-0.37%)

Change-Id: Ie404098af26b114fbdf95c0edcc7aea3a1a2dc82
Reviewed-on: https://dart-review.googlesource.com/74485
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-09-11 21:34:52 +00:00
Ryan Macnak ebca3aba60 [vm, gc] Concurrent marking barrier.
Code size impact on flutter_gallery after enabled:
ARM32 Instructions(CodeSize): 5892064 -> 6110592 (+3.71%)
ARM64 Instructions(CodeSize): 6307104 -> 6514528 (+3.28%)

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: If093f24e4dc6bf29f407cc45e95bb2274fc53dce
Reviewed-on: https://dart-review.googlesource.com/68481
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-11 21:14:25 +00:00
Samir Jindel cbd17b535f Re-land "[vm/precomp] Use @pragma("vm:exact-result-type") to specify method behavior."
We need to block interrupts while evaluating pragmas to prevert reentrant class finalization.
Original revision is in patchset 0.

Change-Id: I872cec4eaf4ca85567c9657c458ed39c8b2e30de
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/73160
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-11 18:14:51 +00:00
Alexander Markov 3ba5aa8ba7 [vm/bytecode] Support SymbolConstant nodes in bytecode pipeline
After https://github.com/dart-lang/sdk/commit/609d2770bea3d4c9dc76b515a52ee325dfb5c50d
constant evaluator produces SymbolConstant nodes.

This CL adds handling of SymbolConstant nodes to bytecode generator by
emitting a new constant pool entry. Constant pool reader is adjusted to
read new constant pool entry.

Change-Id: Idc1e91e765014b3290d80e5a3743448b8a0f472c
Reviewed-on: https://dart-review.googlesource.com/74322
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-09-11 17:54:16 +00:00
Ryan Macnak 482d27dfe7 [vm, compiler] Block LR for StoreStaticField and StoreIndexed on ARM.
Skip barrier for x.slot = x. Note that box allocations are non-Smi.

Bug: https://github.com/dart-lang/sdk/issues/34411
Change-Id: I846639747f0b583c24cb6ecf40548cf32b76d580
Reviewed-on: https://dart-review.googlesource.com/74324
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-11 17:05:24 +00:00
Martin Kustermann 01518b725d [VM] Optimize object allocation on ARM/ARM64 for code size as well as performance
Decreases flutter gallery RX size by 0.5 % on ARM
Decreases flutter gallery RX size by 0.85 % on ARM64
Increases performance slightly of various benchmarks, e.g. DeltaBlue by 2.2% on ARM64-aot

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

Change-Id: I258eae5bdc33d0220d0e73f60ad21824da5ec7f1
Reviewed-on: https://dart-review.googlesource.com/72762
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-11 12:53:56 +00:00
Martin Kustermann 4bbeda1826 [VM] Use one double-word load instruction for populating ic-data/code-obj in switchable calls
Decreases flutter gallery RX size by 0.5 % on ARM64
Increases ARM64 perf, e.g. by 3.8% DeltaBlue

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

Change-Id: I32e9be0d1df2fc50d287761d75b6db60c187d225
Reviewed-on: https://dart-review.googlesource.com/73902
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-11 10:02:04 +00:00
Martin Kustermann 609d2770be Reland "[VM] Add new SymbolConstant to package:kernel/ast.dart"
The canonicalization of symbols needs to take library privacy into
account. Since the Symbol class itself only has a [_name] field but does
not reference in which library the symbol came from, the [_name] must be
mangled.

Mangling is done by backends and so we make a new [SymbolConstant] which
the backends can desugar by doing appropriate mangling and construction
of a [Symbol] instance.

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

Change-Id: I2e13288483c35f875d39eefdb73677b2cc03527a
Reviewed-on: https://dart-review.googlesource.com/74360
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-09-11 09:29:01 +00:00
Martin Kustermann 05ccfa8502 [VM] Reduce size of monomorphic entries in AOT on ARM/ARM64 & use smaller tail-calls in various places
Decreases flutter gallery RX size by 1.5 % on ARM
Decreases flutter gallery RX size by 1.3 % on ARM64

Improves arm performance (significantly), e.g. DeltaBlue +6.8%, many typed data benchmarks +xx%
Improves arm64 performance, e.g. DeltaBlue +3.1%


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

Change-Id: Iaa6cc31597e0bcde471ec2e966730c3f2c9fdd05
Reviewed-on: https://dart-review.googlesource.com/73180
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-09-11 09:03:02 +00:00
Alexander Aprelev d97823b704 Revert "[VM] Add new SymbolConstant to package:kernel/ast.dart"
This reverts commit ef72098353 as it broke
buildbot on CQ.

Change-Id: If9d19a9393157078d0e0890b92a418ba5ced42c6
Reviewed-on: https://dart-review.googlesource.com/74281
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-10 20:40:43 +00:00
Martin Kustermann ef72098353 [VM] Add new SymbolConstant to package:kernel/ast.dart
The canonicalization of symbols needs to take library privacy into
account. Since the Symbol class itself only has a [_name] field but does
not reference in which library the symbol came from, the [_name] must be
mangled.

Mangling is done by backends and so we make a new [SymbolConstant] which
the backends can desugar by doing appropriate mangling and construction
of a [Symbol] instance.

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

Change-Id: I5ddb5331ce79a0b942807929d4b8f1050a9899e7
Reviewed-on: https://dart-review.googlesource.com/73883
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-09-10 15:31:09 +00:00
Martin Kustermann 14cf3717f2 [VM] Do not generate fall-through code if the intrinsic is exhaustive (handles all cases)
Change-Id: I71053fa14b59227fa33274cbfb6880d3e2394898
Reviewed-on: https://dart-review.googlesource.com/73621
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-10 15:12:22 +00:00
Ryan Macnak d66572d09b [vm, arm64] Eliminate some no-ops already filtered from the other architectures.
Flutter Gallery release:
Instructions(CodeSize): 6270144 -> 6234080 (-0.58%)

Change-Id: If5d4a1d41c6a1d9e5e45f1fceab6d938aef484bc
Reviewed-on: https://dart-review.googlesource.com/74005
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-07 21:44:18 +00:00
asiva cd3ddede99 Move flags strong/sync-async/reify-generic-functions back to global vm flags (they are not set as isolate specific flags).
Change-Id: I4d5cba4f5ac657a0834e3755312147cff1fbc001
Reviewed-on: https://dart-review.googlesource.com/71426
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-09-07 21:22:13 +00:00
Zach Anderson b4004f6476 [vm] Reland: Move the interpreter under a flag.
After this CL, the interpreter is included by default in the
JIT VM under the flag --enable-interpreter.

Reland with fix to NativeArgument setup in simulator_arm.cc

Change-Id: Ib9b4df6eb4d997dfbe361188b8a127828c1d9c6f
Reviewed-on: https://dart-review.googlesource.com/74003
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-07 19:25:31 +00:00
Zach Anderson 21406f576a Revert "[vm] Move the interpreter under a flag."
This reverts commit 715ab7b30b.

Reason for revert: simarm and kernel precomp builds failing

Original change's description:
> [vm] Move the interpreter under a flag.
> 
> After this CL, the interpreter is included by default in the
> JIT VM under the flag --enable-interpreter.
> 
> Change-Id: I06458f20288d67981822788ee6e867c2127ebdd3
> Reviewed-on: https://dart-review.googlesource.com/71800
> Commit-Queue: Zach Anderson <zra@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Reviewed-by: Siva Annamalai <asiva@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
> Reviewed-by: Ryan Macnak <rmacnak@google.com>

TBR=rmacnak@google.com,alexmarkov@google.com,zra@google.com,asiva@google.com,regis@google.com

Change-Id: I3622f4dbe53288d07fc21b34ee5ff68f2682b36d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/74001
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2018-09-07 17:14:21 +00:00
Ryan Macnak 94eb90af80 [vm, arm64] Don't use the object pool for small Smi constants.
Shrinks the clustered snapshot from fewer object pool entries but increases the image snapshot from less deduplication. Removes memory traffic for these constants.

Flutter Gallery
profile Total(CodeSize): 15284383 -> 15271689 (-0.08%)
release Total(CodeSize): 11358403 -> 11361337 (+0.02%)

Change-Id: I2ee4d49ba11241da5bf2928cfa44a39d5605eb86
Reviewed-on: https://dart-review.googlesource.com/73680
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-07 17:04:23 +00:00
Zach Anderson 715ab7b30b [vm] Move the interpreter under a flag.
After this CL, the interpreter is included by default in the
JIT VM under the flag --enable-interpreter.

Change-Id: I06458f20288d67981822788ee6e867c2127ebdd3
Reviewed-on: https://dart-review.googlesource.com/71800
Commit-Queue: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-09-07 16:46:07 +00:00
Ryan Macnak 73ea44f374 [vm, arm64] Use ldp/stp for PushRegisters/SaveRegisters.
Flutter Gallery release:
Instructions(CodeSize): 6270144 -> 6175488 (-1.51%)

Change-Id: Iafd36eb8ab958427a69988f28ac84b254b89f1eb
Reviewed-on: https://dart-review.googlesource.com/73681
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-06 21:58:52 +00:00
Martin Kustermann eb06189349 [VM] Fix bug introduced when restoring small intrinsics in ab7b1e3
Change-Id: I2608132a7fad36675ddf217a1787cef49b9b8f6a
Reviewed-on: https://dart-review.googlesource.com/73620
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-06 20:49:15 +00:00
Samir Jindel c7ab56e1b5 Re-land "[vm] Skip bounds checks on invocation of partially instantiated closures."
This removes the part of the CL which contained asserts about the syntactic form of
the partial instantiation target.

Reviewed-on: https://dart-review.googlesource.com/72460
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Change-Id: I73733310795cd2c98b33bc641e769531d88a636a
Reviewed-on: https://dart-review.googlesource.com/73580
Reviewed-by: Samir Jindel <sjindel@google.com>
2018-09-06 18:10:27 +00:00
Alexander Markov cdd18e6811 [vm/bytecode] Support dynamic invocation forwarders and omit checks in bytecode
This CL adds support for _dynamic_ calls (which are routed through
dynamic invocation forwarders) to bytecode pipeline.

This allows to skip argument type checks for non-covariant and
non-generic-convarint-impl parameters in bytecode when calling instance
members through known interface targets. In case of dynamic call, dynamic
invocation forwarders perform type checks which are otherwise skipped.

This CL also corrects argument type checks in forwarding stubs.
Forwarding stubs are synthetic methods, introduced by front-end to ensure
type safety if some of the argument type checks are skipped.
The specifics of forwarding stubs is that they should use parameter types
of a *target* of a stub for the argument type checks.

This change unifies how argument type checks are performed in bytecode
and in the VM in JIT mode. This allows to mix bytecode methods with
methods JIT-compiled from kernel AST in more cases.

Change-Id: I3a2720a488c8bbb91de1b189eb36ee8c51684a78
Reviewed-on: https://dart-review.googlesource.com/72543
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-09-06 17:23:12 +00:00
Ryan Macnak 1d4c316d55 [vm, gc] Don't eagerly evacuate new space on old allocation failure, take 2.
Large allocations and direct old space allocations are not signals that the current new space objects will be long lived.

Still perform a scavenge to handle (dead new -> dead old) references even when new space allocation is low, but a non-evacuating scavenge.

Change-Id: I4008fb163c4536abfc7ba42410ec57917a69786a
Reviewed-on: https://dart-review.googlesource.com/72340
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-09-04 22:51:07 +00:00