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

Unified Diff: src/handles-inl.h

Issue 3788008: [Isolates] Fix auto extraction of isolate from heap objects in handle constructor. (Closed)
Patch Set: Created 10 years, 2 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/handles.h ('k') | src/heap-inl.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 6e7c3d972434f16fb7ce410824e22112f1f8649e..cfe34f1230a899497bd622670300dc51e4541964 100644
--- a/src/handles-inl.h
+++ b/src/handles-inl.h
@@ -37,15 +37,18 @@
namespace v8 {
namespace internal {
-template<class T>
-Handle<T>::Handle(T* obj) {
- ASSERT(!obj->IsFailure());
- location_ = HandleScope::CreateHandle(obj, Isolate::Current());
+inline Isolate* GetIsolateForHandle(Object* obj) {
+ return Isolate::Current();
+}
+
+inline Isolate* GetIsolateForHandle(HeapObject* obj) {
+ return obj->GetIsolate();
}
template<class T>
-Handle<T>::Handle(HeapObject* obj) {
- location_ = HandleScope::CreateHandle<T>(obj, obj->GetIsolate());
+Handle<T>::Handle(T* obj) {
+ ASSERT(!obj->IsFailure());
+ location_ = HandleScope::CreateHandle(obj, GetIsolateForHandle(obj));
}
« no previous file with comments | « src/handles.h ('k') | src/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698