Split extra checks into extra checks and handle zapping
authorjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 30 Sep 2013 11:56:52 +0000 (11:56 +0000)
committerjochen@chromium.org <jochen@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 30 Sep 2013 11:56:52 +0000 (11:56 +0000)
That will make it easier to turn on handle zapping alone and experiment
with it.

R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17004 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

Makefile
build/features.gypi
src/api.cc
src/api.h
src/global-handles.cc
src/handles-inl.h
src/handles.cc
src/handles.h

index bcf3bcca0d11c906be7e829ef66f6c7ed850db6d..9c4326ae9882988cf6a2f992b21f7cb7cef40620 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -76,10 +76,10 @@ ifeq ($(snapshot), off)
 endif
 # extrachecks=on/off
 ifeq ($(extrachecks), on)
-  GYPFLAGS += -Dv8_enable_extra_checks=1
+  GYPFLAGS += -Dv8_enable_extra_checks=1 -Dv8_enable_handle_zapping=1
 endif
 ifeq ($(extrachecks), off)
-  GYPFLAGS += -Dv8_enable_extra_checks=0
+  GYPFLAGS += -Dv8_enable_extra_checks=0 -Dv8_enable_handle_zapping=0
 endif
 # gdbjit=on/off
 ifeq ($(gdbjit), on)
index 5343284dbc987958368807f65a797af134d6a2cf..8ef58a9d4677854247654ea817d0101a049cc398 100644 (file)
       'Debug': {
         '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%': 0,
         },
         'conditions': [
           ['v8_enable_extra_checks==1', {
             'defines': ['ENABLE_EXTRA_CHECKS',],
           }],
+          ['v8_enable_handle_zapping==1', {
+            'defines': ['ENABLE_HANDLE_ZAPPING',],
+          }],
         ],  # conditions
       },  # Release
     },  # configurations
index 3f31556d4cf24e4ff61c1fa4baee6636717f2bea..544a083079edbedc021c94576d54f4a78ff225ff 100644 (file)
@@ -7525,7 +7525,7 @@ DeferredHandles::~DeferredHandles() {
   isolate_->UnlinkDeferredHandles(this);
 
   for (int i = 0; i < blocks_.length(); i++) {
-#ifdef ENABLE_EXTRA_CHECKS
+#ifdef ENABLE_HANDLE_ZAPPING
     HandleScope::ZapRange(blocks_[i], &blocks_[i][kHandleBlockSize]);
 #endif
     isolate_->handle_scope_implementer()->ReturnBlock(blocks_[i]);
index 8fb17a07b61c0d312edf4f0b82be30a95c6a2a1f..9197bafbc52331785f8d636b732a68e61281ba47 100644 (file)
--- a/src/api.h
+++ b/src/api.h
@@ -667,7 +667,7 @@ void HandleScopeImplementer::DeleteExtensions(internal::Object** prev_limit) {
 #ifdef DEBUG
     // SealHandleScope may make the prev_limit to point inside the block.
     if (block_start <= prev_limit && prev_limit <= block_limit) {
-#ifdef ENABLE_EXTRA_CHECKS
+#ifdef ENABLE_HANDLE_ZAPPING
       internal::HandleScope::ZapRange(prev_limit, block_limit);
 #endif
       break;
@@ -677,7 +677,7 @@ void HandleScopeImplementer::DeleteExtensions(internal::Object** prev_limit) {
 #endif
 
     blocks_.RemoveLast();
-#ifdef ENABLE_EXTRA_CHECKS
+#ifdef ENABLE_HANDLE_ZAPPING
     internal::HandleScope::ZapRange(block_start, block_limit);
 #endif
     if (spare_ != NULL) {
index 1a98e49ff375a055babc8a0394301128273ad22f..2ebe1c0088fb7d5b865460feb50549c0a0d18157 100644 (file)
@@ -79,7 +79,7 @@ class GlobalHandles::Node {
                   Internals::kNodeIsPartiallyDependentShift);
   }
 
-#ifdef ENABLE_EXTRA_CHECKS
+#ifdef ENABLE_HANDLE_ZAPPING
   ~Node() {
     // TODO(1428): if it's a weak handle we should have invoked its callback.
     // Zap the values for eager trapping.
index 185280887ad14b5c52cd2712b7c9c2e39f03f45d..ec69c3fdbe61dc7283a8d075942faa2eaa1394bb 100644 (file)
@@ -135,7 +135,7 @@ void HandleScope::CloseScope(Isolate* isolate,
   if (current->limit != prev_limit) {
     current->limit = prev_limit;
     DeleteExtensions(isolate);
-#ifdef ENABLE_EXTRA_CHECKS
+#ifdef ENABLE_HANDLE_ZAPPING
     ZapRange(current->next, prev_limit);
   } else {
     ZapRange(current->next, prev_next);
index 6b9025dbf6306da14897b1e4656e45e7bb2aebf0..054dde38eb6ca149cfe7cbbf01c8acde9313c6f2 100644 (file)
@@ -101,7 +101,7 @@ void HandleScope::DeleteExtensions(Isolate* isolate) {
 }
 
 
-#ifdef ENABLE_EXTRA_CHECKS
+#ifdef ENABLE_HANDLE_ZAPPING
 void HandleScope::ZapRange(Object** start, Object** end) {
   ASSERT(end - start <= kHandleBlockSize);
   for (Object** p = start; p != end; p++) {
index 0f619d572e3e7f7b6ddee2929f4d3951cdeba339..05b0c5ed036be720324c43e1229832d9271838ce 100644 (file)
@@ -177,7 +177,7 @@ class HandleScope {
   // Extend the handle scope making room for more handles.
   static internal::Object** Extend(Isolate* isolate);
 
-#ifdef ENABLE_EXTRA_CHECKS
+#ifdef ENABLE_HANDLE_ZAPPING
   // Zaps the handles in the half-open interval [start, end).
   static void ZapRange(Object** start, Object** end);
 #endif