Commit graph

94 commits

Author SHA1 Message Date
Samir Jindel bc16959fc7 Reland "[vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable."
The original revision is in patchset 1.

Three bugs are fixed:

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

Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-mac-debug-simarm_x64-try,vm-kernel-precomp-mac-release-simarm_x64-try,vm-kernel-reload-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-win-debug-x64-try,vm-kernel-win-release-ia32-try,vm-kernel-win-release-x64-try
Change-Id: I326009cfacb51a84e9de4ddf9ff2d6d415460f91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113829
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-21 13:33:37 +00:00
Samir Jindel 663a8630e6 Revert "[vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable."
This reverts commit bab592fd28.

Reason for revert: Breaks SIMARM_X64 build and crashes in hot-reload.

Original change's description:
> [vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable.
> 
> Issue https://github.com/dart-lang/sdk/issues/37629
> 
> Change-Id: Ib61c32bde5a8b38d90b4da77e27e3874b8bfb7e2
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111432
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Martin Kustermann <kustermann@google.com>

TBR=kustermann@google.com,alexmarkov@google.com,sjindel@google.com

Change-Id: Id7dc3068a97debc7a8f757df31ef33fb68bdcb44
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113827
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2019-08-20 16:27:32 +00:00
Samir Jindel bab592fd28 [vm/ffi] Dispatch native callbacks through trampolines if we can't ensure callbacks will always be executable.
Issue https://github.com/dart-lang/sdk/issues/37629

Change-Id: Ib61c32bde5a8b38d90b4da77e27e3874b8bfb7e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111432
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-20 15:54:50 +00:00
Samir Jindel e59a4a2b42 [vm/ffi] Call natives through stubs if write-protection is enabled without dual-mapping.
Addresses the Dart -> Native half of dartbug.com/37629

Change-Id: I242b7f3a14dd105334a8b6e5c089b173c398491e
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/111280
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-08-07 11:37:20 +00:00
Samir Jindel 43382ded6d [vm/ffi] Regression test for dartbug.com/37133
Also removed some redundant test code.

Change-Id: Idbb343d35592816814d473de2317324029481c6f
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-kernel-win-debug-x64-try,vm-kernel-win-debug-ia32-try,vm-kernel-mac-debug-x64-try,vm-kernel-reload-mac-debug-simdbc64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105590
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-06-17 10:47:00 +00:00
Daco Harkes a8b93d9e78 [vm/ffi] DBC support on x64 Linux/MacOS hosts
Issue: https://github.com/dart-lang/sdk/issues/35773

Change-Id: Ib58fb8df6c5c18e604fbf2a156ab69025e5f57d7
Cq-Include-Trybots: luci.dart.try:vm-kernel-linux-debug-simdbc64-try, vm-kernel-linux-release-simdbc64-try, vm-kernel-mac-debug-simdbc64-try, vm-kernel-mac-release-simdbc64-try, vm-kernel-reload-mac-debug-simdbc64-try, vm-kernel-reload-mac-release-simdbc64-try, vm-kernel-linux-debug-ia32-try, vm-dartkb-linux-debug-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97221
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-05-09 11:46:03 +00:00
Ryan Macnak 3fd6fa4ff7 [vm] Fix errors compiling with GCC.
Change-Id: Ia3127ba9ef4ee1faf1f85a6eaa0dafd0cf187b2b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99376
Reviewed-by: Aart Bik <ajcbik@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2019-04-24 23:12:45 +00:00
Daco Harkes 462e03d01e Reland "[vm] Refactor Location to use either dart::Register or dart::host::Register"
Refactoring motivation: go/dart-simulated-ffi

* template Location and PairLocation with <dart::Register, dart::FpuRegister> or <dart::host::Register, dart::host::FpuRegister>
* move RegisterName and FpuRegisterName from assembler to constants
* move methods that are only implemented by Location and not HostLocation out of Location

Change-Id: Ie9aa2dae63380da0cbfb15eacc440537fbed48f8
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try, vm-kernel-precomp-win-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98845
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2019-04-11 10:09:23 +00:00
Samir Jindel f4e63990cb [vm/ffi] Support FFI on ARM32.
Fixes dartbug.com/36311.
Addresses dartbug.com/35760.

Change-Id: Ib6c4db69f31dfb5317e4162b80d3e30a996e3a2e
Cq-Include-Trybots: luci.dart.try:vm-ffi-android-debug-arm-try,vm-ffi-android-release-arm-try,vm-ffi-android-product-arm-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97631
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
2019-04-10 13:15:16 +00:00
Daco Harkes 8e0a669e74 Revert "[vm] Refactor Location to use either dart::Register or dart::host::Register"
This reverts commit 60b3643e8e.

Reason for revert: Broke Windows+simulator builds. (Template instantiation checks are different on Windows than on Linux/MacOS)

Original change's description:
> [vm] Refactor Location to use either dart::Register or dart::host::Register
> 
> Refactoring motivation: go/dart-simulated-ffi
> 
> * template Location and PairLocation with <dart::Register, dart::FpuRegister> or <dart::host::Register, dart::host::FpuRegister>
> * move RegisterName and FpuRegisterName from assembler to constants
> 
> Change-Id: I266b97ef1f0493c184f4486c7a0482845d4ac644
> Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97312
> Commit-Queue: Daco Harkes <dacoharkes@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Samir Jindel <sjindel@google.com>

TBR=vegorov@google.com,sjindel@google.com,dacoharkes@google.com

Change-Id: I8b4721e3ddbe1d32c3b553555064868bce5ea089
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98843
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2019-04-08 10:28:12 +00:00
Daco Harkes 60b3643e8e [vm] Refactor Location to use either dart::Register or dart::host::Register
Refactoring motivation: go/dart-simulated-ffi

* template Location and PairLocation with <dart::Register, dart::FpuRegister> or <dart::host::Register, dart::host::FpuRegister>
* move RegisterName and FpuRegisterName from assembler to constants

Change-Id: I266b97ef1f0493c184f4486c7a0482845d4ac644
Cq-Include-Trybots: luci.dart.try:vm-kernel-precomp-bare-linux-release-simarm-try, vm-kernel-precomp-bare-linux-release-simarm64-try, vm-kernel-precomp-linux-debug-x64-try, vm-kernel-linux-debug-simdbc64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97312
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-04-08 09:45:27 +00:00
Daco Harkes 544371c7f2 [vm] Refactor constants to be available in namespaces dart and dart::host
Refactoring motivation: go/dart-simulated-ffi

Change-Id: I219aba2793cfb7d7ea5ecc0a2ab93276c6cbf1e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97325
Reviewed-by: Samir Jindel <sjindel@google.com>
2019-04-08 09:45:27 +00:00
Vyacheslav Egorov f496e538f4 [vm] Decouple assemblers from runtime.
This is the next step towards preventing compiler from directly peeking
into runtime and instead interact with runtime through a well defined
surface. The goal of the refactoring to locate all places where compiler
accesses some runtime information and partion those accesses into two
categories:

- creating objects in the host runtime (e.g. allocating strings, numbers, etc)
during compilation;
- accessing properties of the target runtime (e.g. offsets of fields) to
embed those into the generated code;

This change introduces dart::compiler and dart::compiler::target namespaces.

All code in the compiler will gradually be moved into dart::compiler namespace.
One of the motivations for this change is to be able to prevent access to
globally defined host constants like kWordSize by shadowing them in the
dart::compiler namespace.

The nested namespace dart::compiler::target hosts all information about
target runtime that compiler could access, e.g. compiler::target::kWordSize
defines word size of the target which will eventually be made different
from the host kWordSize (defined by dart::kWordSize).

The API for compiler to runtime interaction is placed into compiler_api.h.

Note that we still permit runtime to access compiler internals directly -
this is not going to be decoupled as part of this work.

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

Change-Id: If4396d295879391becfa6c38d4802bbff81f5b20
Reviewed-on: https://dart-review.googlesource.com/c/90242
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-01-25 16:45:13 +00:00
Ryan Macnak 04941b5507 [vm, gc] For large arrays (arrays on a large heap page), use a card-based remembered set.
Bug: https://github.com/dart-lang/sdk/issues/30433
Change-Id: I7c710d9e36ab593295d00fc5e9e72a86a1b843af
Reviewed-on: https://dart-review.googlesource.com/c/63688
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-11-05 22:03:34 +00:00
Ryan Macnak cd44af1a14 [vm, compiler] ARM64 has 32 registers, not 16.
Change-Id: I58fcdb00e0d8244d1437b218d682991c484b8313
Reviewed-on: https://dart-review.googlesource.com/c/82401
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-11-01 16:29:19 +00:00
Ryan Macnak 808ed6238b [vm, compiler] Make register allocator instead of assembler put the write barrier value into a fixed register.
Unlike the assembler, the register allocator is in a position to avoid a move. Use the call result register since it is the most popular value source.

This pattern will also be needed to get the write barrier slot into a fixed register for card-marking, since X64 and ARM don't have a TMP2.

dart2js aot product:
X64 Instructions(CodeSize): 9049952 -> 8994240 (-0.62%)
ARM Instructions(CodeSize): 9772096 -> 9711696 (-0.62%)
ARM64 Instructions(CodeSize): 10185056 -> 10122496 (-0.61%)

Bug: https://github.com/dart-lang/sdk/issues/34002
Change-Id: Id2e9dd7b3d86069a9da3ba4e141720511ce6399e
Reviewed-on: https://dart-review.googlesource.com/76307
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-09-26 23:55:27 +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
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 9686636f6b Revert "Re-land "[vm] Factor out more of the slow-path of the store barrier into the stubs.""
This reverts commit 79ed0553e9.

Reason for revert: Issue with register allocator on SIMARM.

Original change's description:
> Re-land "[vm] Factor out more of the slow-path of the store barrier into the stubs."
> 
> When compiling instrinsic graphs on ARM and ARM64 we need to save LR when emitting
> the store barrier because the intrinsics don't have frames and won't restore it before
> returning.
> 
> Original revision is in Patchset 1.
> 
> Change-Id: I58cee3941c82efa22bd6ddbd00e00c489de53898
> 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,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
> Reviewed-on: https://dart-review.googlesource.com/66382
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=alexmarkov@google.com,sjindel@google.com

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

Change-Id: If8f8bc1a508f300ab83b03a0be7e0c318e5f99fe
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, vm-kernel-linux-release-simarm-try, vm-kernel-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/67140
Reviewed-by: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Samir Jindel <sjindel@google.com>
2018-07-27 15:01:44 +00:00
Samir Jindel 79ed0553e9 Re-land "[vm] Factor out more of the slow-path of the store barrier into the stubs."
When compiling instrinsic graphs on ARM and ARM64 we need to save LR when emitting
the store barrier because the intrinsics don't have frames and won't restore it before
returning.

Original revision is in Patchset 1.

Change-Id: I58cee3941c82efa22bd6ddbd00e00c489de53898
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,vm-kernel-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try
Reviewed-on: https://dart-review.googlesource.com/66382
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-07-25 14:11:05 +00:00
Alexander Markov 2eba6faa30 Revert "[vm] Factor out more of the slow-path of the store barrier into the stubs."
This reverts commit b3e289a95e.

Reason for revert: multiple failures on *-simarm, *-simarm64 and vm-precomp-android-release-2-3-be bots.

Original change's description:
> [vm] Factor out more of the slow-path of the store barrier into the stubs.
> 
> This delivers a 2.1% code size reduction on Flutter Gallery, and roughly 1.6% speed
> improvement on dart2js(dart2js).
> 
> 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: I2d2ceca8707d5e6fba79c558624d611f9e17d21a
> Reviewed-on: https://dart-review.googlesource.com/65060
> Commit-Queue: Samir Jindel <sjindel@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>

TBR=alexmarkov@google.com,sjindel@google.com

Change-Id: Iae83a5108d56cbd30e5727217b5ee043449f82ff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
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
Reviewed-on: https://dart-review.googlesource.com/66360
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
2018-07-24 00:44:01 +00:00
Samir Jindel b3e289a95e [vm] Factor out more of the slow-path of the store barrier into the stubs.
This delivers a 2.1% code size reduction on Flutter Gallery, and roughly 1.6% speed
improvement on dart2js(dart2js).

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: I2d2ceca8707d5e6fba79c558624d611f9e17d21a
Reviewed-on: https://dart-review.googlesource.com/65060
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2018-07-23 22:07:39 +00:00
Ryan Macnak 7ebe83fda1 [vm] Don't need to preserve ICData past the dispatching stubs.
Change-Id: I0752c4d09c836d64c8ef43b4f65b2763a550aee8
Reviewed-on: https://dart-review.googlesource.com/64666
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-07-13 23:26:29 +00:00
Michael Goderbauer 29d6e96370 Use softfp on 32bit ARM for iOS
Change-Id: I20ef6c998649aa041639feab93d49166570c53f4
Reviewed-on: https://dart-review.googlesource.com/52524
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-24 23:07:38 +00:00
Martin Kustermann 3b057dea98 [VM] Remove legacy Object::empty_context() and CTX constant
Our generated code does not keep the context in a special register
anymore (for quite some time now).  The context is just another definition
in the IR language and gets assigned register locations by the linearscan
register allocator.

Furthermore we no longer use an empty context for closures which have no
captured states, instead the context of those closures is just `null`.

This CL therefore removes Object::empty_context() and the CTX constant.

Change-Id: Iea171e0d0fd56c48f1c456e08e060a12267e39cc
Reviewed-on: https://dart-review.googlesource.com/51129
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2018-04-19 20:09:38 +00:00
Martin Kustermann 3b414a277c Reland "[VM] Introduction of type testing stubs - Part 1-4"
Relands 165c583d57

    [VM] Introduction of type testing stubs - Part 1

    This CL:

      * Adds a field to [RawAbstractType] which will always hold a pointer
        to the entrypoint of a type testing stub

      * Makes this new field be initialized to a default stub whenever a
        instances are created (e.g. via Type::New(), snapshot reader, ...)

      * Makes the clustered snapshotter write a reference to the
        corresponding [RawInstructions] object when writing the field and do
        the reverse when reading it.

      * Makes us call the type testing stub for performing assert-assignable
        checks.

    To reduce unnecessary loads on callsites, we store the entrypoint of the
    type testing stubs directly in the type objects.  This means that the
    caller of type testing stubs can simply branch there without populating
    a code object first.  This also means that the type testing stubs
    themselves have no access to a pool and we therefore also don't hold on
    to the [Code] object, only the [Instruction] object is necessary.

    The type testing stubs do not setup a frame themselves and also have no
    safepoint.  In the case when the type testing stubs could not determine
    a positive answer they will tail-call a general-purpose stub.

    The general-purpose stub sets up a stub frame, tries to consult a
    [SubtypeTestCache] and bails out to runtime if this was unsuccessful.

    This CL is just the the first, for ease of reviewing.  The actual
    type-specialized type testing stubs will be generated in later CLs.

    Reviewed-on: https://dart-review.googlesource.com/44787

Relands f226c22424

    [VM] Introduction of type testing stubs - Part 2

    This CL starts building type testing stubs specialzed for [Type] objects
    we test against.

    More specifically, it adds support for:

      * Handling obvious fast cases on the call sites (while still having a
        call to stub for negative case)

      * Handling type tests against type parameters, by loading the value
        of the type parameter on the call sites and invoking it's type testing stub.

      * Specialzed type testing stubs for instantiated types where we can
        do [CidRange]-based subtype-checks.

        ==> e.g. String/List<dynamic>

      * Specialzed type testing stubs for instantiated types where we can
        do [CidRange]-based subclass-checks for the class and
        [CidRange]-based subtype-checks for the type arguments.

        ==> e.g. Widget<State>, where we know [Widget] is only extended and not
                 implemented.

      * Specialzed type testing stubs for certain non-instantiated types where we
        can do [CidRange]-based subclass-checks for the class and
        [CidRange]-based subtype-checks for the instantiated type arguments and
        cid based comparisons for type parameters.  (Note that this fast-case migth
        result in some false-negatives!)

        ==> e.g. _HashMapEntry<K, V>, where we know [_HashMapEntry] is only
                 extended and not implemented.

       This optimizes cases where the caller uses `new HashMap<A, B>()` and only
       uses `A` and `B` as key/values (and not subclasses of it).  The false-negative
       can occur when subtypes of A or B are used.  In such cases we fall back to the
       [SubtypeTestCache]-based imlementation.

    Reviewed-on: https://dart-review.googlesource.com/44788

Relands 25f98bcc75

    [VM] Introduction of type testing stubs - Part 3

    The changes include:

      * Make AssertAssignableInstr no longer have a call-summary, which
        helps methods with several parameter checks by not having to
        re-load/re-initialize type arguments registers

      * Lazily create SubtypeTestCaches: We already go to runtime to warm up
        the caches, so we now also create the caches on the first runtime
        call and patch the pool entries.

      * No longer load the destination name into a register: We only need
        the name when we throw an exception, so it is not on the hot path.
        Instead we let the runtime look at the call site, decoding a pool
        index from the instructions stream.  The destination name will be
        available in the pool, at a consecutive index to the subtype cache.

      * Remove the fall-through to N=1 case for probing subtypeing tests,
        since those will always be handled by the optimized stubs.

      * Do not generate optimized stubs for FutureOr<T> (so far it just
        falled-through to TTS).  We can make optimzed version of that later,
        but it requires special subtyping rules.

      * Local code quality improvement in the type-testing-stubs: Avoid
        extra jump at last case of cid-class-range checks.

    There are still a number of optimization opportunities we can do in
    future changes.

    Reviewed-on: https://dart-review.googlesource.com/46984

Relands 2c52480ec8

    [VM] Introduction of type testing stubs - Part 4

    In order to avoid generating type testing stubs for too many types in
    the system - and thereby potentially cause an increase in code size -
    this change introduces a smarter way to decide for which types we should
    generate optimized type testing stubs.

    The precompiler creates a [TypeUsageInfo] which we use to collect
    information.  More specifically:

       a) We collect the destination types for all type checks we emit
          (we do this inside AssertAssignableInstr::EmitNativeCode).

          -> These are types we might want to generate optimized type testing
             stubs for.

       b) We collect type argument vectors used in instance creations (we do
          this inside AllocateObjectInstr::EmitNativeCode) and keep a set of
          of used type argument vectors for each class.

    After the precompiler has finished compiling normal code we scan the set
    of destination types collected in a) for uninstantiated types (or more
    specifically, type parameter types).

    We then propagate the type argument vectors used on object allocation sites,
    which were collected in b), in order to find out what kind of types are flowing
    into those type parameters.

    This allows us to extend the set of types which we test against, by
    adding the types that flow into type parameters.

    We use this final augmented set of destination types as a "filter" when
    making the decision whether to generate an optimized type testing stub
    for a given type.

    Reviewed-on: https://dart-review.googlesource.com/48640

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

