Chromium Code Reviews| Index: src/runtime/runtime-utils.h |
| diff --git a/src/runtime/runtime-utils.h b/src/runtime/runtime-utils.h |
| index 5cdf0430817a9769e018b3062b2fc1d50a8736e7..d6095b621159812a6ea1532739ea1a19c7b5c08f 100644 |
| --- a/src/runtime/runtime-utils.h |
| +++ b/src/runtime/runtime-utils.h |
| @@ -50,6 +50,13 @@ namespace internal { |
| // Cast the given object to a boolean and store it in a variable with |
| // the given name. If the object is not a boolean call IllegalOperation |
| // and return. |
| +#define CONVERT_INTPTR_ARG_CHECKED(name, index) \ |
|
Mircea Trofin
2016/07/12 02:49:13
Is the comment above still pertinent?
|
| + RUNTIME_ASSERT(args[index]->IsNumber()); \ |
| + intptr_t name = static_cast<intptr_t>(args.number_at(index)); |
| + |
| +// Cast the given object to a boolean and store it in a variable with |
| +// the given name. If the object is not a boolean call IllegalOperation |
| +// and return. |
| #define CONVERT_BOOLEAN_ARG_CHECKED(name, index) \ |
| RUNTIME_ASSERT(args[index]->IsBoolean()); \ |
| bool name = args[index]->IsTrue(isolate); |
| @@ -111,6 +118,13 @@ namespace internal { |
| int32_t name = 0; \ |
| RUNTIME_ASSERT(args[index]->ToInt32(&name)); |
| +// Assert that the given argument is a number within the Uint32 range |
| +// and convert it to uint32_t. If the argument is not an Uint32 call |
| +// IllegalOperation and return. |
| +#define CONVERT_UINT32_ARG_CHECKED(name, index) \ |
| + RUNTIME_ASSERT(args[index]->IsNumber()); \ |
| + uint32_t name = 0; \ |
| + RUNTIME_ASSERT(args[index]->ToUint32(&name)); |
| // Cast the given argument to PropertyAttributes and store its value in a |
| // variable with the given name. If the argument is not a Smi call or the |