Commit Graph

396 Commits

Author SHA1 Message Date
Erik Corry 619656b9c8 [VM] Fix far branches on ARM64 and add tests
R=rmacnak@google.com

Change-Id: I089d12bced44576a8a19e29bad94b1256f320f5f
Reviewed-on: https://dart-review.googlesource.com/38720
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-02-06 08:21:32 +00:00
Erik Corry ea91bc9888 [VM] ARM64: Fix assert hit with tbz branches in huge functions
R=vegorov@google.com

Change-Id: I584af6d68302dc7b2a47ed4f9846f56f0c942ddd
Reviewed-on: https://dart-review.googlesource.com/38640
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-02-05 19:06:03 +00:00
Martin Kustermann cf8a6063f8 [VM] Improve AssertAssignable/InstanceOf by having a fast case for non-generic, instantiated types
When the type to test against is instantiated and has no type arguments
there is a high probability that we receive instances of that class or
subclasses at runtime.

This CL therefore extends the fast-path of AssertAssignable/InstanceOf
by checking whether the instance class id is within the cid ranges that
directly/indirectly implement/extend the type to test against.

Currently we have an almost depth-first preorder numbering of class ids
in AOT, but there are exceptions.  So each class can have a number of
cid-ranges as subclasses / classes which implement it's interface.

This seems to improve performance of dart-aot-v2
  * flutter stock build by 15+%
  * DeltaBlueClosures by 10+%

and reduces code size on
  * flutter gallery by -3%

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

Change-Id: I07dd91589cc3fcd8c5952bdba339e2e2a459e08e
Reviewed-on: https://dart-review.googlesource.com/35620
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-01-25 07:13:42 +00:00
Ryan Macnak e6ebdccc2f [vm, armv6] Fix pool pointer offset used for large immediates.
Bug: https://github.com/dart-lang/sdk/issues/31857
Change-Id: I1d9fe0ee3234bc331a764cfc699efa820257a45c
Reviewed-on: https://dart-review.googlesource.com/34508
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2018-01-16 21:15:13 +00:00
Alexander Markov 618bff43ea [VM] Clean up bigints from assembler_dbc_test
In preparation for Dart 2.0 fixed-size integers, simdbc/simdbc64 C++
unit tests are cleaned up to avoid bigints.

Change-Id: I0c63d4cbd9d1903c92b3cb52dee0b38ed9085df4
Reviewed-on: https://dart-review.googlesource.com/32449
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-01-04 22:53:16 +00:00
Erik Corry 8d58c13ca2 [VM] Use new Write barrier filters.
R=vegorov@google.com

Bug:
Change-Id: Icec38f730157448b47f5bf5a43dc582e4064e98e
Reviewed-on: https://dart-review.googlesource.com/30861
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2017-12-21 09:59:03 +00:00
Martin Kustermann cf1de7d46c [VM] Replace hand-written assembly prologues with IR
As part of the prologue changes we get rid of the empty context as well.

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

Change-Id: I707e23c631bcfbbad6c91c4963d0c10f7a0be625
Reviewed-on: https://dart-review.googlesource.com/25320
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-13 16:04:34 +00:00
Erik Corry 1dec18e2cf [VM] Make x64 assembler more regular
Apart from removing almost 1000 lines of very repetitive code, the idea here is
to change the assembler from a huge pile of arbitrary code into something that
can be used to generate tables of opcodes and their structure. Later, I'd like to
use this to make the disassembler more table driven and less arbitrary, and
perhaps build an x86 simulator in the same vein as the ARM simulator, which
would help me debug (I find the ARM simulator very useful when making low level
changes to the VM and miss its functionality on x86).

R=vegorov@google.com

Bug:
Change-Id: I1ae2c1696f88b67862843c9ac05c827a7c9b9a6e
Reviewed-on: https://dart-review.googlesource.com/25241
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-12-12 14:14:45 +00:00
Ryan Macnak fda4ab3dbf [vm] Move the info_array for ObjectPool inline.
The info_array is needed to visit an ObjectPool's pointers, requiring the compactor to move the info_array's body before forwarding the ObjectPool's pointers. Moving the info_array inline remove this constraint on the compactor.

Also saves 3 words per ObjectPool modulo allocation size rounding.

