Revision: 5536
Author: [email protected]
Date: Mon Sep 27 09:58:02 2010
Log: [Isolates] Add isolate parameter to handle constructor.
Review URL: http://codereview.chromium.org/3418033
http://code.google.com/p/v8/source/detail?r=5536
Modified:
/branches/experimental/isolates/src/api.cc
/branches/experimental/isolates/src/handles-inl.h
/branches/experimental/isolates/src/handles.h
=======================================
--- /branches/experimental/isolates/src/api.cc Fri Sep 24 17:27:22 2010
+++ /branches/experimental/isolates/src/api.cc Mon Sep 27 09:58:02 2010
@@ -486,7 +486,7 @@
i::Object** v8::HandleScope::CreateHandle(i::Object* value) {
- return i::HandleScope::CreateHandle(value);
+ return i::HandleScope::CreateHandle(value, i::Isolate::Current());
}
=======================================
--- /branches/experimental/isolates/src/handles-inl.h Wed Sep 1 10:01:38
2010
+++ /branches/experimental/isolates/src/handles-inl.h Mon Sep 27 09:58:02
2010
@@ -40,7 +40,14 @@
template<class T>
Handle<T>::Handle(T* obj) {
ASSERT(!obj->IsFailure());
- location_ = HandleScope::CreateHandle(obj);
+ location_ = HandleScope::CreateHandle(obj, Isolate::Current());
+}
+
+
+template<class T>
+Handle<T>::Handle(T* obj, Isolate* isolate) {
+ ASSERT(!obj->IsFailure());
+ location_ = HandleScope::CreateHandle(obj, isolate);
}
@@ -59,9 +66,10 @@
template <typename T>
-T** HandleScope::CreateHandle(T* value) {
+T** HandleScope::CreateHandle(T* value, Isolate* isolate) {
+ ASSERT(isolate == Isolate::Current());
v8::ImplementationUtilities::HandleScopeData* current =
- Isolate::Current()->handle_scope_data();
+ isolate->handle_scope_data();
internal::Object** cur = current->next;
if (cur == current->limit) cur = Extend();
=======================================
--- /branches/experimental/isolates/src/handles.h Wed Sep 1 10:01:38 2010
+++ /branches/experimental/isolates/src/handles.h Mon Sep 27 09:58:02 2010
@@ -44,6 +44,7 @@
public:
INLINE(explicit Handle(T** location)) { location_ = location; }
INLINE(explicit Handle(T* obj));
+ INLINE(Handle(T* obj, Isolate* isolate));
INLINE(Handle()) : location_(NULL) {}
@@ -118,7 +119,7 @@
// Creates a new handle with the given value.
template <typename T>
- static inline T** CreateHandle(T* value);
+ static inline T** CreateHandle(T* value, Isolate* isolate);
// Deallocates any extensions used by the current scope.
static void DeleteExtensions(Isolate* isolate);
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev