Upgrade V8 to 5.1.281.57 DO NOT MERGE
FPIIM-449
Change-Id: Id981b686b4d587ac31697662eb98bb34be42ad90
(cherry picked from commit 3b9bc31999c9787eb726ecdbfd5796bfdec32a18)
diff --git a/src/runtime/runtime-utils.h b/src/runtime/runtime-utils.h
index c673b5a..17c78d5 100644
--- a/src/runtime/runtime-utils.h
+++ b/src/runtime/runtime-utils.h
@@ -5,19 +5,49 @@
#ifndef V8_RUNTIME_RUNTIME_UTILS_H_
#define V8_RUNTIME_RUNTIME_UTILS_H_
+#include "src/base/logging.h"
#include "src/runtime/runtime.h"
namespace v8 {
namespace internal {
-#define RUNTIME_ASSERT(value) \
- if (!(value)) return isolate->ThrowIllegalOperation();
+#ifdef DEBUG
+
+#define RUNTIME_ASSERT(value) \
+ do { \
+ if (!(value)) { \
+ V8_RuntimeError(__FILE__, __LINE__, #value); \
+ return isolate->ThrowIllegalOperation(); \
+ } \
+ } while (0)
+
+#define RUNTIME_ASSERT_HANDLIFIED(value, T) \
+ do { \
+ if (!(value)) { \
+ V8_RuntimeError(__FILE__, __LINE__, #value); \
+ isolate->ThrowIllegalOperation(); \
+ return MaybeHandle<T>(); \
+ } \
+ } while (0)
+
+#else
+
+#define RUNTIME_ASSERT(value) \
+ do { \
+ if (!(value)) { \
+ return isolate->ThrowIllegalOperation(); \
+ } \
+ } while (0)
#define RUNTIME_ASSERT_HANDLIFIED(value, T) \
- if (!(value)) { \
- isolate->ThrowIllegalOperation(); \
- return MaybeHandle<T>(); \
- }
+ do { \
+ if (!(value)) { \
+ isolate->ThrowIllegalOperation(); \
+ return MaybeHandle<T>(); \
+ } \
+ } while (0)
+
+#endif
// Cast the given object to a value of the specified type and store
// it in a variable with the given name. If the object is not of the