Bug: https://github.com/dart-lang/sdk/issues/30978
Change-Id: I94de0e4b7356d46fb145efee7ab14abd7473eb4c
Reviewed-on: https://dart-review.googlesource.com/27480
Reviewed-by: Erik Corry <erikcorry@google.com>
2017-12-08 20:42:51 +00:00
Erik Corry 3b3406fea0 [VM] Fix golden disassembler output on IA32
R=johnniwinther@google.com

Bug:
Change-Id: If8fe92a2811dc114b5e0dce208ef82bd47408086
Reviewed-on: https://dart-review.googlesource.com/23540
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2017-11-24 11:40:59 +00:00
Erik Corry 1d9ff70a08 [VM] Pick more compact instruction encodings on x64
Several tricks here:
* When zeroing registers we can use xorl instead of xorq because the 'l'
  variant will zero the top bits.
* test and 'and' instructions with immediate arguments can use 8-bit and 32 bit
  variants more heavily.
* mov reg, immediate can use more compact encodings when sign-extension is not
  needed.

Performance is better than +1% when measured on Dart2JS.

R=vegorov@google.com

Intel optimization manual says: "Assembly/Compiler Coding Rule 64. (H impact, M
generality) Use the 32-bit versions of instructions in 64-bit mode to reduce
code size unless the 64-bit version is necessary to access 64-bit data or
additional registers."
Bug:
Change-Id: I2a989315c45f8d8ebab719653fbfa2b18ebb77c9
Reviewed-on: https://dart-review.googlesource.com/23400
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-24 10:53:17 +00:00
Erik Corry 5253b7ed24 [VM] Fix ARM64 test to clear register before use
R=vegorov@google.com

Bug:
Change-Id: Ia223f98fa6e87f915b519738d47677837c911309
Reviewed-on: https://dart-review.googlesource.com/23100
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2017-11-22 16:03:44 +00:00
Erik Corry 70e5deacb5 [VM] Disable disassembly tests that differ on Windows
R=kustermann@google.com

Bug:
Change-Id: I925538c28aaefd144d7bc94a554a64ff4ead9ad8
Reviewed-on: https://dart-review.googlesource.com/23021
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-11-22 13:15:28 +00:00
Erik Corry d300b08e35 [VM] Use X64 disassembler for IA32 and X64 (reland)
R=vegorov@google.com

This removes the IA32 disassembler and uses the X64 disassembler for
both variants.  Instructions that were in the IA32 assembler, but not
supported by the X64 disassembler have been added.  It also adds some
regression tests for a lot of the disassembler output.
Bug:
Change-Id: I243abbb04c3a77810ce96ca74f7f42a5a1aea0cf
Reviewed-on: https://dart-review.googlesource.com/22982
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2017-11-22 12:04:18 +00:00
Erik Corry 80992a5a09 Revert "[VM] Use X64 disassembler for IA32 and X64"
This reverts commit 9e42f006d9.
due to test failures on non-Linux platforms.

R=karlklose@google.com

Bug:
Change-Id: I5dc40da75d8d89fca8fce98a69a39d767493af1b
Reviewed-on: https://dart-review.googlesource.com/22921
Reviewed-by: Karl Klose <karlklose@google.com>
2017-11-22 09:11:12 +00:00
Erik Corry 9e42f006d9 [VM] Use X64 disassembler for IA32 and X64
R=vegorov@google.com

Bug:
Change-Id: I19b1f58e16ea35dc81b941c54e6e57b97cad3d74
Reviewed-on: https://dart-review.googlesource.com/22020
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-22 08:01:07 +00:00
Ryan Macnak 5b9558228d Reapply "[vm, arm64] Add assembler support for tbz and use it for BranchIfSmi."
Skip addition of far branch support to the test harness.

Change-Id: Idec3a644e0dc4165bfaa8daa948f1aee172c1eea
Reviewed-on: https://dart-review.googlesource.com/22740
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-21 23:38:05 +00:00
Ryan Macnak 9bdc803d11 [vm, arm64] Don't access beyond CSP in assembler tests.
Change-Id: I10adfd4aaaef170c74747a1dceb7dfb17bddb9b5
Reviewed-on: https://dart-review.googlesource.com/22662
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-21 22:08:19 +00:00
Erik Corry 1109ffcb6a [VM] Add ARM64 bitfield instructions
R=rmacnak@google.com