Closes https://github.com/dart-lang/sdk/issues/32852

Change-Id: Ib79fbe7f043aa88f32bddad62d7656c638914b44
Reviewed-on: https://dart-review.googlesource.com/50944
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-04-13 09:06:56 +00:00
Ryan Macnak b3c94b5d52 Revert "Reland "[VM] Introduction of type testing stubs - Part 1-4""
This reverts commit 34763bc4c9.

Bug: https://github.com/dart-lang/sdk/issues/32852
Change-Id: I2131907d7036644707d5109a951969fc48dd74e1
Reviewed-on: https://dart-review.googlesource.com/50842
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2018-04-11 22:42:59 +00:00
Martin Kustermann 34763bc4c9 Reland "[VM] Introduction of type testing stubs - Part 1-4"
Relands 165c583d57

    [VM] Introduction of type testing stubs - Part 1

    This CL:

      * Adds a field to [RawAbstractType] which will always hold a pointer
        to the entrypoint of a type testing stub

      * Makes this new field be initialized to a default stub whenever a
        instances are created (e.g. via Type::New(), snapshot reader, ...)

      * Makes the clustered snapshotter write a reference to the
        corresponding [RawInstructions] object when writing the field and do
        the reverse when reading it.

      * Makes us call the type testing stub for performing assert-assignable
        checks.

    To reduce unnecessary loads on callsites, we store the entrypoint of the
    type testing stubs directly in the type objects.  This means that the
    caller of type testing stubs can simply branch there without populating
    a code object first.  This also means that the type testing stubs
    themselves have no access to a pool and we therefore also don't hold on
    to the [Code] object, only the [Instruction] object is necessary.

    The type testing stubs do not setup a frame themselves and also have no
    safepoint.  In the case when the type testing stubs could not determine
    a positive answer they will tail-call a general-purpose stub.

    The general-purpose stub sets up a stub frame, tries to consult a
    [SubtypeTestCache] and bails out to runtime if this was unsuccessful.

    This CL is just the the first, for ease of reviewing.  The actual
    type-specialized type testing stubs will be generated in later CLs.

    Reviewed-on: https://dart-review.googlesource.com/44787

