Reviewers: Sven Panne,

Description:
remove V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT and
V8_ALLOW_ACCESS_TO_PERSISTENT_ARROW

[email protected]
BUG=

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

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M include/v8.h
  M src/api.cc
  M src/global-handles.cc
  M test/cctest/test-api.cc


Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 5b0b30493b29dd73e95b6fdb06403f8030cc46da..54b513a0220e4b6012c723d7e0bc5ad7749aee4b 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -764,10 +764,7 @@ template <class T> class Persistent // NOLINT

 #ifndef V8_USE_UNSAFE_HANDLES

-#ifndef V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT
-
  private:
-#endif
   // TODO(dcarney): make unlinkable before cutover
   V8_INLINE(Persistent(const Persistent& that)) : val_(that.val_) {}
   // TODO(dcarney): make unlinkable before cutover
@@ -790,11 +787,8 @@ template <class T> class Persistent // NOLINT
   }
   // TODO(dcarney): remove before cutover
   V8_INLINE(T* operator*() const) { return val_; }
- public:
-#ifndef V8_ALLOW_ACCESS_TO_PERSISTENT_ARROW

  private:
-#endif
   // TODO(dcarney): remove before cutover
   V8_INLINE(T* operator->() const) { return val_; }
  public:
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 77c3088a0d2ffa45c54195450c5f1251dced4a7d..0755ae1926ba39ec314689ca355010816086716e 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -25,9 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-// TODO(dcarney): remove
-#define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT
-
 #include "api.h"

 #include <string.h>  // For memcpy, strlen.
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 20a258c5b4899bd8ca01cf752696cb57d51fb634..b601e999002319e47694ffddd73ec7e5423e9bb1 100644
--- a/src/global-handles.cc
+++ b/src/global-handles.cc
@@ -25,9 +25,6 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-// TODO(dcarney): remove
-#define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT
-
 #include "v8.h"

 #include "api.h"
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index 9eecf945b4d3f991d969b5f53857693a5c8c0b3f..26a9207f7cef8557b07c88590cc235e698bb85ad 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -4350,7 +4350,7 @@ THREADED_TEST(Equality) {

   v8::Handle<v8::Object> obj = v8::Object::New();
   v8::Persistent<v8::Object> alias(isolate, obj);
-  CHECK(alias->StrictEquals(obj));
+  CHECK(v8::Local<v8::Object>::New(isolate, alias)->StrictEquals(obj));
   alias.Dispose(isolate);
 }

@@ -6084,7 +6084,8 @@ v8::Handle<Value> WhammyPropertyGetter(Local<String> name,

   v8::Handle<v8::Object> obj = v8::Object::New();
   if (!prev.IsEmpty()) {
-    prev->Set(v8_str("next"), obj);
+    v8::Local<v8::Object>::New(info.GetIsolate(), prev)
+        ->Set(v8_str("next"), obj);
     prev.MakeWeak<Value, Snorkel>(info.GetIsolate(),
                                   new Snorkel(),
                                   &HandleWeakReference);
@@ -6237,10 +6238,11 @@ THREADED_TEST(IndependentHandleRevival) {
   v8::Persistent<v8::Object> object;
   {
     v8::HandleScope handle_scope(isolate);
-    object.Reset(isolate, v8::Object::New());
-    object->Set(v8_str("x"), v8::Integer::New(1));
+    v8::Local<v8::Object> o = v8::Object::New();
+    object.Reset(isolate, o);
+    o->Set(v8_str("x"), v8::Integer::New(1));
     v8::Local<String> y_str = v8_str("y");
-    object->Set(y_str, y_str);
+    o->Set(y_str, y_str);
   }
   bool revived = false;
   object.MakeWeak(isolate, &revived, &RevivingCallback);
@@ -6250,9 +6252,10 @@ THREADED_TEST(IndependentHandleRevival) {
   HEAP->CollectAllGarbage(i::Heap::kAbortIncrementalMarkingMask);
   {
     v8::HandleScope handle_scope(isolate);
+    v8::Local<v8::Object> o = v8::Local<v8::Object>::New(isolate, object);
     v8::Local<String> y_str = v8_str("y");
-    CHECK_EQ(v8::Integer::New(1), object->Get(v8_str("x")));
-    CHECK(object->Get(y_str)->Equals(y_str));
+    CHECK_EQ(v8::Integer::New(1), o->Get(v8_str("x")));
+    CHECK(o->Get(y_str)->Equals(y_str));
   }
 }

@@ -12465,10 +12468,13 @@ THREADED_TEST(DisposeEnteredContext) {
   }
   v8::HandleScope scope(isolate);
   {
-    inner->Enter();
-    inner.Dispose(inner->GetIsolate());
+    // Don't want a handle here, so do this unsafely
+    v8::Handle<v8::Context> inner_local =
+        *reinterpret_cast<v8::Handle<v8::Context>*>(&inner);
+    inner_local->Enter();
+    inner.Dispose();
     inner.Clear();
-    inner->Exit();
+    inner_local->Exit();
   }
 }

@@ -12487,7 +12493,8 @@ THREADED_TEST(Regress54) {
     local->SetInternalFieldCount(1);
     templ.Reset(isolate, inner.Close(local));
   }
-  v8::Handle<v8::Object> result = templ->NewInstance();
+  v8::Handle<v8::Object> result =
+      v8::Local<v8::ObjectTemplate>::New(isolate, templ)->NewInstance();
   CHECK_EQ(1, result->InternalFieldCount());
 }

@@ -17148,10 +17155,10 @@ TEST(RunTwoIsolatesOnSingleThread) {

   {
     v8::Isolate::Scope iscope(isolate2);
-    context2.Dispose(context2->GetIsolate());
+    context2.Dispose();
   }

-  context1.Dispose(context1->GetIsolate());
+  context1.Dispose();
   isolate1->Exit();

   v8::V8::SetFatalErrorHandler(StoringErrorCallback);


--
--
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.


Reply via email to