mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 23:49:45 +00:00
[vm] Fix Windows ARM64 MSVC build.
TEST=--no-clang Change-Id: I7e7da1afd13337f73230f3ded1f800c6ed7c969e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/331420 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
parent
d358abfd1f
commit
95e1de4f38
|
@ -447,31 +447,31 @@ struct simd128_value_t {
|
|||
#endif
|
||||
|
||||
// Byte sizes.
|
||||
constexpr int kInt8SizeLog2 = 0;
|
||||
constexpr int kInt8Size = 1 << kInt8SizeLog2;
|
||||
constexpr intptr_t kInt8SizeLog2 = 0;
|
||||
constexpr intptr_t kInt8Size = 1 << kInt8SizeLog2;
|
||||
static_assert(kInt8Size == sizeof(int8_t), "Mismatched int8 size constant");
|
||||
constexpr int kInt16SizeLog2 = 1;
|
||||
constexpr int kInt16Size = 1 << kInt16SizeLog2;
|
||||
constexpr intptr_t kInt16SizeLog2 = 1;
|
||||
constexpr intptr_t kInt16Size = 1 << kInt16SizeLog2;
|
||||
static_assert(kInt16Size == sizeof(int16_t), "Mismatched int16 size constant");
|
||||
constexpr int kInt32SizeLog2 = 2;
|
||||
constexpr int kInt32Size = 1 << kInt32SizeLog2;
|
||||
constexpr intptr_t kInt32SizeLog2 = 2;
|
||||
constexpr intptr_t kInt32Size = 1 << kInt32SizeLog2;
|
||||
static_assert(kInt32Size == sizeof(int32_t), "Mismatched int32 size constant");
|
||||
constexpr int kInt64SizeLog2 = 3;
|
||||
constexpr int kInt64Size = 1 << kInt64SizeLog2;
|
||||
constexpr intptr_t kInt64SizeLog2 = 3;
|
||||
constexpr intptr_t kInt64Size = 1 << kInt64SizeLog2;
|
||||
static_assert(kInt64Size == sizeof(int64_t), "Mismatched int64 size constant");
|
||||
|
||||
constexpr int kDoubleSize = sizeof(double);
|
||||
constexpr int kFloatSize = sizeof(float);
|
||||
constexpr int kQuadSize = 4 * kFloatSize;
|
||||
constexpr int kSimd128Size = sizeof(simd128_value_t);
|
||||
constexpr intptr_t kDoubleSize = sizeof(double);
|
||||
constexpr intptr_t kFloatSize = sizeof(float);
|
||||
constexpr intptr_t kQuadSize = 4 * kFloatSize;
|
||||
constexpr intptr_t kSimd128Size = sizeof(simd128_value_t);
|
||||
|
||||
// Bit sizes.
|
||||
constexpr int kBitsPerByteLog2 = 3;
|
||||
constexpr int kBitsPerByte = 1 << kBitsPerByteLog2;
|
||||
constexpr int kBitsPerInt8 = kInt8Size * kBitsPerByte;
|
||||
constexpr int kBitsPerInt16 = kInt16Size * kBitsPerByte;
|
||||
constexpr int kBitsPerInt32 = kInt32Size * kBitsPerByte;
|
||||
constexpr int kBitsPerInt64 = kInt64Size * kBitsPerByte;
|
||||
constexpr intptr_t kBitsPerByteLog2 = 3;
|
||||
constexpr intptr_t kBitsPerByte = 1 << kBitsPerByteLog2;
|
||||
constexpr intptr_t kBitsPerInt8 = kInt8Size * kBitsPerByte;
|
||||
constexpr intptr_t kBitsPerInt16 = kInt16Size * kBitsPerByte;
|
||||
constexpr intptr_t kBitsPerInt32 = kInt32Size * kBitsPerByte;
|
||||
constexpr intptr_t kBitsPerInt64 = kInt64Size * kBitsPerByte;
|
||||
|
||||
// The following macro works on both 32 and 64-bit platforms.
|
||||
// Usage: instead of writing 0x1234567890123456ULL
|
||||
|
@ -509,16 +509,16 @@ typedef uintptr_t uword;
|
|||
|
||||
// Byte sizes for native machine words.
|
||||
#ifdef ARCH_IS_32_BIT
|
||||
constexpr int kWordSizeLog2 = kInt32SizeLog2;
|
||||
constexpr intptr_t kWordSizeLog2 = kInt32SizeLog2;
|
||||
#else
|
||||
constexpr int kWordSizeLog2 = kInt64SizeLog2;
|
||||
constexpr intptr_t kWordSizeLog2 = kInt64SizeLog2;
|
||||
#endif
|
||||
constexpr int kWordSize = 1 << kWordSizeLog2;
|
||||
constexpr intptr_t kWordSize = 1 << kWordSizeLog2;
|
||||
static_assert(kWordSize == sizeof(word), "Mismatched word size constant");
|
||||
|
||||
// Bit sizes for native machine words.
|
||||
constexpr int kBitsPerWordLog2 = kWordSizeLog2 + kBitsPerByteLog2;
|
||||
constexpr int kBitsPerWord = 1 << kBitsPerWordLog2;
|
||||
constexpr intptr_t kBitsPerWordLog2 = kWordSizeLog2 + kBitsPerByteLog2;
|
||||
constexpr intptr_t kBitsPerWord = 1 << kBitsPerWordLog2;
|
||||
|
||||
// Integer constants for native machine words.
|
||||
constexpr word kWordMin = static_cast<uword>(1) << (kBitsPerWord - 1);
|
||||
|
@ -564,14 +564,14 @@ constexpr intptr_t kIntptrMin = (kIntptrOne << (kBitsPerWord - 1));
|
|||
constexpr intptr_t kIntptrMax = ~kIntptrMin;
|
||||
|
||||
// Time constants.
|
||||
constexpr int kMillisecondsPerSecond = 1000;
|
||||
constexpr int kMicrosecondsPerMillisecond = 1000;
|
||||
constexpr int kMicrosecondsPerSecond =
|
||||
constexpr intptr_t kMillisecondsPerSecond = 1000;
|
||||
constexpr intptr_t kMicrosecondsPerMillisecond = 1000;
|
||||
constexpr intptr_t kMicrosecondsPerSecond =
|
||||
(kMicrosecondsPerMillisecond * kMillisecondsPerSecond);
|
||||
constexpr int kNanosecondsPerMicrosecond = 1000;
|
||||
constexpr int kNanosecondsPerMillisecond =
|
||||
constexpr intptr_t kNanosecondsPerMicrosecond = 1000;
|
||||
constexpr intptr_t kNanosecondsPerMillisecond =
|
||||
(kNanosecondsPerMicrosecond * kMicrosecondsPerMillisecond);
|
||||
constexpr int kNanosecondsPerSecond =
|
||||
constexpr intptr_t kNanosecondsPerSecond =
|
||||
(kNanosecondsPerMicrosecond * kMicrosecondsPerSecond);
|
||||
|
||||
// Helpers to scale micro second times to human understandable values.
|
||||
|
|
|
@ -21,50 +21,50 @@ class LocalVariable;
|
|||
|
||||
struct FrameLayout {
|
||||
// The offset (in words) from FP to the first object.
|
||||
int first_object_from_fp;
|
||||
intptr_t first_object_from_fp;
|
||||
|
||||
// The offset (in words) from FP to the last fixed object.
|
||||
int last_fixed_object_from_fp;
|
||||
intptr_t last_fixed_object_from_fp;
|
||||
|
||||
// The offset (in words) from FP to the slot past the last parameter.
|
||||
int param_end_from_fp;
|
||||
intptr_t param_end_from_fp;
|
||||
|
||||
// The offset (in words) from SP on entry (before frame is setup) to
|
||||
// the last parameter.
|
||||
int last_param_from_entry_sp;
|
||||
intptr_t last_param_from_entry_sp;
|
||||
|
||||
// The offset (in words) from FP to the first local.
|
||||
int first_local_from_fp;
|
||||
intptr_t first_local_from_fp;
|
||||
|
||||
// The fixed size of the frame.
|
||||
int dart_fixed_frame_size;
|
||||
intptr_t dart_fixed_frame_size;
|
||||
|
||||
// The offset (in words) from FP to the saved pool (if applicable).
|
||||
int saved_caller_pp_from_fp;
|
||||
intptr_t saved_caller_pp_from_fp;
|
||||
|
||||
// The offset (in words) from FP to the saved FP.
|
||||
int saved_caller_fp_from_fp;
|
||||
intptr_t saved_caller_fp_from_fp;
|
||||
|
||||
// The offset (in words) from FP to the saved return address.
|
||||
int saved_caller_pc_from_fp;
|
||||
intptr_t saved_caller_pc_from_fp;
|
||||
|
||||
// The offset (in words) from FP to the code object (if applicable).
|
||||
int code_from_fp;
|
||||
intptr_t code_from_fp;
|
||||
|
||||
// Entry and exit frame layout.
|
||||
int exit_link_slot_from_entry_fp;
|
||||
intptr_t exit_link_slot_from_entry_fp;
|
||||
|
||||
// The number of fixed slots below the saved PC.
|
||||
int saved_below_pc() const { return -first_local_from_fp; }
|
||||
intptr_t saved_below_pc() const { return -first_local_from_fp; }
|
||||
|
||||
// Returns the FP-relative index where [variable] can be found (assumes
|
||||
// [variable] is not captured), in words.
|
||||
int FrameSlotForVariable(const LocalVariable* variable) const;
|
||||
intptr_t FrameSlotForVariable(const LocalVariable* variable) const;
|
||||
|
||||
// Returns the FP-relative index where [variable_index] can be found (assumes
|
||||
// [variable_index] comes from a [LocalVariable::index()], which is not
|
||||
// captured).
|
||||
int FrameSlotForVariableIndex(int index) const;
|
||||
intptr_t FrameSlotForVariableIndex(intptr_t index) const;
|
||||
|
||||
// Returns the variable index from a FP-relative index.
|
||||
intptr_t VariableIndexForFrameSlot(intptr_t frame_slot) const {
|
||||
|
|
|
@ -34,13 +34,13 @@ const intptr_t kSmiMax32 = (static_cast<intptr_t>(1) << kSmiBits32) - 1;
|
|||
const intptr_t kSmiMin32 = -(static_cast<intptr_t>(1) << kSmiBits32);
|
||||
|
||||
#if defined(DART_COMPRESSED_POINTERS)
|
||||
static constexpr int kCompressedWordSize = kInt32Size;
|
||||
static constexpr int kCompressedWordSizeLog2 = kInt32SizeLog2;
|
||||
static constexpr intptr_t kCompressedWordSize = kInt32Size;
|
||||
static constexpr intptr_t kCompressedWordSizeLog2 = kInt32SizeLog2;
|
||||
typedef uint32_t compressed_uword;
|
||||
typedef int32_t compressed_word;
|
||||
#else
|
||||
static constexpr int kCompressedWordSize = kWordSize;
|
||||
static constexpr int kCompressedWordSizeLog2 = kWordSizeLog2;
|
||||
static constexpr intptr_t kCompressedWordSize = kWordSize;
|
||||
static constexpr intptr_t kCompressedWordSizeLog2 = kWordSizeLog2;
|
||||
typedef uintptr_t compressed_uword;
|
||||
typedef intptr_t compressed_word;
|
||||
#endif
|
||||
|
|
|
@ -80,12 +80,13 @@ FrameLayout frame_layout = invalid_frame_layout;
|
|||
|
||||
FrameLayout runtime_frame_layout = invalid_frame_layout;
|
||||
|
||||
int FrameLayout::FrameSlotForVariable(const LocalVariable* variable) const {
|
||||
intptr_t FrameLayout::FrameSlotForVariable(
|
||||
const LocalVariable* variable) const {
|
||||
ASSERT(!variable->is_captured());
|
||||
return this->FrameSlotForVariableIndex(variable->index().value());
|
||||
}
|
||||
|
||||
int FrameLayout::FrameSlotForVariableIndex(int variable_index) const {
|
||||
intptr_t FrameLayout::FrameSlotForVariableIndex(intptr_t variable_index) const {
|
||||
// Variable indices are:
|
||||
// [1, 2, ..., M] for the M parameters.
|
||||
// [0, -1, -2, ... -(N-1)] for the N [LocalVariable]s
|
||||
|
|
Loading…
Reference in a new issue