Commit Graph

22 Commits

Author SHA1 Message Date
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