Also some minor cleanup in the way we encode ARM instructions.
I'll be needing these for 32 bit Smis on ARM64.
Bug:
Change-Id: I5f515590375a2c6ad11bc6f1a80a4f8e27cd82b4
Reviewed-on: https://dart-review.googlesource.com/20668
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-11-16 15:34:11 +00:00
Erik Corry 54c54a87db [VM] Fix compilation of assembly tests on Mac
R=vegorov@google.com

Bug:
Change-Id: I65128750e1eb37d8664916ff4e94aee45211b1e0
Reviewed-on: https://dart-review.googlesource.com/21440
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-16 14:36:03 +00:00
Erik Corry f3be82bb34 [VM] Make x86 and x64 assemblers less repetitive
This also means that an orthogonal selection of the core ALU instructions
are available so future programmers don't have to add instructions
to the assembler as needed, which tends to slow down progress.

R=vegorov@google.com

Bug:
Change-Id: I5fea72c70ea7ffbae8efad85aef4ecc96c235cb6
Reviewed-on: https://dart-review.googlesource.com/21140
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-16 14:18:41 +00:00
Erik Corry 248d4468f4 [VM] Add csneg instruction on ARM64
R=rmacnak@google.com

I'll be needing this for some read barrier experiments.
Bug:
Change-Id: I18ac62a9a23a2bd285826e4247b8ee2819d5283b
Reviewed-on: https://dart-review.googlesource.com/20065
Commit-Queue: Erik Corry <erikcorry@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-11-12 20:34:14 +00:00
Ryan Macnak 0e552547a6 Revert "[vm, arm64] Add assembler support for tbz and use it for BranchIfSmi."
This reverts commit 64271895a9.

Reason for revert: Crashes in unchanged assembler tests

Original change's description:
> [vm, arm64] Add assembler support for tbz and use it for BranchIfSmi.
> 
> (Apparently we already had it implemented in the simulator and disassembler.)
> 
> MegaNeverOverridden (Odroid-C2)   -3.702% (-0.5 noise)
> BinaryTrees (Odroid-C2)           -3.296% (-0.4 noise)
> ...
> MegaEquality (Odroid-C2)           2.256% (0.4 noise)
> Splay (Odroid-C2)                  9.879% (0.6 noise)
> MegaOverriddenEvery2nd (Odroid-C2) 6.317% (0.7 noise)
> StringInterpolation (Odroid-C2)    19.07% (0.8 noise)
> ForInLoop (Odroid-C2)              4.902% (1.0 noise)
> 
> Flutter gallery iOS instructions:
> 12543904 -> 12504224 (-0.32%)
> 
> Change-Id: I23fa58e5589ddf5042a2075431bc53aa21723813
> Reviewed-on: https://dart-review.googlesource.com/17061
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Régis Crelier <regis@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,rmacnak@google.com,regis@google.com

Change-Id: I6d55907972a6f1485e2789a8623a557bcdfa7f22
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/20320
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-11-10 23:57:09 +00:00
Ryan Macnak 64271895a9 [vm, arm64] Add assembler support for tbz and use it for BranchIfSmi.
(Apparently we already had it implemented in the simulator and disassembler.)

MegaNeverOverridden (Odroid-C2)   -3.702% (-0.5 noise)
BinaryTrees (Odroid-C2)           -3.296% (-0.4 noise)
...
MegaEquality (Odroid-C2)           2.256% (0.4 noise)
Splay (Odroid-C2)                  9.879% (0.6 noise)
MegaOverriddenEvery2nd (Odroid-C2) 6.317% (0.7 noise)
StringInterpolation (Odroid-C2)    19.07% (0.8 noise)
ForInLoop (Odroid-C2)              4.902% (1.0 noise)

Flutter gallery iOS instructions:
12543904 -> 12504224 (-0.32%)

Change-Id: I23fa58e5589ddf5042a2075431bc53aa21723813
Reviewed-on: https://dart-review.googlesource.com/17061
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-11-10 21:35:48 +00:00
Erik Corry f607a2edae [VM] Don't try to disassemble Stop pseudoinstruction
R=zra@google.com

