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

Unified Diff: src/handles-inl.h

Issue 222163002: Introduce MaybeHandle to police exception checking in handlified code. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: renamed to MaybeHandle and added template Throw Created 6 years, 9 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
« src/handles.h ('K') | « src/handles.h ('k') | src/isolate.h » ('j') | 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 19a02cca9ae9b32871dffd6258db0bcec339ea49..612024a67b60d2bbfca711fd39170923f83c6438 100644
--- a/src/handles-inl.h
+++ b/src/handles-inl.h
@@ -40,54 +40,54 @@ namespace internal {
template<typename T>
Handle<T>::Handle(T* obj) {
ASSERT(!obj->IsFailure());
- location_ = HandleScope::CreateHandle(obj->GetIsolate(), obj);
+ this->location_ = HandleScope::CreateHandle(obj->GetIsolate(), obj);
}
template<typename T>
Handle<T>::Handle(T* obj, Isolate* isolate) {
ASSERT(!obj->IsFailure());
- location_ = HandleScope::CreateHandle(isolate, obj);
+ this->location_ = HandleScope::CreateHandle(isolate, obj);
}
template <typename T>
inline bool Handle<T>::is_identical_to(const Handle<T> o) const {
- ASSERT(location_ == NULL || !(*location_)->IsFailure());
+ ASSERT(this->location_ == NULL || !(*this->location_)->IsFailure());
// Dereferencing deferred handles to check object equality is safe.
SLOW_ASSERT(
- (location_ == NULL || IsDereferenceAllowed(NO_DEFERRED_CHECK)) &&
+ (this->location_ == NULL || IsDereferenceAllowed(NO_DEFERRED_CHECK)) &&
(o.location_ == NULL || o.IsDereferenceAllowed(NO_DEFERRED_CHECK)));
- if (location_ == o.location_) return true;
- if (location_ == NULL || o.location_ == NULL) return false;
- return *location_ == *o.location_;
+ if (this->location_ == o.location_) return true;
+ if (this->location_ == NULL || o.location_ == NULL) return false;
+ return *this->location_ == *o.location_;
}
template <typename T>
inline T* Handle<T>::operator*() const {
- ASSERT(location_ != NULL && !(*location_)->IsFailure());
+ ASSERT(this->location_ != NULL && !(*this->location_)->IsFailure());
SLOW_ASSERT(IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK));
- return *BitCast<T**>(location_);
+ return *BitCast<T**>(this->location_);
}
template <typename T>
inline T** Handle<T>::location() const {
- ASSERT(location_ == NULL || !(*location_)->IsFailure());
- SLOW_ASSERT(location_ == NULL ||
+ ASSERT(this->location_ == NULL || !(*this->location_)->IsFailure());
+ SLOW_ASSERT(this->location_ == NULL ||
IsDereferenceAllowed(INCLUDE_DEFERRED_CHECK));
- return location_;
+ return this->location_;
}
#ifdef DEBUG
template <typename T>
bool Handle<T>::IsDereferenceAllowed(DereferenceCheckMode mode) const {
- ASSERT(location_ != NULL);
- Object* object = *BitCast<T**>(location_);
+ ASSERT(this->location_ != NULL);
+ Object* object = *BitCast<T**>(this->location_);
if (object->IsSmi()) return true;
HeapObject* heap_object = HeapObject::cast(object);
Heap* heap = heap_object->GetHeap();
- Object** handle = reinterpret_cast<Object**>(location_);
+ Object** handle = reinterpret_cast<Object**>(this->location_);
Object** roots_array_start = heap->roots_array_start();
if (roots_array_start <= handle &&
handle < roots_array_start + Heap::kStrongRootListLength &&
« src/handles.h ('K') | « src/handles.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698