Index: src/conversions-inl.h |
diff --git a/src/conversions-inl.h b/src/conversions-inl.h |
index 5fe71e09d3cc49d79277d434c66fbcfbd26e3b55..d449a8fcd8270d787bf078d73d2ad7bdaf29917a 100644 |
--- a/src/conversions-inl.h |
+++ b/src/conversions-inl.h |
@@ -97,6 +97,13 @@ int32_t DoubleToInt32(double x) { |
} |
} |
+bool DoubleToSmiInteger(double value, int* smi_int_value) { |
+ if (IsMinusZero(value)) return false; |
+ int i = FastD2IChecked(value); |
+ if (value != i || !Smi::IsValid(i)) return false; |
+ *smi_int_value = i; |
+ return true; |
+} |
bool IsSmiDouble(double value) { |
return !IsMinusZero(value) && value >= Smi::kMinValue && |