Relands f226c22424

    [VM] Introduction of type testing stubs - Part 2

    This CL starts building type testing stubs specialzed for [Type] objects
    we test against.

    More specifically, it adds support for:

      * Handling obvious fast cases on the call sites (while still having a
        call to stub for negative case)

      * Handling type tests against type parameters, by loading the value
        of the type parameter on the call sites and invoking it's type testing stub.

      * Specialzed type testing stubs for instantiated types where we can
        do [CidRange]-based subtype-checks.

        ==> e.g. String/List<dynamic>

      * Specialzed type testing stubs for instantiated types where we can
        do [CidRange]-based subclass-checks for the class and
        [CidRange]-based subtype-checks for the type arguments.

        ==> e.g. Widget<State>, where we know [Widget] is only extended and not
                 implemented.

      * Specialzed type testing stubs for certain non-instantiated types where we
        can do [CidRange]-based subclass-checks for the class and
        [CidRange]-based subtype-checks for the instantiated type arguments and
        cid based comparisons for type parameters.  (Note that this fast-case migth
        result in some false-negatives!)

        ==> e.g. _HashMapEntry<K, V>, where we know [_HashMapEntry] is only
                 extended and not implemented.

       This optimizes cases where the caller uses `new HashMap<A, B>()` and only
       uses `A` and `B` as key/values (and not subclasses of it).  The false-negative
       can occur when subtypes of A or B are used.  In such cases we fall back to the
       [SubtypeTestCache]-based imlementation.

    Reviewed-on: https://dart-review.googlesource.com/44788

