Index: src/runtime/runtime-numbers.cc |
diff --git a/src/runtime/runtime-numbers.cc b/src/runtime/runtime-numbers.cc |
index 3286aa6f131a5047474093cf8d62d1d3e0012848..8074e4102023fdccca82c8a943832ca12d233966 100644 |
--- a/src/runtime/runtime-numbers.cc |
+++ b/src/runtime/runtime-numbers.cc |
@@ -561,5 +561,22 @@ RUNTIME_FUNCTION(RuntimeReference_NumberToString) { |
SealHandleScope shs(isolate); |
return __RT_impl_Runtime_NumberToStringRT(args, isolate); |
} |
+ |
+ |
+RUNTIME_FUNCTION(RuntimeReference_IsSmi) { |
+ SealHandleScope shs(isolate); |
+ DCHECK(args.length() == 1); |
+ CONVERT_ARG_CHECKED(Object, obj, 0); |
+ return isolate->heap()->ToBoolean(obj->IsSmi()); |
+} |
+ |
+ |
+RUNTIME_FUNCTION(RuntimeReference_IsNonNegativeSmi) { |
+ SealHandleScope shs(isolate); |
+ DCHECK(args.length() == 1); |
+ CONVERT_ARG_CHECKED(Object, obj, 0); |
+ return isolate->heap()->ToBoolean(obj->IsSmi() && |
+ Smi::cast(obj)->value() >= 0); |
+} |
} |
} // namespace v8::internal |