Revision: 14568
Author: [email protected]
Date: Tue May 7 05:02:15 2013
Log: Fix braindead Handle::is_identical_to
[email protected]
BUG=
Review URL: https://codereview.chromium.org/14660008
http://code.google.com/p/v8/source/detail?r=14568
Modified:
/branches/bleeding_edge/src/handles-inl.h
/branches/bleeding_edge/src/type-info.cc
=======================================
--- /branches/bleeding_edge/src/handles-inl.h Fri Apr 26 00:35:07 2013
+++ /branches/bleeding_edge/src/handles-inl.h Tue May 7 05:02:15 2013
@@ -53,8 +53,9 @@
template <typename T>
inline bool Handle<T>::is_identical_to(const Handle<T> other) const {
- ASSERT(location_ == NULL ||
- reinterpret_cast<Address>(*location_) != kZapValue);
+ ASSERT(location_ == NULL || !(*location_)->IsFailure());
+ 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));
return *location_ == *other.location_;
@@ -63,24 +64,22 @@
template <typename T>
inline T* Handle<T>::operator*() const {
- ASSERT(location_ != NULL);
- ASSERT(reinterpret_cast<Address>(*location_) != kHandleZapValue);
+ ASSERT(location_ != NULL && !(*location_)->IsFailure());
SLOW_ASSERT(IsDereferenceAllowed(false));
return *BitCast<T**>(location_);
}
template <typename T>
inline T** Handle<T>::location() const {
- ASSERT(location_ == NULL ||
- reinterpret_cast<Address>(*location_) != kZapValue);
- SLOW_ASSERT(IsDereferenceAllowed(false));
+ ASSERT(location_ == NULL || !(*location_)->IsFailure());
+ SLOW_ASSERT(location_ == NULL || IsDereferenceAllowed(false));
return location_;
}
#ifdef DEBUG
template <typename T>
bool Handle<T>::IsDereferenceAllowed(bool allow_deferred) const {
- if (location_ == NULL) return true;
+ ASSERT(location_ != NULL);
Object* object = *BitCast<T**>(location_);
if (object->IsSmi()) return true;
HeapObject* heap_object = HeapObject::cast(object);
=======================================
--- /branches/bleeding_edge/src/type-info.cc Thu May 2 08:40:07 2013
+++ /branches/bleeding_edge/src/type-info.cc Tue May 7 05:02:15 2013
@@ -67,7 +67,7 @@
isolate_(isolate),
zone_(zone) {
BuildDictionary(code);
- ASSERT(reinterpret_cast<Address>(*dictionary_.location()) !=
kHandleZapValue);
+ ASSERT(dictionary_->IsDictionary());
}
--
--
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.