[v8] use toV8Fast in hand coded callbacks
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 13:48:31 +0000 (13:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Feb 2013 13:48:31 +0000 (13:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=108817

Patch by Dan Carney <dcarney@google.com> on 2013-02-04
Reviewed by Kentaro Hara.

No new tests. No change in functionality.

* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::openCallback):
(WebCore::V8DOMWindow::indexedPropertyGetter):
(WebCore::V8DOMWindow::namedPropertyGetter):
* bindings/v8/custom/V8DocumentCustom.cpp:
(WebCore::V8Document::evaluateCallback):
* bindings/v8/custom/V8DocumentLocationCustom.cpp:
(WebCore::V8Document::locationAccessorGetter):
* bindings/v8/custom/V8EventCustom.cpp:
(WebCore::V8Event::dataTransferAccessorGetter):
(WebCore::V8Event::clipboardDataAccessorGetter):
* bindings/v8/custom/V8FileReaderCustom.cpp:
(WebCore::V8FileReader::resultAccessorGetter):
* bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
(WebCore):
(WebCore::getNamedItems):
(WebCore::getItem):
(WebCore::V8HTMLAllCollection::namedPropertyGetter):
(WebCore::V8HTMLAllCollection::itemCallback):
(WebCore::V8HTMLAllCollection::namedItemCallback):
(WebCore::V8HTMLAllCollection::callAsFunctionCallback):
* bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
(WebCore::V8HTMLCanvasElement::getContextCallback):
* bindings/v8/custom/V8HTMLCollectionCustom.cpp:
(WebCore::V8HTMLCollection::namedPropertyGetter):
* bindings/v8/custom/V8HTMLElementCustom.cpp:
(WebCore::V8HTMLElement::itemValueAccessorGetter):
* bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp:
(WebCore):
(WebCore::getNamedItems):
(WebCore::V8HTMLFormControlsCollection::namedPropertyGetter):
(WebCore::V8HTMLFormControlsCollection::namedItemCallback):
* bindings/v8/custom/V8HTMLFormElementCustom.cpp:
(WebCore::V8HTMLFormElement::indexedPropertyGetter):
(WebCore::V8HTMLFormElement::namedPropertyGetter):
* bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp:
(WebCore::V8HTMLFrameSetElement::namedPropertyGetter):
* bindings/v8/custom/V8HTMLLinkElementCustom.cpp:
(WebCore::V8HTMLLinkElement::sizesAccessorGetter):
* bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
(WebCore):
(WebCore::getNamedItems):
(WebCore::V8HTMLOptionsCollection::namedPropertyGetter):
(WebCore::V8HTMLOptionsCollection::namedItemCallback):
(WebCore::V8HTMLOptionsCollection::indexedPropertyGetter):
* bindings/v8/custom/V8HTMLSelectElementCustom.cpp:
(WebCore::V8HTMLSelectElement::indexedPropertyGetter):
* bindings/v8/custom/V8MessageEventCustom.cpp:
(WebCore::V8MessageEvent::dataAccessorGetter):
(WebCore::V8MessageEvent::portsAccessorGetter):
* bindings/v8/custom/V8NamedNodeMapCustom.cpp:
(WebCore::V8NamedNodeMap::indexedPropertyGetter):
(WebCore::V8NamedNodeMap::namedPropertyGetter):
* bindings/v8/custom/V8NodeListCustom.cpp:
(WebCore::V8NodeList::namedPropertyGetter):
* bindings/v8/custom/V8PopStateEventCustom.cpp:
(WebCore::V8PopStateEvent::stateAccessorGetter):
* bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
(WebCore::V8SQLTransactionSync::executeSqlCallback):
* bindings/v8/custom/V8StyleSheetListCustom.cpp:
(WebCore::V8StyleSheetList::namedPropertyGetter):
* bindings/v8/custom/V8TrackEventCustom.cpp:
(WebCore::V8TrackEvent::trackAccessorGetter):
* bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
(WebCore::V8XMLHttpRequest::responseAccessorGetter):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141763 268f45cc-cd09-0410-ab3c-d52691b4dbfc

24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp
Source/WebCore/bindings/v8/custom/V8DocumentLocationCustom.cpp
Source/WebCore/bindings/v8/custom/V8EventCustom.cpp
Source/WebCore/bindings/v8/custom/V8FileReaderCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLAllCollectionCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLCanvasElementCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLCollectionCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLElementCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLFormElementCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLLinkElementCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp
Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp
Source/WebCore/bindings/v8/custom/V8NamedNodeMapCustom.cpp
Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp
Source/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp
Source/WebCore/bindings/v8/custom/V8SQLTransactionSyncCustom.cpp
Source/WebCore/bindings/v8/custom/V8StyleSheetListCustom.cpp
Source/WebCore/bindings/v8/custom/V8TrackEventCustom.cpp
Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp

index 68b8840b7228434b07851547b47c370776109210..b281b07dc0b1563362c6db072c688299ac49142d 100644 (file)
@@ -1,3 +1,78 @@
+2013-02-04  Dan Carney  <dcarney@google.com>
+
+        [v8] use toV8Fast in hand coded callbacks
+        https://bugs.webkit.org/show_bug.cgi?id=108817
+
+        Reviewed by Kentaro Hara.
+
+        No new tests. No change in functionality.
+
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::openCallback):
+        (WebCore::V8DOMWindow::indexedPropertyGetter):
+        (WebCore::V8DOMWindow::namedPropertyGetter):
+        * bindings/v8/custom/V8DocumentCustom.cpp:
+        (WebCore::V8Document::evaluateCallback):
+        * bindings/v8/custom/V8DocumentLocationCustom.cpp:
+        (WebCore::V8Document::locationAccessorGetter):
+        * bindings/v8/custom/V8EventCustom.cpp:
+        (WebCore::V8Event::dataTransferAccessorGetter):
+        (WebCore::V8Event::clipboardDataAccessorGetter):
+        * bindings/v8/custom/V8FileReaderCustom.cpp:
+        (WebCore::V8FileReader::resultAccessorGetter):
+        * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
+        (WebCore):
+        (WebCore::getNamedItems):
+        (WebCore::getItem):
+        (WebCore::V8HTMLAllCollection::namedPropertyGetter):
+        (WebCore::V8HTMLAllCollection::itemCallback):
+        (WebCore::V8HTMLAllCollection::namedItemCallback):
+        (WebCore::V8HTMLAllCollection::callAsFunctionCallback):
+        * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
+        (WebCore::V8HTMLCanvasElement::getContextCallback):
+        * bindings/v8/custom/V8HTMLCollectionCustom.cpp:
+        (WebCore::V8HTMLCollection::namedPropertyGetter):
+        * bindings/v8/custom/V8HTMLElementCustom.cpp:
+        (WebCore::V8HTMLElement::itemValueAccessorGetter):
+        * bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp:
+        (WebCore):
+        (WebCore::getNamedItems):
+        (WebCore::V8HTMLFormControlsCollection::namedPropertyGetter):
+        (WebCore::V8HTMLFormControlsCollection::namedItemCallback):
+        * bindings/v8/custom/V8HTMLFormElementCustom.cpp:
+        (WebCore::V8HTMLFormElement::indexedPropertyGetter):
+        (WebCore::V8HTMLFormElement::namedPropertyGetter):
+        * bindings/v8/custom/V8HTMLFrameSetElementCustom.cpp:
+        (WebCore::V8HTMLFrameSetElement::namedPropertyGetter):
+        * bindings/v8/custom/V8HTMLLinkElementCustom.cpp:
+        (WebCore::V8HTMLLinkElement::sizesAccessorGetter):
+        * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
+        (WebCore):
+        (WebCore::getNamedItems):
+        (WebCore::V8HTMLOptionsCollection::namedPropertyGetter):
+        (WebCore::V8HTMLOptionsCollection::namedItemCallback):
+        (WebCore::V8HTMLOptionsCollection::indexedPropertyGetter):
+        * bindings/v8/custom/V8HTMLSelectElementCustom.cpp:
+        (WebCore::V8HTMLSelectElement::indexedPropertyGetter):
+        * bindings/v8/custom/V8MessageEventCustom.cpp:
+        (WebCore::V8MessageEvent::dataAccessorGetter):
+        (WebCore::V8MessageEvent::portsAccessorGetter):
+        * bindings/v8/custom/V8NamedNodeMapCustom.cpp:
+        (WebCore::V8NamedNodeMap::indexedPropertyGetter):
+        (WebCore::V8NamedNodeMap::namedPropertyGetter):
+        * bindings/v8/custom/V8NodeListCustom.cpp:
+        (WebCore::V8NodeList::namedPropertyGetter):
+        * bindings/v8/custom/V8PopStateEventCustom.cpp:
+        (WebCore::V8PopStateEvent::stateAccessorGetter):
+        * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
+        (WebCore::V8SQLTransactionSync::executeSqlCallback):
+        * bindings/v8/custom/V8StyleSheetListCustom.cpp:
+        (WebCore::V8StyleSheetList::namedPropertyGetter):
+        * bindings/v8/custom/V8TrackEventCustom.cpp:
+        (WebCore::V8TrackEvent::trackAccessorGetter):
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::V8XMLHttpRequest::responseAccessorGetter):
+
 2013-02-04  David Kilzer  <ddkilzer@apple.com>
 
         Remove duplicate entry from WebCore Xcode project
index 6139dd0bbdb87dac59c9c89fd276023f6f8c96aa..3e087fc7b52c2fb57356c5ce2ab943d426550da4 100644 (file)
@@ -435,7 +435,7 @@ v8::Handle<v8::Value> V8DOMWindow::openCallback(const v8::Arguments& args)
     if (!openedWindow)
         return v8::Undefined();
 
-    return toV8(openedWindow.release(), args.Holder(), args.GetIsolate());
+    return toV8Fast(openedWindow.release(), args, impl);
 }
 
 v8::Handle<v8::Value> V8DOMWindow::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
@@ -451,7 +451,7 @@ v8::Handle<v8::Value> V8DOMWindow::indexedPropertyGetter(uint32_t index, const v
 
     Frame* child = frame->tree()->scopedChild(index);
     if (child)
-        return toV8(child->document()->domWindow(), info.Holder(), info.GetIsolate());
+        return toV8Fast(child->document()->domWindow(), info, window);
 
     return v8Undefined();
 }
@@ -472,7 +472,7 @@ v8::Handle<v8::Value> V8DOMWindow::namedPropertyGetter(v8::Local<v8::String> nam
     AtomicString propName = toWebCoreAtomicString(name);
     Frame* child = frame->tree()->scopedChild(propName);
     if (child)
-        return toV8(child->document()->domWindow(), info.Holder(), info.GetIsolate());
+        return toV8Fast(child->document()->domWindow(), info, window);
 
     // Search IDL functions defined in the prototype
     if (!info.Holder()->GetRealNamedProperty(name).IsEmpty())
@@ -486,8 +486,8 @@ v8::Handle<v8::Value> V8DOMWindow::namedPropertyGetter(v8::Local<v8::String> nam
             RefPtr<HTMLCollection> items = doc->windowNamedItems(propName);
             if (!items->isEmpty()) {
                 if (items->hasExactlyOneItem())
-                    return toV8(items->item(0), info.Holder(), info.GetIsolate());
-                return toV8(items.release(), info.Holder(), info.GetIsolate());
+                    return toV8Fast(items->item(0), info, window);
+                return toV8Fast(items.release(), info, window);
             }
         }
     }