Relands 25f98bcc75

    [VM] Introduction of type testing stubs - Part 3

    The changes include:

      * Make AssertAssignableInstr no longer have a call-summary, which
        helps methods with several parameter checks by not having to
        re-load/re-initialize type arguments registers

      * Lazily create SubtypeTestCaches: We already go to runtime to warm up
        the caches, so we now also create the caches on the first runtime
        call and patch the pool entries.

      * No longer load the destination name into a register: We only need
        the name when we throw an exception, so it is not on the hot path.
        Instead we let the runtime look at the call site, decoding a pool
        index from the instructions stream.  The destination name will be
        available in the pool, at a consecutive index to the subtype cache.

      * Remove the fall-through to N=1 case for probing subtypeing tests,
        since those will always be handled by the optimized stubs.

      * Do not generate optimized stubs for FutureOr<T> (so far it just
        falled-through to TTS).  We can make optimzed version of that later,
        but it requires special subtyping rules.

      * Local code quality improvement in the type-testing-stubs: Avoid
        extra jump at last case of cid-class-range checks.

    There are still a number of optimization opportunities we can do in
    future changes.

    Reviewed-on: https://dart-review.googlesource.com/46984

Relands 2c52480ec8

    [VM] Introduction of type testing stubs - Part 4

    In order to avoid generating type testing stubs for too many types in
    the system - and thereby potentially cause an increase in code size -
    this change introduces a smarter way to decide for which types we should
    generate optimized type testing stubs.

    The precompiler creates a [TypeUsageInfo] which we use to collect
    information.  More specifically:

       a) We collect the destination types for all type checks we emit
          (we do this inside AssertAssignableInstr::EmitNativeCode).

          -> These are types we might want to generate optimized type testing
             stubs for.

       b) We collect type argument vectors used in instance creations (we do
          this inside AllocateObjectInstr::EmitNativeCode) and keep a set of
          of used type argument vectors for each class.

    After the precompiler has finished compiling normal code we scan the set
    of destination types collected in a) for uninstantiated types (or more
    specifically, type parameter types).

    We then propagate the type argument vectors used on object allocation sites,
    which were collected in b), in order to find out what kind of types are flowing
    into those type parameters.

    This allows us to extend the set of types which we test against, by
    adding the types that flow into type parameters.

    We use this final augmented set of destination types as a "filter" when
    making the decision whether to generate an optimized type testing stub
    for a given type.

    Reviewed-on: https://dart-review.googlesource.com/48640

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