This was causing crashes on OSs that place constant strings at high
addresses.
Bug:
Change-Id: Id61c6c7e817a7bb44fdc998f5b918e61b971153a
Reviewed-on: https://dart-review.googlesource.com/18546
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Zach Anderson <zra@google.com>
2017-11-06 23:28:20 +00:00
Ryan Macnak f60efb7e40 Reapply "[vm] Popcount via compiler intrinsics."
Add missing rename of CountOneBits in ARM assembler.

Change-Id: I735da06343248573a1b049109ebc2bf0d1634960
Reviewed-on: https://dart-review.googlesource.com/18504
Reviewed-by: Zach Anderson <zra@google.com>
2017-11-03 17:39:16 +00:00
Erik Corry d0abf73d12 [VM] Add bt immediate instruction for IA32, X64
R=vegorov@google.com

Bug:
Change-Id: I89640ac207877c7b564b6e9713ee72895ca02054
Reviewed-on: https://dart-review.googlesource.com/17443
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2017-10-31 17:06:55 +00:00
Ryan Macnak c250af2839 [vm, arm64] Prefer BranchIfSmi over tsti + b.
This does not change the generated instructions, but makes is easier to try tbz.

Change-Id: I0914c241149ca21b6797283630dcf645bc53dbde
Reviewed-on: https://dart-review.googlesource.com/17048
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-10-27 22:03:50 +00:00
Ryan Macnak 9d93909715 [vm, arm64] Use a branch instead of two predicated moves for loading cids.
Two instructions shorter.

JIT:
MegaFieldHasGetterOnceIndirect (Odroid-C2) 15.97% (0.8 noise)
        MegaOnlyOverriddenOnce (Odroid-C2) 18.96% (0.9 noise)
MegaOnlyOverriddenOnceIndirect (Odroid-C2) 16.94% (1.0 noise)
                  MegaEquality (Odroid-C2) 5.729% (1.2 noise)
        MegaFieldHasGetterOnce (Odroid-C2) 26.56% (1.2 noise)

AOT:
MegaOverriddenEvery2ndIndirect (Odroid-C2) 2.872% (0.4 noise)
             MegaFieldIndirect (Odroid-C2) 3.856% (0.4 noise)
   MegaNeverOverriddenIndirect (Odroid-C2) 5.658% (0.5 noise)
           MegaNeverOverridden (Odroid-C2) 4.278% (0.5 noise)
        MegaOnlyOverriddenOnce (Odroid-C2) 4.966% (0.6 noise)
                     MegaField (Odroid-C2) 6.310% (0.6 noise)
MegaOnlyOverriddenOnceIndirect (Odroid-C2) 6.355% (0.8 noise)

Change-Id: I66c1d3d5b04bfdada0b09bd4bd9e99d19f8eaa56
Reviewed-on: https://dart-review.googlesource.com/16692
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-10-26 19:50:36 +00:00
Alexander Markov 841b1ad814 [VM] Improve performance of allocators on ARM in non-product mode
This CL improves performance of allocation statistic counters on ARM
by removing duplicated loads and increasing distance between dependent
loads. These statistic counters are part of allocator fast path in a
non-product mode.

This change improves performance of gestures/velocity_tracker_bench
Flutter micro-benchmark in 'flutter run --profile' mode:

Before: 3352 µs
After:  3156 µs (-5.8%)
(minimum of 5 runs)
Change-Id: Ic7998318d9ca3e7997379d0054faaf5b0b569bb6
Reviewed-on: https://dart-review.googlesource.com/15640
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-10-20 18:01:49 +00:00
Ryan Macnak 7ddc885b5c IA32: Visit the object reference used in optimized static calls.
Such a call site starts with a reference to a stub in the VM isolate, so the pointer was not recordered, but after it first runs it will be patched to a code object in the current isolate, which may move during compaction.

Bug: https://github.com/dart-lang/sdk/issues/30978
Change-Id: I3bf8fd1cf8884cbba9956254cad70f46e8b8cc00
Reviewed-on: https://dart-review.googlesource.com/12701
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-10-11 23:29:56 +00:00
Vyacheslav Egorov 579b06ed4c [VM] Improve code patterns for various SIMD instructions on ia32/x64.
There are three types of changes in this CL:

