mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
![Samir Jindel](/assets/img/avatar_default.png)
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>
107 lines
2.9 KiB
C++
107 lines
2.9 KiB
C++
// Copyright (c) 2018, 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.
|
|
|
|
#ifndef RUNTIME_VM_CONSTANTS_H_
|
|
#define RUNTIME_VM_CONSTANTS_H_
|
|
|
|
#if defined(TARGET_ARCH_IA32)
|
|
#include "vm/constants_ia32.h"
|
|
#elif defined(TARGET_ARCH_X64)
|
|
#include "vm/constants_x64.h"
|
|
#elif defined(TARGET_ARCH_ARM)
|
|
#include "vm/constants_arm.h"
|
|
#elif defined(TARGET_ARCH_ARM64)
|
|
#include "vm/constants_arm64.h"
|
|
#elif defined(TARGET_ARCH_DBC)
|
|
#include "vm/constants_dbc.h"
|
|
#else
|
|
#error Unknown architecture.
|
|
#endif
|
|
|
|
#if defined(HOST_ARCH_IA32)
|
|
#include "vm/constants_ia32.h"
|
|
#elif defined(HOST_ARCH_X64)
|
|
#include "vm/constants_x64.h"
|
|
#elif defined(HOST_ARCH_ARM)
|
|
#include "vm/constants_arm.h"
|
|
#elif defined(HOST_ARCH_ARM64)
|
|
#include "vm/constants_arm64.h"
|
|
#else
|
|
#error Unknown host architecture.
|
|
#endif
|
|
|
|
namespace dart {
|
|
|
|
#if defined(TARGET_ARCH_IA32)
|
|
using namespace arch_ia32; // NOLINT
|
|
#elif defined(TARGET_ARCH_X64)
|
|
using namespace arch_x64; // NOLINT
|
|
#elif defined(TARGET_ARCH_ARM)
|
|
using namespace arch_arm; // NOLINT
|
|
#elif defined(TARGET_ARCH_ARM64)
|
|
using namespace arch_arm64; // NOLINT
|
|
#elif defined(TARGET_ARCH_DBC)
|
|
// DBC is defined in namespace dart already.
|
|
#else
|
|
#error Unknown architecture.
|
|
#endif
|
|
|
|
namespace host {
|
|
|
|
#if defined(HOST_ARCH_IA32)
|
|
using namespace arch_ia32; // NOLINT
|
|
#elif defined(HOST_ARCH_X64)
|
|
using namespace arch_x64; // NOLINT
|
|
#elif defined(HOST_ARCH_ARM)
|
|
using namespace arch_arm; // NOLINT
|
|
#elif defined(HOST_ARCH_ARM64)
|
|
using namespace arch_arm64; // NOLINT
|
|
#else
|
|
#error Unknown host architecture.
|
|
#endif
|
|
|
|
} // namespace host
|
|
|
|
class RegisterNames {
|
|
public:
|
|
static const char* RegisterName(Register reg) {
|
|
ASSERT((0 <= reg) && (reg < kNumberOfCpuRegisters));
|
|
return cpu_reg_names[reg];
|
|
}
|
|
static const char* FpuRegisterName(FpuRegister reg) {
|
|
ASSERT((0 <= reg) && (reg < kNumberOfFpuRegisters));
|
|
return fpu_reg_names[reg];
|
|
}
|
|
#if !defined(HOST_ARCH_EQUALS_TARGET_ARCH)
|
|
static const char* RegisterName(host::Register reg) {
|
|
ASSERT((0 <= reg) && (reg < host::kNumberOfCpuRegisters));
|
|
return host::cpu_reg_names[reg];
|
|
}
|
|
static const char* FpuRegisterName(host::FpuRegister reg) {
|
|
ASSERT((0 <= reg) && (reg < host::kNumberOfFpuRegisters));
|
|
return host::fpu_reg_names[reg];
|
|
}
|
|
#endif // !defined(HOST_ARCH_EQUALS_TARGET_ARCH)
|
|
};
|
|
|
|
#if !defined(TARGET_ARCH_DBC)
|
|
|
|
static constexpr bool IsArgumentRegister(Register reg) {
|
|
return ((1 << reg) & CallingConventions::kArgumentRegisters) != 0;
|
|
}
|
|
|
|
static constexpr bool IsFpuArgumentRegister(FpuRegister reg) {
|
|
return ((1 << reg) & CallingConventions::kFpuArgumentRegisters) != 0;
|
|
}
|
|
|
|
static constexpr bool IsCalleeSavedRegister(Register reg) {
|
|
return ((1 << reg) & CallingConventions::kCalleeSaveCpuRegisters) != 0;
|
|
}
|
|
|
|
#endif // !defined(TARGET_ARCH_DBC)
|
|
|
|
} // namespace dart
|
|
|
|
#endif // RUNTIME_VM_CONSTANTS_H_
|