Lars spotted that Handle::operator -> and * are not inlined. That apparently buys...
authorantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 11 Jun 2009 19:44:48 +0000 (19:44 +0000)
committerantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 11 Jun 2009 19:44:48 +0000 (19:44 +0000)
speedup for some DOM operations.

Review URL: http://codereview.chromium.org/122038

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

include/v8.h

index 87ce2a2..e7b2677 100644 (file)
@@ -212,9 +212,9 @@ template <class T> class V8EXPORT_INLINE Handle {
    */
   bool IsEmpty() const { return val_ == 0; }
 
-  T* operator->() const;
+  T* operator->() const { return val_; }
 
-  T* operator*() const;
+  T* operator*() const { return val_; }
 
   /**
    * Sets the handle to be empty. IsEmpty() will then return true.
@@ -2509,18 +2509,6 @@ void Persistent<T>::ClearWeak() {
   V8::ClearWeak(reinterpret_cast<void**>(**this));
 }
 
-template <class T>
-T* Handle<T>::operator->() const {
-  return val_;
-}
-
-
-template <class T>
-T* Handle<T>::operator*() const {
-  return val_;
-}
-
-
 Local<Value> Arguments::operator[](int i) const {
   if (i < 0 || length_ <= i) return Local<Value>(*Undefined());
   return Local<Value>(reinterpret_cast<Value*>(values_ - i));