* If there is a repeated per-component sequence of instruction, it is
replaced with a loop (e.g. see Float32x4ConstructorInstr);
* When accessing components in the spilled SIMD values don't use 
hardcoded constants but instead compute the offset from op_kind() 
(e.g. kFloat32x4WithZ accesses component with index kFloat32x4WithZ - kFloat32x4WithX = 2).
This allows to share code.
* Use setcc and arithmetic to materialize result of the comparison instead of branches;
* Use the fact that true and false are consecutive values in the Thread structure to convert
0/1 to true/false (see Int32x4GetFlagInstr)
* Extract Int32x4 components without spilling the whole SIMD value to the 
stack (see Int32x4GetFlagInstr).

This extracted from a larger refactoring CL: https://dart-review.googlesource.com/c/sdk/+/10120

Bug: https://github.com/dart-lang/sdk/issues/30949
Change-Id: Ic3757789a1ca621b267150133991fed5b85da633
Reviewed-on: https://dart-review.googlesource.com/11080
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2017-10-04 20:03:41 +00:00
Régis Crelier 6cfac06ad2 [gardening] Fix recently added assembly test.
Change-Id: Ibe3b1ec0e8969159fb04dcd5eac67088e05d44e8
Reviewed-on: https://dart-review.googlesource.com/10821
Reviewed-by: Régis Crelier <regis@google.com>
2017-10-04 00:25:38 +00:00
Lasse Reichstein Holst Nielsen 422bc2ebcc Make X64 assembler setcc operation accept more byte registers.
Bug: http://dartbug.com/30952
Change-Id: If33b439e056b777f723e4be20f892aa2ca64c1ee
Reviewed-on: https://dart-review.googlesource.com/10380
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2017-10-03 16:05:39 +00:00
Alexander Markov 087d61a2b4 [VM, Compiler] Remove duplication in UnboxInstr code generation
In this CL most of the code generation logic of UnboxInstr is unified
among architectures and moved to a platform-independent part.

In addition:
* Asm comment corrected for check null slow path.
* Non-instantiated generic types are eagerly converted to dynamic in
  type propagator.

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: Idcb2c67938e63ac79cf78d125451bd485247daad
Reviewed-on: https://dart-review.googlesource.com/9741
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2017-09-29 19:42:22 +00:00
Alexander Aprelev ce427ac14f Revert "Revert "Introduce StaticCallNode::kNoRebind and use that in implicit closures.""
This reverts commit ade37f931e.

This re-lands RebindRule change with fixes for the "-mdebug--hot-reload" test failures.

Original commit is reverted in patch set 1.
Fixes are in following patch sets.

Bug:
Change-Id: I49375af9b891323fe05c670d77cbf880964aae54
Reviewed-on: https://dart-review.googlesource.com/9361
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2017-09-28 19:43:32 +00:00
Dmitry Stefantsov ade37f931e Revert "Introduce StaticCallNode::kNoRebind and use that in implicit closures."
This reverts commit 97393fd961.

TBR=aam@google.com

Change-Id: I8fc5f644e994faa20aa8b5c54f8d6227a054e39d
Reviewed-on: https://dart-review.googlesource.com/9220
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-28 08:44:48 +00:00
Alexander Aprelev 97393fd961 Introduce StaticCallNode::kNoRebind and use that in implicit closures.
Change-Id: I6219462fed278dbb90361c2084eed886c9245097

Revert "Revert "Introduce inline cache reload rule attribute to static call AST node and ICData.""

This reverts commit 162283c2f3.

This re-lands the change with original revert in Patch set 1, actual bug fix in next patch set.

Bug:
Change-Id: I6219462fed278dbb90361c2084eed886c9245097
Reviewed-on: https://dart-review.googlesource.com/8760
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-28 03:26:22 +00:00
Alexander Aprelev 162283c2f3 Revert "Introduce inline cache reload rule attribute to static call AST node and ICData."
This reverts commit 68a727fa5c.

Revert "Fix ICData::New() invocation. Follow-up to 68a727fa5cf5."

This reverts commit ac06b1c8ea.

Revert "Fix last ICData::New() invocation. Follow-up to 68a727fa5cf5."

This reverts commit da26ffc4de.

