Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1225)

Unified Diff: src/runtime/runtime-utils.h

Issue 2137993003: [wasm] Adding feature to JIT a wasm function at runtime and hook up the compiled code into the indi… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Changed casting Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698