Change-Id: I6d33d4ca3d5187a1eb1664078c003061855f0160
Reviewed-on: https://dart-review.googlesource.com/50482
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-04-10 12:20:10 +00:00
Martin Kustermann 1e997ee6b7 Revert "Reland "[VM] Introduction of type testing stubs - Part 1-4""
This reverts commit 8054409a02.

Reason for revert: Potential cause of flakes, not entirely clear yet if it was caused by this CL.

Change-Id: Icb119a107f22245ba2f303c7f2ae11f061f605f5
Reviewed-on: https://dart-review.googlesource.com/50261
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
2018-04-09 14:29:07 +00:00
Martin Kustermann 8054409a02 Reland "[VM] Introduction of type testing stubs - Part 1-4"
Relands 165c583d57

    [VM] Introduction of type testing stubs - Part 1

    This CL:

      * Adds a field to [RawAbstractType] which will always hold a pointer
        to the entrypoint of a type testing stub

      * Makes this new field be initialized to a default stub whenever a
        instances are created (e.g. via Type::New(), snapshot reader, ...)

      * Makes the clustered snapshotter write a reference to the
        corresponding [RawInstructions] object when writing the field and do
        the reverse when reading it.

      * Makes us call the type testing stub for performing assert-assignable
        checks.

    To reduce unnecessary loads on callsites, we store the entrypoint of the
    type testing stubs directly in the type objects.  This means that the
    caller of type testing stubs can simply branch there without populating
    a code object first.  This also means that the type testing stubs
    themselves have no access to a pool and we therefore also don't hold on
    to the [Code] object, only the [Instruction] object is necessary.

    The type testing stubs do not setup a frame themselves and also have no
    safepoint.  In the case when the type testing stubs could not determine
    a positive answer they will tail-call a general-purpose stub.

    The general-purpose stub sets up a stub frame, tries to consult a
    [SubtypeTestCache] and bails out to runtime if this was unsuccessful.

    This CL is just the the first, for ease of reviewing.  The actual
    type-specialized type testing stubs will be generated in later CLs.

    Reviewed-on: https://dart-review.googlesource.com/44787

