Commit 896627db authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[cleanup] Drop Runtime_IsValidSmi

It only had one callsite, and that callsite was useless:
%IsValidSmi(two_31) has never returned {true} on any
configuration we have ever shipped.

Bug: v8:10933
Change-Id: I09cdfd7bbd7960d1ec460ad4bd9f0d21e47f7393
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2434746
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70285}
parent f3861a87
...@@ -13,15 +13,6 @@ ...@@ -13,15 +13,6 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
RUNTIME_FUNCTION(Runtime_IsValidSmi) {
SealHandleScope shs(isolate);
DCHECK_EQ(1, args.length());
CONVERT_NUMBER_CHECKED(int32_t, number, Int32, args[0]);
return isolate->heap()->ToBoolean(Smi::IsValid(number));
}
RUNTIME_FUNCTION(Runtime_StringToNumber) { RUNTIME_FUNCTION(Runtime_StringToNumber) {
HandleScope handle_scope(isolate); HandleScope handle_scope(isolate);
DCHECK_EQ(1, args.length()); DCHECK_EQ(1, args.length());
......
...@@ -276,7 +276,6 @@ namespace internal { ...@@ -276,7 +276,6 @@ namespace internal {
F(GetHoleNaNLower, 0, 1) \ F(GetHoleNaNLower, 0, 1) \
F(GetHoleNaNUpper, 0, 1) \ F(GetHoleNaNUpper, 0, 1) \
I(IsSmi, 1, 1) \ I(IsSmi, 1, 1) \
F(IsValidSmi, 1, 1) \
F(MaxSmi, 0, 1) \ F(MaxSmi, 0, 1) \
F(NumberToStringSlow, 1, 1) \ F(NumberToStringSlow, 1, 1) \
F(StringParseFloat, 1, 1) \ F(StringParseFloat, 1, 1) \
......
...@@ -73,16 +73,14 @@ assertUnoptimized(mul_by_2); ...@@ -73,16 +73,14 @@ assertUnoptimized(mul_by_2);
// Deopt on overflow. // Deopt on overflow.
// 2^30 is a smi boundary on arm and ia32. // -2^30 is in Smi range on most configurations, +2^30 is not.
var two_30 = 1 << 30; var two_30 = 1 << 30;
// 2^31 is a smi boundary on arm64 and x64. assertEquals(two_30, mul_by_neg_1(-two_30));
var two_31 = 2 * two_30;
// TODO(rmcilroy): replace after r16361 with: if (%IsValidSmi(two_31)) { // For good measure, check that overflowing int32 range (or Smi range
if (true) { // without pointer compression) works too.
assertEquals(two_31, mul_by_neg_1(-two_31)); var two_31 = two_30 * 2;
assertUnoptimized(mul_by_neg_1); assertEquals(two_31, mul_by_neg_1(-two_31));
} else {
assertEquals(two_30, mul_by_neg_1(-two_30)); // One of the two situations deoptimized the code.
assertUnoptimized(mul_by_neg_1); assertUnoptimized(mul_by_neg_1);
}
...@@ -53,17 +53,14 @@ mul2(-1, 2); ...@@ -53,17 +53,14 @@ mul2(-1, 2);
mul2(-1, 2); mul2(-1, 2);
%OptimizeFunctionOnNextCall(mul2); %OptimizeFunctionOnNextCall(mul2);
// 2^30 is a smi boundary on arm and ia32. // -2^30 is in Smi range on most configurations, +2^30 is not.
var two_30 = 1 << 30; var two_30 = 1 << 30;
// 2^31 is a smi boundary on x64. assertEquals(two_30, mul2(-two_30, -1));
var two_31 = 2 * two_30;
if (%IsValidSmi(two_31)) { // For good measure, check that overflowing int32 range (or Smi range
// Deopt on two_31 on x64. // without pointer compression) works too.
assertEquals(two_31, mul2(-two_31, -1)); var two_31 = two_30 * 2;
assertUnoptimized(mul2); assertEquals(two_31, mul2(-two_31, -1));
} else {
// Deopt on two_30 on ia32. // One of the two situations deoptimized the code.
assertEquals(two_30, mul2(-two_30, -1)); assertUnoptimized(mul2);
assertUnoptimized(mul2);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment