From d62f77fd2160333cd6d780552f6ef209c245aa8c Mon Sep 17 00:00:00 2001 From: "antonm@chromium.org" Date: Thu, 11 Jun 2009 19:44:48 +0000 Subject: [PATCH] Lars spotted that Handle::operator -> and * are not inlined. That apparently buys us almost ~10% 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 | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/include/v8.h b/include/v8.h index 87ce2a2..e7b2677 100644 --- a/include/v8.h +++ b/include/v8.h @@ -212,9 +212,9 @@ template 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::ClearWeak() { V8::ClearWeak(reinterpret_cast(**this)); } -template -T* Handle::operator->() const { - return val_; -} - - -template -T* Handle::operator*() const { - return val_; -} - - Local Arguments::operator[](int i) const { if (i < 0 || length_ <= i) return Local(*Undefined()); return Local(reinterpret_cast(values_ - i)); -- 2.7.4