Reviewers: Yang,

Message:
PTAL

Description:
Cannot use Handle<T>::cast in Unique<T>::cast since it will try to do a T::cast (and its typecheck) concurrently, which is unsafe concurrently on moving values

BUG=

Please review this at https://codereview.chromium.org/1022943002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+4, -8 lines):
  M src/bootstrapper.cc
  M src/lookup.h
  M src/lookup.cc
  M src/unique.h


Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 4cdf2d605c0c55d1f5eb31e4ce2cb5124e1a855f..93fd25f5da5313370bc78f6bfa58ab395d8daa16 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2772,8 +2772,7 @@ void Genesis::TransferNamedProperties(Handle<JSObject> from,
                                               isolate());
         DCHECK(!value->IsCell());
         if (value->IsPropertyCell()) {
-          value = Handle<Object>(PropertyCell::cast(*value)->value(),
-                                 isolate());
+          value = handle(PropertyCell::cast(*value)->value(), isolate());
         }
         PropertyDetails details = properties->DetailsAt(i);
         DCHECK_EQ(kData, details.kind());
Index: src/lookup.cc
diff --git a/src/lookup.cc b/src/lookup.cc
index 2b69aa67959f957a0fc283a6b4d30892257ec081..929b022ed5faa5b14ff5b8d536a60e21d612d101 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -312,7 +312,7 @@ Handle<PropertyCell> LookupIterator::GetPropertyCell() const {
   Handle<GlobalObject> global = Handle<GlobalObject>::cast(holder);
Object* value = global->property_dictionary()->ValueAt(dictionary_entry());
   DCHECK(value->IsPropertyCell());
-  return Handle<PropertyCell>(PropertyCell::cast(value));
+  return handle(PropertyCell::cast(value));
 }


Index: src/lookup.h
diff --git a/src/lookup.h b/src/lookup.h
index e2237abd63ac3d6fdf0ae9a443008576be39c6c0..f658b1382904c352d12e92b7f74b7dcac3ed6e65 100644
--- a/src/lookup.h
+++ b/src/lookup.h
@@ -138,10 +138,6 @@ class LookupIterator FINAL BASE_EMBEDDED {
   int GetAccessorIndex() const;
   int GetConstantIndex() const;
   Handle<PropertyCell> GetPropertyCell() const;
-  Handle<PropertyCell> GetTransitionPropertyCell() const {
-    DCHECK_EQ(TRANSITION, state_);
-    return Handle<PropertyCell>::cast(transition_);
-  }
   Handle<Object> GetAccessors() const;
   Handle<Object> GetDataValue() const;
   // Usually returns the value that was passed in, but may perform
Index: src/unique.h
diff --git a/src/unique.h b/src/unique.h
index b56ee84a33695488d696aa89d3ea6e58361a0570..0517718246d429e53388980df90e457633daf69d 100644
--- a/src/unique.h
+++ b/src/unique.h
@@ -108,7 +108,8 @@ class Unique {
   }

   template <class S> static Unique<T> cast(Unique<S> that) {
-    return Unique<T>(that.raw_address_, Handle<T>::cast(that.handle_));
+    return Unique<T>(that.raw_address_,
+ Handle<T>(reinterpret_cast<T**>(that.handle_.location())));
   }

   inline bool IsInitialized() const {


--
--
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/d/optout.

Reply via email to