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

Unified Diff: src/handles-inl.h

Issue 16171017: Cosmetic change to the handle dereference check. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles-inl.h
diff --git a/src/handles-inl.h b/src/handles-inl.h
index 9d38f3891034695322c14b0d132b73f2db1eff8e..4f4490b75bfa97d2c0aa0d0e03b3833f3a19c8fb 100644
--- a/src/handles-inl.h
+++ b/src/handles-inl.h
@@ -57,7 +57,8 @@ inline bool Handle<T>::is_identical_to(const Handle<T> other) const {
if (location_ == other.location_) return true;
if (location_ == NULL || other.location_ == NULL) return false;
// Dereferencing deferred handles to check object equality is safe.
- SLOW_ASSERT(IsDereferenceAllowed(true) && other.IsDereferenceAllowed(true));
+ SLOW_ASSERT(IsDereferenceAllowed(NO_DEFERRED_CHECK) &&
+ other.IsDereferenceAllowed(NO_DEFERRED_CHECK));
return *location_ == *other.location_;
}
@@ -65,20 +66,21 @@ inline bool Handle<T>::is_identical_to(const Handle<T> other) const {
template <typename T>
inline T* Handle<T>::operator*() const {
ASSERT(location_ != NULL && !(*location_)->IsFailure());
- SLOW_ASSERT(IsDereferenceAllowed(false));
+ SLOW_ASSERT(IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK));
return *BitCast<T**>(location_);
}
template <typename T>
inline T** Handle<T>::location() const {
ASSERT(location_ == NULL || !(*location_)->IsFailure());
- SLOW_ASSERT(location_ == NULL || IsDereferenceAllowed(false));
+ SLOW_ASSERT(location_ == NULL ||
+ IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK));
return location_;
}
#ifdef DEBUG
template <typename T>
-bool Handle<T>::IsDereferenceAllowed(bool explicitly_allow_deferred) const {
+bool Handle<T>::IsDereferenceAllowed(DereferenceCheckMode mode) const {
ASSERT(location_ != NULL);
Object* object = *BitCast<T**>(location_);
if (object->IsSmi()) return true;
@@ -91,7 +93,7 @@ bool Handle<T>::IsDereferenceAllowed(bool explicitly_allow_deferred) const {
return true;
}
if (!AllowHandleDereference::IsAllowed()) return false;
- if (!explicitly_allow_deferred &&
+ if (mode == INCLUDE_DEFERRED_CHECK &&
!AllowDeferredHandleDereference::IsAllowed()) {
// Accessing maps and internalized strings is safe.
if (heap_object->IsMap()) return true;
« no previous file with comments | « src/handles.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698