Commit Graph

8 Commits

Author SHA1 Message Date
Vyacheslav Egorov beb7114861 [vm/compiler] Add check to prevent inclusion of compiler headers into AOT runtime
This relands commit b0a71d364c

Cq-Include-Trybots: dart/try:vm-kernel-precomp-linux-release-simarm64-try,vm-kernel-precomp-linux-release-simarm-try,vm-kernel-linux-release-simarm64-try,vm-kernel-linux-release-simarm-try,vm-kernel-precomp-linux-release-x64-try
Change-Id: I1d32e5d0d44f4e422d188643b548ed81859f7d74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143807
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2020-04-17 13:11:08 +00:00
Alexander Aprelev c7861f309f Revert "[vm/compiler] Add check to prevent inclusion of compiler headers into AOT runtime"
This reverts commit b0a71d364c as it broke precomp builds.

Change-Id: Ieb776739b8d3e9ac74794e05fc20a793625e5f09
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143865
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2020-04-16 23:51:09 +00:00
Vyacheslav Egorov b0a71d364c [vm/compiler] Add check to prevent inclusion of compiler headers into AOT runtime
#if defined(DART_PRECOMPILED_RUNTIME)
  #error "AOT runtime should not use compiler sources (including header files)"
  #endif  // defined(DART_PRECOMPILED_RUNTIME)

Remove #if defined(DART_PRECOMPILED_RUNTIME) from most compiler sources.

Change-Id: Id175c83fdbea38d9d5e1371ff433e3888f2afe8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143523
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2020-04-16 22:59:03 +00:00
Samir Jindel c885bdde1d [vm] DBC is obsolete. Remove dead code.
Change-Id: Ica33af158cca53c8e951e4b2582de83660e8a60d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/121851
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2019-10-27 18:18:29 +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
Vyacheslav Egorov 05a28ab557 [VM] Introduce new way to define instruction backends (Reland).
Rewrite most SIMD instructions on ARM using this new way.

Our current way for defining instruction backends -- a pair of two virtual
methods called MakeLocationSummary and EmitNativeCode, leads to unnecessary
duplicated and verbose code. Code generation happens in three steps:

1. For each instruction in the graph MakeLocationSummary is called to
constructing a location summary object encoding register allocation constraints;
2. When all register constraints are collected a register allocation is performed
and results are filled back into the location summaries;
3. For each instruction in the graph EmitNativeCode is called. It unpacks
location summary attached to the instruction into actual machine registers and
emits native code.

There is usually a lot of duplication between declaring register constraints in
MLS and unpacking them in ENC which this CL is trying to remove.

The new way is centered on the concept of an *emitter function* which encodes
in its signature register constraints for a particular instruction.

We use a combination of templates and macroses to enable writing

    DEFINE_BACKEND(BinaryFloat32x4Op,
                   (QRegister result, QRegister left, QRegister right)) {
      // ...
    }

Instead of

    LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
                                                                 bool opt) const {
      const intptr_t kNumInputs = 2;
      const intptr_t kNumTemps = 0;
      LocationSummary* summary = new (zone)
          LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
      summary->set_in(0, Location::RequiresFpuRegister());
      summary->set_in(1, Location::RequiresFpuRegister());
      summary->set_out(0, Location::RequiresFpuRegister());
      return summary;
    }

    void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
      const QRegister left = locs()->in(0).fpu_reg();
      const QRegister right = locs()->in(1).fpu_reg();
      const QRegister result = locs()->out(0).fpu_reg();
      // ...
    }

This change also introduces a new, more handy way to work with S/D components of QRegisters, QRegister_ wrapper type.

Bug: https://github.com/dart-lang/sdk/issues/30949
Change-Id: I7bb0fc9672c89acc3d3d9b5e9859ae5a5471f420
Reviewed-on: https://dart-review.googlesource.com/11820
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2017-10-06 11:48:02 +00:00
William Hesse 6043dbb6d8 Revert "[VM] Introduce new way to define instruction backends."
This reverts commit 04aa2b0186.

Reason for revert: Compilation is failing on some Windows builders.  It may be the version of MSVC running on those machines that makes the difference.  But I think we need to revert until we figure it out.  The error is "runtime\vm\compiler\backend\locations_helpers_test.cc(111): error C2466: cannot allocate an array of constant size 0"

