525b43d747
This is the next step towards preventing compiler from directly peeking into runtime and instead interact with runtime through a well defined surface. This CL decouples the hand-written intrinsifier code from the runtime: * the intrinsifier is split up into a GraphIntrinsifier and AsmIntrinsifier * the recognized methods list is moved to a separate .h file * all intrinsifier code is moved into dart::compiler namespace * the AsmIntrinsifier is only interacting with RT through runtime_api.h Issue https://github.com/dart-lang/sdk/issues/31709 Change-Id: I0a73ad620e051dd49c9db7da3241212b3b74ccdd Reviewed-on: https://dart-review.googlesource.com/c/92740 Commit-Queue: Martin Kustermann <kustermann@google.com> Reviewed-by: Aart Bik <ajcbik@google.com>
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM.
|
|
#if defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
|
|
|
|
#include "vm/compiler/assembler/assembler.h"
|
|
#include "vm/compiler/graph_intrinsifier.h"
|
|
|
|
namespace dart {
|
|
namespace compiler {
|
|
|
|
#define __ assembler->
|
|
|
|
intptr_t GraphIntrinsifier::ParameterSlotFromSp() {
|
|
return -1;
|
|
}
|
|
|
|
static bool IsABIPreservedRegister(Register reg) {
|
|
return ((1 << reg) & kAbiPreservedCpuRegs) != 0;
|
|
}
|
|
|
|
void GraphIntrinsifier::IntrinsicCallPrologue(Assembler* assembler) {
|
|
ASSERT(IsABIPreservedRegister(CODE_REG));
|
|
ASSERT(IsABIPreservedRegister(ARGS_DESC_REG));
|
|
ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP));
|
|
|
|
// Save LR by moving it to a callee saved temporary register.
|
|
assembler->Comment("IntrinsicCallPrologue");
|
|
assembler->mov(CALLEE_SAVED_TEMP, Operand(LR));
|
|
}
|
|
|
|
void GraphIntrinsifier::IntrinsicCallEpilogue(Assembler* assembler) {
|
|
// Restore LR.
|
|
assembler->Comment("IntrinsicCallEpilogue");
|
|
assembler->mov(LR, Operand(CALLEE_SAVED_TEMP));
|
|
}
|
|
|
|
#undef __
|
|
|
|
} // namespace compiler
|
|
} // namespace dart
|
|
|
|
#endif // defined(TARGET_ARCH_ARM) && !defined(DART_PRECOMPILED_RUNTIME)
|