diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 81af36d1732..730c50613f5 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -169,7 +169,7 @@ config("dart_arch_config") { assert(false) } if (dart_force_simulator) { - defines += [ "USING_SIMULATOR" ] + defines += [ "DART_INCLUDE_SIMULATOR" ] if (dart_target_arch == "arm64") { defines += [ "SIMULATOR_FFI" ] } diff --git a/runtime/bin/snapshot_utils.cc b/runtime/bin/snapshot_utils.cc index 038d87aec93..79543bf19e8 100644 --- a/runtime/bin/snapshot_utils.cc +++ b/runtime/bin/snapshot_utils.cc @@ -25,14 +25,14 @@ #define LOG_SECTION_BOUNDARIES false -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) #if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID) || \ defined(DART_HOST_OS_FUCHSIA) #define NATIVE_SHARED_OBJECT_FORMAT_ELF 1 #elif defined(DART_HOST_OS_MACOS) #define NATIVE_SHARED_OBJECT_FORMAT_MACHO 1 #endif -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) namespace dart { namespace bin { @@ -215,7 +215,7 @@ static AppSnapshot* TryReadAppSnapshotDynamicLibrary( DartUtils::MagicNumber magic_number, const char* script_name, const char** error) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) *error = "running on a simulated architecture"; return nullptr; #else @@ -277,7 +277,7 @@ static AppSnapshot* TryReadAppSnapshotDynamicLibrary( return new DylibAppSnapshot(magic_number, library, vm_data_buffer, vm_instructions_buffer, isolate_data_buffer, isolate_instructions_buffer); -#endif // defined(USING_SIMULATOR) +#endif // defined(DART_INCLUDE_SIMULATOR) } class ElfAppSnapshot : public AppSnapshot { diff --git a/runtime/lib/ffi_dynamic_library.cc b/runtime/lib/ffi_dynamic_library.cc index 5fb31a302a4..0aefcee4b5f 100644 --- a/runtime/lib/ffi_dynamic_library.cc +++ b/runtime/lib/ffi_dynamic_library.cc @@ -29,11 +29,11 @@ namespace dart { -#if (defined(USING_SIMULATOR) && !defined(SIMULATOR_FFI)) || \ +#if (defined(DART_INCLUDE_SIMULATOR) && !defined(SIMULATOR_FFI)) || \ (defined(DART_PRECOMPILER) && !defined(TESTING)) DART_NORETURN static void SimulatorUnsupported() { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) Exceptions::ThrowUnsupportedError("Not supported on this simulator."); #else Exceptions::ThrowUnsupportedError("Not supported in precompiler."); @@ -66,7 +66,7 @@ DEFINE_NATIVE_ENTRY(Ffi_GetFfiNativeResolver, 1, 0) { SimulatorUnsupported(); } -#else // defined(USING_SIMULATOR) || \ +#else // defined(DART_INCLUDE_SIMULATOR) || \ // (defined(DART_PRECOMPILER) && !defined(TESTING)) // If an error occurs populates |error| (if provided) with an error message @@ -516,7 +516,7 @@ DEFINE_NATIVE_ENTRY(Ffi_GetFfiNativeResolver, 1, 0) { return Pointer::New(reinterpret_cast(FfiResolve)); } -#endif // (defined(USING_SIMULATOR) && !defined (SIMULATOR_FFI)) || \ +#endif // (defined(DART_INCLUDE_SIMULATOR) && !defined (SIMULATOR_FFI)) || \ // (defined(DART_PRECOMPILER) && !defined(TESTING)) } // namespace dart diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h index 04c13c54e9c..6ae592148de 100644 --- a/runtime/platform/globals.h +++ b/runtime/platform/globals.h @@ -368,30 +368,30 @@ struct simd128_value_t { // Determine whether we will be using the simulator. #if defined(TARGET_ARCH_IA32) #if !defined(HOST_ARCH_IA32) -#define USING_SIMULATOR 1 +#define DART_INCLUDE_SIMULATOR 1 #endif #elif defined(TARGET_ARCH_X64) #if !defined(HOST_ARCH_X64) -#define USING_SIMULATOR 1 +#define DART_INCLUDE_SIMULATOR 1 #endif #elif defined(TARGET_ARCH_ARM) #if !defined(HOST_ARCH_ARM) #define TARGET_HOST_MISMATCH 1 #if !defined(IS_SIMARM_HOST64) -#define USING_SIMULATOR 1 +#define DART_INCLUDE_SIMULATOR 1 #endif #endif #elif defined(TARGET_ARCH_ARM64) #if !defined(HOST_ARCH_ARM64) -#define USING_SIMULATOR 1 +#define DART_INCLUDE_SIMULATOR 1 #endif #elif defined(TARGET_ARCH_RISCV32) #if !defined(HOST_ARCH_RISCV32) -#define USING_SIMULATOR 1 +#define DART_INCLUDE_SIMULATOR 1 #endif #elif defined(TARGET_ARCH_RISCV64) #if !defined(HOST_ARCH_RISCV64) -#define USING_SIMULATOR 1 +#define DART_INCLUDE_SIMULATOR 1 #endif #else #error Unknown architecture. diff --git a/runtime/vm/compiler/assembler/assembler_arm.cc b/runtime/vm/compiler/assembler/assembler_arm.cc index b0aa28a065d..c576660e712 100644 --- a/runtime/vm/compiler/assembler/assembler_arm.cc +++ b/runtime/vm/compiler/assembler/assembler_arm.cc @@ -15,8 +15,9 @@ #include "vm/tags.h" // An extra check since we are assuming the existence of /proc/cpuinfo below. -#if !defined(USING_SIMULATOR) && !defined(__linux__) && !defined(ANDROID) && \ - !defined(DART_HOST_OS_IOS) && !defined(DART_HOST_OS_MACOS) +#if !defined(DART_INCLUDE_SIMULATOR) && !defined(__linux__) && \ + !defined(ANDROID) && !defined(DART_HOST_OS_IOS) && \ + !defined(DART_HOST_OS_MACOS) #error ARM cross-compile only supported on Linux, Android, iOS, and Mac #endif diff --git a/runtime/vm/compiler/assembler/assembler_arm_test.cc b/runtime/vm/compiler/assembler/assembler_arm_test.cc index 7f9695b3434..931f56ce8e0 100644 --- a/runtime/vm/compiler/assembler/assembler_arm_test.cc +++ b/runtime/vm/compiler/assembler/assembler_arm_test.cc @@ -1871,7 +1871,7 @@ ASSEMBLER_TEST_RUN(Sdiv_corner, test) { } ASSEMBLER_TEST_GENERATE(IntDiv_supported, assembler) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) bool orig = TargetCPUFeatures::integer_division_supported(); HostCPUFeatures::set_integer_division_supported(true); __ mov(R0, Operand(27)); @@ -1889,7 +1889,7 @@ ASSEMBLER_TEST_GENERATE(IntDiv_supported, assembler) { ASSEMBLER_TEST_RUN(IntDiv_supported, test) { EXPECT(test != nullptr); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) bool orig = TargetCPUFeatures::integer_division_supported(); HostCPUFeatures::set_integer_division_supported(true); typedef int (*Tst)() DART_UNUSED; @@ -1902,7 +1902,7 @@ ASSEMBLER_TEST_RUN(IntDiv_supported, test) { } ASSEMBLER_TEST_GENERATE(IntDiv_unsupported, assembler) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) bool orig = TargetCPUFeatures::integer_division_supported(); HostCPUFeatures::set_integer_division_supported(false); __ mov(R0, Operand(27)); @@ -1920,7 +1920,7 @@ ASSEMBLER_TEST_GENERATE(IntDiv_unsupported, assembler) { ASSEMBLER_TEST_RUN(IntDiv_unsupported, test) { EXPECT(test != nullptr); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) bool orig = TargetCPUFeatures::integer_division_supported(); HostCPUFeatures::set_integer_division_supported(false); typedef int (*Tst)() DART_UNUSED; diff --git a/runtime/vm/compiler/assembler/assembler_riscv_test.cc b/runtime/vm/compiler/assembler/assembler_riscv_test.cc index e9cfccaeed1..86f36c1f288 100644 --- a/runtime/vm/compiler/assembler/assembler_riscv_test.cc +++ b/runtime/vm/compiler/assembler/assembler_riscv_test.cc @@ -50,7 +50,7 @@ static intx_t Call(intx_t entry, intx_t arg1 = 0, intx_t arg2 = 0, intx_t arg3 = 0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->Call(entry, arg0, arg1, arg2, arg3); #else typedef intx_t (*F)(intx_t, intx_t, intx_t, intx_t); @@ -58,7 +58,7 @@ static intx_t Call(intx_t entry, #endif } static float CallF(intx_t entry, intx_t arg0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallF(entry, arg0); #else typedef float (*F)(intx_t); @@ -66,7 +66,7 @@ static float CallF(intx_t entry, intx_t arg0) { #endif } static float CallF(intx_t entry, intx_t arg0, float arg1) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallF(entry, arg0, arg1); #else typedef float (*F)(intx_t, float); @@ -74,7 +74,7 @@ static float CallF(intx_t entry, intx_t arg0, float arg1) { #endif } static float CallF(intx_t entry, double arg0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallF(entry, arg0); #else typedef float (*F)(double); @@ -82,7 +82,7 @@ static float CallF(intx_t entry, double arg0) { #endif } static float CallF(intx_t entry, float arg0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallF(entry, arg0); #else typedef float (*F)(float); @@ -90,7 +90,7 @@ static float CallF(intx_t entry, float arg0) { #endif } static float CallF(intx_t entry, float arg0, float arg1) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallF(entry, arg0, arg1); #else typedef float (*F)(float, float); @@ -98,7 +98,7 @@ static float CallF(intx_t entry, float arg0, float arg1) { #endif } static float CallF(intx_t entry, float arg0, float arg1, float arg2) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallF(entry, arg0, arg1, arg2); #else typedef float (*F)(float, float, float); @@ -106,7 +106,7 @@ static float CallF(intx_t entry, float arg0, float arg1, float arg2) { #endif } static intx_t CallI(intx_t entry, float arg0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallI(entry, arg0); #else typedef intx_t (*F)(float); @@ -114,7 +114,7 @@ static intx_t CallI(intx_t entry, float arg0) { #endif } static intx_t CallI(intx_t entry, float arg0, float arg1) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallI(entry, arg0, arg1); #else typedef intx_t (*F)(float, float); @@ -122,7 +122,7 @@ static intx_t CallI(intx_t entry, float arg0, float arg1) { #endif } static double CallD(intx_t entry, intx_t arg0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallD(entry, arg0); #else typedef double (*F)(intx_t); @@ -131,7 +131,7 @@ static double CallD(intx_t entry, intx_t arg0) { } #if XLEN == 32 static double CallD(intx_t entry, int64_t arg0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallD(entry, arg0); #else typedef double (*F)(int64_t); @@ -140,7 +140,7 @@ static double CallD(intx_t entry, int64_t arg0) { } #endif static double CallD(intx_t entry, intx_t arg0, double arg1) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallD(entry, arg0, arg1); #else typedef double (*F)(intx_t, double); @@ -148,7 +148,7 @@ static double CallD(intx_t entry, intx_t arg0, double arg1) { #endif } static double CallD(intx_t entry, float arg0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallD(entry, arg0); #else typedef double (*F)(float); @@ -156,7 +156,7 @@ static double CallD(intx_t entry, float arg0) { #endif } static double CallD(intx_t entry, double arg0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallD(entry, arg0); #else typedef double (*F)(double); @@ -164,7 +164,7 @@ static double CallD(intx_t entry, double arg0) { #endif } static double CallD(intx_t entry, double arg0, double arg1) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallD(entry, arg0, arg1); #else typedef double (*F)(double, double); @@ -172,7 +172,7 @@ static double CallD(intx_t entry, double arg0, double arg1) { #endif } static double CallD(intx_t entry, double arg0, double arg1, double arg2) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallD(entry, arg0, arg1, arg2); #else typedef double (*F)(double, double, double); @@ -180,7 +180,7 @@ static double CallD(intx_t entry, double arg0, double arg1, double arg2) { #endif } static intx_t CallI(intx_t entry, double arg0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallI(entry, arg0); #else typedef intx_t (*F)(double); @@ -188,7 +188,7 @@ static intx_t CallI(intx_t entry, double arg0) { #endif } static intx_t CallI(intx_t entry, double arg0, double arg1) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallI(entry, arg0, arg1); #else typedef intx_t (*F)(double, double); @@ -197,7 +197,7 @@ static intx_t CallI(intx_t entry, double arg0, double arg1) { } #if XLEN == 32 static int64_t CallI64(intx_t entry, double arg0, double arg1 = 0.0) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) return Simulator::Current()->CallI64(entry, arg0, arg1); #else typedef int64_t (*F)(double, double); diff --git a/runtime/vm/compiler/stub_code_compiler_arm.cc b/runtime/vm/compiler/stub_code_compiler_arm.cc index 749be9cf068..bdeced03601 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm.cc @@ -311,7 +311,7 @@ void StubCodeCompiler::GenerateLoadFfiCallbackMetadataRuntimeFunction( } void StubCodeCompiler::GenerateFfiCallbackTrampolineStub() { -#if defined(USING_SIMULATOR) && !defined(DART_PRECOMPILER) +#if defined(DART_INCLUDE_SIMULATOR) && !defined(DART_PRECOMPILER) // TODO(37299): FFI is not supported in SIMARM. __ Breakpoint(); #else diff --git a/runtime/vm/compiler/stub_code_compiler_arm64.cc b/runtime/vm/compiler/stub_code_compiler_arm64.cc index bed546c1a37..c49e1273291 100644 --- a/runtime/vm/compiler/stub_code_compiler_arm64.cc +++ b/runtime/vm/compiler/stub_code_compiler_arm64.cc @@ -76,7 +76,7 @@ void StubCodeCompiler::EnsureIsNewOrRemembered() { // [Thread::tsan_utils_->setjmp_buffer_]). static void WithExceptionCatchingTrampoline(Assembler* assembler, std::function fun) { -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) const Register kTsanUtilsReg = R3; // Reserve space for arguments and align frame before entering C++ world. @@ -147,11 +147,11 @@ static void WithExceptionCatchingTrampoline(Assembler* assembler, __ Bind(&do_native_call); __ MoveRegister(kSavedRspReg, SP); } -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) fun(); -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) if (FLAG_target_thread_sanitizer) { __ MoveRegister(SP, kSavedRspReg); __ AddImmediate(SP, kJumpBufferSize); @@ -161,7 +161,7 @@ static void WithExceptionCatchingTrampoline(Assembler* assembler, __ str(TMP, Address(kTsanUtilsReg2, target::TsanUtils::setjmp_buffer_offset())); } -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) } // Input parameters: diff --git a/runtime/vm/compiler/stub_code_compiler_riscv.cc b/runtime/vm/compiler/stub_code_compiler_riscv.cc index b8cbed3de04..49bf14000a6 100644 --- a/runtime/vm/compiler/stub_code_compiler_riscv.cc +++ b/runtime/vm/compiler/stub_code_compiler_riscv.cc @@ -322,7 +322,7 @@ void StubCodeCompiler::GenerateLoadFfiCallbackMetadataRuntimeFunction( } void StubCodeCompiler::GenerateFfiCallbackTrampolineStub() { -#if defined(USING_SIMULATOR) && !defined(DART_PRECOMPILER) +#if defined(DART_INCLUDE_SIMULATOR) && !defined(DART_PRECOMPILER) // TODO(37299): FFI is not supported in SIMRISCV32/64. __ ebreak(); #else diff --git a/runtime/vm/compiler/stub_code_compiler_x64.cc b/runtime/vm/compiler/stub_code_compiler_x64.cc index e80ee335af6..0304d261640 100644 --- a/runtime/vm/compiler/stub_code_compiler_x64.cc +++ b/runtime/vm/compiler/stub_code_compiler_x64.cc @@ -79,7 +79,7 @@ void StubCodeCompiler::EnsureIsNewOrRemembered() { // [Thread::tsan_utils_->setjmp_buffer_]). static void WithExceptionCatchingTrampoline(Assembler* assembler, std::function fun) { -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) const Register kTsanUtilsReg = RAX; // Reserve space for arguments and align frame before entering C++ world. @@ -149,11 +149,11 @@ static void WithExceptionCatchingTrampoline(Assembler* assembler, __ Bind(&do_native_call); __ MoveRegister(kSavedRspReg, RSP); } -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) fun(); -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) if (FLAG_target_thread_sanitizer) { __ MoveRegister(RSP, kSavedRspReg); __ AddImmediate(RSP, Immediate(kJumpBufferSize)); @@ -161,7 +161,7 @@ static void WithExceptionCatchingTrampoline(Assembler* assembler, __ movq(kTsanUtilsReg2, Address(THR, target::Thread::tsan_utils_offset())); __ popq(Address(kTsanUtilsReg2, target::TsanUtils::setjmp_buffer_offset())); } -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) } // Input parameters: diff --git a/runtime/vm/cpu_arm64.cc b/runtime/vm/cpu_arm64.cc index d435bf15ff5..9234831a05d 100644 --- a/runtime/vm/cpu_arm64.cc +++ b/runtime/vm/cpu_arm64.cc @@ -24,7 +24,7 @@ void CPU::FlushICache(uword start, uword size) { #if defined(DART_PRECOMPILED_RUNTIME) UNREACHABLE(); #else -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { return; } @@ -65,9 +65,9 @@ void CPU::FlushICache(uword start, uword size) { const char* CPU::Id() { return -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) "sim" -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) "arm64"; } @@ -76,7 +76,7 @@ const char* HostCPUFeatures::hardware_ = nullptr; bool HostCPUFeatures::initialized_ = false; #endif -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) void HostCPUFeatures::Init() { CpuInfo::Init(); hardware_ = CpuInfo::GetCpuModel(); @@ -96,7 +96,7 @@ void HostCPUFeatures::Cleanup() { CpuInfo::Cleanup(); } -#else // !defined(USING_SIMULATOR) +#else // !defined(DART_INCLUDE_SIMULATOR) void HostCPUFeatures::Init() { CpuInfo::Init(); @@ -116,7 +116,7 @@ void HostCPUFeatures::Cleanup() { hardware_ = nullptr; CpuInfo::Cleanup(); } -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) } // namespace dart diff --git a/runtime/vm/cpu_ia32.cc b/runtime/vm/cpu_ia32.cc index 8fe5a9c4724..fc60017203f 100644 --- a/runtime/vm/cpu_ia32.cc +++ b/runtime/vm/cpu_ia32.cc @@ -20,9 +20,9 @@ void CPU::FlushICache(uword start, uword size) { const char* CPU::Id() { return -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) "sim" -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) "ia32"; } diff --git a/runtime/vm/cpu_riscv.cc b/runtime/vm/cpu_riscv.cc index e1440a9d2ee..361be8faa20 100644 --- a/runtime/vm/cpu_riscv.cc +++ b/runtime/vm/cpu_riscv.cc @@ -10,7 +10,7 @@ #include "vm/cpuinfo.h" -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) #if !defined(DART_HOST_OS_FUCHSIA) #include #else @@ -28,7 +28,7 @@ namespace dart { void CPU::FlushICache(uword start, uword size) { #if defined(DART_PRECOMPILED_RUNTIME) UNREACHABLE(); -#elif !defined(USING_SIMULATOR) +#elif !defined(DART_INCLUDE_SIMULATOR) // Nothing to do. Flushing no instructions. if (size == 0) { return; @@ -53,9 +53,9 @@ void CPU::FlushICache(uword start, uword size) { const char* CPU::Id() { return -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) "sim" -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) #if defined(TARGET_ARCH_RISCV32) "riscv32"; #elif defined(TARGET_ARCH_RISCV64) @@ -70,7 +70,7 @@ const char* HostCPUFeatures::hardware_ = nullptr; bool HostCPUFeatures::initialized_ = false; #endif -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) void HostCPUFeatures::Init() { CpuInfo::Init(); hardware_ = CpuInfo::GetCpuModel(); @@ -90,7 +90,7 @@ void HostCPUFeatures::Cleanup() { CpuInfo::Cleanup(); } -#else // !defined(USING_SIMULATOR) +#else // !defined(DART_INCLUDE_SIMULATOR) void HostCPUFeatures::Init() { CpuInfo::Init(); @@ -110,7 +110,7 @@ void HostCPUFeatures::Cleanup() { hardware_ = nullptr; CpuInfo::Cleanup(); } -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) } // namespace dart diff --git a/runtime/vm/cpu_x64.cc b/runtime/vm/cpu_x64.cc index e9c360302f5..942c8a62785 100644 --- a/runtime/vm/cpu_x64.cc +++ b/runtime/vm/cpu_x64.cc @@ -20,9 +20,9 @@ void CPU::FlushICache(uword start, uword size) { const char* CPU::Id() { return -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) "sim" -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) "x64"; } @@ -36,7 +36,7 @@ bool HostCPUFeatures::abm_supported_ = false; bool HostCPUFeatures::initialized_ = false; #endif -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) void HostCPUFeatures::Init() { CpuInfo::Init(); hardware_ = CpuInfo::GetCpuModel(); @@ -60,7 +60,7 @@ void HostCPUFeatures::Cleanup() { CpuInfo::Cleanup(); } -#else // !defined(USING_SIMULATOR) +#else // !defined(DART_INCLUDE_SIMULATOR) void HostCPUFeatures::Init() { CpuInfo::Init(); @@ -83,7 +83,7 @@ void HostCPUFeatures::Cleanup() { hardware_ = nullptr; CpuInfo::Cleanup(); } -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) } // namespace dart diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc index 71fe736d38d..ba56a765f0f 100644 --- a/runtime/vm/dart.cc +++ b/runtime/vm/dart.cc @@ -386,7 +386,7 @@ char* Dart::DartInit(const Dart_InitializeParams* params) { TargetCPUFeatures::Init(); FfiCallbackMetadata::Init(); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) Simulator::Init(); #endif // Create the read-only handles area. diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc index 9be9ccc3af2..496143b84c0 100644 --- a/runtime/vm/dart_entry.cc +++ b/runtime/vm/dart_entry.cc @@ -103,7 +103,7 @@ static ObjectPtr InvokeDartCode(uword entry_point, DartEntryScope dart_entry_scope(thread); const uword stub = StubCode::InvokeDartCode().EntryPoint(); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { auto invoke = [&](uword entry_point, uword arguments_descriptor, uword arguments, Thread* thread) -> uword { diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc index 667fcddd140..b1010480179 100644 --- a/runtime/vm/exceptions.cc +++ b/runtime/vm/exceptions.cc @@ -618,7 +618,7 @@ NO_SANITIZE_SAFE_STACK // This function manipulates the safestack pointer. thread->set_execution_state(Thread::kThreadInGenerated); } -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) // Unwinding of the C++ frames and destroying of their stack resources is done // by the simulator, because the target stack_pointer is a simulated stack // pointer and not the C++ stack pointer. diff --git a/runtime/vm/interpreter.cc b/runtime/vm/interpreter.cc index 6373bb4f557..0df840d8163 100644 --- a/runtime/vm/interpreter.cc +++ b/runtime/vm/interpreter.cc @@ -583,7 +583,7 @@ DART_NOINLINE bool Interpreter::InvokeCompiled(Thread* thread, { InterpreterSetjmpBuffer buffer(this); if (!DART_SETJMP(buffer.buffer_)) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) // We need to beware that bouncing between the interpreter and the // simulator may exhaust the C stack before exhausting either the // interpreter or simulator stacks. diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc index 28060449db0..c3571cdb415 100644 --- a/runtime/vm/isolate.cc +++ b/runtime/vm/isolate.cc @@ -1869,7 +1869,7 @@ Isolate::~Isolate() { free(name_); delete field_table_; -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) delete simulator_; #endif delete message_handler_; diff --git a/runtime/vm/native_arguments.h b/runtime/vm/native_arguments.h index 1bbc371bfb9..5b98fab64c2 100644 --- a/runtime/vm/native_arguments.h +++ b/runtime/vm/native_arguments.h @@ -21,7 +21,7 @@ class Thread; #if defined(TESTING) || defined(DEBUG) -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) // The simulator/isolate might not exist yet for an async FFI callback, so do // not check. An equivalent check exists in the simulator itself. #define CHECK_STACK_ALIGNMENT \ diff --git a/runtime/vm/native_entry.cc b/runtime/vm/native_entry.cc index ff7806260dc..7958cc107cb 100644 --- a/runtime/vm/native_entry.cc +++ b/runtime/vm/native_entry.cc @@ -119,7 +119,7 @@ extern "C" void DRT_BootstrapNativeCall(Dart_NativeArguments args, uword NativeEntry::BootstrapNativeCallWrapperEntry() { uword entry = reinterpret_cast(DRT_BootstrapNativeCall); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { entry = Simulator::RedirectExternalReference( entry, Simulator::kNativeCallWrapper, @@ -165,7 +165,7 @@ extern "C" void DRT_NoScopeNativeCall(Dart_NativeArguments args, uword NativeEntry::NoScopeNativeCallWrapperEntry() { uword entry = reinterpret_cast(DRT_NoScopeNativeCall); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { entry = Simulator::RedirectExternalReference( entry, Simulator::kNativeCallWrapper, @@ -198,7 +198,7 @@ extern "C" void DRT_AutoScopeNativeCall(Dart_NativeArguments args, uword NativeEntry::AutoScopeNativeCallWrapperEntry() { uword entry = reinterpret_cast(DRT_AutoScopeNativeCall); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { entry = Simulator::RedirectExternalReference( entry, Simulator::kNativeCallWrapper, diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index 299811b6b8d..c27c12ba0f4 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -27010,7 +27010,7 @@ const char* StackTrace::ToCString() const { #else const char kCompressedPointers[] = "no"; #endif -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) const char kUsingSimulator[] = "yes"; #else const char kUsingSimulator[] = "no"; diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc index 97b5ee6c998..e5b294079e9 100644 --- a/runtime/vm/object_test.cc +++ b/runtime/vm/object_test.cc @@ -8206,7 +8206,8 @@ TEST_CASE(TypeArguments_Cache_SomeInstantiations) { // reasons. Any core issues will likely be found by SomeInstantiations. #if !defined(DEBUG) && !defined(USING_MEMORY_SANITIZER) && \ !defined(USING_THREAD_SANITIZER) && !defined(USING_LEAK_SANITIZER) && \ - !defined(USING_UNDEFINED_BEHAVIOR_SANITIZER) && !defined(USING_SIMULATOR) + !defined(USING_UNDEFINED_BEHAVIOR_SANITIZER) && \ + !defined(DART_INCLUDE_SIMULATOR) TEST_CASE(TypeArguments_Cache_ManyInstantiations) { const intptr_t kNumClasses = 100000; static_assert(kNumClasses > TypeArguments::Cache::kMaxLinearCacheEntries, diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc index cc9c00be632..07910217e06 100644 --- a/runtime/vm/profiler.cc +++ b/runtime/vm/profiler.cc @@ -45,7 +45,7 @@ DEFINE_FLAG(int, max_profile_depth, Sample::kPCArraySizeInWords* kMaxSamplesPerTick, "Maximum number stack frames walked. Minimum 1. Maximum 255."); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) DEFINE_FLAG(bool, profile_vm, true, "Always collect native stack traces."); #else DEFINE_FLAG(bool, profile_vm, false, "Always collect native stack traces."); @@ -363,7 +363,7 @@ static bool GetAndValidateThreadStackBounds(OSThread* os_thread, ASSERT(stack_lower != nullptr); ASSERT(stack_upper != nullptr); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) const bool use_simulator_stack_bounds = FLAG_use_simulator && thread != nullptr && thread->IsExecutingDartCode(); if (use_simulator_stack_bounds) { @@ -375,7 +375,7 @@ static bool GetAndValidateThreadStackBounds(OSThread* os_thread, } #else const bool use_simulator_stack_bounds = false; -#endif // defined(USING_SIMULATOR) +#endif // defined(DART_INCLUDE_SIMULATOR) if (!use_simulator_stack_bounds) { *stack_lower = os_thread->stack_limit(); @@ -514,7 +514,7 @@ void Profiler::DumpStackTrace(uword sp, uword fp, uword pc, bool for_crash) { #else const char kCompressedPointers[] = "no"; #endif -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) const char kUsingSimulator[] = "yes"; #else const char kUsingSimulator[] = "no"; @@ -1249,7 +1249,7 @@ static Sample* SetupSample(Thread* thread, } sample->Init(isolate->main_port(), OS::GetCurrentMonotonicMicros(), tid); uword vm_tag = thread->vm_tag(); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) // When running in the simulator, the runtime entry function address // (stored as the vm tag) is the address of a redirect function. // Attempt to find the real runtime entry function address and use that. @@ -1393,7 +1393,7 @@ void Profiler::SampleThread(Thread* thread, if (in_dart_code) { // If we're in Dart code, use the Dart stack pointer. -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { Simulator* simulator = isolate->simulator(); sp = simulator->get_register(SPREG); diff --git a/runtime/vm/runtime_entry.cc b/runtime/vm/runtime_entry.cc index 88cf9098803..cd79ef62dff 100644 --- a/runtime/vm/runtime_entry.cc +++ b/runtime/vm/runtime_entry.cc @@ -123,7 +123,7 @@ uword RuntimeEntry::GetEntryPoint() const { // this is a redirection address that forces the simulator to call // into the runtime system. uword entry = reinterpret_cast(function()); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { // Redirection to leaf runtime calls supports a maximum of 4 arguments // passed in registers (maximum 2 double arguments for leaf float runtime @@ -153,14 +153,14 @@ uword RuntimeEntry::GetEntryPoint() const { } while (0) #endif -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) #define CHECK_SIMULATOR_STACK_OVERFLOW() \ if (FLAG_use_simulator && !OSThread::Current()->HasStackHeadroom()) { \ Exceptions::ThrowStackOverflow(); \ } #else #define CHECK_SIMULATOR_STACK_OVERFLOW() -#endif // defined(USING_SIMULATOR) +#endif // defined(DART_INCLUDE_SIMULATOR) void OnEveryRuntimeEntryCall(Thread* thread, const char* runtime_call_name, @@ -3490,7 +3490,7 @@ static void HandleOSRRequest(Thread* thread) { DEFINE_RUNTIME_ENTRY(InterruptOrStackOverflow, 0) { uword stack_pos = OSThread::GetCurrentStackPointer(); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { stack_pos = Simulator::Current()->get_sp(); // If simulator was never called it may return 0 as a value of SPREG. @@ -4384,7 +4384,7 @@ extern "C" uword /*ObjectPtr*/ InterpretCall(uword /*FunctionPtr*/ function_in, uword RuntimeEntry::InterpretCallEntry() { #if defined(DART_DYNAMIC_MODULES) uword entry = reinterpret_cast(InterpretCall); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { entry = Simulator::RedirectExternalReference( entry, Simulator::kLeafRuntimeCall, 5); diff --git a/runtime/vm/signal_handler_android.cc b/runtime/vm/signal_handler_android.cc index e605d0104f5..02949bc8541 100644 --- a/runtime/vm/signal_handler_android.cc +++ b/runtime/vm/signal_handler_android.cc @@ -76,7 +76,7 @@ uintptr_t SignalHandler::GetCStackPointer(const mcontext_t& mcontext) { } uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { -#if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) +#if defined(TARGET_ARCH_ARM64) && !defined(DART_INCLUDE_SIMULATOR) return static_cast(mcontext.regs[SPREG]); #else return GetCStackPointer(mcontext); diff --git a/runtime/vm/signal_handler_linux.cc b/runtime/vm/signal_handler_linux.cc index 31c33d514ae..1078498d77a 100644 --- a/runtime/vm/signal_handler_linux.cc +++ b/runtime/vm/signal_handler_linux.cc @@ -82,7 +82,7 @@ uintptr_t SignalHandler::GetCStackPointer(const mcontext_t& mcontext) { } uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { -#if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) +#if defined(TARGET_ARCH_ARM64) && !defined(DART_INCLUDE_SIMULATOR) return static_cast(mcontext.regs[SPREG]); #else return GetCStackPointer(mcontext); diff --git a/runtime/vm/signal_handler_macos.cc b/runtime/vm/signal_handler_macos.cc index 962dae66936..c05f49a3656 100644 --- a/runtime/vm/signal_handler_macos.cc +++ b/runtime/vm/signal_handler_macos.cc @@ -65,7 +65,7 @@ uintptr_t SignalHandler::GetCStackPointer(const mcontext_t& mcontext) { } uintptr_t SignalHandler::GetDartStackPointer(const mcontext_t& mcontext) { -#if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) +#if defined(TARGET_ARCH_ARM64) && !defined(DART_INCLUDE_SIMULATOR) return static_cast(mcontext->__ss.__x[SPREG]); #else return GetCStackPointer(mcontext); diff --git a/runtime/vm/simulator.h b/runtime/vm/simulator.h index 659bc8b2482..0b8c8cc294b 100644 --- a/runtime/vm/simulator.h +++ b/runtime/vm/simulator.h @@ -7,7 +7,7 @@ #include "vm/globals.h" -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) #if defined(TARGET_ARCH_IA32) #error Simulator not implemented. #elif defined(TARGET_ARCH_X64) @@ -21,6 +21,6 @@ #else #error Unknown architecture. #endif // defined(TARGET_ARCH_...) -#endif // defined(USING_SIMULATOR) +#endif // defined(DART_INCLUDE_SIMULATOR) #endif // RUNTIME_VM_SIMULATOR_H_ diff --git a/runtime/vm/simulator_arm.cc b/runtime/vm/simulator_arm.cc index a678ac23ad2..97cab5f9d22 100644 --- a/runtime/vm/simulator_arm.cc +++ b/runtime/vm/simulator_arm.cc @@ -9,7 +9,7 @@ #if defined(TARGET_ARCH_ARM) // Only build the simulator if not compiling for real ARM hardware. -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) #include "vm/simulator.h" @@ -3710,6 +3710,6 @@ void Simulator::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) { } // namespace dart -#endif // defined(USING_SIMULATOR) +#endif // defined(DART_INCLUDE_SIMULATOR) #endif // defined TARGET_ARCH_ARM diff --git a/runtime/vm/simulator_arm64.cc b/runtime/vm/simulator_arm64.cc index 4c12e243ec7..4423b73d36d 100644 --- a/runtime/vm/simulator_arm64.cc +++ b/runtime/vm/simulator_arm64.cc @@ -9,7 +9,7 @@ #if defined(TARGET_ARCH_ARM64) // Only build the simulator if not compiling for real ARM hardware. -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) #include "vm/simulator.h" @@ -4125,6 +4125,6 @@ void Simulator::JumpToFrame(uword pc, uword sp, uword fp, Thread* thread) { } // namespace dart -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) #endif // defined TARGET_ARCH_ARM64 diff --git a/runtime/vm/simulator_riscv.cc b/runtime/vm/simulator_riscv.cc index b59e7a8382c..f716b472313 100644 --- a/runtime/vm/simulator_riscv.cc +++ b/runtime/vm/simulator_riscv.cc @@ -9,7 +9,7 @@ #if defined(TARGET_ARCH_RISCV32) || defined(TARGET_ARCH_RISCV64) // Only build the simulator if not compiling for real RISCV hardware. -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) #include "vm/simulator.h" @@ -3451,6 +3451,6 @@ void Simulator::CSRClear(uint16_t csr, intx_t mask) { } // namespace dart -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) #endif // defined TARGET_ARCH_RISCV diff --git a/runtime/vm/simulator_x64.cc b/runtime/vm/simulator_x64.cc index 31b37921826..f5b1e0900e6 100644 --- a/runtime/vm/simulator_x64.cc +++ b/runtime/vm/simulator_x64.cc @@ -9,7 +9,7 @@ #if defined(TARGET_ARCH_X64) // Only build the simulator if not compiling for real X64 hardware. -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) #include "vm/simulator.h" @@ -67,6 +67,6 @@ uword Simulator::FunctionForRedirect(uword redirect) { } // namespace dart -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) #endif // defined TARGET_ARCH_X64 diff --git a/runtime/vm/stack_frame.cc b/runtime/vm/stack_frame.cc index 67df41cc801..030c46736aa 100644 --- a/runtime/vm/stack_frame.cc +++ b/runtime/vm/stack_frame.cc @@ -738,7 +738,7 @@ void StackFrameIterator::FrameSetIterator::Unpoison() { // instrumented C++, so there is nothing to unpoison. Additionally, // fp_ will be somewhere in the simulator's stack instead of the OSThread's // stack. -#if !defined(USING_SIMULATOR) +#if !defined(DART_INCLUDE_SIMULATOR) if (fp_ == 0) return; // Note that Thread::os_thread_ is cleared when the thread is descheduled. ASSERT(is_interpreted() || (thread_->os_thread() == nullptr) || @@ -754,7 +754,7 @@ void StackFrameIterator::FrameSetIterator::Unpoison() { uword upper = fp_ + kSavedCallerPcSlotFromFp * kWordSize; // Both lower and upper are inclusive, so we add one word when computing size. MSAN_UNPOISON(reinterpret_cast(lower), upper - lower + kWordSize); -#endif // !defined(USING_SIMULATOR) +#endif // !defined(DART_INCLUDE_SIMULATOR) } StackFrame* StackFrameIterator::FrameSetIterator::NextFrame(bool validate) { diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc index 07c564641bb..1d5b2d7e872 100644 --- a/runtime/vm/thread.cc +++ b/runtime/vm/thread.cc @@ -532,7 +532,7 @@ void Thread::EnterIsolateGroupAsMutator(IsolateGroup* isolate_group, thread->SetupDartMutatorStateDependingOnSnapshot(isolate_group); ResumeThreadInternal(thread); -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { thread->SetStackLimit(Simulator::Current()->overflow_stack_limit()); } else { @@ -586,7 +586,7 @@ void Thread::ResumeDartMutatorThreadInternal(Thread* thread) { ResumeThreadInternal(thread); if (Dart::vm_isolate() != nullptr && thread->isolate() != Dart::vm_isolate()) { -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) if (FLAG_use_simulator) { thread->SetStackLimit(Simulator::Current()->overflow_stack_limit()); } else { @@ -1328,7 +1328,7 @@ intptr_t Thread::OffsetFromThread(const RuntimeEntry* runtime_entry) { bool Thread::TopErrorHandlerIsSetJump() const { if (long_jump_base() == nullptr) return false; if (top_exit_frame_info_ == 0) return true; -#if defined(USING_SIMULATOR) || defined(USING_SAFE_STACK) +#if defined(DART_INCLUDE_SIMULATOR) || defined(USING_SAFE_STACK) // False positives: simulator stack and native stack are unordered. return true; #else @@ -1344,7 +1344,7 @@ bool Thread::TopErrorHandlerIsSetJump() const { bool Thread::TopErrorHandlerIsExitFrame() const { if (top_exit_frame_info_ == 0) return false; if (long_jump_base() == nullptr) return true; -#if defined(USING_SIMULATOR) || defined(USING_SAFE_STACK) +#if defined(DART_INCLUDE_SIMULATOR) || defined(USING_SAFE_STACK) // False positives: simulator stack and native stack are unordered. return true; #else diff --git a/runtime/vm/thread_interrupter_macos.cc b/runtime/vm/thread_interrupter_macos.cc index 0d07da01a09..5c7af4c21c7 100644 --- a/runtime/vm/thread_interrupter_macos.cc +++ b/runtime/vm/thread_interrupter_macos.cc @@ -114,7 +114,7 @@ class ThreadInterrupterMacOS { its.lr = state.__lr; #endif // HOST_ARCH_... -#if defined(TARGET_ARCH_ARM64) && !defined(USING_SIMULATOR) +#if defined(TARGET_ARCH_ARM64) && !defined(DART_INCLUDE_SIMULATOR) its.dsp = state.__x[SPREG]; #endif return its; diff --git a/runtime/vm/thread_test.cc b/runtime/vm/thread_test.cc index caba19be394..a3d50b4d7b6 100644 --- a/runtime/vm/thread_test.cc +++ b/runtime/vm/thread_test.cc @@ -624,11 +624,11 @@ TEST_CASE(SafepointTestDart) { // to get their verification done and exit. Use a specific UserTag // to enable the helpers to verify that the main thread is // successfully interrupted in the pure Dart loop. -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) const intptr_t kLoopCount = 12345678; #else const intptr_t kLoopCount = 1234567890; -#endif // defined(USING_SIMULATOR) +#endif // defined(DART_INCLUDE_SIMULATOR) char buffer[1024]; Utils::SNPrint(buffer, sizeof(buffer), "import 'dart:developer';\n" diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h index 9e2e948ff0e..0bfc10f5219 100644 --- a/runtime/vm/unit_test.h +++ b/runtime/vm/unit_test.h @@ -524,7 +524,7 @@ class AssemblerTest { // using the ABI calling convention. // ResultType is the return type of the assembler test function. // ArgNType is the type of the Nth argument. -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) // Since Simulator::Call always return a int64_t, bit_cast does not work // on 32-bit platforms when returning an int32_t. Use static cast on the @@ -611,7 +611,7 @@ class AssemblerTest { typedef ResultType (*FunctionType)(Arg1Type, Arg2Type, Arg3Type); return reinterpret_cast(entry())(arg1, arg2, arg3); } -#endif // defined(USING_SIMULATOR) +#endif // defined(DART_INCLUDE_SIMULATOR) // Assemble test and set code_. void Assemble(); diff --git a/runtime/vm/version_in.cc b/runtime/vm/version_in.cc index 7ff65c23c0c..c1106055fef 100644 --- a/runtime/vm/version_in.cc +++ b/runtime/vm/version_in.cc @@ -33,7 +33,7 @@ const char* Version::str_ = "{{VERSION_STR}} ({{CHANNEL}}) ({{COMMIT_TIME}})" " on \"" kHostOperatingSystemName "_" -#if defined(USING_SIMULATOR) +#if defined(DART_INCLUDE_SIMULATOR) "sim" #endif kTargetArchitectureName "\"";