Original change's description:
> [VM] Introduce new way to define instruction backends.
> 
> Rewrite most SIMD instructions on ARM using this new way.
> 
> Our current way for defining instruction backends -- a pair of two virtual
> methods called MakeLocationSummary and EmitNativeCode, leads to unnecessary
> duplicated and verbose code. Code generation happens in three steps:
> 
> 1. For each instruction in the graph MakeLocationSummary is called to
> constructing a location summary object encoding register allocation constraints;
> 2. When all register constraints are collected a register allocation is performed
> and results are filled back into the location summaries;
> 3. For each instruction in the graph EmitNativeCode is called. It unpacks
> location summary attached to the instruction into actual machine registers and
> emits native code.
> 
> There is usually a lot of duplication between declaring register constraints in
> MLS and unpacking them in ENC which this CL is trying to remove.
> 
> The new way is centered on the concept of an *emitter function* which encodes
> in its signature register constraints for a particular instruction.
> 
> We use a combination of templates and macroses to enable writing
> 
>     DEFINE_BACKEND(BinaryFloat32x4Op,
>                    (QRegister result, QRegister left, QRegister right)) {
>       // ...
>     }
> 
> Instead of
> 
>     LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
>                                                                  bool opt) const {
>       const intptr_t kNumInputs = 2;
>       const intptr_t kNumTemps = 0;
>       LocationSummary* summary = new (zone)
>           LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
>       summary->set_in(0, Location::RequiresFpuRegister());
>       summary->set_in(1, Location::RequiresFpuRegister());
>       summary->set_out(0, Location::RequiresFpuRegister());
>       return summary;
>     }
> 
>     void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
>       const QRegister left = locs()->in(0).fpu_reg();
>       const QRegister right = locs()->in(1).fpu_reg();
>       const QRegister result = locs()->out(0).fpu_reg();
>       // ...
>     }
> 
> This change also introduces a new, more handy way to work with S/D components of QRegisters, QRegister_ wrapper type.
> 
> Bug: https://github.com/dart-lang/sdk/issues/30949
> Change-Id: I7f2beb106d1458facf4a3d75cae123e1fc25d8b5
> Reviewed-on: https://dart-review.googlesource.com/11507
> Reviewed-by: Zach Anderson <zra@google.com>
> Reviewed-by: Alexander Markov <alexmarkov@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>

TBR=vegorov@google.com,alexmarkov@google.com,zra@google.com

Change-Id: Icfaabe58351a61d4eb50c4f9ac3bbd9677339fe7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/30949
Reviewed-on: https://dart-review.googlesource.com/11780
Reviewed-by: William Hesse <whesse@google.com>
2017-10-05 22:55:58 +00:00
Vyacheslav Egorov 04aa2b0186 [VM] Introduce new way to define instruction backends.
Rewrite most SIMD instructions on ARM using this new way.

Our current way for defining instruction backends -- a pair of two virtual
methods called MakeLocationSummary and EmitNativeCode, leads to unnecessary
duplicated and verbose code. Code generation happens in three steps:

1. For each instruction in the graph MakeLocationSummary is called to
constructing a location summary object encoding register allocation constraints;
2. When all register constraints are collected a register allocation is performed
and results are filled back into the location summaries;
3. For each instruction in the graph EmitNativeCode is called. It unpacks
location summary attached to the instruction into actual machine registers and
emits native code.

There is usually a lot of duplication between declaring register constraints in
MLS and unpacking them in ENC which this CL is trying to remove.

The new way is centered on the concept of an *emitter function* which encodes
in its signature register constraints for a particular instruction.

We use a combination of templates and macroses to enable writing

    DEFINE_BACKEND(BinaryFloat32x4Op,
                   (QRegister result, QRegister left, QRegister right)) {
      // ...
    }

Instead of

    LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone,
                                                                 bool opt) const {
      const intptr_t kNumInputs = 2;
      const intptr_t kNumTemps = 0;
      LocationSummary* summary = new (zone)
          LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall);
      summary->set_in(0, Location::RequiresFpuRegister());
      summary->set_in(1, Location::RequiresFpuRegister());
      summary->set_out(0, Location::RequiresFpuRegister());
      return summary;
    }

    void BinaryFloat32x4OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
      const QRegister left = locs()->in(0).fpu_reg();
      const QRegister right = locs()->in(1).fpu_reg();
      const QRegister result = locs()->out(0).fpu_reg();
      // ...
    }

This change also introduces a new, more handy way to work with S/D components of QRegisters, QRegister_ wrapper type.

Bug: https://github.com/dart-lang/sdk/issues/30949
Change-Id: I7f2beb106d1458facf4a3d75cae123e1fc25d8b5
Reviewed-on: https://dart-review.googlesource.com/11507
Reviewed-by: Zach Anderson <zra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
2017-10-05 22:31:43 +00:00