index 1d648a8b8e11d7894c3bac619f31001569743ccf..f445ec8f86dc3fb6c04fa17d225556f8147c965a 100644 (file)
@@ -86,7 +86,7 @@ v8::Handle<v8::Value> V8Document::evaluateCallback(const v8::Arguments& args)
     if (ec)
         return setDOMException(ec, args.GetIsolate());
 
-    return toV8(result.release(), args.Holder(), args.GetIsolate());
+    return toV8Fast(result.release(), args, document.get());
 }
 
 v8::Handle<v8::Object> wrap(Document* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
index 7d911a4418a2de18b6efadbf0d39154ef6c38495..03e883e541800e38c8f57d864bc88291fe8d09e6 100644 (file)
@@ -40,7 +40,7 @@ v8::Handle<v8::Value> V8Document::locationAccessorGetter(v8::Local<v8::String> n
         return v8Null(info.GetIsolate());
 
     DOMWindow* window = document->domWindow();
-    return toV8(window->location(), info.Holder(), info.GetIsolate());
+    return toV8Fast(window->location(), info, document);
 }
 
 void V8Document::locationAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
index 58acbbc269bcd243b6e881b194ce85bc21e3f02d..440672a0ba305a750938e9fb70cb7238e8255e6c 100644 (file)
@@ -47,7 +47,7 @@ v8::Handle<v8::Value> V8Event::dataTransferAccessorGetter(v8::Local<v8::String>
     Event* event = V8Event::toNative(info.Holder());
 
     if (event->isDragEvent())
-        return toV8(static_cast<MouseEvent*>(event)->clipboard(), info.Holder(), info.GetIsolate());
+        return toV8Fast(static_cast<MouseEvent*>(event)->clipboard(), info, event);
 
     return v8::Undefined();
 }
@@ -57,7 +57,7 @@ v8::Handle<v8::Value> V8Event::clipboardDataAccessorGetter(v8::Local<v8::String>
     Event* event = V8Event::toNative(info.Holder());
 
     if (event->isClipboardEvent())
-        return toV8(static_cast<ClipboardEvent*>(event)->clipboard(), info.Holder(), info.GetIsolate());
+        return toV8Fast(static_cast<ClipboardEvent*>(event)->clipboard(), info, event);
 
     return v8::Undefined();
 }
index 8849dbcb32b5b24bfe1d78fd00a7cc7116f5e65d..8282345a864f156d1655580bd86215cf4bf38ebe 100644 (file)
@@ -45,7 +45,7 @@ v8::Handle<v8::Value> V8FileReader::resultAccessorGetter(v8::Local<v8::String> n
     v8::Handle<v8::Object> holder = info.Holder();
     FileReader* imp = V8FileReader::toNative(holder);
     if (imp->readType() == FileReaderLoader::ReadAsArrayBuffer)
-        return toV8(imp->arrayBufferResult(), info.Holder(), info.GetIsolate());
+        return toV8Fast(imp->arrayBufferResult(), info, imp);
     return v8StringOrNull(imp->stringResult(), info.GetIsolate());
 }
 
index 1c95ea7fb33476372a817b144c83c30af0202442..1d869efe524c4757cdaa73433ad7931e899bd891 100644 (file)
@@ -40,7 +40,8 @@
 
 namespace WebCore {
 
-static v8::Handle<v8::Value> getNamedItems(HTMLAllCollection* collection, AtomicString name, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+template<class HolderContainer>
+static v8::Handle<v8::Value> getNamedItems(HTMLAllCollection* collection, AtomicString name, const HolderContainer& holder)
 {
     Vector<RefPtr<Node> > namedItems;
     collection->namedItems(name, namedItems);
@@ -49,18 +50,19 @@ static v8::Handle<v8::Value> getNamedItems(HTMLAllCollection* collection, Atomic
         return v8Undefined();
 
     if (namedItems.size() == 1)
-        return toV8(namedItems.at(0).release(), creationContext, isolate);
+        return toV8Fast(namedItems.at(0).release(), holder, collection);
 
     // FIXME: HTML5 specification says this should be a HTMLCollection.
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlallcollection
-    return toV8(V8NamedNodesCollection::create(namedItems), creationContext, isolate);
+    return toV8Fast(V8NamedNodesCollection::create(namedItems), holder, collection);
 }
 
-static v8::Handle<v8::Value> getItem(HTMLAllCollection* collection, v8::Handle<v8::Value> argument, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+template<class HolderContainer>
+static v8::Handle<v8::Value> getItem(HTMLAllCollection* collection, v8::Handle<v8::Value> argument, const HolderContainer& holder)
 {
     v8::Local<v8::Uint32> index = argument->ToArrayIndex();
     if (index.IsEmpty()) {
-        v8::Handle<v8::Value> result = getNamedItems(collection, toWebCoreString(argument->ToString()), creationContext, isolate);
+        v8::Handle<v8::Value> result = getNamedItems(collection, toWebCoreString(argument->ToString()), holder);
 
         if (result.IsEmpty())
             return v8::Undefined();
@@ -69,7 +71,7 @@ static v8::Handle<v8::Value> getItem(HTMLAllCollection* collection, v8::Handle<v
     }
 
     RefPtr<Node> result = collection->item(index->Uint32Value());
-    return toV8(result.release(), creationContext, isolate);
+    return toV8Fast(result.release(), holder, collection);
 }
 
 v8::Handle<v8::Value> V8HTMLAllCollection::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
@@ -80,19 +82,19 @@ v8::Handle<v8::Value> V8HTMLAllCollection::namedPropertyGetter(v8::Local<v8::Str
         return v8Undefined();
 
     HTMLAllCollection* imp = V8HTMLAllCollection::toNative(info.Holder());
-    return getNamedItems(imp, toWebCoreAtomicString(name), info.Holder(), info.GetIsolate());
+    return getNamedItems(imp, toWebCoreAtomicString(name), info);
 }
 
 v8::Handle<v8::Value> V8HTMLAllCollection::itemCallback(const v8::Arguments& args)
 {
     HTMLAllCollection* imp = V8HTMLAllCollection::toNative(args.Holder());
-    return getItem(imp, args[0], args.Holder(), args.GetIsolate());
+    return getItem(imp, args[0], args);
 }
 
 v8::Handle<v8::Value> V8HTMLAllCollection::namedItemCallback(const v8::Arguments& args)
 {
     HTMLAllCollection* imp = V8HTMLAllCollection::toNative(args.Holder());
-    v8::Handle<v8::Value> result = getNamedItems(imp, toWebCoreString(args[0]), args.Holder(), args.GetIsolate());
+    v8::Handle<v8::Value> result = getNamedItems(imp, toWebCoreString(args[0]), args);
 
     if (result.IsEmpty())
         return v8::Undefined();
@@ -108,7 +110,7 @@ v8::Handle<v8::Value> V8HTMLAllCollection::callAsFunctionCallback(const v8::Argu
     HTMLAllCollection* imp = V8HTMLAllCollection::toNative(args.Holder());
 
     if (args.Length() == 1)
-        return getItem(imp, args[0], args.Holder(), args.GetIsolate());
+        return getItem(imp, args[0], args);
 
     // If there is a second argument it is the index of the item we want.
     String name = toWebCoreString(args[0]);
@@ -117,7 +119,7 @@ v8::Handle<v8::Value> V8HTMLAllCollection::callAsFunctionCallback(const v8::Argu
         return v8::Undefined();
 
     if (Node* node = imp->namedItemWithIndex(name, index->Uint32Value()))
-        return toV8(node, args.Holder(), args.GetIsolate());
+        return toV8Fast(node, args, imp);
 
     return v8::Undefined();
 }
index 738cdbba81bd1a60a770bb3d56d66c53ee512aa0..a5f0866e1014b1d8c0f62afc4383c596450d0afe 100644 (file)
@@ -85,7 +85,7 @@ v8::Handle<v8::Value> V8HTMLCanvasElement::getContextCallback(const v8::Argument
     if (!result)
         return v8Null(args.GetIsolate());
     else if (result->is2d()) {
-        v8::Handle<v8::Value> v8Result = toV8(static_cast<CanvasRenderingContext2D*>(result), args.Holder(), args.GetIsolate());
+        v8::Handle<v8::Value> v8Result = toV8Fast(static_cast<CanvasRenderingContext2D*>(result), args, imp);
         if (InspectorInstrumentation::canvasAgentEnabled(imp->document())) {
             ScriptState* scriptState = ScriptState::forContext(v8::Context::GetCurrent());
             ScriptObject context(scriptState, v8::Handle<v8::Object>::Cast(v8Result));
@@ -97,7 +97,7 @@ v8::Handle<v8::Value> V8HTMLCanvasElement::getContextCallback(const v8::Argument
     }
 #if ENABLE(WEBGL)
     else if (result->is3d()) {
-        v8::Handle<v8::Value> v8Result = toV8(static_cast<WebGLRenderingContext*>(result), args.Holder(), args.GetIsolate());
+        v8::Handle<v8::Value> v8Result = toV8Fast(static_cast<WebGLRenderingContext*>(result), args, imp);
         if (InspectorInstrumentation::canvasAgentEnabled(imp->document())) {
             ScriptState* scriptState = ScriptState::forContext(v8::Context::GetCurrent());
             ScriptObject glContext(scriptState, v8::Handle<v8::Object>::Cast(v8Result));
index 8624194eb4fd87946e3a919c9022fed121370c98..6ac9edcd24cdc987dc561b9451aac9055656192d 100644 (file)
@@ -59,13 +59,13 @@ v8::Handle<v8::Value> V8HTMLCollection::namedPropertyGetter(v8::Local<v8::String
         RefPtr<PropertyNodeList> item = static_cast<HTMLPropertiesCollection*>(imp)->propertyNodeList(toWebCoreAtomicString(name));
         if (!item)
             return v8Undefined();
-        return toV8(item.release(), info.Holder(), info.GetIsolate());
+        return toV8Fast(item.release(), info, imp);
     }
 #endif
     Node* item = imp->namedItem(toWebCoreAtomicString(name));
     if (!item)
         return v8Undefined();
-    return toV8(item, info.Holder(), info.GetIsolate());
+    return toV8Fast(item, info, imp);
 }
 
 v8::Handle<v8::Object> wrap(HTMLCollection* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
index 62e0516d3e147f580ceeee3bed74eff3a5ac2060..bac58b8f559bd1356265768eaae5fc56dd9c8cca 100644 (file)
@@ -50,7 +50,7 @@ v8::Handle<v8::Object> wrap(HTMLElement* impl, v8::Handle<v8::Object> creationCo
 v8::Handle<v8::Value> V8HTMLElement::itemValueAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     HTMLElement* impl = V8HTMLElement::toNative(info.Holder());
-    return toV8(impl->itemValue().get(), info.Holder(), info.GetIsolate());
+    return toV8Fast(impl->itemValue().get(), info, impl);
 }
 
 void V8HTMLElement::itemValueAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
index f0dfbe0cfd4469e6a5bc64d9831b39a2ab24c9f0..01daa492c2adb0fc12b511359086d989a9894aa7 100644 (file)
@@ -39,7 +39,8 @@
 
 namespace WebCore {
 
-static v8::Handle<v8::Value> getNamedItems(HTMLFormControlsCollection* collection, const AtomicString& name, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+template<typename HolderContainer>
+static v8::Handle<v8::Value> getNamedItems(HTMLFormControlsCollection* collection, const AtomicString& name, const HolderContainer& holder)
 {
     Vector<RefPtr<Node> > namedItems;
     collection->namedItems(name, namedItems);
@@ -48,9 +49,9 @@ static v8::Handle<v8::Value> getNamedItems(HTMLFormControlsCollection* collectio
         return v8Undefined();
 
     if (namedItems.size() == 1)
-        return toV8(namedItems.at(0).release(), creationContext, isolate);
+        return toV8Fast(namedItems.at(0).release(), holder, collection);
 
-    return toV8(collection->ownerNode()->radioNodeList(name).get(), creationContext, isolate);
+    return toV8Fast(collection->ownerNode()->radioNodeList(name).get(), holder, collection);
 }
 
 v8::Handle<v8::Value> V8HTMLFormControlsCollection::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
@@ -61,13 +62,13 @@ v8::Handle<v8::Value> V8HTMLFormControlsCollection::namedPropertyGetter(v8::Loca
         return v8Undefined();
 
     HTMLFormControlsCollection* imp = V8HTMLFormControlsCollection::toNative(info.Holder());
-    return getNamedItems(imp, toWebCoreAtomicString(name), info.Holder(), info.GetIsolate());
+    return getNamedItems(imp, toWebCoreAtomicString(name), info);
 }
 
 v8::Handle<v8::Value> V8HTMLFormControlsCollection::namedItemCallback(const v8::Arguments& args)
 {
     HTMLFormControlsCollection* imp = V8HTMLFormControlsCollection::toNative(args.Holder());
-    v8::Handle<v8::Value> result = getNamedItems(imp, toWebCoreString(args[0]), args.Holder(), args.GetIsolate());
+    v8::Handle<v8::Value> result = getNamedItems(imp, toWebCoreString(args[0]), args);
 
     if (result.IsEmpty())
         return v8::Undefined(args.GetIsolate());
index dafde2f38ae8aead1d43edb3ebdbb70de71a1415..aaeaac9a786a94ab6ccc6955420272a044bd06aa 100644 (file)
@@ -47,7 +47,7 @@ v8::Handle<v8::Value> V8HTMLFormElement::indexedPropertyGetter(uint32_t index, c
     RefPtr<Node> formElement = form->elements()->item(index);
     if (!formElement)
         return v8Undefined();
-    return toV8(formElement.release(), info.Holder(), info.GetIsolate());
+    return toV8Fast(formElement.release(), info, form);
 }
 
 v8::Handle<v8::Value> V8HTMLFormElement::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
@@ -72,9 +72,9 @@ v8::Handle<v8::Value> V8HTMLFormElement::namedPropertyGetter(v8::Local<v8::Strin
     ASSERT(!elements.isEmpty());
 
     if (elements.size() == 1)
-        return toV8(elements.at(0).release(), info.Holder(), info.GetIsolate());
+        return toV8Fast(elements.at(0).release(), info, imp);
 
-    return toV8(V8NamedNodesCollection::create(elements), info.Holder(), info.GetIsolate());
+    return toV8Fast(V8NamedNodesCollection::create(elements), info, imp);
 }
 
 } // namespace WebCore
index 2a0048de85b9deeaf251dbfaebceb50ee7bae93e..0eeb81d3d2b41f76f76d7e1569fb57eefe34eb6f 100644 (file)
@@ -57,7 +57,7 @@ v8::Handle<v8::Value> V8HTMLFrameSetElement::namedPropertyGetter(v8::Local<v8::S
         return v8Undefined();
     if (!document->frame())
         return v8Undefined();
-    return toV8(document->domWindow(), info.Holder(), info.GetIsolate());
+    return toV8Fast(document->domWindow(), info, imp);
 }
 
 } // namespace WebCore
index a9815a9a179bafec3a31c82edc09d7909345a2e5..3ed3ff763aa4a9086833cd563e9b6ac520995b18 100644 (file)
@@ -40,7 +40,7 @@ namespace WebCore {
 v8::Handle<v8::Value> V8HTMLLinkElement::sizesAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
     HTMLLinkElement* imp = V8HTMLLinkElement::toNative(info.Holder());
-    return toV8(imp->sizes(), info.Holder(), info.GetIsolate());
+    return toV8Fast(imp->sizes(), info, imp);
 }
 
 void V8HTMLLinkElement::sizesAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
index 2fed8d3473126e41599899b1ee0a51b0a195c4bf..4154ae44bc3873b685832ab3bc33c6c3f8b4bda1 100644 (file)
@@ -45,7 +45,8 @@
 
 namespace WebCore {
 
-static v8::Handle<v8::Value> getNamedItems(HTMLOptionsCollection* collection, const AtomicString& name, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+template<typename HolderContainer>
+static v8::Handle<v8::Value> getNamedItems(HTMLOptionsCollection* collection, const AtomicString& name, const HolderContainer& holder)
 {
     Vector<RefPtr<Node> > namedItems;
     collection->namedItems(name, namedItems);
@@ -54,9 +55,9 @@ static v8::Handle<v8::Value> getNamedItems(HTMLOptionsCollection* collection, co
         return v8Undefined();
 
     if (namedItems.size() == 1)
-        return toV8(namedItems.at(0).release(), creationContext, isolate);
+        return toV8Fast(namedItems.at(0).release(), holder, collection);
 
-    return toV8(V8NamedNodesCollection::create(namedItems), creationContext, isolate);
+    return toV8Fast(V8NamedNodesCollection::create(namedItems), holder, collection);
 }
 
 v8::Handle<v8::Value> V8HTMLOptionsCollection::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
@@ -67,13 +68,13 @@ v8::Handle<v8::Value> V8HTMLOptionsCollection::namedPropertyGetter(v8::Local<v8:
         return v8Undefined();
 
     HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(info.Holder());
-    return getNamedItems(imp, toWebCoreAtomicString(name), info.Holder(), info.GetIsolate());
+    return getNamedItems(imp, toWebCoreAtomicString(name), info);
 }
 
 v8::Handle<v8::Value> V8HTMLOptionsCollection::namedItemCallback(const v8::Arguments& args)
 {
     HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder());
-    v8::Handle<v8::Value> result = getNamedItems(imp, toWebCoreString(args[0]), args.Holder(), args.GetIsolate());
+    v8::Handle<v8::Value> result = getNamedItems(imp, toWebCoreString(args[0]), args);
 
     if (result.IsEmpty())
         return v8::Undefined(args.GetIsolate());
@@ -141,7 +142,7 @@ v8::Handle<v8::Value> V8HTMLOptionsCollection::indexedPropertyGetter(uint32_t in
     if (!result)
         return v8Undefined();
 
-    return toV8(result.release(), info.Holder(), info.GetIsolate());
+    return toV8Fast(result.release(), info, collection);
 }
 
 v8::Handle<v8::Value> V8HTMLOptionsCollection::indexedPropertySetter(uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
index cbf6bc060e809e005cd3b6021117c04ec18728b9..00d56f9d169e72903b1252d2c6e62eb14537badf 100644 (file)
@@ -48,11 +48,12 @@ namespace WebCore {
 v8::Handle<v8::Value> V8HTMLSelectElement::indexedPropertyGetter(uint32_t index, const v8::AccessorInfo& info)
 {
     ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
-    RefPtr<Node> result = V8HTMLSelectElement::toNative(info.Holder())->item(index);
+    HTMLSelectElement* select = V8HTMLSelectElement::toNative(info.Holder());
+    RefPtr<Node> result = select->item(index);
     if (!result)
         return v8Undefined();
 
-    return toV8(result.release(), info.Holder(), info.GetIsolate());
+    return toV8Fast(result.release(), info, select);
 }
 
 v8::Handle<v8::Value> V8HTMLSelectElement::indexedPropertySetter(uint32_t index, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
index 67a3b1554509c0bfff1d84c405df17c3cfb8d827..b9d9afe7e163a632b88b6c1951ae97db1570a2f6 100644 (file)
@@ -71,11 +71,11 @@ v8::Handle<v8::Value> V8MessageEvent::dataAccessorGetter(v8::Local<v8::String> n
     }
 
     case MessageEvent::DataTypeBlob:
-        result = toV8(event->dataAsBlob(), info.Holder(), info.GetIsolate());
+        result = toV8Fast(event->dataAsBlob(), info, event);
         break;
 
     case MessageEvent::DataTypeArrayBuffer:
-        result = toV8(event->dataAsArrayBuffer(), info.Holder(), info.GetIsolate());
+        result = toV8Fast(event->dataAsArrayBuffer(), info, event);
         break;
     }
 
@@ -98,7 +98,7 @@ v8::Handle<v8::Value> V8MessageEvent::portsAccessorGetter(v8::Local<v8::String>
 
     v8::Local<v8::Array> portArray = v8::Array::New(portsCopy.size());
     for (size_t i = 0; i < portsCopy.size(); ++i)
-        portArray->Set(v8Integer(i, info.GetIsolate()), toV8(portsCopy[i].get(), info.Holder(), info.GetIsolate()));
+        portArray->Set(v8Integer(i, info.GetIsolate()), toV8Fast(portsCopy[i].get(), info, event));
 
     return portArray;
 }
index 22819d5c8fefd6a0bfa161139de5865137688a34..abb1e62e3c4df0e33134198a3d3b623ae1bc7487 100644 (file)
@@ -49,7 +49,7 @@ v8::Handle<v8::Value> V8NamedNodeMap::indexedPropertyGetter(uint32_t index, cons
     if (!result)
         return v8Undefined();
 
-    return toV8(result.release(), info.Holder(), info.GetIsolate());
+    return toV8Fast(result.release(), info, imp);
 }
 
 v8::Handle<v8::Value> V8NamedNodeMap::namedPropertyGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
@@ -64,7 +64,7 @@ v8::Handle<v8::Value> V8NamedNodeMap::namedPropertyGetter(v8::Local<v8::String>
     if (!result)
         return v8Undefined();
 
-    return toV8(result.release(), info.Holder(), info.GetIsolate());
+    return toV8Fast(result.release(), info, imp);
 }
 
 } // namespace WebCore
index 71d8a121107d55296248107bc329bb6777c8a273..6aeafb677f152e3a2532f6b8b5ee4ffa529484fd 100644 (file)
@@ -56,7 +56,7 @@ v8::Handle<v8::Value> V8NodeList::namedPropertyGetter(v8::Local<v8::String> name
     if (!result)
         return v8Undefined();
 
-    return toV8(result.release(), info.Holder(), info.GetIsolate());
+    return toV8Fast(result.release(), info, list);
 }
 
 void* V8NodeList::opaqueRootForGC(void* object, v8::Persistent<v8::Object> wrapper)
index fc549444cded422e284ffdd0f6ddfb753163f55f..dc032c8cb61787b874b196f260e4ea9debcd5f64 100644 (file)
@@ -70,7 +70,7 @@ v8::Handle<v8::Value> V8PopStateEvent::stateAccessorGetter(v8::Local<v8::String>
     bool isSameState = history->isSameAsCurrentState(event->serializedState().get());
 
     if (isSameState) {
-        v8::Handle<v8::Object> v8History = toV8(history, info.Holder(), info.GetIsolate()).As<v8::Object>();
+        v8::Handle<v8::Object> v8History = toV8Fast(history, info, event).As<v8::Object>();
         if (!history->stateChanged()) {
             result = v8History->GetHiddenValue(V8HiddenPropertyName::state());
             if (!result.IsEmpty())
index 0e686b3f349339b534393bc0f2d80209c74e9f13..66fdd908156f7254ad2fe27975eeb5e4a804364b 100644 (file)
@@ -87,7 +87,7 @@ v8::Handle<v8::Value> V8SQLTransactionSync::executeSqlCallback(const v8::Argumen
     SQLTransactionSync* transaction = V8SQLTransactionSync::toNative(args.Holder());
 
     ExceptionCode ec = 0;
-    v8::Handle<v8::Value> result = toV8(transaction->executeSQL(statement, sqlValues, ec), args.Holder(), args.GetIsolate());
+    v8::Handle<v8::Value> result = toV8Fast(transaction->executeSQL(statement, sqlValues, ec), args, transaction);
     setDOMException(ec, args.GetIsolate());
 
     return result;
index 7d69aabc61f31e481f81d0b9b5e0f00dc9320c2a..0d8677cefb51433e286476d7e89145c9320d53a3 100644 (file)
@@ -49,7 +49,7 @@ v8::Handle<v8::Value> V8StyleSheetList::namedPropertyGetter(v8::Local<v8::String
     if (!item)
         return v8Undefined();
 
-    return toV8(item->sheet(), info.Holder(), info.GetIsolate());
+    return toV8Fast(item->sheet(), info, imp);
 }
 
 } // namespace WebCore
index bfbb9595281e1894f1cc4d77a3c89ecac5cf94ad..a7be4963cff640d4c369d8c1a4ae1dc7d806a6b3 100644 (file)
@@ -55,7 +55,7 @@ v8::Handle<v8::Value> V8TrackEvent::trackAccessorGetter(v8::Local<v8::String> na
         break;
         
     case TrackBase::TextTrack:
-        return toV8(static_cast<TextTrack*>(track), info.Holder(), info.GetIsolate());
+        return toV8Fast(static_cast<TextTrack*>(track), info, trackEvent);
         break;
 
     case TrackBase::AudioTrack:
index 2f6d54e7702af812ec5c5dcf8c643b90bba85346..95dc363a2a143ca54473b693409a6a4d1944e6a4 100644 (file)
@@ -90,7 +90,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::responseAccessorGetter(v8::Local<v8::Str
             Document* document = xmlHttpRequest->responseXML(ec);
             if (ec)
                 return setDOMException(ec, info.GetIsolate());
-            return toV8(document, info.Holder(), info.GetIsolate());
+            return toV8Fast(document, info, xmlHttpRequest);
         }
 
     case XMLHttpRequest::ResponseTypeBlob:
@@ -99,7 +99,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::responseAccessorGetter(v8::Local<v8::Str
             Blob* blob = xmlHttpRequest->responseBlob(ec);
             if (ec)
                 return setDOMException(ec, info.GetIsolate());
-            return toV8(blob, info.Holder(), info.GetIsolate());
+            return toV8Fast(blob, info, xmlHttpRequest);
         }
 
     case XMLHttpRequest::ResponseTypeArrayBuffer:
@@ -108,7 +108,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::responseAccessorGetter(v8::Local<v8::Str
             ArrayBuffer* arrayBuffer = xmlHttpRequest->responseArrayBuffer(ec);
             if (ec)
                 return setDOMException(ec, info.GetIsolate());
-            return toV8(arrayBuffer, info.Holder(), info.GetIsolate());
+            return toV8Fast(arrayBuffer, info, xmlHttpRequest);
         }
     }