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

Unified Diff: src/unique.h

Issue 1022943002: Cannot use Handle<T>::cast in Unique<T>::cast since it will try to do a T::cast (and its typecheck)… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Locally allow handle deref Created 5 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
« no previous file with comments | « src/lookup.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/unique.h
diff --git a/src/unique.h b/src/unique.h
index b56ee84a33695488d696aa89d3ea6e58361a0570..c04c966a4f9bc5f622c08c29d387039823e62c95 100644
--- a/src/unique.h
+++ b/src/unique.h
@@ -108,7 +108,12 @@ class Unique {
}
template <class S> static Unique<T> cast(Unique<S> that) {
- return Unique<T>(that.raw_address_, Handle<T>::cast(that.handle_));
+ // Allow fetching location() to unsafe-cast the handle. This is necessary
+ // since we can't concurrently safe-cast. Safe-casting requires looking at
+ // the heap which may be moving concurrently to the compiler thread.
+ AllowHandleDereference allow_deref;
+ return Unique<T>(that.raw_address_,
+ Handle<T>(reinterpret_cast<T**>(that.handle_.location())));
}
inline bool IsInitialized() const {
« no previous file with comments | « src/lookup.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698