Reviewers: jochen, danno,
Message:
PTAL
Description:
Revert "Introduce a handle zapping setting, and enable it by default for
release
and debug" due to performance impact.
Please review this at https://chromiumcodereview.appspot.com/18325027/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M Makefile
M build/common.gypi
M src/api.h
M src/api.cc
M src/global-handles.cc
M src/handles-inl.h
M src/handles.h
M src/handles.cc
Index: Makefile
diff --git a/Makefile b/Makefile
index
5c9b56bd6e4b1d9df924f2107e3a7a5aac853c2a..16c004f32d00d11ec16008323034f4baf4ada80c
100644
--- a/Makefile
+++ b/Makefile
@@ -80,13 +80,6 @@ endif
ifeq ($(extrachecks), off)
GYPFLAGS += -Dv8_enable_extra_checks=0
endif
-# handlezapping=on/off
-ifeq ($(handlezapping), on)
- GYPFLAGS += -Dv8_enable_handle_zapping=1
-endif
-ifeq ($(handlezapping), off)
- GYPFLAGS += -Dv8_enable_handle_zapping=0
-endif
# gdbjit=on/off
ifeq ($(gdbjit), on)
GYPFLAGS += -Dv8_enable_gdbjit=1
Index: build/common.gypi
diff --git a/build/common.gypi b/build/common.gypi
index
f73c8812f0a673ff81d812357120bb6bbf364fce..dbb33a867bfb9abd6aaeb88a542aa69b168c082d
100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -490,7 +490,6 @@
'Debug': {
'variables': {
'v8_enable_extra_checks%': 1,
- 'v8_enable_handle_zapping%': 1,
},
'defines': [
'DEBUG',
@@ -519,9 +518,6 @@
['v8_enable_extra_checks==1', {
'defines': ['ENABLE_EXTRA_CHECKS',],
}],
- ['v8_enable_handle_zapping==1', {
- 'defines': ['ENABLE_HANDLE_ZAPPING',],
- }],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or
OS=="netbsd"', {
'cflags':
[ '-Wall', '<(werror)', '-W', '-Wno-unused-parameter',
'-Wnon-virtual-dtor', '-Woverloaded-virtual' ],
@@ -554,15 +550,11 @@
'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',],
- }],
['OS=="linux" or OS=="freebsd" or OS=="openbsd" or
OS=="netbsd"', {
'cflags!': [
'-O2',
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index
4d654fb1efb667f8fc08aa366f64b705538e1431..c56bc05601e06f20607e0147b0eed429e5e28816
100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -7979,7 +7979,7 @@ DeferredHandles::~DeferredHandles() {
isolate_->UnlinkDeferredHandles(this);
for (int i = 0; i < blocks_.length(); i++) {
-#ifdef ENABLE_HANDLE_ZAPPING
+#ifdef ENABLE_EXTRA_CHECKS
HandleScope::ZapRange(blocks_[i], &blocks_[i][kHandleBlockSize]);
#endif
isolate_->handle_scope_implementer()->ReturnBlock(blocks_[i]);
Index: src/api.h
diff --git a/src/api.h b/src/api.h
index
85b280728bcbee2681e25b32dcdae89f2a7a2dbc..0f33bc815fe7bec76663be4ae7e2fb48dc558e50
100644
--- a/src/api.h
+++ b/src/api.h
@@ -665,22 +665,17 @@ 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_HANDLE_ZAPPING
+#ifdef ENABLE_EXTRA_CHECKS
internal::HandleScope::ZapRange(prev_limit, block_limit);
#endif
break;
}
#else
- if (prev_limit == block_limit) {
-#ifdef ENABLE_HANDLE_ZAPPING
- internal::HandleScope::ZapRange(prev_limit, block_limit);
-#endif
- break;
- }
+ if (prev_limit == block_limit) break;
#endif
blocks_.RemoveLast();
-#ifdef ENABLE_HANDLE_ZAPPING
+#ifdef ENABLE_EXTRA_CHECKS
internal::HandleScope::ZapRange(block_start, block_limit);
#endif
if (spare_ != NULL) {
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index
fa782245f2e4ded28f19ca0034a8ba16cfaaf608..5c65635d0f9f3c31f747656dee7ef4ac9bcbf20e
100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -78,7 +78,7 @@ class GlobalHandles::Node {
Internals::kNodeIsPartiallyDependentShift);
}
-#ifdef ENABLE_HANDLE_ZAPPING
+#ifdef ENABLE_EXTRA_CHECKS
~Node() {
// TODO(1428): if it's a weak handle we should have invoked its
callback.
// Zap the values for eager trapping.
@@ -117,7 +117,7 @@ class GlobalHandles::Node {
void Release() {
ASSERT(state() != FREE);
set_state(FREE);
-#ifdef ENABLE_HANDLE_ZAPPING
+#ifdef ENABLE_EXTRA_CHECKS
// Zap the values for eager trapping.
object_ = reinterpret_cast<Object*>(kGlobalHandleZapValue);
class_id_ = v8::HeapProfiler::kPersistentHandleNoClassId;
Index: src/handles-inl.h
diff --git a/src/handles-inl.h b/src/handles-inl.h
index
f427d1287eb90e7dff0f6d805083409ffa4f0700..4f4490b75bfa97d2c0aa0d0e03b3833f3a19c8fb
100644
--- a/src/handles-inl.h
+++ b/src/handles-inl.h
@@ -134,7 +134,7 @@ void HandleScope::CloseScope(Isolate* isolate,
DeleteExtensions(isolate);
}
-#ifdef ENABLE_HANDLE_ZAPPING
+#ifdef ENABLE_EXTRA_CHECKS
ZapRange(prev_next, prev_limit);
#endif
}
Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index
fdfc01a425df5280028db9fffaf83295b985c19d..fc45aaa8b6e0169b70672fd2dfde691813a66849
100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -101,7 +101,7 @@ void HandleScope::DeleteExtensions(Isolate* isolate) {
}
-#ifdef ENABLE_HANDLE_ZAPPING
+#ifdef ENABLE_EXTRA_CHECKS
void HandleScope::ZapRange(Object** start, Object** end) {
ASSERT(end - start <= kHandleBlockSize);
for (Object** p = start; p != end; p++) {
@@ -554,7 +554,7 @@ v8::Handle<v8::Array>
GetKeysForNamedInterceptor(Handle<JSReceiver> receiver,
LOG(isolate, ApiObjectAccess("interceptor-named-enum", *object));
result = args.Call(enum_fun);
}
-#if ENABLE_HANDLE_ZAPPING
+#if ENABLE_EXTRA_CHECKS
CHECK(result.IsEmpty() || v8::Utils::OpenHandle(*result)->IsJSObject());
#endif
return v8::Local<v8::Array>::New(reinterpret_cast<v8::Isolate*>(isolate),
@@ -575,7 +575,7 @@ v8::Handle<v8::Array>
GetKeysForIndexedInterceptor(Handle<JSReceiver> receiver,
v8::ToCData<v8::IndexedPropertyEnumerator>(interceptor->enumerator());
LOG(isolate, ApiObjectAccess("interceptor-indexed-enum", *object));
result = args.Call(enum_fun);
-#if ENABLE_HANDLE_ZAPPING
+#if ENABLE_EXTRA_CHECKS
CHECK(result.IsEmpty() ||
v8::Utils::OpenHandle(*result)->IsJSObject());
#endif
}
Index: src/handles.h
diff --git a/src/handles.h b/src/handles.h
index
5dd9fe72acc4974a2d97255584d17ee443b0e05c..140c34e9ba3d096bb538a22dba84e53a2e28b3c0
100644
--- a/src/handles.h
+++ b/src/handles.h
@@ -177,7 +177,7 @@ class HandleScope {
// Extend the handle scope making room for more handles.
static internal::Object** Extend(Isolate* isolate);
-#ifdef ENABLE_HANDLE_ZAPPING
+#ifdef ENABLE_EXTRA_CHECKS
// Zaps the handles in the half-open interval [start, end).
static void ZapRange(Object** start, Object** end);
#endif
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.