[vm/compiler] Avoid unnessary checks on 64-bit
Rationale: Follow up from two previous CLs. Use of 64-bit macro (requested by Martin) and avoid unnessary check on 64-bit platforms (requested by Alex) https://github.com/dart-lang/sdk/issues/37868 https://github.com/dart-lang/sdk/issues/37895 Change-Id: I80e6825953090f5079377d0452b70e48c5be92a2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114550 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Aart Bik <ajcbik@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
a5c961d50b
commit
64a42600ea
@@ -662,7 +662,7 @@ CompileType CompileType::Int() {
|
||||
}
|
||||
|
||||
CompileType CompileType::Int32() {
|
||||
#if defined(TARGET_ARCH_X64) || defined(TARGET_ARCH_ARM64)
|
||||
#if defined(TARGET_ARCH_IS_64_BIT)
|
||||
return FromCid(kSmiCid);
|
||||
#else
|
||||
return Int();
|
||||
|
||||
@@ -280,11 +280,15 @@ static bool IntrinsifyArraySetIndexed(FlowGraph* flow_graph,
|
||||
switch (array_cid) {
|
||||
case kTypedDataUint8ClampedArrayCid:
|
||||
case kExternalTypedDataUint8ClampedArrayCid:
|
||||
// Clamping operations need the exact value for proper operations.
|
||||
// All others get away with truncating even non-smi values.
|
||||
#if defined(TARGET_ARCH_IS_32_BIT)
|
||||
// On 32-bit architectures, clamping operations need the exact value
|
||||
// for proper operations. On 64-bit architectures, kUnboxedIntPtr
|
||||
// maps to kUnboxedInt64. All other situations get away with
|
||||
// truncating even non-smi values.
|
||||
builder.AddInstruction(new CheckSmiInstr(new Value(value), DeoptId::kNone,
|
||||
builder.TokenPos()));
|
||||
FALL_THROUGH;
|
||||
#endif
|
||||
case kTypedDataInt8ArrayCid:
|
||||
case kTypedDataInt16ArrayCid:
|
||||
case kTypedDataUint8ArrayCid:
|
||||
|
||||
Reference in New Issue
Block a user