Index: src/runtime/runtime-utils.h |
diff --git a/src/runtime/runtime-utils.h b/src/runtime/runtime-utils.h |
index 3fe32975e678d4f2687ccc5fbf4c3ad6ad345728..4b072b1eb600f1f0998ff5ec291dae6c5821c7d5 100644 |
--- a/src/runtime/runtime-utils.h |
+++ b/src/runtime/runtime-utils.h |
@@ -55,6 +55,17 @@ namespace internal { |
RUNTIME_ASSERT(args[index]->IsNumber()); \ |
double name = args.number_at(index); |
+ |
+// Cast the given argument to a size_t and store its value in a variable with |
+// the given name. If the argument is not a size_t call IllegalOperation and |
+// return. |
+#define CONVERT_SIZE_ARG_CHECKED(name, index) \ |
+ RUNTIME_ASSERT(args[index]->IsNumber()); \ |
+ Handle<Object> name##_object = args.at<Object>(index); \ |
+ size_t name = 0; \ |
+ RUNTIME_ASSERT(TryNumberToSize(isolate, *name##_object, &name)); |
+ |
+ |
// Call the specified converter on the object *comand store the result in |
// a variable of the specified type with the given name. If the |
// object is not a Number call IllegalOperation and return. |