Relands f226c22424

    [VM] Introduction of type testing stubs - Part 2

    This CL starts building type testing stubs specialzed for [Type] objects
    we test against.

    More specifically, it adds support for:

      * Handling obvious fast cases on the call sites (while still having a
        call to stub for negative case)

      * Handling type tests against type parameters, by loading the value
        of the type parameter on the call sites and invoking it's type testing stub.

      * Specialzed type testing stubs for instantiated types where we can
        do [CidRange]-based subtype-checks.

        ==> e.g. String/List<dynamic>

      * Specialzed type testing stubs for instantiated types where we can
        do [CidRange]-based subclass-checks for the class and
        [CidRange]-based subtype-checks for the type arguments.

        ==> e.g. Widget<State>, where we know [Widget] is only extended and not
                 implemented.

      * Specialzed type testing stubs for certain non-instantiated types where we
        can do [CidRange]-based subclass-checks for the class and
        [CidRange]-based subtype-checks for the instantiated type arguments and
        cid based comparisons for type parameters.  (Note that this fast-case migth
        result in some false-negatives!)

        ==> e.g. _HashMapEntry<K, V>, where we know [_HashMapEntry] is only
                 extended and not implemented.

       This optimizes cases where the caller uses `new HashMap<A, B>()` and only
       uses `A` and `B` as key/values (and not subclasses of it).  The false-negative
       can occur when subtypes of A or B are used.  In such cases we fall back to the
       [SubtypeTestCache]-based imlementation.

    Reviewed-on: https://dart-review.googlesource.com/44788

Relands 25f98bcc75

    [VM] Introduction of type testing stubs - Part 3

    The changes include:

      * Make AssertAssignableInstr no longer have a call-summary, which
        helps methods with several parameter checks by not having to
        re-load/re-initialize type arguments registers

      * Lazily create SubtypeTestCaches: We already go to runtime to warm up
        the caches, so we now also create the caches on the first runtime
        call and patch the pool entries.

      * No longer load the destination name into a register: We only need
        the name when we throw an exception, so it is not on the hot path.
        Instead we let the runtime look at the call site, decoding a pool
        index from the instructions stream.  The destination name will be
        available in the pool, at a consecutive index to the subtype cache.

      * Remove the fall-through to N=1 case for probing subtypeing tests,
        since those will always be handled by the optimized stubs.

      * Do not generate optimized stubs for FutureOr<T> (so far it just
        falled-through to TTS).  We can make optimzed version of that later,
        but it requires special subtyping rules.

      * Local code quality improvement in the type-testing-stubs: Avoid
        extra jump at last case of cid-class-range checks.

    There are still a number of optimization opportunities we can do in
    future changes.

    Reviewed-on: https://dart-review.googlesource.com/46984

