Remove "extra checks"
authorjochen <jochen@chromium.org>
Thu, 8 Jan 2015 16:29:27 +0000 (08:29 -0800)
committerCommit bot <commit-bot@chromium.org>
Thu, 8 Jan 2015 16:29:39 +0000 (16:29 +0000)
Instead, just use DCHECKs. The builders that want them in release mode
should already be useding dcheck_always_on anyways

BUG=none
R=machenbach@chromium.org
LOG=y

Review URL: https://codereview.chromium.org/841083002

Cr-Commit-Position: refs/heads/master@{#26001}

BUILD.gn
Makefile
build/features.gypi
src/api.h
src/base/logging.h
src/ia32/macro-assembler-ia32.cc
src/objects-inl.h
src/objects.cc
src/x64/macro-assembler-x64.cc
src/x87/macro-assembler-x87.cc

index 5a8cfbc6cf1185f26c20740eeec37e9a8abecd8f..58e6c38ee49823644590f8fe9e268b9cc950e079 100644 (file)
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -18,7 +18,6 @@ v8_interpreted_regexp = false
 v8_object_print = false
 v8_postmortem_support = false
 v8_use_snapshot = true
-v8_enable_extra_checks = is_debug
 v8_target_arch = cpu_arch
 v8_random_seed = "314159265"
 
@@ -82,9 +81,6 @@ config("features") {
   if (v8_enable_i18n_support == true) {
     defines += [ "V8_I18N_SUPPORT" ]
   }
-  if (v8_enable_extra_checks == true) {
-    defines += [ "ENABLE_EXTRA_CHECKS" ]
-  }
   if (v8_enable_handle_zapping == true) {
     defines += [ "ENABLE_HANDLE_ZAPPING" ]
   }
index 2cef1954ca1a413b7d06ec3512d30cfc897672a0..8bdfd9f86a4b2bea1bf298f128a8d91a2057cdb0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -85,10 +85,10 @@ ifeq ($(snapshot), external)
 endif
 # extrachecks=on/off
 ifeq ($(extrachecks), on)
-  GYPFLAGS += -Dv8_enable_extra_checks=1 -Dv8_enable_handle_zapping=1
+  GYPFLAGS += -Ddcheck_always_on=1 -Dv8_enable_handle_zapping=1
 endif
 ifeq ($(extrachecks), off)
-  GYPFLAGS += -Dv8_enable_extra_checks=0 -Dv8_enable_handle_zapping=0
+  GYPFLAGS += -Ddcheck_always_on=0 -Dv8_enable_handle_zapping=0
 endif
 # gdbjit=on/off
 ifeq ($(gdbjit), on)
index 25041ce42fde0b4f964e9f50f31c85b2cafb7cde..a3ee0fbbf08cd52e768984be9403ad8426c7eff3 100644 (file)
       'DebugBaseCommon': {
         'abstract': 1,
         'variables': {
-          'v8_enable_extra_checks%': 1,
           'v8_enable_handle_zapping%': 1,
         },
         'conditions': [
-          ['v8_enable_extra_checks==1', {
-            'defines': ['ENABLE_EXTRA_CHECKS',],
-          }],
           ['v8_enable_handle_zapping==1', {
             'defines': ['ENABLE_HANDLE_ZAPPING',],
           }],
       },  # Debug
       'Release': {
         'variables': {
-          'v8_enable_extra_checks%': 0,
           'v8_enable_handle_zapping%': 1,
         },
         'conditions': [
-          ['v8_enable_extra_checks==1', {
-            'defines': ['ENABLE_EXTRA_CHECKS',],
-          }],
           ['v8_enable_handle_zapping==1', {
             'defines': ['ENABLE_HANDLE_ZAPPING',],
           }],
index 5d846071b481d6c630308f67a4c9fe1068d22b0b..d2a120c92f8285cdac4fa7d23ab14366b60828a1 100644 (file)
--- a/src/api.h
+++ b/src/api.h
@@ -368,14 +368,14 @@ MAKE_TO_LOCAL(ExternalToLocal, JSObject, External)
 
 // Implementations of OpenHandle
 
-#define MAKE_OPEN_HANDLE(From, To)                                          \
-  v8::internal::Handle<v8::internal::To> Utils::OpenHandle(                 \
-    const v8::From* that, bool allow_empty_handle) {                        \
-    EXTRA_CHECK(allow_empty_handle || that != NULL);                        \
-    EXTRA_CHECK(that == NULL ||                                             \
-        (*reinterpret_cast<v8::internal::Object* const*>(that))->Is##To()); \
-    return v8::internal::Handle<v8::internal::To>(                          \
-        reinterpret_cast<v8::internal::To**>(const_cast<v8::From*>(that))); \
+#define MAKE_OPEN_HANDLE(From, To)                                             \
+  v8::internal::Handle<v8::internal::To> Utils::OpenHandle(                    \
+      const v8::From* that, bool allow_empty_handle) {                         \
+    DCHECK(allow_empty_handle || that != NULL);                                \
+    DCHECK(that == NULL ||                                                     \
+           (*reinterpret_cast<v8::internal::Object* const*>(that))->Is##To()); \
+    return v8::internal::Handle<v8::internal::To>(                             \
+        reinterpret_cast<v8::internal::To**>(const_cast<v8::From*>(that)));    \
   }
 
 OPEN_HANDLE_LIST(MAKE_OPEN_HANDLE)
index 323ff50c5bc70c9f550b7dc25b4d468406d4063c..e73fac46adc1b771ee44da70143d81cbb8ceae61 100644 (file)
@@ -214,12 +214,4 @@ void DumpBacktrace();
 
 #define DCHECK_NOT_NULL(p)  DCHECK_NE(NULL, p)
 
-// "Extra checks" are lightweight checks that are enabled in some release
-// builds.
-#ifdef ENABLE_EXTRA_CHECKS
-#define EXTRA_CHECK(condition) CHECK(condition)
-#else
-#define EXTRA_CHECK(condition) ((void) 0)
-#endif
-
 #endif  // V8_BASE_LOGGING_H_
index 38259d7651443aedf41b91042855635fda94ad2a..a3c235b79648151cce992737bd1a44296ca0b84e 100644 (file)
@@ -2183,7 +2183,7 @@ void MacroAssembler::CallApiFunctionAndReturn(
   j(not_equal, &promote_scheduled_exception);
   bind(&exception_handled);
 
-#if ENABLE_EXTRA_CHECKS
+#if DEBUG
   // Check if the function returned a valid JavaScript value.
   Label ok;
   Register return_value = eax;
index c0fa725a539e0002102460cb67978743de5c30e5..7a00868ece963490f23dd3adce5387b0810453c7 100644 (file)
@@ -2237,7 +2237,7 @@ bool Object::IsStringObjectWithCharacterAt(uint32_t index) {
 
 
 void Object::VerifyApiCallResultType() {
-#if ENABLE_EXTRA_CHECKS
+#if DEBUG
   if (!(IsSmi() ||
         IsString() ||
         IsSymbol() ||
@@ -2249,7 +2249,7 @@ void Object::VerifyApiCallResultType() {
         IsNull())) {
     FATAL("API call returned invalid object");
   }
-#endif  // ENABLE_EXTRA_CHECKS
+#endif  // DEBUG
 }
 
 
index 10ae80a37f0578790340843bc85ba14935a277f5..944b450ffa7dae2ce6ad4870f119d5ee274d3c76 100644 (file)
@@ -13539,10 +13539,8 @@ MaybeHandle<JSObject> JSObject::GetKeysForNamedInterceptor(
     result = args.Call(enum_fun);
   }
   if (result.IsEmpty()) return MaybeHandle<JSObject>();
-#if ENABLE_EXTRA_CHECKS
-  CHECK(v8::Utils::OpenHandle(*result)->IsJSArray() ||
-        v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
-#endif
+  DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() ||
+         v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
   // Rebox before returning.
   return handle(*v8::Utils::OpenHandle(*result), isolate);
 }
@@ -13564,10 +13562,8 @@ MaybeHandle<JSObject> JSObject::GetKeysForIndexedInterceptor(
     result = args.Call(enum_fun);
   }
   if (result.IsEmpty()) return MaybeHandle<JSObject>();
-#if ENABLE_EXTRA_CHECKS
-  CHECK(v8::Utils::OpenHandle(*result)->IsJSArray() ||
-        v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
-#endif
+  DCHECK(v8::Utils::OpenHandle(*result)->IsJSArray() ||
+         v8::Utils::OpenHandle(*result)->HasSloppyArgumentsElements());
   // Rebox before returning.
   return handle(*v8::Utils::OpenHandle(*result), isolate);
 }
index 5b897de545878f952b579e8b205b0fefb2062de0..b6378bf7d56311ba8716d5d8b8f19fd558a366fc 100644 (file)
@@ -799,7 +799,7 @@ void MacroAssembler::CallApiFunctionAndReturn(
   j(not_equal, &promote_scheduled_exception);
   bind(&exception_handled);
 
-#if ENABLE_EXTRA_CHECKS
+#if DEBUG
   // Check if the function returned a valid JavaScript value.
   Label ok;
   Register return_value = rax;
index 008b2af63d93394a5ad4790e364ee757f8282a7f..96a05908a4cdde9eafcb2ed4a9f85cb6d964e7a8 100644 (file)
@@ -2147,7 +2147,7 @@ void MacroAssembler::CallApiFunctionAndReturn(
   j(not_equal, &promote_scheduled_exception);
   bind(&exception_handled);
 
-#if ENABLE_EXTRA_CHECKS
+#if DEBUG
   // Check if the function returned a valid JavaScript value.
   Label ok;
   Register return_value = eax;