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

Unified Diff: include/v8.h

Issue 5107003: [Isolates] Cleanup of codepaths slowing down Dromaeo in browser. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/isolates
Patch Set: tiny fix Created 10 years 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 | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 7b954983af19a451f4a6d26710e81dca89c3d246..72a497d331485a6e078d50fc524a9dd531ffa060 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -436,7 +436,8 @@ class V8EXPORT HandleScope {
/**
* Creates a new handle with the given value.
*/
- static internal::Object** CreateHandle(internal::Object* value);
+ template <class T>
+ static internal::Object** CreateHandle(T* value);
private:
// Make it impossible to create heap-allocated or illegal handle
@@ -3499,8 +3500,7 @@ Local<T>::Local() : Handle<T>() { }
template <class T>
Local<T> Local<T>::New(Handle<T> that) {
if (that.IsEmpty()) return Local<T>();
- internal::Object** p = reinterpret_cast<internal::Object**>(*that);
- return Local<T>(reinterpret_cast<T*>(HandleScope::CreateHandle(*p)));
+ return Local<T>(reinterpret_cast<T*>(HandleScope::CreateHandle(*that)));
}
@@ -3647,7 +3647,7 @@ Local<Value> Object::UncheckedGetInternalField(int index) {
// value directly.
int offset = I::kJSObjectHeaderSize + (internal::kPointerSize * index);
O* value = I::ReadField<O*>(obj, offset);
- O** result = HandleScope::CreateHandle(value);
+ O** result = HandleScope::CreateHandle(reinterpret_cast<Value*>(&value));
return Local<Value>(reinterpret_cast<Value*>(result));
} else {
return Local<Value>();
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698