Bug:
Change-Id: Ia2d4e6a3c3a3a329982c90aded11e72bf25a9a34
Reviewed-on: https://dart-review.googlesource.com/8402
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
2017-09-26 02:08:17 +00:00
Alexander Aprelev da26ffc4de Fix last ICData::New() invocation. Follow-up to 68a727fa5c.
TBR=rmacnak

Bug:
Change-Id: I9a2bc03843a108c9fda7e39ca2ebd5bb2ee6cecd
Reviewed-on: https://dart-review.googlesource.com/8246
Reviewed-by: Alexander Aprelev <aam@google.com>
2017-09-25 20:52:45 +00:00
Ryan Macnak 98edf8d2e5 [vm] Apply the large object threshold to inline allocation paths.
Previously allocations of Arrays/TypedData from generated code would try to allocate objects of any size into new-space. These allocation sites would only end up allocating into old-space if new-space didn't have enough free space and the allocation takes the slow path into the runtime. This means the allocation space from generated code was unstable. This change makes the allocation policy consistent between generated code and C++: objects larger than kNewAllocatableSize are always allocated into old-space.

This change regresses the microbenchmarks Streams.callbacks and Streams.controller (-44% and -33% on x64) because they allocate large, short-lived arrays.

Change-Id: I81c65af305b45b6fd40ec81d4a4ddc015bfc039c
Reviewed-on: https://dart-review.googlesource.com/4300
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2017-09-21 17:46:06 +00:00
Alexander Markov f6d6766920 [VM] Restore disassembler in flutter/profile (dart/release) mode
This CL restores disassembler in precompiled mode after it was removed
in 8cb752f73b.
Without disassembler observatory is not able to show assembly code
in 'flutter run --profile' mode.

This CL also pulls BufferFormatter out of il_printer.h/.cc as it is also
used in disassembler.

Change-Id: I098ddb8d8f5a2426028c1f467d58e5c2d6a82d21
Reviewed-on: https://dart-review.googlesource.com/7486
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-21 16:07:02 +00:00
Erik Corry 06abc845ea [VM] Fix x64 assembler for subl immediate instruction
R=regis@google.com

Bug:
Change-Id: I8344bce9b7b4bbafc48df98b7c212084826f5372
Reviewed-on: https://dart-review.googlesource.com/5221
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Erik Corry <erikcorry@google.com>
2017-09-12 21:08:51 +00:00
Alexander Markov 0af232924c [VM, Compiler] Add initial implementation of check null instruction
This CL introduces new IL instruction, CheckNullInstr, for testing
if an object is null. This instruction will be used to ensure
correctness when AOT relies on strong mode types, which are nullable
by default (unless proven otherwise).

Code generation of CheckNullInstr is implemented without major code
duplication between different CPUs using common macro-assembler
pseudo-instructions implemented by all platforms.

Also, code generation of GenericCheckBoundInstr is refactored in
the similar way.

Issue: https://github.com/dart-lang/sdk/issues/30480
Change-Id: I35e9b556302fe7db98ce5167b3601f08ddbee642
Reviewed-on: https://dart-review.googlesource.com/4540
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
2017-09-12 19:25:43 +00:00
Régis Crelier e0300086d1 [VM precompiler generic functions] Fix previous bad commit.
Generic functions cannot be called via monomorphic checked entries, because
the argument descriptor is lost. This limitation was removed by error and not
properly tested. It is reintroduced in runtime_entry.cc.
Changes in other sources are merely clean up and non-critical.

Change-Id: I7967950c1ad008b50e8691d59f4a9d5cd1c9f885
Reviewed-on: https://dart-review.googlesource.com/3761
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2017-09-06 23:27:36 +00:00
Vyacheslav Egorov 8a179fb953 [VM, Compiler] Move compiler to a separate folder.
New folder structure (nested under vm/):

- compiler/
-   jit/         - JIT specific code
-   aot/         - AOT specific code
-   backend/     - all middle-end and back-end code (IL, flow graph)
-   assembler/   - assemblers and disassemblers
-   frontend/    - front ends (AST -> IL, Kernel -> IL)

compiler/README.md would be the documentation root for the compiler
pipeline

Bug: https://github.com/dart-lang/sdk/issues/30575
Change-Id: I2dfd9688793bff737f7632ddc77fca766875ce36
Reviewed-on: https://dart-review.googlesource.com/2940
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-09-04 15:15:18 +00:00