Relands 2c52480ec8

    [VM] Introduction of type testing stubs - Part 4

    In order to avoid generating type testing stubs for too many types in
    the system - and thereby potentially cause an increase in code size -
    this change introduces a smarter way to decide for which types we should
    generate optimized type testing stubs.

    The precompiler creates a [TypeUsageInfo] which we use to collect
    information.  More specifically:

       a) We collect the destination types for all type checks we emit
          (we do this inside AssertAssignableInstr::EmitNativeCode).

          -> These are types we might want to generate optimized type testing
             stubs for.

       b) We collect type argument vectors used in instance creations (we do
          this inside AllocateObjectInstr::EmitNativeCode) and keep a set of
          of used type argument vectors for each class.

    After the precompiler has finished compiling normal code we scan the set
    of destination types collected in a) for uninstantiated types (or more
    specifically, type parameter types).

    We then propagate the type argument vectors used on object allocation sites,
    which were collected in b), in order to find out what kind of types are flowing
    into those type parameters.

    This allows us to extend the set of types which we test against, by
    adding the types that flow into type parameters.

    We use this final augmented set of destination types as a "filter" when
    making the decision whether to generate an optimized type testing stub
    for a given type.

    Reviewed-on: https://dart-review.googlesource.com/48640

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

Change-Id: I44a1d5d4b27454ae026aef2a301aada3dd399ea0
Reviewed-on: https://dart-review.googlesource.com/49861
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2018-04-09 11:25:36 +00:00
Martin Kustermann dbb1d3d44f Revert "[VM] Introduction of type testing stubs - Part 1-4"
This reverts commit 2c52480ec8.
This reverts commit 25f98bcc75.
This reverts commit f226c22424.
This reverts commit 165c583d57.

Change-Id: I3892d672b9ca0b0acc0b9b83c32ecc92355839c2
Reviewed-on: https://dart-review.googlesource.com/49843
Reviewed-by: Martin Kustermann <kustermann@google.com>
2018-04-06 08:35:01 +00:00
Martin Kustermann 25f98bcc75 [VM] Introduction of type testing stubs - Part 3
The changes include:

  * Make AssertAssignableInstr no longer have a call-summary, which
    helps methods with several parameter checks by not having to
    re-load/re-initialize type arguments registers

  * Lazily create SubtypeTestCaches: We already go to runtime to warm up
    the caches, so we now also create the caches on the first runtime
    call and patch the pool entries.

  * No longer load the destination name into a register: We only need
    the name when we throw an exception, so it is not on the hot path.
    Instead we let the runtime look at the call site, decoding a pool
    index from the instructions stream.  The destination name will be
    available in the pool, at a consecutive index to the subtype cache.

  * Remove the fall-through to N=1 case for probing subtypeing tests,
    since those will always be handled by the optimized stubs.

  * Do not generate optimized stubs for FutureOr<T> (so far it just
    falled-through to TTS).  We can make optimzed version of that later,
    but it requires special subtyping rules.

  * Local code quality improvement in the type-testing-stubs: Avoid
    extra jump at last case of cid-class-range checks.

There are still a number of optimization opportunities we can do in
future changes.

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

Change-Id: I4dc5a8a49f939178fe74d44736ef69e4b9088e46
Reviewed-on: https://dart-review.googlesource.com/46984
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
2018-04-06 07:00:50 +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
Zachary Anderson 6cd8a79078 VM: Re-format to use at most one newline between functions
R=asiva@google.com

Review-Url: https://codereview.chromium.org/2974233002 .
2017-07-13 08:08:37 -07:00
Erik Corry 029b1cb948 Spelling fixes e to i.
R=kevmoo@google.com
BUG=

Review-Url: https://codereview.chromium.org/2957593002 .
2017-06-24 13:41:39 +02:00
Erik Corry dfb67ecbf8 VM-codegen: Clean up the way we emit code for comparison instructions.
Removes some redundancy in the Emit* methods in intermediate_language_*.cc for
the 6 architectures we support.

This is a reapplication of https://codereview.chromium.org/2937933002/ -
see the comments there.  It fixes a bug in the way the TestCids
instruction was emitted on DBC.

R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2947633002 .
2017-06-20 17:41:12 +02:00
Erik Corry 1f7d2d5439 Revert "Reduce copying, redundancy & repetition for codegen of comparison instructions"
R=kustermann@google.com
BUG=

This reverts commit e25dfc07d1.
Reason: Failure on SIMDBC64
Review-Url: https://codereview.chromium.org/2949513002 .
2017-06-19 10:28:47 +02:00
Erik Corry e25dfc07d1 Reduce copying, redundancy & repetition for codegen of comparison instructions
R=vegorov@google.com
BUG=

Review-Url: https://codereview.chromium.org/2937933002 .
2017-06-19 09:45:03 +02:00
Zachary Anderson 5850122513 Fix simarm build for newer gcc's
R=rmacnak@google.com

Review-Url: https://codereview.chromium.org/2924473002 .
2017-06-05 09:22:06 -07:00
Ryan Macnak 9f2668c998 Set TARGET_OS_* from GN, falling back to HOST_OS_*.
Use TARGET_OS_* instead of HOST_OS_* to decide on the assembly variant to use. Allows, say, a gen_snapshot compiled for a Mac to target Android when generating AOT as assembly.

