Revision: 14956
Author: [email protected]
Date: Wed Jun 5 08:35:14 2013
Log: Cosmetic change to the handle dereference check.
[email protected]
BUG=
Review URL: https://chromiumcodereview.appspot.com/16171017
http://code.google.com/p/v8/source/detail?r=14956
Modified:
/branches/bleeding_edge/src/handles-inl.h
/branches/bleeding_edge/src/handles.h
=======================================
--- /branches/bleeding_edge/src/handles-inl.h Tue Jun 4 01:06:53 2013
+++ /branches/bleeding_edge/src/handles-inl.h Wed Jun 5 08:35:14 2013
@@ -57,7 +57,8 @@
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 @@
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 @@
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;
=======================================
--- /branches/bleeding_edge/src/handles.h Tue Jun 4 01:06:53 2013
+++ /branches/bleeding_edge/src/handles.h Wed Jun 5 08:35:14 2013
@@ -85,7 +85,9 @@
inline Handle<T> EscapeFrom(v8::HandleScope* scope);
#ifdef DEBUG
- bool IsDereferenceAllowed(bool explicitly_allow_deferred) const;
+ enum DereferenceCheckMode { INCLUDE_DEFERRED_CHECK, NO_DEFERRED_CHECK };
+
+ bool IsDereferenceAllowed(DereferenceCheckMode mode) const;
#endif // DEBUG
private:
--
--
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.