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

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

Issue 1162503002: Implement Atomics API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add more symbols to anonymous namespace Created 5 years, 7 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
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | test/mjsunit/asm/atomics-add.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | test/mjsunit/asm/atomics-add.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698