R=fschneider@google.com, zra@google.com

Review-Url: https://codereview.chromium.org/2757783003 .
2017-03-20 14:48:28 -07:00
Zachary Anderson a1bcf051d8 clang-format runtime/vm
R=johnmccutchan@google.com

Review URL: https://codereview.chromium.org/2481873005 .
2016-11-08 13:54:47 -08:00
Zachary Anderson 103881d01c Make header include guards great again
i.e. #ifndef VM_WHATEVER -> #ifndef RUNTIME_VM_WHATEVER

This lets us remove a hack from the PRESUBMIT.py script that existed
for reasons that are no longer valid, and sets us up to add some
presubmit checks for the GN build.

R=asiva@google.com, rmacnak@google.com

Review URL: https://codereview.chromium.org/2450713004 .
2016-10-26 00:26:03 -07:00
Ryan Macnak df4e0d5ac6 ARM/ARM64: Fix smashed CODE_REG in intrinsics with InvokeMathCFunctionInstrs.
X64: Fix smashed ARGS_DESC_REG.

IA32: Remove unnecessary preservation of ICREG.

BUG=http://dartbug.com/26516
R=vegorov@google.com

Review URL: https://codereview.chromium.org/2003403003 .
2016-05-25 10:02:21 -07:00
Ryan Macnak 85cdc0eac2 Don't assume we want the iOS ABI if running simarm on Mac and the EABI otherwise.
Allow controlling the target ABI by defining TARGET_ABI_IOS or TARGET_ABI_EABI.  If neither is defined, default to the previous behavior.

Make Linux, Mac, Android and iOS agree on the value of PreferredCodeAlignment for all architectures.

BUG=http://dartbug.com/26464
R=zra@google.com

Review URL: https://codereview.chromium.org/1982613003 .
2016-05-17 15:03:54 -07:00
John McCutchan 0a8c668e5c Add graph intrinsics for many math library functions:
- sin, cos, tan, asin, acos, atan, and atan2.

Other fixes:

- support calling from intrinsic code

R=fschneider@google.com

Review URL: https://codereview.chromium.org/1823263002 .
2016-03-23 06:58:12 -07:00
Ryan Macnak d422888b46 Use the iOS ABI when running SIMARM on Mac or targeting iOS.
Linux / iOS
R7   preserved / FP
R9   preserved / volatile
R11  FP / preserved

BUG=http://dartbug.com/24683
R=zra@google.com

Review URL: https://codereview.chromium.org/1421253004 .
2015-10-27 14:36:38 -07:00
Ryan Macnak dd7250323d Re-assign registers on ARM so PP and CODE_REG are below R7 (FP on iOS).
Also update descriptions of register availability in instrinsics.

1) Mechanical replacement in *arm.* files except the simulator and constants_arm.h (with sed).

R5 -> R9
R6 -> R8
R8 -> R10
R9 -> R5
R10 -> R6

2) Change register aliases.

CTX = R10 -> CTX = R6
PP = R9 -> PP = R5
ICREG = R5 -> ICREG = R9
CODE_REG = R10 -> CODE_REG = R6
THR = R8 -> THR = R10

3) Fixup users of ldrd/strd to have valid register pairs.

bigint_lsh
bigint_absadd
bigint_abssub
bigint_sqradd
TYPED_ARRAY_ALLOCATION
InlineArrayAllocation
AllocateArrayStub
AllocateContextStub

4) Fix PushList in MegamorphicMissStub to keep runtime call arguments in the right order.

BUG=http://dartbug.com/24683
R=fschneider@google.com

Review URL: https://codereview.chromium.org/1419223003 .
2015-10-26 11:05:32 -07:00
Ryan Macnak 91bc8005fe Don't touch x18 on ARM64 - it is globally reserved on iOS.
Move SP on ARM64 to x19.

Use a mask instead of a range for determining the globally blocked registers.

R=regis@google.com

Review URL: https://codereview.chromium.org/1417433002 .
2015-10-19 14:17:07 -07:00
Florian Schneider bac82e2592 VM: New calling convention for generated code.
Instead of calling code object directly, call indirectly and
pass the code object in a register. The object pool is then loaded from
the code object. This is another preparation step for making generated code
relocatable.

All non-ia32 platforms:
No entry patching.

ARM:
PC marker (now code object) moves to the same place as on x64 (below saved PP, above saved FP).
R9 is now used as PP, R10 as CODE_REG.

BUG=
R=koda@google.com, rmacnak@google.com

Committed: 1d343e5a7b

Review URL: https://codereview.chromium.org//1192103004 .
2015-09-19 13:21:09 +02:00
Florian Schneider 7af7a2db87 Revert "VM: New calling convention for generated code."
This reverts commit 1d343e5a7b.

Because of Windows test failures.

BUG=
TBR=whesse@google.com

Review URL: https://codereview.chromium.org//1343373003 .
2015-09-16 13:46:05 +02:00