[vm] Introduce HAS_SMI_63_BITS

TEST=This is a refactoring, existing tests cover this.

Change-Id: I19c062bcf3d468814e2c2ecfacc9a65050925fc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208650
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 42edc70..ed20219 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -334,6 +334,10 @@
 #error Automatic target architecture detection failed.
 #endif
 
+#if defined(TARGET_ARCH_IS_64_BIT) && !defined(DART_COMPRESSED_POINTERS)
+#define HAS_SMI_63_BITS 1
+#endif
+
 // Verify that host and target architectures match, we cannot
 // have a 64 bit Dart VM generating 32 bit code or vice-versa.
 #if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64)
diff --git a/runtime/vm/compiler/assembler/assembler_base.h b/runtime/vm/compiler/assembler/assembler_base.h
index 55258dc..1f22998 100644
--- a/runtime/vm/compiler/assembler/assembler_base.h
+++ b/runtime/vm/compiler/assembler/assembler_base.h
@@ -193,7 +193,7 @@
   // 64-bit ARM specific constants.
   kQWord,
 
-#if defined(TARGET_ARCH_IS_64_BIT) && !defined(DART_COMPRESSED_POINTERS)
+#if defined(HAS_SMI_63_BITS)
   kObjectBytes = kEightBytes,
 #else
   kObjectBytes = kFourBytes,
diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc
index 129f0e7..527fa42 100644
--- a/runtime/vm/compiler/backend/il.cc
+++ b/runtime/vm/compiler/backend/il.cc
@@ -3736,7 +3736,7 @@
   switch (from) {
     case kUnboxedUint8:
     case kUnboxedUint16:
-#if defined(TARGET_ARCH_IS_64_BIT) && !defined(DART_COMPRESSED_POINTERS)
+#if defined(HAS_SMI_63_BITS)
     case kUnboxedInt32:
     case kUnboxedUint32:
 #endif
diff --git a/runtime/vm/compiler/backend/type_propagator.cc b/runtime/vm/compiler/backend/type_propagator.cc
index 9aecb2c..06edf78 100644
--- a/runtime/vm/compiler/backend/type_propagator.cc
+++ b/runtime/vm/compiler/backend/type_propagator.cc
@@ -699,7 +699,7 @@
 }
 
 CompileType CompileType::Int32() {
-#if defined(TARGET_ARCH_IS_64_BIT) && !defined(DART_COMPRESSED_POINTERS)
+#if defined(HAS_SMI_63_BITS)
   return FromCid(kSmiCid);
 #else
   return Int();
diff --git a/runtime/vm/compiler/frontend/kernel_to_il.cc b/runtime/vm/compiler/frontend/kernel_to_il.cc
index 06b2e7e..68cdb57 100644
--- a/runtime/vm/compiler/frontend/kernel_to_il.cc
+++ b/runtime/vm/compiler/frontend/kernel_to_il.cc
@@ -1486,7 +1486,7 @@
       body += Box(kUnboxedFfiIntPtr);
     } break;
     case MethodRecognizer::kHas63BitSmis: {
-#if defined(TARGET_ARCH_IS_64_BIT) && !defined(DART_COMPRESSED_POINTERS)
+#if defined(HAS_SMI_63_BITS)
       body += Constant(Bool::True());
 #else
       body += Constant(Bool::False());