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

Unified Diff: src/handles.cc

Issue 1235253007: Revert of [handles] Sanitize Handle and friends. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/handles.h ('k') | src/handles-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.cc
diff --git a/src/handles.cc b/src/handles.cc
index ca23a6f75f711d5fd00f142b0f53860b5fee0428..d4153159861bd21cf00b01f64d6f1bc23a087422 100644
--- a/src/handles.cc
+++ b/src/handles.cc
@@ -8,34 +8,6 @@
namespace v8 {
namespace internal {
-
-#ifdef DEBUG
-bool HandleBase::IsDereferenceAllowed(DereferenceCheckMode mode) const {
- DCHECK_NOT_NULL(location_);
- Object* object = *location_;
- if (object->IsSmi()) return true;
- HeapObject* heap_object = HeapObject::cast(object);
- Heap* heap = heap_object->GetHeap();
- Object** roots_array_start = heap->roots_array_start();
- if (roots_array_start <= location_ &&
- location_ < roots_array_start + Heap::kStrongRootListLength &&
- heap->RootCanBeTreatedAsConstant(
- static_cast<Heap::RootListIndex>(location_ - roots_array_start))) {
- return true;
- }
- if (!AllowHandleDereference::IsAllowed()) return false;
- if (mode == INCLUDE_DEFERRED_CHECK &&
- !AllowDeferredHandleDereference::IsAllowed()) {
- // Accessing cells, maps and internalized strings is safe.
- if (heap_object->IsCell()) return true;
- if (heap_object->IsMap()) return true;
- if (heap_object->IsInternalizedString()) return true;
- return !heap->isolate()->IsDeferredHandle(location_);
- }
- return true;
-}
-#endif
-
int HandleScope::NumberOfHandles(Isolate* isolate) {
HandleScopeImplementer* impl = isolate->handle_scope_implementer();
@@ -95,7 +67,7 @@
void HandleScope::ZapRange(Object** start, Object** end) {
DCHECK(end - start <= kHandleBlockSize);
for (Object** p = start; p != end; p++) {
- *reinterpret_cast<Address*>(p) = kHandleZapValue;
+ *reinterpret_cast<Address*>(p) = v8::internal::kHandleZapValue;
}
}
#endif
« no previous file with comments | « src/handles.h ('k') | src/handles-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698